/* ZAIN: personal brand layer. Loaded after sections.css and the inline hero styles.
   Palette: deep charcoal, warm ivory, antique gold. Crimson is a small accent only
   (the hanko seals, the ring, one glow), so gold leads. */

:root {
  --crimson: #c2272e;
  --serif-body: "Shippori Mincho", "Noto Serif JP", Georgia, serif;
}

html { scroll-padding-top: 72px; }
body { overflow-x: clip; }

.skip {
  position: fixed; left: 16px; top: -60px; z-index: 100; background: var(--gold); color: #0e0d11;
  padding: 10px 16px; font: 700 14px/1 var(--body); letter-spacing: 0.1em; text-decoration: none;
}
.skip:focus { top: 12px; }
:focus-visible { outline: 1px solid var(--gold); outline-offset: 3px; }

/* ---------------- hero: gold instead of crimson ---------------- */
h1 { font-size: clamp(44px, 7.4vw, 104px); text-shadow: 0 0 50px rgba(201, 163, 90, 0.22); }
.title-block { max-width: 760px; }
.eyebrow { color: var(--gold); }
.tagline { font-family: var(--serif-body); font-size: clamp(18px, 1.7vw, 24px); letter-spacing: 0.02em; color: #cfc6bd; }
.cta { background: var(--gold); color: #0e0d11; box-shadow: 0 0 30px rgba(201, 163, 90, 0.3); transition: background 0.3s, box-shadow 0.3s; }
.cta:hover, .cta:focus-visible { background: #e0bd76; box-shadow: 0 0 40px rgba(201, 163, 90, 0.5); }
.nav-spacer { height: 44px; }
.credit { z-index: 2; }

/* ---------------- global nav ---------------- */
.site-nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 20px var(--gutter);
  transition: background 0.4s, padding 0.3s, backdrop-filter 0.4s;
}
.site-nav.is-scrolled {
  padding-block: 12px; background: rgba(8, 7, 10, 0.78);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-nav .logo { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; font-size: 20px; }
.seal-dot { width: 8px; height: 8px; background: var(--crimson); display: inline-block; transform: rotate(45deg); }
.nav-links { display: flex; gap: clamp(18px, 2.4vw, 36px); list-style: none; }
.nav-links a {
  position: relative; display: inline-block; padding: 8px 2px; color: var(--muted); text-decoration: none;
  font: 600 13px/1 var(--body); letter-spacing: 0.24em; text-transform: uppercase; transition: color 0.3s;
}
.nav-links a:hover, .nav-links a.is-active { color: var(--text); }
.nav-links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform 0.4s; }
.nav-links a.is-active::after { transform: scaleX(1); }
.nav-tools { display: flex; align-items: center; gap: 12px; }
.nav-progress { position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; background: var(--gold); transform: scaleX(0); transform-origin: left; opacity: 0.8; }
.sound { min-height: 40px; }


@media (max-width: 900px) {
  .nav-links { display: none; }
}

/* ---------------- shared ---------------- */
.section-title em { color: var(--gold); text-shadow: 0 0 40px rgba(201, 163, 90, 0.25); }
.seal {
  display: grid; place-items: center; width: 44px; height: 44px; background: var(--crimson); color: #f3eee8;
  font-family: var(--serif); font-size: 24px; line-height: 1; border-radius: 3px;
  box-shadow: 0 6px 24px rgba(194, 39, 46, 0.35);
}

/* ---------------- 01 About ---------------- */
.about { position: relative; padding-block: var(--section-y) calc(var(--section-y) * 0.6); }
/* ease the hero's last frame into the night sky so the first heading stays readable */
.about::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 45vh; pointer-events: none; background: linear-gradient(to bottom, rgba(7, 7, 10, 0.92), rgba(7, 7, 10, 0)); }
.about-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(32px, 6vw, 104px); align-items: start; }
.about-visual { position: sticky; top: 14vh; height: 72vh; align-self: start; }
.about-frame {
  position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 4px; background: #050407;
  border: 1px solid var(--gold-soft); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
.about-frame img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0;
  transform: scale(1.06); transition: opacity 1s ease, transform 1.8s cubic-bezier(.2, .7, .2, 1);
}
.about-frame img.is-active { opacity: 1; transform: none; }
.about-frame::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.6); }
.about-frame .seal { position: absolute; right: 16px; bottom: 16px; z-index: 2; }

.about-head { display: grid; gap: 22px; min-height: 72vh; align-content: start; padding-bottom: clamp(32px, 8vh, 80px); }
.about-lead { font-family: var(--serif-body); font-size: clamp(26px, 3vw, 44px); line-height: 1.25; max-width: 22ch; text-wrap: balance; }
.about-sub { color: var(--muted); font-size: clamp(18px, 1.5vw, 21px); max-width: 44ch; }
.chapter {
  display: grid; gap: 14px; align-content: center; min-height: 62vh; padding-block: clamp(36px, 7vh, 80px);
  border-top: 1px solid var(--line); max-width: 560px;
}
.chapter-num { font-family: var(--display); color: var(--gold); letter-spacing: 0.3em; font-size: 15px; }
.chapter h3 { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; font-size: clamp(26px, 2.6vw, 38px); line-height: 1; }
.chapter p { font-family: var(--serif-body); font-size: clamp(18px, 1.5vw, 21px); line-height: 1.65; color: #d8d0c7; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chips li { font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; padding: 7px 12px; border: 1px solid var(--gold-soft); border-radius: 999px; color: var(--gold); }
.about-close { font-family: var(--serif-body); font-size: clamp(22px, 2.2vw, 30px); line-height: 1.4; color: var(--text); border-top: 1px solid var(--gold-soft); padding-top: 32px; max-width: 28ch; margin-top: 24px; }
.chapter-img { display: none; }

@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-visual { display: none; }
  .about-head, .chapter { min-height: 0; max-width: none; }
  .chapter { padding-block: 40px; }
  .chapter-img {
    display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 4px;
    border: 1px solid var(--gold-soft); margin-bottom: 8px;
  }
}

