/* =========================================================
   EdqSolutions
   1. Tokens          5. Problem statement
   2. Base            6. Method
   3. Nav             7. Work (Future of Finance)
   4. Hero            8. Stack, Contact, Footer, 404
   9. Responsive + reduced motion
   ========================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  --ink: #15171b;          /* text and buttons only, never a big background */
  --paper: #f8f6f1;
  --sand: #eee8da;
  --sand-deep: #e7dfcc;
  --green: #0e7c4a;
  --gold: #ffc83d;

  --font-display: "Big Shoulders Display", "Oswald", "Arial Narrow", Impact, sans-serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --pad: clamp(20px, 4vw, 56px);
  --maxw: 1320px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* Section themes. Every section sets its own colors from these. */
.on-light, .on-sand {
  --fg: var(--ink);
  --muted: rgba(21, 23, 27, .7);
  --line: rgba(21, 23, 27, .2);
  --accent: var(--green);
  --err: #b3261e;
  color: var(--fg);
}
.on-light { --bg: var(--paper); background: var(--bg); }
.on-sand  { --bg: var(--sand);  background: var(--bg); }
.on-green {
  --bg: var(--green);
  --fg: #fbf8f0;
  --muted: rgba(251, 248, 240, .82);
  --line: rgba(251, 248, 240, .34);
  --accent: var(--gold);
  --err: #ffd9d5;
  background: var(--bg); color: var(--fg);
}
.on-gold {
  --bg: var(--gold);
  --fg: var(--ink);
  --muted: rgba(21, 23, 27, .74);
  --line: rgba(21, 23, 27, .3);
  --accent: #0b5c36;
  --err: #7a140e;
  background: var(--bg); color: var(--fg);
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, ol, ul, dl, dd { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
img, svg, canvas { display: block; max-width: 100%; }

:focus-visible { outline: 2px solid var(--accent, var(--green)); outline-offset: 3px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper);
  padding: 10px 16px; border-radius: 6px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }
.section { padding-block: clamp(96px, 14vw, 200px); }

.display {
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  line-height: .88;
  letter-spacing: -.005em;
  font-size: clamp(52px, 9vw, 150px);
}
.display-sub {
  margin-top: clamp(20px, 3vw, 36px);
  max-width: 34ch;
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.35;
  color: var(--muted);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 16px; font-weight: 600; line-height: 1;
  text-decoration: none; cursor: pointer;
  background: transparent;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.btn .ico { transition: transform .25s var(--ease); }
.btn:hover .ico { transform: translateX(3px); }
.btn:hover .ico-down { transform: translateY(3px) rotate(90deg); }
.ico-down { transform: rotate(90deg); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--ink); border-color: var(--ink); }
.btn-ghost { color: var(--fg); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--fg); }
.btn-solid { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--paper); border-color: var(--paper); color: var(--ink); }

/* ---------- 3. Nav ---------- */
.site-nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--pad);
  color: var(--ink);
  pointer-events: none;
}
.site-nav a { pointer-events: auto; text-decoration: none; font-size: 15px; font-weight: 500; }
.brand, .site-nav nav {
  background: rgba(248, 246, 241, .86);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid rgba(21, 23, 27, .1);
  border-radius: 999px;
}
.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 18px;
  line-height: 0;
}

.brand img {
  display: block;
  width: 190px;
  height: 52px;
  object-fit: contain;
  object-position: center;
}
.site-nav nav { display: flex; gap: clamp(4px, 1.5vw, 10px); padding: 5px; pointer-events: auto; }
.site-nav nav a { padding: 7px 14px; border-radius: 999px; transition: background-color .25s var(--ease), color .25s var(--ease); }
.site-nav nav a:hover { background: rgba(21, 23, 27, .08); }
.site-nav nav a.nav-cta { background: var(--ink); color: var(--paper); }
.site-nav nav a.nav-cta:hover { background: var(--green); }

/* ---------- 4. Hero ---------- */
.hero-track { position: relative; height: 200vh; background: var(--paper); }
.hero-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }

