/* ================================================================
   EKANA — the case, one page
   House system first: the tokens below are EKANA's own, copied verbatim
   from the EKANA page's stylesheet, so this page is its sibling.
   Phone first: base styles are the 390-wide view; wider screens add.
   ================================================================ */

:root {
  /* colour: EKANA's palette, named */
  --c-blue: #001f3d;
  --c-blue-2: #0a2c50;
  --c-gold: #baa53c;
  --c-steel: #5ea3c0;
  --c-silver: #bcbec0;
  --c-paper: #f4f4ec;
  --c-paper-2: #eceadd;
  --c-white: #ffffff;
  --c-char: #2c2c2c;
  --c-gold-2: color-mix(in srgb, var(--c-gold) 72%, var(--c-white));
  --c-gold-deep: color-mix(in srgb, var(--c-gold) 60%, var(--c-blue));
  --c-muted: color-mix(in srgb, var(--c-char) 72%, var(--c-silver));
  --c-muted-on-blue: color-mix(in srgb, var(--c-paper) 74%, var(--c-silver));
  --c-line: color-mix(in srgb, var(--c-silver) 42%, transparent);
  --c-line-gold: color-mix(in srgb, var(--c-gold) 30%, transparent);
  --c-line-paper: color-mix(in srgb, var(--c-paper) 18%, transparent);
  --c-head: color-mix(in srgb, var(--c-paper) 92%, transparent);
  --c-head-solid: color-mix(in srgb, var(--c-paper) 97%, transparent);
  --c-veil: color-mix(in srgb, var(--c-blue) 82%, transparent);
  --c-veil-soft: color-mix(in srgb, var(--c-blue) 30%, transparent);
  --c-veil-paper: color-mix(in srgb, var(--c-paper) 72%, transparent);
  --c-gold-wash: color-mix(in srgb, var(--c-gold) 14%, transparent);
  --c-blue-wash: color-mix(in srgb, var(--c-blue) 8%, transparent);

  /* type: two self-hosted faces, one scale on a 1.25 ratio, one poster size */
  --f-display: "Khand", "Arial Narrow", Impact, sans-serif;
  --f-body: "Hind", "Segoe UI", Arial, sans-serif;
  --t-0: clamp(0.78rem, 0.74rem + 0.2vw, 0.86rem);
  --t-1: clamp(1rem, 0.95rem + 0.25vw, 1.08rem);
  --t-2: clamp(1.2rem, 1.1rem + 0.5vw, 1.35rem);
  --t-3: clamp(1.45rem, 1.25rem + 0.9vw, 1.7rem);
  --t-4: clamp(1.8rem, 1.4rem + 1.6vw, 2.2rem);
  --t-5: clamp(2.2rem, 1.5rem + 2.6vw, 2.9rem);
  --t-6: clamp(2.7rem, 1.6rem + 4vw, 3.9rem);
  --t-7: clamp(3.3rem, 1.6rem + 6vw, 5.2rem);
  --t-poster: clamp(3.1rem, 1rem + 8.6vw, 8rem);
  --lh-body: 1.62;
  --lh-tight: 0.94;
  --track-label: 0.28em;
  --track-nav: 0.14em;

  /* space */
  --s-1: 0.5rem;
  --s-2: 1rem;
  --s-3: 1.5rem;
  --s-4: 2.5rem;
  --s-5: 4rem;
  --s-6: 6.5rem;
  --s-7: 10rem;
  --gut: clamp(1.25rem, 3vw, 2.5rem);
  --wrap: 78rem;
  --measure: 60ch;

  /* two radii, two shadows */
  --r-0: 0px;
  --r-1: 10px;
  --sh-1: 0 2px 10px rgba(0, 31, 61, 0.10);
  --sh-2: 0 18px 60px rgba(0, 31, 61, 0.30);

  /* motion */
  --ease: cubic-bezier(0.19, 0.75, 0.14, 1);
  --snap: cubic-bezier(0.6, 0.05, 0.1, 1);
  --d-1: 500ms;
  --d-2: 850ms;
  --d-tape: 42s;

  /* textures EKANA uses on its dark grounds */
  --stripe: repeating-linear-gradient(115deg, transparent 0 26px, rgba(244, 244, 236, 0.018) 26px 28px);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.045 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  --grade: saturate(0.9) contrast(1.04);
}

/* ---------------- fonts: EKANA's own subsets, self-hosted ---------------- */
@font-face { font-family: "Khand"; font-weight: 500; font-display: swap; src: url("fonts/khand-500-latin.woff2") format("woff2"); }
@font-face { font-family: "Khand"; font-weight: 600; font-display: swap; src: url("fonts/khand-600-latin.woff2") format("woff2"); }
@font-face { font-family: "Khand"; font-weight: 700; font-display: swap; src: url("fonts/khand-700-latin.woff2") format("woff2"); }
@font-face { font-family: "Hind"; font-weight: 500; font-display: swap; src: url("fonts/hind-500-latin.woff2") format("woff2"); }
@font-face { font-family: "Hind"; font-weight: 600; font-display: swap; src: url("fonts/hind-600-latin.woff2") format("woff2"); }

