/* Craftloop mockups: "Daylight Bold" direction.
   Tokens first; components below. Class selectors only, so specificity stays flat. */

:root {
  --paper: #FFFFFF;
  --ink: #0F1A3A;
  --ink-2: #47506B;
  --ink-3: #7C849C;
  --line: #E3E7F2;
  --cobalt: #2453FF;
  --cobalt-deep: #1A3BCC;
  --wash: #EEF2FF;
  --pattern: #D9E1F7;
  --ad: #1B2A55;
  --ad-2: #2A3D73;
  --vt: #0E6B55;
  --vt-wash: #E8F3EF;

  --display: "Bricolage Grotesque", "Public Sans", system-ui, sans-serif;
  --body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --fs-hero: clamp(3.1rem, 7.4vw, 6.6rem);
  --fs-h1: clamp(2.6rem, 5.6vw, 4.8rem);
  --fs-h2: clamp(2.1rem, 4.2vw, 3.6rem);
  --fs-h3: clamp(1.35rem, 2vw, 1.6rem);
  --fs-lead: clamp(1.1rem, 1.5vw, 1.3rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.875rem;

  --wrap: 1200px;
  --gutter: clamp(20px, 4vw, 40px);
  --nav-h: 72px;
  --r-tile: 28px;
  --r-ctl: 12px;
  --device-shadow: 0 30px 60px -20px rgba(15, 26, 58, .35), 0 12px 24px -12px rgba(15, 26, 58, .25);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: var(--nav-h); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 var(--fs-body)/1.6 var(--body); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 800; font-variation-settings: "opsz" 96; letter-spacing: -0.045em; line-height: .98; }
h3 { font-size: var(--fs-h3); letter-spacing: -0.03em; line-height: 1.15; font-variation-settings: "opsz" 32; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 12px; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.lead { font-size: var(--fs-lead); line-height: 1.5; color: var(--ink-2); max-width: 36em; }
.muted { color: var(--ink-2); }
.small { font-size: var(--fs-small); }

/* ---------- Mockup ribbon ---------- */
.mock-ribbon { background: var(--ink); color: #C9D2EA; font-size: .8rem; text-align: center; padding: 6px 12px; }
.mock-ribbon b { color: #fff; font-weight: 600; }

/* ---------- Logo ---------- */
.mark { display: block; flex: none; }
.mark .lift { transform: translate(5px, -5px); transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.lockup { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.lockup .word { font: 800 1.6rem/1 var(--display); font-variation-settings: "opsz" 48; letter-spacing: -0.05em; }
.lockup:hover .mark .lift { transform: translate(0, 0); }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.nav.scrolled { border-bottom-color: var(--line); }
.nav-in { height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nav-links { display: flex; align-items: center; gap: 32px; list-style: none; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; font-weight: 500; color: var(--ink-2); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 8px; text-decoration-color: var(--cobalt); }
.nav-links a.btn, .nav-links a.btn:hover, .nav-links a.btn[aria-current] { color: #fff; text-decoration: none; }
.nav-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: #fff; color: var(--ink); align-items: center; justify-content: center; cursor: pointer; }
.nav-sheet { display: none; }

@media (max-width: 760px) {
  :root { --nav-h: 64px; }
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-sheet { display: block; position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 24px; transform: translateY(-8px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; box-shadow: 0 20px 30px -20px rgba(15, 26, 58, .3); }
  .nav-sheet.open { opacity: 1; transform: none; pointer-events: auto; }
  .nav-sheet a { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; font: 700 1.35rem/1.2 var(--display); letter-spacing: -0.03em; }
  .nav-sheet .btn { display: flex; color: #fff; margin-top: 18px; width: 100%; justify-content: center; border-bottom: 0; font: 600 1rem/1 var(--body); }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: var(--r-ctl); font: 600 1rem/1 var(--body); text-decoration: none; border: 2px solid var(--cobalt); background: var(--cobalt); color: #fff; cursor: pointer; transition: background .15s, border-color .15s, transform .15s; }
.btn:hover { background: var(--cobalt-deep); border-color: var(--cobalt-deep); }
.btn:active { transform: translateY(1px); }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-quiet:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-light { background: #fff; color: var(--ink); border-color: #fff; }
.btn-light:hover { background: var(--wash); border-color: var(--wash); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: .95rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Capability chips ---------- */
.caps { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 28px 0 0; }
.caps li { border: 1.5px solid var(--ink); border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: .92rem; }

/* ---------- Device frames ---------- */
.phone { position: relative; aspect-ratio: 9 / 19.5; border-radius: 15% / 7%; background: var(--ink); padding: 3.2%; box-shadow: var(--device-shadow); }
.phone .screen { width: 100%; height: 100%; border-radius: 12% / 5.6%; overflow: hidden; background: #fff; }
.phone .screen img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.browser { position: relative; border-radius: 14px; background: #fff; overflow: hidden; box-shadow: var(--device-shadow); border: 1px solid rgba(15, 26, 58, .12); }
.browser .bar { height: 34px; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: #F3F5FA; border-bottom: 1px solid var(--line); }
.browser .bar i { width: 9px; height: 9px; border-radius: 50%; background: #D3D8E6; flex: none; }
.browser .url { margin: 0 auto; font-size: .72rem; color: var(--ink-3); background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 2px 12px; white-space: nowrap; }
.browser .screen img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; }
.tablet { position: relative; aspect-ratio: 3 / 4; border-radius: 6%; background: var(--ink); padding: 2.6%; box-shadow: var(--device-shadow); }
.tablet .screen { width: 100%; height: 100%; border-radius: 3.6%; overflow: hidden; }
.tablet .screen img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* Scroll focus: JS sets --p (0 blurred to 1 sharp) and --py (parallax px). */
.focus { --p: 1; --py: 0; filter: blur(calc((1 - var(--p)) * 10px)); opacity: calc(.3 + var(--p) * .7); transform: translate3d(0, calc(var(--py) * 1px), 0) scale(calc(.94 + var(--p) * .06)); will-change: transform, filter; }

/* ---------- Hero (home) ---------- */
.hero { padding: clamp(40px, 7vw, 96px) 0 clamp(56px, 8vw, 120px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { font-size: var(--fs-hero); line-height: .9; letter-spacing: -0.055em; margin-bottom: 28px; }
.hero .lead { margin-bottom: 32px; }
.hero-tiles { position: relative; height: clamp(460px, 46vw, 600px); }
.ptile { position: absolute; width: 50%; border-radius: var(--r-tile); padding: 22px 22px 0; color: #fff; text-decoration: none; overflow: hidden; display: flex; flex-direction: column; transition: translate .3s; }
.ptile:hover { translate: 0 -4px; }
.ptile .name { font: 800 1.45rem/1 var(--display); letter-spacing: -0.035em; }
.ptile .what { font-size: .9rem; color: rgba(255, 255, 255, .78); margin: 6px 0 2px; }
.ptile .since { font-size: .8rem; color: rgba(255, 255, 255, .6); margin-bottom: 18px; }
.ptile .phone { flex: none; width: 84%; margin: auto auto -42%; box-shadow: 0 20px 40px -10px rgba(0, 0, 0, .45); background: #0A1128; }
.drift { --py: 0; transform: translate3d(0, calc(var(--py) * 1px), 0); will-change: transform; }
.ptile-ad { left: 0; top: 0; background: var(--ad); height: 86%; }
.ptile-vt { right: 0; top: 14%; background: var(--vt); height: 86%; }

/* ---------- Showcase bands (home) ---------- */
.band { padding: clamp(72px, 10vw, 140px) 0; position: relative; overflow: hidden; }
.band-ad { background: var(--ad); color: #fff; }
.band-vt { background: var(--vt-wash); }
.band-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
.band-vt .band-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
.band h2 { font-size: var(--fs-h2); margin: 10px 0 22px; }
.band .kicker { font-weight: 600; font-size: .95rem; }
.band-ad .kicker { color: #9FB4FF; }
.band-vt .kicker { color: var(--vt); }
.band-ad .lead { color: #C9D2EA; }
.band ul.points { list-style: none; padding: 0; margin: 26px 0 32px; display: grid; gap: 14px; }
.band ul.points li { padding-left: 30px; position: relative; }
.band ul.points li::before { content: ""; position: absolute; left: 0; top: .45em; width: 16px; height: 16px; border-radius: 50%; border: 3px solid currentColor; border-right-color: transparent; transform: rotate(-45deg); opacity: .8; }
.band-ad ul.points li { color: #E4E9F7; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0 0 32px; border-top: 1px solid; }
.band-ad .facts { border-color: rgba(255, 255, 255, .18); }
.band-vt .facts { border-color: rgba(14, 107, 85, .25); }
.facts div { padding: 14px 16px 14px 0; border-bottom: 1px solid; }
.band-ad .facts div { border-color: rgba(255, 255, 255, .18); }
.band-vt .facts div { border-color: rgba(14, 107, 85, .25); }
.facts dt { font-size: .82rem; opacity: .7; }
.facts dd { margin: 2px 0 0; font: 700 1.15rem/1.2 var(--display); letter-spacing: -0.02em; }
.stage { position: relative; height: clamp(420px, 44vw, 580px); }
.stage .browser { position: absolute; width: 88%; top: 6%; }
.band-ad .stage .browser { right: -4%; }
.band-vt .stage .browser { left: -4%; }
.stage .phone { position: absolute; width: 27%; bottom: -2%; }
.band-ad .stage .phone { left: 0; }
.band-vt .stage .phone { right: 2%; }
.stage .phone-2 { width: 23%; bottom: auto; top: -4%; }
.band-ad .stage .phone-2 { left: auto; right: -2%; }

/* ---------- Section heads ---------- */
.section { padding: clamp(72px, 10vw, 136px) 0; }
.section-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 64px); }
.section-head h2 { font-size: var(--fs-h2); margin-bottom: 18px; }

/* ---------- Loop steps (a real sequence, so numbered) ---------- */
.loop-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; counter-reset: step; position: relative; }
.loop-steps::before { content: ""; position: absolute; left: 28px; right: calc((100% - 72px) / 4 - 28px); top: 27px; height: 2px; background: repeating-linear-gradient(90deg, var(--cobalt) 0 10px, transparent 10px 18px); }
.loop-steps li { position: relative; counter-increment: step; }
.loop-steps li::before { content: counter(step); display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: #fff; border: 2px solid var(--cobalt); color: var(--cobalt); font: 800 1.3rem/1 var(--display); margin-bottom: 20px; position: relative; }
.loop-steps li:last-child::before { background: var(--cobalt); color: #fff; }
.loop-steps h3 { margin-bottom: 8px; }
.loop-steps p { color: var(--ink-2); font-size: .98rem; }
.loop-back { margin-top: 28px; font-size: .95rem; color: var(--ink-2); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }

/* ---------- Proofs of concept list ---------- */
.poc { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.poc li { display: grid; grid-template-columns: 240px 210px minmax(0, 1fr); gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.poc .pname { font: 800 1.35rem/1.1 var(--display); letter-spacing: -0.03em; }
.poc .pdesc { color: var(--ink-2); max-width: 62ch; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 600; white-space: nowrap; }
.status::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; }
.status-public { color: #0E7A4E; }
.status-public::before { background: currentColor; }
.status-private { color: #8A5A00; }
.status-done { color: var(--cobalt); }
.status-done::before { background: currentColor; box-shadow: 0 0 0 3px var(--wash); }

/* ---------- CTA band ---------- */
.cta { background: var(--cobalt); color: #fff; padding: clamp(64px, 9vw, 120px) 0; position: relative; overflow: hidden; }
.cta .truchet-bg { position: absolute; inset: 0; opacity: .16; }
.cta .wrap { position: relative; }
.cta h2 { font-size: var(--fs-h2); max-width: 14ch; margin-bottom: 20px; }
.cta p { color: #DCE4FF; font-size: var(--fs-lead); max-width: 34em; margin-bottom: 32px; }

/* ---------- Footer ---------- */
.footer { padding: 56px 0 40px; border-top: 1px solid var(--line); }
.footer-in { display: flex; flex-wrap: wrap; gap: 24px 48px; justify-content: space-between; align-items: flex-start; }
.footer nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px 28px; }
.footer nav a { text-decoration: none; color: var(--ink-2); }
.footer nav a:hover { color: var(--ink); }
.footer .tagline { margin: 14px 0 0; font: 700 1.05rem/1.3 var(--display); letter-spacing: -0.02em; color: var(--ink); }
.tagline-big { margin: 0; font: 800 clamp(1.6rem, 3.4vw, 2.6rem)/1.1 var(--display); letter-spacing: -0.035em; }
.footer .fine { width: 100%; color: var(--ink-3); font-size: .85rem; margin-top: 12px; }

/* ---------- Page header (inner pages) ---------- */
.page-head { padding: clamp(48px, 7vw, 104px) 0 clamp(40px, 5vw, 72px); }
.page-head h1 { font-size: var(--fs-h1); max-width: 15ch; margin-bottom: 22px; }

/* ---------- Work: case studies ---------- */
.case { padding: clamp(64px, 9vw, 120px) 0; border-top: 1px solid var(--line); }
.case-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: end; margin-bottom: 56px; }
.case-id { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.case-id .swatch { width: 40px; height: 40px; border-radius: 12px; }
.case-id .tag { font-weight: 600; color: var(--ink-2); }
.case h2 { font-size: var(--fs-h2); }
.case-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: clamp(32px, 6vw, 80px); margin-bottom: 64px; }
.case-cols h3 { margin-bottom: 14px; }
.patterns { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 32px; }
.patterns dt { font: 700 1.15rem/1.25 var(--display); letter-spacing: -0.02em; margin-bottom: 6px; display: flex; gap: 10px; align-items: center; }
.patterns dt svg { flex: none; }
.patterns dd { margin: 0; color: var(--ink-2); font-size: .98rem; }

.reel { display: flex; gap: clamp(16px, 2.5vw, 32px); align-items: flex-end; overflow-x: auto; padding: 24px 4px 48px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.reel > * { flex: none; scroll-snap-align: center; margin: 0; }
.reel .phone { width: clamp(190px, 19vw, 250px); }
.reel .browser { width: clamp(420px, 52vw, 680px); }
.reel .tablet { width: clamp(280px, 28vw, 380px); }
.reel figcaption { margin-top: 14px; font-size: .88rem; color: var(--ink-2); text-align: center; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 2px solid var(--ink); }
.timeline li { padding: 18px 20px 0 0; position: relative; }
.timeline li::before { content: ""; position: absolute; top: -7px; left: 0; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); }
.timeline li:last-child::before { background: var(--cobalt); border-color: var(--cobalt); }
.timeline time { font: 700 1rem/1.2 var(--display); letter-spacing: -0.01em; display: block; margin-bottom: 4px; }
.timeline span { color: var(--ink-2); font-size: .95rem; }

/* Agent pipeline */
.pipeline { background: var(--ad); color: #fff; border-radius: var(--r-tile); padding: clamp(28px, 4vw, 48px); margin-bottom: 64px; }
.pipeline h3 { margin-bottom: 8px; }
.pipeline > p { color: #C9D2EA; max-width: 52em; }
.pipe { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin: 36px 0 26px; }
.pipe-track { position: absolute; left: 4%; right: 4%; top: 30px; height: 2px; background: rgba(255, 255, 255, .18); }
.pipe-dot { position: absolute; top: 25px; width: 12px; height: 12px; margin-left: -6px; border-radius: 3px; background: #9FB4FF; box-shadow: 0 0 12px #9FB4FF; }
.agent { position: relative; z-index: 1; text-align: center; }
.agent .node { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 18px; background: var(--ad-2); border: 2px solid rgba(255, 255, 255, .22); display: grid; place-items: center; transition: background .25s, border-color .25s, transform .25s; }
.agent .node svg { width: 26px; height: 26px; }
.agent.on .node { background: var(--cobalt); border-color: #9FB4FF; transform: scale(1.08); }
.agent b { display: block; font-family: var(--display); font-size: 1.02rem; letter-spacing: -0.02em; }
.agent span { display: block; font-size: .82rem; color: #B7C2E2; line-height: 1.4; margin-top: 4px; }
.pipe-foot { display: flex; flex-wrap: wrap; gap: 12px 28px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .14); font-size: .92rem; color: #C9D2EA; }
.pipe-foot strong { color: #fff; }

/* ---------- About: loop story ---------- */
.story { position: relative; }
.story-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(32px, 6vw, 80px); }
.story-steps { padding: 10vh 0 30vh; }
.story-step { min-height: 72vh; display: flex; flex-direction: column; justify-content: center; opacity: .28; transition: opacity .4s; }
.story-step.active { opacity: 1; }
.story-step .n { font: 800 1rem/1 var(--display); color: var(--cobalt); margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.story-step .n::before { content: ""; width: 28px; height: 2px; background: var(--cobalt); }
.story-step h2 { font-size: clamp(2rem, 3.6vw, 3.1rem); margin-bottom: 18px; }
.story-step p { color: var(--ink-2); max-width: 30em; }
.story-step ul { margin: 6px 0 0; padding-left: 1.1em; color: var(--ink-2); }
.story-step li { margin: 4px 0; }
.story-stage { order: 2; align-self: start; position: sticky; top: calc(var(--nav-h) + 4vh); height: calc(92vh - var(--nav-h)); display: flex; align-items: center; justify-content: center; }
.board { position: relative; width: min(100%, 560px); aspect-ratio: 1; }
.board svg.truchet { width: 100%; height: 100%; overflow: visible; }
.board .cell { transform-box: fill-box; transform-origin: center; transition: transform .45s cubic-bezier(.3, 1.4, .5, 1); }
.board .cell path { fill: none; stroke: var(--ink); stroke-width: 7; stroke-linecap: round; transition: stroke .4s, opacity .4s; }
.board .cell rect { fill: none; stroke: var(--pattern); stroke-width: 1.5; stroke-dasharray: 4 5; opacity: 0; transition: opacity .4s; }
.board .cell .ring { fill: none; stroke: var(--cobalt); stroke-width: 3; opacity: 0; }
.board[data-state="2"] .cell rect, .board[data-state="3"] .cell rect { opacity: 1; }
.board .cell.done path { stroke: var(--cobalt); }
.board .cell.looping .ring { animation: ring .5s ease-out; }
@keyframes ring { 0% { opacity: 1; stroke-dashoffset: 280; } 100% { opacity: 0; stroke-dashoffset: 0; } }
.board .circles circle { fill: none; stroke: var(--cobalt); stroke-width: 7; opacity: 0; transition: opacity .5s; }
.board[data-state="4"] .cell path, .board[data-state="5"] .cell path { stroke: var(--pattern); }
.board[data-state="4"] .circles circle, .board[data-state="5"] .circles circle { opacity: 1; }
.board .hud { position: absolute; left: 0; right: 0; bottom: -44px; text-align: center; font-size: .92rem; color: var(--ink-2); min-height: 1.6em; }
.board .hud b { color: var(--cobalt); }
.board .ship { position: absolute; left: 50%; top: 50%; width: 34%; transform: translate(-50%, -40%) scale(.9); opacity: 0; transition: opacity .6s, transform .8s cubic-bezier(.2, .9, .2, 1); }
.board[data-state="5"] .ship { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.numbers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 2px solid var(--ink); }
.numbers div { padding: 24px 24px 0 0; }
.numbers strong { display: block; font: 800 clamp(2.4rem, 4.6vw, 3.8rem)/1 var(--display); letter-spacing: -0.05em; color: var(--cobalt); margin-bottom: 10px; }
.numbers span { color: var(--ink-2); }
.prose { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 6vw, 80px); padding: clamp(56px, 8vw, 104px) 0; border-top: 1px solid var(--line); }
.prose h2 { font-size: clamp(1.9rem, 3.2vw, 2.7rem); }
.prose p { color: var(--ink-2); max-width: 36em; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: clamp(32px, 6vw, 88px); padding-bottom: clamp(64px, 9vw, 120px); }
.form { display: grid; gap: 22px; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field label, .field legend { display: block; font-weight: 600; margin-bottom: 8px; }
.field .hint { font-weight: 400; color: var(--ink-3); font-size: .9rem; }
.field input, .field textarea, .field select { width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1.5px solid #C8CFE0; border-radius: var(--r-ctl); padding: 12px 14px; min-height: 50px; }
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 4px var(--wash); }
.field.invalid input, .field.invalid textarea { border-color: #C2342B; }
.field .err { display: none; color: #B42318; font-size: .9rem; margin-top: 6px; }
.field.invalid .err { display: block; }
fieldset.field { border: 0; margin: 0; padding: 0; }
.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choices label { margin: 0; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid #C8CFE0; border-radius: 999px; padding: 9px 16px; cursor: pointer; }
.choices input { width: auto; min-height: 0; accent-color: var(--cobalt); }
.choices label:has(input:checked) { border-color: var(--cobalt); background: var(--wash); }
.sent { display: none; border: 2px solid var(--cobalt); background: var(--wash); border-radius: var(--r-tile); padding: 28px; }
.sent.show { display: block; }
.sent h3 { margin-bottom: 8px; }
.next-steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.next-steps li { counter-increment: s; padding: 0 0 26px 52px; position: relative; }
.next-steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--cobalt); color: var(--cobalt); display: grid; place-items: center; font: 800 1rem/1 var(--display); }
.next-steps li:not(:last-child)::after { content: ""; position: absolute; left: 17px; top: 38px; bottom: 4px; width: 2px; background: var(--pattern); }
.next-steps b { display: block; font-family: var(--display); font-size: 1.15rem; letter-spacing: -0.02em; margin-bottom: 4px; }
.next-steps span { color: var(--ink-2); font-size: .97rem; }
.aside-card { border-top: 2px solid var(--ink); padding-top: 22px; }

/* ---------- Brand sheet ---------- */
.brand-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; padding-bottom: 72px; }
.brand-mark-big { background: var(--wash); border-radius: 36px; aspect-ratio: 1; display: grid; place-items: center; position: relative; }
.brand-mark-big svg { width: 58%; }
.brand-mark-big .replay { position: absolute; right: 18px; bottom: 18px; }
.lift-anim .lift { animation: lift 2.4s cubic-bezier(.5, 0, .2, 1) both; }
@keyframes lift { 0% { transform: translate(5px, -5px); } 35% { transform: translate(0, 0); } 60% { transform: translate(0, 0); } 80% { transform: translate(8px, -8px); } 100% { transform: translate(5px, -5px); } }
.brand-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding: 40px 0; border-top: 1px solid var(--line); }
.brand-row h3 { grid-column: 1 / -1; }
.specimen { border-radius: 20px; padding: 28px; min-height: 160px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); }
.specimen.dark { background: var(--ink); }
.specimen.cobalt { background: var(--cobalt); }
.swatch-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; grid-column: 1 / -1; }
.sw { border-radius: 16px; border: 1px solid var(--line); overflow: hidden; }
.sw div { height: 88px; }
.sw p { margin: 0; padding: 10px 12px; font-size: .85rem; }
.sw p b { display: block; font-size: .95rem; }
.type-spec { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.type-spec .big { font: 800 4rem/.95 var(--display); letter-spacing: -0.05em; }

/* ---------- Pre-framed product shots: the device frame and shadow are in the image ---------- */
.shot { display: block; width: 100%; height: auto; }
.stage .shot { position: absolute; }
.stage .shot-browser { top: 0; }
.band-ad .stage .shot-browser { right: -7%; }
.band-vt .stage .shot-browser { left: -7%; }
.stage .shot-phone { width: 31%; bottom: -6%; }
.band-ad .stage .shot-phone { left: -4%; }
.band-vt .stage .shot-phone { right: -2%; }
.stage .shot-phone-2 { width: 27%; bottom: auto; top: -10%; }
.band-ad .stage .shot-phone-2 { left: auto; right: -6%; }
.ptile .shot { flex: none; width: 98%; margin: auto auto -50%; }
.board .ship.framed { width: 40%; }
.reel .shot-phone { width: clamp(210px, 21vw, 280px); }
.reel .shot-browser { width: clamp(460px, 56vw, 760px); }
.shot-note { font-size: var(--fs-small); color: var(--ink-3); margin-top: 6px; }

/* ---------- Work index: case cards ---------- */
.cases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(32px, 4vw, 56px); padding-bottom: clamp(64px, 9vw, 120px); }
.case-card { display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.case-card .cover { border-radius: 22px; overflow: hidden; box-shadow: var(--device-shadow); transition: translate .3s; }
.case-card:hover .cover { translate: 0 -4px; }
.case-card .cover img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.case-card h2 { font-size: clamp(1.9rem, 3vw, 2.5rem); margin: 28px 0 10px; }
.case-card p { color: var(--ink-2); margin: 0 0 16px; max-width: 34em; }
.case-card .more { margin-top: auto; font-weight: 600; color: var(--cobalt); text-decoration: underline; text-underline-offset: 4px; }
.case-card:hover .more { color: var(--cobalt-deep); }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 20px; }
.chips li { font-size: .82rem; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; background: #fff; }

/* ---------- Case study pages ---------- */
.case-hero { color: #fff; padding-top: clamp(48px, 7vw, 96px); }
.case-hero-ad { background: var(--ad); }
.case-hero-vt { background: var(--vt); }
.case-hero .case-id .tag { color: rgba(255, 255, 255, .78); }
.case-hero .case-id .swatch { background: rgba(255, 255, 255, .16); display: grid; place-items: center; font: 800 1rem/1 var(--display); }
.case-hero .case-id { flex-wrap: wrap; gap: 6px 14px; }
.case-hero .case-id .pname { font: 800 1.35rem/1 var(--display); letter-spacing: -0.03em; white-space: nowrap; }
.case-hero h1 { font-size: var(--fs-h1); max-width: 17ch; margin-bottom: 24px; }
.case-hero .lead { color: rgba(255, 255, 255, .84); max-width: 40em; }
.case-hero .fine-print { font-size: var(--fs-small); color: rgba(255, 255, 255, .66); max-width: 52em; margin-top: 18px; }
.case-hero .credit { font-size: .9rem; color: rgba(255, 255, 255, .7); margin: 16px 0 0; }
.case-hero .btn-row { margin-top: 26px; }
.case-hero-ad + .hero-shot { background: linear-gradient(var(--ad) 0 58%, var(--paper) 58%); }
.case-hero-vt + .hero-shot { background: linear-gradient(var(--vt) 0 58%, var(--paper) 58%); }
.hero-shot { margin-top: -1px; padding-top: clamp(32px, 5vw, 64px); }
.hero-shot img { width: min(100%, 1100px); margin: 0 auto; }
.hero-shot .shot-note { text-align: center; }
.case-body { padding-top: clamp(56px, 8vw, 104px); }
.case-body .case-cols:last-child { margin-bottom: 0; }
.stack-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: clamp(32px, 6vw, 80px); padding: 48px 0 clamp(64px, 9vw, 112px); border-top: 1px solid var(--line); margin-top: 56px; }
.stack-row h3 { margin-bottom: 12px; }
.mock-note { border: 2px dashed var(--pattern); border-radius: 14px; padding: 14px 18px; color: var(--ink-3); font-size: .92rem; margin-top: 18px; }
.mock-note b { color: var(--ink-2); }
.next-case { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 36px 0; border-top: 2px solid var(--ink); }
.next-case span { color: var(--ink-3); font-size: .95rem; display: block; margin-bottom: 4px; }
.next-case div a { font: 800 clamp(1.6rem, 3vw, 2.2rem)/1.1 var(--display); letter-spacing: -0.03em; text-decoration-thickness: 3px; text-underline-offset: 6px; }

/* Pipeline: steps done by plain code get a square, dashed node */
.agent.code .node { border-radius: 8px; border-style: dashed; border-color: #9FB4FF; background: transparent; }
.agent.code.on .node { background: var(--cobalt); border-style: solid; }
.pipe-legend { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: .88rem; color: #C9D2EA; margin: -6px 0 20px; }
.pipe-legend i { display: inline-block; width: 16px; height: 16px; border-radius: 6px; background: var(--ad-2); border: 2px solid rgba(255, 255, 255, .3); vertical-align: -3px; margin-right: 8px; }
.pipe-legend i.code { border-radius: 3px; border-style: dashed; border-color: #9FB4FF; background: transparent; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .cases, .stack-row { grid-template-columns: minmax(0, 1fr); }
  .hero-grid, .band-grid, .band-vt .band-grid, .case-top, .case-cols, .story-grid, .prose, .contact-grid, .brand-hero { grid-template-columns: minmax(0, 1fr); }
  .band-vt .stage { order: 2; }
  .loop-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; }
  .loop-steps::before { display: none; }
  .poc li { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; }
  .poc .pdesc { grid-column: 1 / -1; }
  .timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 28px; border-top: 0; }
  .timeline li { border-top: 2px solid var(--ink); }
  .pipe { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 28px; }
  .pipe-track, .pipe-dot { display: none; }
  .story-stage { order: 0; top: var(--nav-h); height: 54vh; background: #fff; z-index: 2; padding: 8px 0 44px; }
  .story-stage::after { content: ""; position: absolute; left: 0; right: 0; bottom: -28px; height: 28px; background: linear-gradient(#fff, rgba(255, 255, 255, 0)); pointer-events: none; }
  .board { width: min(100%, calc(54vh - 60px)); }
  .board .hud { bottom: -34px; font-size: .85rem; }
  .story-steps { padding: 4vh 0 20vh; }
  .story-step { min-height: 62vh; justify-content: flex-start; padding-top: 8vh; }
}
@media (max-width: 760px) {
  .hero-tiles { height: 500px; }
  .ptile { width: 56%; }
  .ptile-vt { top: 25%; height: 75%; }
  .stage { height: 380px; }
  .patterns { grid-template-columns: minmax(0, 1fr); }
  .numbers { grid-template-columns: minmax(0, 1fr); }
  .numbers div { border-bottom: 1px solid var(--line); padding-bottom: 20px; }
  .form .two { grid-template-columns: minmax(0, 1fr); }
  .loop-steps { grid-template-columns: minmax(0, 1fr); }
  .pipe { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-row { grid-template-columns: minmax(0, 1fr); }
  .type-spec { grid-template-columns: minmax(0, 1fr); }
  .reel .browser { width: 82vw; }
  .reel .shot-browser { width: 88vw; }
  .reel .shot-phone { width: 62vw; }
  .facts dd { font-size: 1.05rem; }
}
@media (max-width: 420px) {
  .hero-tiles { height: 440px; }
  .ptile { padding: 16px 16px 0; }
  .ptile .name { font-size: 1.2rem; }
  .ptile .what { font-size: .8rem; }
  .stage { height: 320px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .focus { filter: none; opacity: 1; transform: none; }
}