.hero-frame {
  --bg: var(--sand-deep);
  background: var(--bg);
  position: absolute; inset: 0;
  overflow: hidden;
  clip-path: inset(0% 0% 0% 0% round 0px);
  will-change: clip-path;
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.flag-tip {
  position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none;
  padding: 6px 12px; border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font-size: 13px; font-weight: 500; line-height: 1.2; white-space: nowrap;
  opacity: 0; transition: opacity .15s var(--ease);
}
.flag-tip.is-on { opacity: 1; }

.hero-content {
  position: relative; z-index: 1;
  height: 100%;
  padding: clamp(76px, 10vh, 104px) var(--pad) clamp(20px, 3vh, 32px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, min(42vw, 42rem));
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "kicker kicker"
    "title  right"
    "foot   foot";
  column-gap: clamp(24px, 4vw, 64px);
  transform-origin: 50% 50%;
  will-change: transform;
}
.hero-kicker { grid-area: kicker; font-size: 14px; color: var(--muted); }

.hero-title {
  grid-area: title;
  align-self: center;
  --hl: min(25vw, 21.5vh);       /* base size of the giant headline */
}
.hero-title .line {
  display: block; width: max-content;
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  line-height: .84;
  letter-spacing: -.005em;
  font-size: calc(var(--hl) * var(--hl-fit, 1)); /* --hl-fit is set by js/scroll.js so lines never overflow */
}

.hero-right { grid-area: right; align-self: center; display: grid; gap: clamp(20px, 3.4vh, 34px); }
.hero-flag-slot { width: 100%; aspect-ratio: 2 / 1; }

.hero-side { padding-bottom: 6px; }
.hero-verbs { margin-bottom: 14px; }
.verb-window { display: block; height: 1em; overflow: hidden; font-size: clamp(38px, 4.2vw, 64px); line-height: 1; }
.verb {
  display: block;
  font-family: var(--font-display); font-weight: 900; text-transform: uppercase;
  color: var(--accent);
}
.hero-lede { font-size: 18px; line-height: 1.45; max-width: 44ch; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }

.hero-foot {
  grid-area: foot;
  display: flex; flex-wrap: wrap;
  margin-top: 18px; padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 14px; color: var(--muted);
}
.hero-foot span { padding-right: clamp(18px, 3vw, 44px); }

/* Entrance: text rises in once the flags have merged (js adds .is-ready) */
.js .hero-reveal { opacity: 0; transform: translateY(22px); }
.js .is-ready .hero-reveal {
  opacity: 1; transform: none;
  transition: opacity .7s var(--ease) var(--d, 0s), transform .8s var(--ease) var(--d, 0s);
}

/* Labels in the paper margin, shown while the hero shrinks */
.hero-labels { position: absolute; inset: 0; z-index: 0; opacity: 0; color: var(--ink); pointer-events: none; }
.hl { position: absolute; font-size: 14px; font-weight: 500; }
.hl-top-left, .hl-top-mid, .hl-top-right { top: 9%; }
.hl-bot-left, .hl-bot-mid, .hl-bot-right { bottom: 5.5%; }
.hl-top-left, .hl-bot-left { left: 9%; }
.hl-top-right, .hl-bot-right { right: 9%; text-align: right; }
.hl-top-mid, .hl-bot-mid { left: 50%; transform: translateX(-50%); }

/* ---------- 5. Problem statement ---------- */
.problem { position: relative; height: 200vh; }
.problem-sticky {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  display: flex; align-items: center;
  padding: 0 var(--pad);
}
.problem-text {
  font-family: var(--font-display); font-weight: 900; text-transform: uppercase;
  line-height: .9; letter-spacing: -.005em;
  font-size: min(8.6vw, 14vh);
  width: 100%; max-width: var(--maxw); margin: 0 auto;
}
.problem-text .block { display: block; }
.problem-text .block + .block { margin-top: clamp(24px, 5vh, 56px); padding-left: clamp(0px, 10vw, 180px); }
.js .problem-text .w { opacity: .14; }

/* ---------- 6. Method ---------- */
.stages { margin-top: clamp(56px, 8vw, 110px); border-top: 1px solid var(--line); }
.stage { border-bottom: 1px solid var(--line); }
.stage-head {
  display: grid;
  grid-template-columns: 72px minmax(0, 1.1fr) minmax(0, 1fr) 32px;
  align-items: center;
  column-gap: 16px;
  width: 100%; padding: clamp(18px, 2.4vw, 30px) 0;
  background: none; border: 0; cursor: pointer; text-align: left;
}
.stage-idx { font-size: 15px; color: var(--muted); }
.stage-name {
  font-family: var(--font-display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(44px, 6.4vw, 100px); line-height: .95;
  transition: color .25s var(--ease);
}
.stage-tag { font-size: 18px; color: var(--muted); }
.stage-icon { position: relative; width: 22px; height: 22px; justify-self: end; }
.stage-icon::before, .stage-icon::after {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px;
  background: currentColor; transition: transform .35s var(--ease);
}
.stage-icon::after { transform: rotate(90deg); }
.stage.is-open .stage-icon::after { transform: rotate(0deg); }
.stage-head:hover .stage-name, .stage.is-open .stage-name { color: var(--accent); }

.stage-body {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .45s var(--ease);
}
.stage.is-open .stage-body { grid-template-rows: 1fr; }
.stage-body > div { overflow: hidden; min-height: 0; visibility: hidden; transition: visibility 0s .45s; }
.stage.is-open .stage-body > div { visibility: visible; transition-delay: 0s; }
.stage-body ul {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 40px;
  padding: 4px 48px 34px 88px;
}
.stage-body li { padding-left: 16px; border-left: 2px solid var(--accent); font-size: 18px; line-height: 1.4; }

/* The closing strip: six stages joined into one line that draws on scroll */
.layer { margin-top: clamp(96px, 12vw, 180px); }
.layer-title { font-size: clamp(48px, 8vw, 128px); }
.layer-strip {
  position: relative; margin-top: clamp(36px, 5vw, 64px);
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
}
.layer-strip::before, .layer-strip::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line);
}
.layer-strip::after { background: var(--accent); height: 2px; top: -.5px; transform: scaleX(var(--layer-p, 0)); transform-origin: left; }
.layer-strip li { position: relative; padding-top: 22px; font-size: 16px; color: var(--muted); transition: color .3s var(--ease); }
.layer-strip li::before {
  content: ""; position: absolute; left: 0; top: -5px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--line); transition: background-color .3s var(--ease), border-color .3s var(--ease);
}
.layer-strip li.is-on { color: var(--fg); }
.layer-strip li.is-on::before { background: var(--accent); border-color: var(--accent); }