/* ---------------- reset, as the EKANA page has it ---------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  font-family: var(--f-body);
  font-weight: 500;
  font-size: var(--t-1);
  line-height: var(--lh-body);
  color: var(--c-char);
  background: var(--c-paper);
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
  overflow-x: clip;
}
main { flex: 1 0 auto; }
img { display: block; max-width: 100%; height: auto; }
h1, h2 {
  font-family: var(--f-display);
  font-weight: 700;
  line-height: var(--lh-tight);
  color: var(--c-blue);
  text-transform: uppercase;
  letter-spacing: 0.008em;
  text-wrap: balance;
}
p { max-width: var(--measure); }
a { color: inherit; }
ol { padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--c-gold); outline-offset: 3px; }
::selection { background: var(--c-gold); color: var(--c-blue); }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gut); }

/* outline lettering: the kit-print signature */
.out { color: transparent; -webkit-text-stroke: 2px var(--c-blue); }
@supports not (-webkit-text-stroke: 2px #fff) { .out { color: inherit; -webkit-text-stroke: 0; } }

/* ---------------- header: the EKANA page's bar, with the mark alone ---------------- */
.head { background: var(--c-head-solid); border-bottom: 1px solid var(--c-line); }
.head__in { display: flex; align-items: center; min-height: 4.5rem; padding-block: var(--s-2); }
.brand { width: clamp(7rem, 22vw, 9.5rem); }

/* ---------------- the case: the title, then the seven pieces in order ---------------- */
.case { display: grid; gap: var(--s-4); padding-block: var(--s-4) var(--s-5); }
.case__title { font-size: var(--t-7); line-height: 0.9; letter-spacing: -0.01em; }
.case__line { margin-top: var(--s-3); font-size: var(--t-2); color: var(--c-muted); max-width: 26rem; }

.pieces { display: grid; }
.piece { position: relative; padding: var(--s-2) 0 var(--s-3) 3rem; border-top: 2px solid var(--c-line-gold); }
.piece:last-child { border-bottom: 2px solid var(--c-line-gold); }
.piece__n {
  position: absolute;
  left: 0;
  top: calc(var(--s-2) + 0.15rem);
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--c-blue);
  color: var(--c-paper);
  font-family: var(--f-display);
  font-weight: 600;
  font-size: var(--t-1);
  line-height: 1;
  display: grid;
  place-items: center;
}
.piece__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem var(--s-3); }
.piece__name { font-size: var(--t-3); font-weight: 600; }
.piece__name a {
  color: var(--c-blue);
  text-decoration: underline;
  text-decoration-color: var(--c-gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.16em;
  transition: color var(--d-1) var(--ease), text-decoration-color var(--d-1) var(--ease);
}
.piece__name a:hover { color: var(--c-gold-deep); text-decoration-color: var(--c-gold-deep); }
.piece__also {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: var(--t-0);
  text-transform: uppercase;
  letter-spacing: var(--track-nav);
  color: var(--c-blue);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--d-1) var(--ease);
}
.piece__also::before {
  content: "";
  display: inline-block;
  width: 0.42em;
  height: 0.42em;
  margin-right: 0.6rem;
  vertical-align: 0.12em;
  background: var(--c-gold);
  rotate: 45deg;
}
.piece__also span {
  text-decoration: underline;
  text-decoration-color: var(--c-gold);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.22em;
  transition: text-decoration-color var(--d-1) var(--ease);
}
.piece__also:hover { color: var(--c-gold-deep); }
.piece__also:hover span { text-decoration-color: var(--c-gold-deep); }
.piece__what { margin-top: var(--s-1); color: var(--c-muted); }

/* ---------------- footer: EKANA's mark on the navy ground, as the EKANA page closes ---------------- */
.foot { background: var(--c-blue) var(--stripe); color: var(--c-silver); position: relative; overflow: hidden; }
.foot::after { content: ""; position: absolute; inset: 0; background-image: var(--grain); pointer-events: none; }
.foot__in { position: relative; z-index: 1; padding-block: var(--s-4); }
.foot__brand { display: inline-flex; align-items: center; flex-wrap: wrap; gap: var(--s-2) var(--s-3); }
.foot__brand img { width: 8rem; }
.foot__brand span {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: var(--t-0);
  text-transform: uppercase;
  letter-spacing: var(--track-label);
  color: var(--c-gold-2);
}

/* ---------------- motion: the title and the pieces rise in, in order ---------------- */
@keyframes fade-up { from { opacity: 0; transform: translateY(1.2rem); } to { opacity: 1; transform: none; } }
.case__intro { animation: fade-up var(--d-2) var(--ease) both; }
.piece { animation: fade-up var(--d-2) var(--ease) 120ms both; }
.piece:nth-child(2) { animation-delay: 190ms; }
.piece:nth-child(3) { animation-delay: 260ms; }
.piece:nth-child(4) { animation-delay: 330ms; }
.piece:nth-child(5) { animation-delay: 400ms; }
.piece:nth-child(6) { animation-delay: 470ms; }
.piece:nth-child(7) { animation-delay: 540ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .case__intro, .piece { animation: none; }
  .piece__name a, .piece__also, .piece__also span { transition: none; }
}

/* ---------------- wider screens: the title at the left, the pieces at the right ---------------- */
@media (min-width: 64rem) {
  .head__in { padding-block: 0; }
  .case { grid-template-columns: repeat(12, 1fr); gap: var(--gut); align-items: start; padding-block: var(--s-5); }
  .case__intro { grid-column: 1 / span 5; position: sticky; top: var(--s-4); }
  .pieces { grid-column: 7 / span 6; }
  .piece { padding-left: 3.6rem; }
  .piece__n { width: 2.4rem; height: 2.4rem; font-size: var(--t-2); top: var(--s-2); }
}