/* ---------------- 02 Arsenal (the spiral itself is unchanged) ---------------- */
.services-ui { padding-top: clamp(84px, 11vh, 110px); }
.services-note { color: #cfc6bd; font-family: var(--serif-body); font-size: 18px; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.9); }
.services-grid .services-note { margin-top: 12px; }

/* ---------------- 03 Proof ---------------- */
.proof { padding-block: var(--section-y); position: relative; }
.cases { display: grid; gap: clamp(72px, 10vw, 150px); }
.case { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(24px, 4.5vw, 72px); align-items: center; position: relative; }
.case:nth-child(even) .case-art { order: 2; }
.case-art {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 4px; border: 1px solid var(--line);
  display: grid; place-items: center; text-align: center; background: var(--charcoal-2); clip-path: inset(0 0 0 0);
}
.case-art[data-ink="gold"] { background: radial-gradient(circle at 25% 30%, #5e4318, transparent 62%), radial-gradient(circle at 80% 80%, #241a0b, transparent 60%), var(--charcoal-2); }
.case-art[data-ink="crimson"] { background: radial-gradient(circle at 25% 30%, #6d1119, transparent 62%), radial-gradient(circle at 80% 80%, #2a0a0d, transparent 60%), var(--charcoal-2); }
.case-art[data-ink="ash"] { background: radial-gradient(circle at 25% 30%, #3a3b42, transparent 62%), radial-gradient(circle at 80% 80%, #17171b, transparent 60%), var(--charcoal-2); }
.case-art[data-ink="ember"] { background: radial-gradient(circle at 25% 30%, #6a2410, transparent 62%), radial-gradient(circle at 80% 80%, #260d07, transparent 60%), var(--charcoal-2); }
.case-art::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.5); pointer-events: none; }
.case-ghost {
  font-family: var(--display); text-transform: uppercase; font-weight: 700; line-height: 0.95;
  font-size: clamp(44px, 7vw, 110px); color: transparent; -webkit-text-stroke: 1px rgba(243, 238, 232, 0.35);
}
.case-soon { position: absolute; left: 16px; bottom: 14px; color: var(--muted); font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase; }
.case-body { display: grid; gap: 28px; min-width: 0; }
.case-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 18px; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 20px; }
.case-num { font-family: var(--display); color: var(--gold); letter-spacing: 0.15em; font-size: 15px; font-variant-numeric: tabular-nums; }
.case-name { font-family: var(--display); text-transform: uppercase; font-size: clamp(28px, 3vw, 46px); line-height: 1; letter-spacing: 0.02em; }
.case-name small { font-size: 0.45em; letter-spacing: 0.2em; color: var(--gold); vertical-align: middle; margin-left: 6px; }
.status { grid-column: 2; justify-self: start; display: inline-flex; align-items: center; gap: 10px; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px rgba(201, 163, 90, 0.7); }
.case-list { display: grid; gap: 18px; }
.case-list > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; }
.case-list dt { color: var(--muted); font-size: 12px; letter-spacing: 0.24em; text-transform: uppercase; padding-top: 5px; }
.case-list dd { font-family: var(--serif-body); font-size: clamp(17px, 1.35vw, 19px); line-height: 1.6; color: #d8d0c7; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font-family: var(--body); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); }
.tags .tag-todo { border-style: dashed; color: var(--muted); }

@media (max-width: 900px) {
  .case { grid-template-columns: 1fr; }
  .case:nth-child(even) .case-art { order: 0; }
  .case-list > div { grid-template-columns: 1fr; gap: 4px; }
  .case-list dt { padding-top: 0; }
}

/* ---------------- 04 Code: a moonlit forest that stays on screen while the words scroll past ---------------- */
.code { position: relative; isolation: isolate; }
/* The forest image carries its own soft top and bottom edges, ground mist and the darker left side for
   the text (baked in, so nothing extra is drawn per frame); it dissolves into the night sky behind. */
.code-scene { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
/* The stage is the photo's own frame (16:9 on desktop, 9:16 on phones), always the full height of the
   screen and anchored on the samurai: narrower screens crop its sides, wider ones show its soft side
   edges. The forest and the figure layer line up exactly in every case. */
.code-stage {
  /* --feet: where his feet touch the stone, in the frame; the figure box is cropped to him and his shadow */
  --ratio: 16 / 9; --ax: 62%; --feet: 66% 74%;
  --fig-x: 59.72%; --fig-y: 30.06%; --fig-w: 17.88%; --fig-h: 48.95%; --fig-feet: 35.1% 89.8%;
  position: absolute; left: var(--ax); top: 0; height: 100%; translate: calc(var(--ax) * -1) 0; aspect-ratio: var(--ratio);
}
.code-plate, .code-figure { position: absolute; inset: 0; transform-origin: var(--feet); will-change: transform; }
.code-figure { inset: auto; left: var(--fig-x); top: var(--fig-y); width: var(--fig-w); height: var(--fig-h); transform-origin: var(--fig-feet); }
.code-plate img, .code-figure img { display: block; width: 100%; height: 100%; }
/* 道: a faint gold outline in the canopy, fading downwards */
.code-kanji {
  position: absolute; right: clamp(16px, 5vw, 80px); top: 9%; font-family: var(--serif); font-weight: 600;
  font-size: clamp(150px, 19vw, 300px); line-height: 1; color: rgba(201, 163, 90, 0.035);
  -webkit-text-stroke: 1px rgba(201, 163, 90, 0.3); --kanji-opacity: 0.32; opacity: var(--kanji-opacity);
  will-change: transform, opacity; /* drawn once, then only moved: the outline and fade are costly to redraw */
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 95%); mask-image: linear-gradient(to bottom, #000 30%, transparent 95%);
}

.code-content { position: relative; z-index: 2; margin-top: -100vh; margin-top: -100svh; padding-block: 18vh 26vh; }
.code-head { display: grid; gap: 18px; }
.code .statement { max-width: 18ch; font-size: clamp(30px, 3.6vw, 54px); margin-top: clamp(28px, 6vh, 64px); text-shadow: 0 2px 30px rgba(0, 0, 0, 0.6); }
.code .statement .w { opacity: 0.42; }

/* The principles: one at a time, set like a printed page. Vertical kanji, number, name, words. */
.tenets { list-style: none; margin-top: clamp(80px, 22vh, 220px); max-width: 600px; }
.tenet {
  display: grid; grid-template-columns: 76px minmax(0, 1fr); grid-template-rows: auto auto 1fr; column-gap: clamp(24px, 3vw, 40px);
  align-content: center; min-height: 52vh; padding-block: 40px; position: relative;
}
.tenet::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(to right, var(--gold-soft), rgba(201, 163, 90, 0.08) 60%, transparent);
}
.tenet-jp {
  grid-row: 1 / 4; font-family: var(--serif); font-weight: 600; color: var(--gold);
  font-size: clamp(40px, 3.6vw, 56px); line-height: 1.18; justify-self: center; align-self: start; text-align: center;
  width: 1em; word-break: break-all; /* one character per line: stacked top to bottom like a hanging scroll */
  text-shadow: 0 0 40px rgba(201, 163, 90, 0.25);
}
.tenet-no { font-family: var(--display); color: var(--gold); letter-spacing: 0.3em; font-size: 13px; }
.tenet-no i { font-style: normal; color: rgba(201, 163, 90, 0.45); }
.tenet h3 { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; font-size: clamp(32px, 3.4vw, 50px); line-height: 1; margin-top: 14px; }
.tenet p { font-family: var(--serif-body); font-size: clamp(19px, 1.5vw, 22px); line-height: 1.65; color: #ddd5cb; max-width: 34ch; margin-top: 18px; text-shadow: 0 1px 18px rgba(0, 0, 0, 0.7); }
.code-note { color: var(--muted); font-size: 15px; letter-spacing: 0.08em; padding-top: 32px; border-top: 1px solid var(--line); max-width: 600px; }

/* Desktop: the one in focus is bright, the others rest, and its kanji is drawn in from the top. */
@media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
  .tenet > * { transition: opacity 0.7s ease, transform 0.9s cubic-bezier(.2, .7, .2, 1); }
  .tenet:not(.is-active) > :not(.tenet-jp) { opacity: 0.5; }
  .tenet .tenet-jp { clip-path: inset(0 0 100% 0); transition: clip-path 1.1s cubic-bezier(.6, 0, .2, 1), opacity 0.7s ease; }
  .tenet.is-active .tenet-jp, .tenet.was-active .tenet-jp { clip-path: inset(0 0 0 0); }
  .tenet.was-active:not(.is-active) .tenet-jp { opacity: 0.5; }
}

/* Phones: the scene is a tall frame at the top of the section; the words follow below it. */
@media (max-width: 900px) {
  /* the phone image fades out from the middle down, through a band of mist, into the night sky */
  .code-scene { position: relative; height: 86svh; }
  .code-stage {
    --ratio: 9 / 16; --ax: 50%; --feet: 50% 72%;
    --fig-x: 29.54%; --fig-y: 22.19%; --fig-w: 60.93%; --fig-h: 54.22%; --fig-feet: 33.8% 91.9%;
  }
  .code-kanji { font-size: 38vw; top: 7%; right: 4vw; --kanji-opacity: 0.26; }
  .code-content { margin-top: -20svh; padding-block: 0 72px; }
  .code .statement { margin-top: 28px; }
  .tenets { margin-top: 44px; }
  .tenet { grid-template-columns: 52px minmax(0, 1fr); min-height: 0; padding-block: 26px 30px; }
  .tenet-jp { font-size: 36px; }
  .tenet h3 { font-size: 30px; margin-top: 10px; }
  .tenet p { font-size: 18px; margin-top: 12px; }
  .code-note { padding-top: 24px; }
}

/* ---------------- 05 Horizon: the samurai on a cliff at sunset; the camera pulls back as you scroll ---------------- */
.next { position: relative; overflow-x: clip; } /* the dusk shadow behind the words is wider than the screen on purpose; never let it widen the page */
.next-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: #2a2230; }
.next-still img, .next-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.next-still img { object-fit: cover; }
.next-canvas { opacity: 0; transition: opacity 0.8s ease; }
.next.is-live .next-canvas { opacity: 1; }
/* the scene rises out of the night above: solid dark at its top edge, fading into the sunset */
.next-veil {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, #0a0809 0%, #0a0809 14%, rgba(10, 8, 9, 0.6) 42%, rgba(10, 8, 9, 0) 78%);
}

.next-copy { position: relative; z-index: 2; margin-top: -100vh; margin-top: -100svh; }
.next-pin { display: grid; gap: clamp(48px, 10vh, 120px); padding-block: 18vh 22vh; }
.next-head { display: grid; gap: 20px; }
.next-lead { font-family: var(--serif-body); font-size: clamp(22px, 2.4vw, 34px); max-width: 20ch; line-height: 1.3; }
.ambitions { list-style: none; display: grid; gap: clamp(40px, 8vh, 90px); }
.ambition { display: grid; gap: 14px; max-width: 30ch; }
.ambition span { font-family: var(--display); color: var(--gold); letter-spacing: 0.3em; font-size: 13px; }
.ambition span i { font-style: normal; color: rgba(201, 163, 90, 0.5); }
.ambition p { font-family: var(--serif-body); font-size: clamp(26px, 2.6vw, 40px); line-height: 1.3; color: var(--text); text-wrap: balance; }
.next-close { font-family: var(--serif-body); font-size: clamp(26px, 2.6vw, 40px); line-height: 1.3; max-width: 22ch; color: var(--gold); }
.next-item { text-shadow: 0 2px 24px rgba(20, 12, 24, 0.75), 0 0 2px rgba(20, 12, 24, 0.5); }
/* plain list (reduced motion): keep the words in the sky on the right, clear of the samurai */
@media (min-width: 901px) { .next:not(.is-sequenced) .next-pin { padding-left: 58%; } }
.next-head .kicker { text-shadow: 0 1px 10px rgba(20, 12, 24, 0.9); }

/* With the scroll sequence on (set by assets/sections.js): the words stay in one place in the sky,
   one line at a time, while the camera moves. Without it they are a plain list over the still. */
.next.is-sequenced { height: 560vh; }
.next.is-sequenced .next-copy { position: absolute; inset: 0; margin-top: 0; }
.next.is-sequenced .next-pin { position: sticky; top: 0; height: 100vh; height: 100svh; display: block; padding: 0; }
.next.is-sequenced .ambitions { display: contents; }
.next.is-sequenced .next-item {
  position: absolute; left: 58%; top: 20vh; width: min(520px, 36vw); opacity: 0; visibility: hidden; will-change: opacity, transform;
}
/* a soft shadow of dusk behind the words so they read over bright cloud */
.next.is-sequenced .next-pin::before {
  content: ""; position: absolute; left: 50%; top: 6vh; width: 52vw; height: 56vh; pointer-events: none;
  background: radial-gradient(closest-side, rgba(24, 16, 30, 0.58), rgba(24, 16, 30, 0));
}

@media (max-width: 900px) {
  .next.is-sequenced { height: 500vh; }
  .next.is-sequenced .next-item { left: var(--gutter); right: var(--gutter); top: 13svh; width: auto; }
  .next.is-sequenced .next-pin::before { left: -10vw; top: 2svh; width: 120vw; height: 46svh; }
  .ambition p, .next-close { font-size: 28px; }
}

/* ---------------- 06 Door ---------------- */
.contact { position: relative; padding-block: var(--section-y); overflow: hidden; background: radial-gradient(ellipse at 50% 0%, rgba(201, 163, 90, 0.12), transparent 55%), #0a0809; }
.torii { position: absolute; left: 50%; top: 50%; width: min(86vw, 1000px); transform: translate(-50%, -50%); opacity: 0.16; pointer-events: none; }
.torii path { fill: none; stroke: var(--gold); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; vector-effect: non-scaling-stroke; }
.contact-inner { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); gap: clamp(36px, 6vw, 96px); align-items: start; }
.contact-head { display: grid; gap: 22px; }
.contact-open { display: inline-flex; align-items: center; gap: 12px; color: var(--gold); font-size: 13px; letter-spacing: 0.3em; text-transform: uppercase; font-weight: 700; }
.contact-open .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 14px rgba(201, 163, 90, 0.8); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.contact-side { display: grid; gap: 40px; padding-top: 12px; }
.contact-form { display: grid; gap: 22px; padding: clamp(22px, 3vw, 36px); border: 1px solid var(--glass-edge); border-radius: 14px; background: rgba(14, 12, 12, 0.82); }
.field { display: grid; gap: 8px; }
.field label { font-size: 12px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--muted); }
.field input, .field textarea {
  width: 100%; background: transparent; color: var(--text); border: 0; border-bottom: 1px solid var(--line);
  font: 400 18px/1.5 var(--serif-body); padding: 8px 0 10px; border-radius: 0; resize: vertical; transition: border-color 0.3s;
}
.field input:focus, .field textarea:focus { outline: 0; border-bottom-color: var(--gold); }
.field [aria-invalid] { border-bottom-color: var(--crimson); }
.contact-form .btn-gold { justify-self: start; border: 0; cursor: pointer; }
.form-note { min-height: 1.5em; color: #e7a6a9; font-size: 16px; line-height: 1.5; }
.form-note.is-ok { color: var(--gold); }
.contact-links { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 28px; }
.contact-links a { color: var(--text); text-decoration: none; font-size: 17px; letter-spacing: 0.04em; border-bottom: 1px solid var(--gold-soft); padding-bottom: 3px; }
.contact-links a[aria-disabled] { color: var(--muted); border-bottom-style: dashed; cursor: default; }
.soon { color: var(--gold); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; margin-left: 6px; }

@media (max-width: 900px) {
  .contact-inner { grid-template-columns: 1fr; }
  .torii { width: 110vw; top: 58%; opacity: 0.1; }
}

/* ---------------- footer ---------------- */
.footer { background: #0a0809; border-top: 1px solid var(--line); }
.footer-mark { font-size: clamp(80px, 24vw, 360px); -webkit-text-stroke: 1px rgba(201, 163, 90, 0.3); margin-block: 0 clamp(20px, 3vw, 36px); line-height: 0.8; }
.footer-sig { text-align: center; font-family: var(--serif-body); font-size: clamp(18px, 2vw, 26px); color: var(--muted); margin-bottom: clamp(40px, 6vw, 72px); }
.footer-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.footer-cols:has(#footerContact:not([hidden])) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.footer-cols a:hover, .footer-cols a:focus-visible { color: var(--gold); }
@media (max-width: 720px) { .footer-cols { grid-template-columns: 1fr 1fr; } .footer-cols:not(:has(#footerContact:not([hidden]))) > div:last-child { grid-column: 1 / -1; } .footer-cols:has(#footerContact:not([hidden])) { grid-template-columns: 1fr 1fr; } }

/* ---------------- phones ---------------- */
@media (max-width: 640px) {
  .hero { height: 380vh; }
  .site-nav { padding: 14px 16px; }
  .sound { padding: 8px 10px; font-size: 12px; }
  .title-block { max-width: none; }
  .nav-spacer { height: 36px; }
  /* bigger tap areas for the small footer links, without moving anything */
  .footer-cols a, .footer-bottom a { display: inline-block; padding-block: 5px; margin-block: -5px; }
}

@media (prefers-reduced-motion: reduce) {
  .about-frame img { transition: none; transform: none; }
  .contact-open .dot { animation: none; }
}

/* ---------------- personal-brand pass 2 ---------------- */
[hidden] { display: none !important; }

/* Arsenal: the fuller card text matters, so keep it on phones too */
@media (max-width: 720px) {
  .services-blurb { display: block; font-size: 15px; line-height: 1.45; }
}

/* How I can help */
.help { padding-block: var(--section-y) calc(var(--section-y) * 0.5); position: relative; }
.offers { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); counter-reset: offer; }
.offer { counter-increment: offer; display: grid; align-content: start; gap: 12px; padding: clamp(24px, 3vw, 36px); background: rgba(10, 9, 12, 0.92); min-width: 0; }
.offer::before { content: counter(offer, decimal-leading-zero); font-family: var(--display); color: var(--gold); letter-spacing: 0.15em; font-size: 14px; }
.offer h3 { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.04em; font-size: clamp(22px, 2vw, 28px); line-height: 1.05; text-wrap: balance; }
.offer p { font-family: var(--serif-body); color: #d8d0c7; font-size: 17px; line-height: 1.55; }
.offer .offer-proof { font-family: var(--body); color: var(--muted); font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; margin-top: auto; padding-top: 8px; }
.help-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px; margin-top: clamp(40px, 6vw, 72px); padding-top: 28px; border-top: 1px solid var(--gold-soft); }
.help-cta p { font-family: var(--serif-body); font-size: clamp(22px, 2.4vw, 32px); max-width: 26ch; line-height: 1.3; }

/* Proof: concept / prototype labels read differently from real work */
.status--concept { color: var(--muted); }
.status--concept::before { background: transparent; border: 1px solid var(--muted); box-shadow: none; }

/* Contact: direct channels */
.contact-direct { list-style: none; display: grid; gap: 14px; }
.contact-direct li { display: grid; gap: 4px; }
.direct-label { font-size: 12px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--muted); }
.contact-direct a { color: var(--text); font-family: var(--serif-body); font-size: clamp(20px, 2vw, 26px); text-decoration: none; border-bottom: 1px solid var(--gold-soft); justify-self: start; user-select: all; }
.contact-direct a:hover, .contact-direct a:focus-visible { color: var(--gold); }
.contact-pending { color: var(--muted); }
.contact-form .btn-gold[disabled] { opacity: 0.6; cursor: progress; }

/* ---------------- hero scroll story (text only; the 3D scene is untouched) ---------------- */
.hero-beats { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.beat {
  position: absolute; top: 50%; width: min(400px, 34vw); display: grid; gap: 14px;
  opacity: 0; transform: translateY(calc(-50% + 24px)); transition: opacity 0.7s ease, transform 0.9s cubic-bezier(.2, .7, .2, 1);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.85);
}
.beat--left { left: var(--gutter); }
.beat--right { right: var(--gutter); text-align: right; justify-items: end; }
.beat.is-active { opacity: 1; transform: translateY(-50%); }
.beat > * { opacity: 0; transform: translateY(12px); transition: opacity 0.6s ease, transform 0.8s cubic-bezier(.2, .7, .2, 1); }
.beat.is-active > * { opacity: 1; transform: none; }
.beat.is-active > :nth-child(2) { transition-delay: 0.08s; }
.beat.is-active > :nth-child(3) { transition-delay: 0.18s; }
.beat-kicker { color: var(--gold); font: 700 12px/1 var(--body); letter-spacing: 0.36em; text-transform: uppercase; }
.beat-title { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: clamp(36px, 4.6vw, 68px); line-height: 0.95; letter-spacing: 0.01em; }
.beat-title em { font-style: normal; color: var(--gold); }
.beat-line { font-family: var(--serif-body); font-size: clamp(17px, 1.4vw, 20px); line-height: 1.5; color: #e2dad1; max-width: 32ch; }

@media (max-width: 900px) {
  .beat, .beat--right { left: 16px; right: 16px; width: auto; top: auto; bottom: 64px; text-align: left; justify-items: start; transform: translateY(24px); }
  .beat.is-active { transform: none; }
  .hero-beats::after {
    content: ""; position: absolute; inset: auto 0 0 0; height: 45%; z-index: -1;
    background: linear-gradient(to top, rgba(7, 7, 10, 0.85), rgba(7, 7, 10, 0)); opacity: 0; transition: opacity 0.6s;
  }
  .hero-beats.has-active::after { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .beat, .beat > * { transition: none; transform: translateY(-50%); }
  .beat > * { transform: none; }
}

/* Proof of Work: real screenshots of each project */
.case-art--shot { aspect-ratio: 16 / 10; background: #0d0c10; }
.case-art--shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform 1s cubic-bezier(.2, .7, .2, 1); }
.case:hover .case-art--shot img { transform: scale(1.03); }
.case-art--shot::after { box-shadow: inset 0 0 0 1px var(--line), inset 0 -60px 80px -40px rgba(0, 0, 0, 0.45); }

/* ---------------- image pass (Zain's picks) ---------------- */
/* About on phones: every chapter image is portrait (4:5) so the full samurai stays in view */
.chapter-img--tall { aspect-ratio: 4 / 5; object-position: 50% 40%; }

/* Contact: the samurai at the gate behind the door section */
.contact { isolation: isolate; }
.contact-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.contact-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 40%; opacity: 0.55; }
.contact-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(10, 8, 9, 0.96) 0%, rgba(10, 8, 9, 0.82) 42%, rgba(10, 8, 9, 0.35) 100%),
              linear-gradient(to bottom, #0a0809 0%, rgba(10, 8, 9, 0) 18%, rgba(10, 8, 9, 0) 75%, #0a0809 100%);
}
@media (max-width: 900px) {
  .contact-bg img { object-position: 60% 30%; opacity: 0.4; }
  .contact-bg::after { background: linear-gradient(to bottom, #0a0809 0%, rgba(10, 8, 9, 0.75) 30%, rgba(10, 8, 9, 0.9) 100%); }
}

/* Footer: the path forward behind ZAIN */
.footer { isolation: isolate; overflow: hidden; }
.footer-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.footer-bg img { width: 100%; height: 115%; object-fit: cover; object-position: 50% 60%; opacity: 0.45; }
.footer-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, #0a0809 0%, rgba(10, 8, 9, 0.55) 35%, rgba(10, 8, 9, 0.85) 70%, #0a0809 100%); }
.footer-mark { -webkit-text-stroke: 1.5px rgba(201, 163, 90, 0.75); text-shadow: 0 0 60px rgba(0, 0, 0, 0.6); }
.footer-sig { color: #d8d0c7; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------------- the menu: a chapter index ----------------
   Opening it should feel like stepping through a gate into the next chapter: a curtain of night wipes down,
   the chapter names rise out of their lines one by one, and the torii path from "The Way" glows quietly beside
   them. Desktop: index on the left, scene on the right. Phones: their own stacked composition (bottom of file). */

.nav-toggle {
  display: inline-flex; align-items: center; gap: 14px; height: 40px; padding: 0 14px 0 16px;
  background: transparent; color: var(--text); border: 1px solid rgba(255, 255, 255, 0.18); cursor: pointer;
  font: 600 13px/1 var(--body); letter-spacing: 0.3em; text-transform: uppercase; transition: border-color 0.3s;
}
.nav-toggle:hover { border-color: var(--gold-soft); }
.nav-toggle-label { min-width: 4.6em; text-align: left; }
.nav-toggle-lines { position: relative; width: 22px; height: 9px; }
.nav-toggle-lines i { position: absolute; right: 0; height: 1px; background: currentColor; transition: transform 0.45s cubic-bezier(0.7, 0, 0.2, 1), width 0.35s, top 0.45s; }
.nav-toggle-lines i:first-child { top: 0; width: 22px; }
.nav-toggle-lines i:last-child { top: 8px; width: 13px; }
.nav-toggle:hover .nav-toggle-lines i:last-child { width: 22px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-lines i { top: 4px; width: 20px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-lines i:first-child { transform: rotate(35deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-lines i:last-child { transform: rotate(-35deg); }

/* While open the header steps back: only the mark, the sound and Close remain. */
.menu-open .site-nav { background: transparent; border-bottom-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.menu-open .nav-links, .menu-open .nav-progress { opacity: 0; pointer-events: none; }
.nav-links { transition: opacity 0.4s; }
.menu-open, .menu-open body { overflow: hidden; }

.menu { position: fixed; inset: 0; z-index: 40; visibility: hidden; overscroll-behavior: contain; }
.menu.is-open { visibility: visible; }
.menu-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(55% 60% at 80% 42%, rgba(201, 163, 90, 0.09), transparent 70%),
    radial-gradient(45% 45% at 6% 104%, rgba(194, 39, 46, 0.12), transparent 70%),
    linear-gradient(180deg, #110e12 0%, #09080b 55%, #0b090b 100%);
}
/* a whisper of film grain so the dark has texture, not flatness */
.menu-bg::after {
  content: ""; position: absolute; inset: 0; opacity: 0.08; mix-blend-mode: overlay; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.menu-inner {
  position: relative; height: 100%; display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-rows: auto 1fr auto;
  column-gap: clamp(40px, 6vw, 120px); padding: clamp(104px, 14vh, 140px) var(--gutter) clamp(24px, 4vh, 40px);
  max-width: 1600px; margin-inline: auto;
}

.menu-kicker {
  grid-column: 1; display: flex; align-items: center; gap: 14px; color: var(--gold);
  font: 700 12px/1 var(--body); letter-spacing: 0.38em; text-transform: uppercase;
}
.menu-kicker span { font-family: var(--serif); font-weight: 400; font-size: 15px; letter-spacing: 0.3em; color: var(--muted); }
.menu-kicker::after { content: ""; width: 48px; height: 1px; background: var(--gold-soft); }

.menu-nav { grid-column: 1; grid-row: 2; align-self: center; }
.menu-list { list-style: none; }
.menu-item { --rule: 1; position: relative; }
/* hairline between chapters; it draws itself in on open (--rule) and turns gold under the one you point at */
.menu-item::before, .menu-item::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; transform-origin: left; }
.menu-item::before { background: var(--line); transform: scaleX(var(--rule)); }
.menu-item::after { background: var(--gold); transform: scaleX(0); transition: transform 0.6s cubic-bezier(0.7, 0, 0.2, 1); }
.menu-item:last-child { box-shadow: inset 0 -1px 0 var(--line); }
.menu-item a {
  display: grid; grid-template-columns: 64px auto minmax(0, 1fr) auto; align-items: baseline; column-gap: 28px;
  padding: clamp(14px, 2.1vh, 22px) 0; color: var(--text); text-decoration: none; outline-offset: 6px;
  transition: opacity 0.45s;
}
.menu-num { font: 600 12px/1 var(--body); letter-spacing: 0.24em; color: var(--muted); font-variant-numeric: tabular-nums; transition: color 0.4s; }
/* the mask the title rises out of; the extra room on the right lets it step forward on hover without clipping */
.menu-title { display: block; overflow: hidden; padding-block: 0.06em; padding-right: 20px; margin-right: -20px; }
.menu-title > span {
  display: block; font: 600 clamp(30px, 3.3vw, 50px)/1 var(--display); text-transform: uppercase; letter-spacing: 0.035em;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.1, 1), color 0.4s;
}
.menu-sub { font: 400 15px/1.3 var(--serif-body); color: var(--muted); opacity: 0.6; transition: opacity 0.4s, transform 0.6s cubic-bezier(0.2, 0.7, 0.1, 1); }
.menu-jp { font: 400 18px/1 var(--serif-body); color: rgba(201, 163, 90, 0.45); transition: color 0.4s; }

/* while GSAP plays the entrance, CSS transitions step aside so the two never fight over the same property */
.menu.is-animating .menu-title > span, .menu.is-animating .menu-sub, .menu.is-animating .menu-num, .menu.is-animating .menu-jp { transition: none; }

/* the chapter you're in carries the crimson seal */
.menu-item.is-current .menu-num { color: var(--text); }
.menu-item.is-current .menu-num::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 10px; background: var(--crimson); transform: rotate(45deg) translateY(-2px); }

/* Pointing at a chapter: it steps forward, the rest fall quiet. */
@media (hover: hover) {
  .menu-list:hover .menu-item a, .menu-list:has(a:focus-visible) .menu-item a { opacity: 0.38; }
  .menu-list .menu-item a:hover, .menu-list .menu-item a:focus-visible { opacity: 1; }
}
.menu-item a:hover .menu-title > span, .menu-item a:focus-visible .menu-title > span { transform: translateX(14px); }
.menu-item a:hover .menu-sub, .menu-item a:focus-visible .menu-sub { opacity: 1; transform: translateX(8px); }
.menu-item a:hover .menu-num, .menu-item a:focus-visible .menu-num, .menu-item a:hover .menu-jp, .menu-item a:focus-visible .menu-jp { color: var(--gold); }
.menu-item:hover::after, .menu-item:has(a:focus-visible)::after { transform: scaleX(1); }

/* the scene: the samurai on the torii path, quiet and dark, with the chapter's kanji drawn over its edge */
.menu-aside { grid-column: 2; grid-row: 1 / 3; position: relative; align-self: center; height: min(64vh, 620px); }
.menu-scene { position: absolute; inset: 0 0 12% 0; overflow: hidden; margin: 0; }
.menu-scene-img {
  position: absolute; inset: 0; background: center 40% / cover no-repeat; filter: brightness(0.62) saturate(0.9) contrast(1.05);
  -webkit-mask-image: radial-gradient(farthest-side at 55% 45%, #000 50%, transparent 100%);
          mask-image: radial-gradient(farthest-side at 55% 45%, #000 50%, transparent 100%);
}
.menu-glyph { position: absolute; left: -0.08em; bottom: 0; display: flex; align-items: flex-end; gap: 18px; pointer-events: none; }
.menu-glyph-jp {
  font: 600 clamp(110px, 12vw, 190px)/0.9 var(--serif-body); color: transparent;
  -webkit-text-stroke: 1px rgba(201, 163, 90, 0.7);
}
.menu-glyph-cap { display: grid; gap: 6px; padding-bottom: 14px; font: 600 11px/1 var(--body); letter-spacing: 0.32em; text-transform: uppercase; color: var(--muted); }
.menu-glyph-cap b { font: 400 16px/1 var(--serif-body); letter-spacing: 0.12em; text-transform: none; color: var(--text); }

.menu-foot {
  grid-column: 1 / -1; grid-row: 3; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding-top: 22px; border-top: 1px solid var(--line);
}
.menu-sig { font: 400 15px/1.4 var(--serif-body); color: var(--muted); }
.menu-meta { font: 600 11px/1 var(--body); letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted); }
.menu-sound {
  display: inline-flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 4px; background: none; border: 0; cursor: pointer;
  color: var(--text); font: 600 12px/1 var(--body); letter-spacing: 0.3em; text-transform: uppercase;
}
.menu-sound:hover .menu-sound-label { color: var(--gold); }
.menu-sound-bars { display: inline-flex; align-items: flex-end; gap: 3px; height: 12px; }
.menu-sound-bars i { width: 2px; height: 3px; background: var(--gold); transition: height 0.3s; }
.menu-sound[aria-pressed="true"] .menu-sound-bars i { animation: menu-bars 1.1s ease-in-out infinite alternate; }
.menu-sound[aria-pressed="true"] .menu-sound-bars i:nth-child(2) { animation-delay: -0.4s; }
.menu-sound[aria-pressed="true"] .menu-sound-bars i:nth-child(3) { animation-delay: -0.8s; }
@keyframes menu-bars { from { height: 3px; } to { height: 12px; } }

/* Tablets and phones: one column, the scene becomes the atmosphere behind the index. */
@media (max-width: 900px) {
  /* If the index is taller than the screen (short phones, or Safari's bars showing), it scrolls instead of
     pushing the sound control off the bottom; the extra bottom room keeps it clear of Safari's toolbar zone. */
  .menu-inner { display: flex; flex-direction: column; padding: 88px var(--gutter) calc(32px + env(safe-area-inset-bottom, 0px)); overflow-y: auto; overscroll-behavior: contain; }
  .menu-nav { margin-block: auto; padding-block: 24px; align-self: stretch; }
  .menu-aside { position: absolute; inset: 0; height: auto; align-self: auto; pointer-events: none; }
  .menu-scene { inset: 0; }
  .menu-scene-img {
    opacity: 0.3; background-position: 50% 30%;
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 18%, rgba(0, 0, 0, 0.5) 55%, transparent 90%);
            mask-image: linear-gradient(180deg, transparent 0%, #000 18%, rgba(0, 0, 0, 0.5) 55%, transparent 90%);
  }
  .menu-glyph { display: none; }
  .menu-item a { grid-template-columns: 40px minmax(0, 1fr) auto; column-gap: 14px; row-gap: 6px; padding: 15px 0; }
  .menu-num { grid-row: 1 / 3; align-self: start; padding-top: 0.55em; }
  .menu-title > span { font-size: clamp(26px, 7.4vw, 36px); }
  .menu-sub { grid-column: 2; grid-row: 2; font-size: 13px; opacity: 0.75; }
  .menu-jp { grid-column: 3; grid-row: 1; align-self: center; }
  .menu-foot { flex-wrap: wrap; row-gap: 8px; padding-top: 16px; }
  .menu-meta { display: none; }
}
@media (max-width: 640px) {
  /* the sound control lives in the menu on phones, so the bar stays clean */
  .site-nav .sound { display: none; }
  .menu-foot { flex-direction: row-reverse; justify-content: space-between; }
  .menu-sig { font-size: 13px; }
}
@media (max-width: 900px) and (max-height: 760px) {
  .menu-sub { display: none; }
  .menu-item a { padding: 12px 0; }
}
@media (max-width: 900px) and (max-height: 620px) {
  .menu-inner { padding-top: 76px; }
  .menu-nav { padding-block: 8px; }
  .menu-item a { padding: 9px 0; }
  .menu-title > span { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .menu { opacity: 0; transition: opacity 0.2s, visibility 0.2s; }
  .menu.is-open { opacity: 1; }
  .menu-sound[aria-pressed="true"] .menu-sound-bars i { animation: none; height: 8px; }
  .menu-title > span, .menu-sub, .menu-item::after, .nav-toggle-lines i { transition: none; }
}