/* ---------- 7. Work: selected projects ---------- */
.work-head {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(24px, 5vw, 80px); align-items: end;
}
.work .display { font-size: clamp(48px, 6.2vw, 100px); }
.work-copy { display: grid; gap: 12px; font-size: 16px; line-height: 1.5; color: var(--muted); max-width: 52ch; }
.work-copy strong { color: var(--fg); font-weight: 600; white-space: nowrap; }

.flow {
  display: grid; grid-template-columns: minmax(250px, .55fr) minmax(0, 1.45fr);
  gap: clamp(28px, 5vw, 80px);
  margin-top: clamp(32px, 4.5vw, 60px);
}

/* Project navigator: a track with a progress line and one marker per project */
.flow-list { position: sticky; top: 14vh; align-self: start; --n: 6; --i: 0; }
.flow-list::before, .flow-list::after {
  content: ""; position: absolute; left: 10px; width: 1px;
  top: calc(100% / var(--n) / 2);
}
.flow-list::before { bottom: calc(100% / var(--n) / 2); background: var(--line); }
.flow-list::after {
  width: 2px; margin-left: -.5px; background: var(--accent);
  height: calc(100% / var(--n) * var(--i));
  transition: height .5s var(--ease);
}
.flow-tab {
  position: relative; display: block; width: 100%;
  min-height: 60px; padding: 14px 0 14px 44px;
  background: none; border: 0; cursor: pointer; text-align: left;
  font-size: 19px; font-weight: 500; line-height: 1.25; color: var(--muted);
  transition: color .25s var(--ease);
}
.flow-tab::before {
  content: ""; position: absolute; left: 4px; top: 50%; width: 13px; height: 13px; margin-top: -6.5px;
  border-radius: 50%; background: var(--bg); border: 1px solid var(--line);
  transition: background-color .3s var(--ease), border-color .3s var(--ease);
}
.tab-num { display: inline-block; min-width: 2ch; margin-right: 10px; font-size: 13px; font-weight: 600; letter-spacing: .04em; opacity: .7; }
.flow-tab:hover { color: var(--fg); }
.flow-tab[aria-selected="true"] { color: var(--fg); font-weight: 600; }
.flow-tab[aria-selected="true"]::before, .flow-tab.is-passed::before { background: var(--accent); border-color: var(--accent); }

/* Panels sit on top of each other, so the section is only as tall as the tallest project
   and never jumps when you switch. */
.flow-panels { min-width: 0; }
.stack-panels, .sub-stack { display: grid; }
.stack-item {
  grid-area: 1 / 1; min-width: 0;
  visibility: hidden; opacity: 0; pointer-events: none; transform: translateY(12px);
  transition: opacity .35s var(--ease), transform .45s var(--ease), visibility 0s .35s;
}
.stack-item.is-active { visibility: visible; opacity: 1; pointer-events: auto; transform: none; transition-delay: 0s; }

.project { display: flex; flex-direction: column; }
.project-count { font-size: 14px; color: var(--muted); }
.project-title {
  margin-top: 8px;
  font-family: var(--font-display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(38px, 4.6vw, 72px); line-height: .9; letter-spacing: -.005em;
  overflow-wrap: anywhere;
}
.project-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px clamp(20px, 3vw, 44px); margin-top: 12px; align-items: start; }
.project-sub { font-size: 17px; font-weight: 600; color: var(--accent); line-height: 1.3; }
.project-lede { margin-top: 8px; font-size: clamp(18px, 1.6vw, 21px); line-height: 1.32; }
.project-intro { display: grid; gap: 8px; font-size: 14.5px; line-height: 1.45; color: var(--muted); }

@keyframes panelIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Participant journey */
.journey { margin-top: 20px; }
.journey-label { font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 10px; max-width: 60ch; }
.journey-scroll { overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.journey-steps {
  position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(var(--min, 96px), 1fr));
  min-width: 0;
}
.journey-steps::before, .journey-steps::after {
  content: ""; position: absolute; left: 6px; right: 0; top: 6px; height: 1px; background: var(--line);
}
.journey-steps::after { height: 2px; top: 5.5px; right: 6px; background: var(--accent); transform: scaleX(var(--jp, 0)); transform-origin: left; transition: transform .25s linear; }
.journey-steps li {
  position: relative; padding: 24px 10px 0 0;
  font-size: 12.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; line-height: 1.3;
  color: var(--muted); transition: color .3s var(--ease);
}
.journey-steps li::before {
  content: ""; position: absolute; left: 0; top: 0; width: 13px; height: 13px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--line);
  transition: background-color .3s var(--ease), border-color .3s var(--ease);
}
.journey-steps li.is-lit { color: var(--fg); }
.journey-steps li.is-lit::before { background: var(--accent); border-color: var(--accent); }
.journey-steps { --min: 96px; }
.journey-steps.is-dense { --min: 88px; }
.journey-steps.is-dense li { font-size: 11px; letter-spacing: .03em; padding-right: 4px; }
.journey-steps li { overflow-wrap: break-word; }
.jn { display: block; margin-bottom: 2px; font-weight: 500; opacity: .6; }
.jstep { display: inline; }
button.jstep {
  padding: 0; margin: 0; background: none; border: 0; cursor: pointer;
  font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; text-align: left;
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 5px; text-decoration-thickness: 2px;
  transition: text-decoration-color .2s var(--ease);
}
button.jstep:hover { text-decoration-color: var(--line); }
.journey-steps li.is-current button.jstep { text-decoration-color: var(--accent); }
.journey-steps li.is-current::before { box-shadow: 0 0 0 4px rgba(14, 124, 74, .18); }
.journey-caption, .journey-note { margin-top: 12px; max-width: 64ch; font-size: 15px; line-height: 1.5; color: var(--muted); }
.journey-caption { min-height: 3em; }
.journey-caption strong { color: var(--fg); font-weight: 600; }
.journey-note { margin-top: 0; }

/* Project body: sub-tabs or a single block */
.project-body { margin-top: 16px; }
.subtabs { display: flex; flex-wrap: wrap; gap: 4px 22px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.subtab {
  padding: 8px 0 10px; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  cursor: pointer; font-size: 15px; font-weight: 500; color: var(--muted);
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.subtab:hover { color: var(--fg); }
.subtab[aria-selected="true"] { color: var(--fg); font-weight: 600; border-bottom-color: var(--accent); }
.subpanel > p, .subpanel-plain > p { max-width: 64ch; font-size: 16px; line-height: 1.5; color: var(--muted); margin-top: 8px; }
.sub-title { font-size: 19px; font-weight: 600; line-height: 1.3; max-width: 44ch; }
.block-label { font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }

.groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 28px; }
.group h4 { font-size: 15px; font-weight: 600; color: var(--accent); padding-bottom: 6px; border-bottom: 2px solid var(--accent); }
.group li { padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.3; }

.items { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 24px; }
.item { padding-left: 14px; border-left: 2px solid var(--accent); }
.item h4 { font-size: 16px; font-weight: 600; }
.item p { margin-top: 2px; font-size: 14.5px; line-height: 1.4; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 15px; }

.principle-title {
  font-family: var(--font-display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(30px, 3.6vw, 52px); line-height: .95; max-width: 20ch;
}

.meta {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 10px clamp(20px, 3vw, 44px);
  margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line);
}
.project .meta { margin-top: 18px; }
.meta dt { font-size: 12.5px; color: var(--muted); }
.meta dd { margin: 1px 0 0; font-size: 14px; line-height: 1.35; }
.meta > div:first-child { grid-row: span 2; }

/* ---------- 8. Stack ---------- */
.chain {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-top: clamp(56px, 8vw, 110px);
  position: relative;
  clip-path: inset(-12px 0 0 0); /* keeps the pulse inside the line's width */
}
.chain::after { /* a pulse that travels along the line */
  content: ""; position: absolute; top: -1px; left: 0; width: 90px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: chainPulse 6s linear infinite;
}
@keyframes chainPulse { from { left: -90px; } to { left: 100%; } }
.chain li { position: relative; padding: 24px 16px 0 0; border-top: 1px solid var(--line); }
.chain li::before {
  content: ""; position: absolute; top: -5px; left: 0; width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--muted);
}
.chain-name { display: block; font-size: 19px; font-weight: 600; line-height: 1.25; }
.chain-desc { display: block; margin-top: 6px; font-size: 15px; color: var(--muted); }
.chain li.is-core { border-top: 2px solid var(--accent); margin-top: -1px; }
.chain li.is-core::before { background: var(--accent); border-color: var(--accent); top: -6px; }
.chain li.is-core .chain-name { color: var(--fg); }

.stack-note { margin-top: clamp(56px, 8vw, 110px); max-width: 30ch; font-size: clamp(24px, 3vw, 40px); line-height: 1.25; font-weight: 500; }
.stack-tools { display: block; color: var(--muted); }
.stack-claim { display: block; margin-top: 12px; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(40px, 7vw, 120px); align-items: start; }
.contact .display { font-size: clamp(48px, 7.4vw, 120px); }
.contact-form { display: grid; gap: 26px; padding-top: 12px; }
.field label { display: block; margin-bottom: 6px; font-size: 15px; color: var(--muted); }
.field input, .field textarea {
  width: 100%; padding: 10px 0 12px;
  background: transparent; color: var(--fg);
  border: 0; border-bottom: 1px solid var(--fg); border-radius: 0;
  font: inherit; font-size: 20px;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus-visible, .field textarea:focus-visible { outline: none; border-bottom: 2px solid var(--accent); padding-bottom: 11px; }
.field [aria-invalid="true"] { border-bottom-color: var(--err); }
.contact-form .btn { justify-self: start; }
.form-status { min-height: 1.5em; font-size: 16px; }
.form-status.is-error { color: var(--err); font-weight: 500; }
.contact-alt { font-size: 16px; color: var(--muted); }
.contact-alt a { color: var(--fg); }

/* ---------- Footer ---------- */
.site-footer { padding-block: clamp(40px, 6vw, 72px) 36px; border-top: 1px solid var(--line); }
.footer-top { display: flex; flex-wrap: wrap; gap: 28px 40px; align-items: center; justify-content: space-between; }
.footer-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
  color: var(--fg);
}

.footer-brand img {
  display: block;
  width: 190px;
  height: auto;
  object-fit: contain;
}
.footer-line { margin-top: 6px; font-size: 16px; color: var(--muted); }
.footer-legal { padding-right: 72px; margin-top: clamp(28px, 4vw, 48px); padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }

.social { display: flex; flex-wrap: wrap; gap: 10px; }
.social a {
  display: grid; place-items: center; width: 46px; height: 46px;
  border: 1px solid var(--line); border-radius: 50%;
  color: var(--fg); background: transparent;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.social svg { width: 21px; height: 21px; }
.social a:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); transform: translateY(-2px); }
.social a.is-empty { cursor: default; }

/* ---------- WhatsApp button ---------- */
.wa-fab {
  position: fixed; z-index: 60;
  right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
  display: inline-flex; align-items: center;
  height: 58px; padding: 0 8px;
  background: #25d366; color: var(--ink);
  border-radius: 999px; text-decoration: none;
  box-shadow: 0 6px 20px rgba(21, 23, 27, .22);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.wa-fab svg { width: 42px; height: 42px; flex: none; }
.wa-label {
  max-width: 0; overflow: hidden; white-space: nowrap;
  font-size: 15px; font-weight: 600;
  transition: max-width .35s var(--ease), padding .35s var(--ease);
}
.wa-fab:hover, .wa-fab:focus-visible { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(21, 23, 27, .28); }
.wa-fab:hover .wa-label, .wa-fab:focus-visible .wa-label { max-width: 170px; padding: 0 14px 0 8px; }
.wa-fab:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---------- 404 page ---------- */
.nf { min-height: 100svh; display: grid; place-content: center; gap: 24px; padding: var(--pad); }
.nf .display { font-size: clamp(72px, 18vw, 260px); }
.nf p { max-width: 34ch; color: var(--muted); }
.nf .btn { justify-self: start; }

/* ---------- 9. Responsive ---------- */
@media (max-width: 899px) {
  .work-head { grid-template-columns: 1fr; align-items: start; }
  .flow { grid-template-columns: 1fr; gap: 24px; }
  .flow-list { position: static; display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: thin; }
  .flow-list::before, .flow-list::after { display: none; }
  .flow-tab { width: auto; flex: none; min-height: 0; padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px; font-size: 15px; white-space: nowrap; }
  .flow-tab::before { display: none; }
  .flow-tab[aria-selected="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
  .journey-steps { --min: 104px; }
  .journey-steps.is-dense { --min: 122px; }

  /* On phones, only the open project takes up space (no equal-height stacking) */
  .stack-panels, .sub-stack { display: block; }
  .stack-item { visibility: visible; opacity: 1; transform: none; pointer-events: auto; transition: none; }
  .stack-item:not(.is-active) { display: none; }
  .stack-item.is-active { animation: panelIn .4s var(--ease); }
  .groups { grid-template-columns: 1fr; }
  .project-row { grid-template-columns: 1fr; }
  .meta { grid-template-columns: 1fr; }
  .meta > div:first-child { grid-row: auto; }

  .chain { grid-template-columns: 1fr; margin-left: 4px; }
  .chain::after { display: none; }
  .chain li { border-top: 0; border-left: 1px solid var(--line); padding: 0 0 28px 24px; }
  .chain li::before { top: 4px; left: -5px; }
  .chain li.is-core { border-top: 0; margin-top: 0; border-left: 2px solid var(--accent); }
  .chain li.is-core::before { top: 4px; left: -6px; }

  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  body { font-size: 17px; }
  .site-nav nav a:not(.nav-cta) { display: none; }

  .hero-content {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto auto;
    grid-template-areas: "kicker" "title" "right" "foot";
    align-content: start;
    row-gap: 14px;
  }
  .hero-title { --hl: min(30vw, 12.5vh); align-self: start; }
  .hero-right { gap: 14px; }
  .hero-side { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 0; }
  .hero-verbs { margin: 0; }
  .verb-window { font-size: 44px; }
  .hero-lede { display: none; }
  .hero-actions { margin-top: 0; flex-wrap: nowrap; }
  .hero-actions .btn { padding: 12px 16px; font-size: 15px; }
  .hero-actions .btn-ghost { display: none; }
  .hero-foot { display: none; }
  .brand {
    padding: 7px 14px;
  }
  
  .brand img {
    width: 135px;
    height: 40px;
  }

  .stage-head { grid-template-columns: 40px minmax(0, 1fr) 28px; row-gap: 2px; }
  .stage-tag { grid-column: 2; grid-row: 2; font-size: 16px; }
  .stage-icon { grid-column: 3; grid-row: 1 / span 2; }
  .stage-body ul { grid-template-columns: 1fr; padding: 4px 0 28px 56px; }
  .items { grid-template-columns: 1fr; }
  .journey-caption { min-height: 5em; }

  .layer-strip { grid-template-columns: 1fr; gap: 14px; }
  .layer-strip::before, .layer-strip::after { display: none; }
  .layer-strip li { padding-top: 0; padding-left: 26px; }
  .layer-strip li::before { top: 6px; }

  .problem-text .block + .block { padding-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-track { height: 100svh; }
  .problem { height: auto; }
  .problem-sticky { position: static; height: auto; min-height: 80svh; }
  .js .problem-text .w { opacity: 1; }
  .chain::after { animation: none; display: none; }
  .js .hero-reveal { opacity: 1; transform: none; }
  .stack-item { transition-duration: .01ms !important; transform: none; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
