/* ─── Case studies v2 — shared foundation ───
   Black & white first; each page adds its own accent. No decorative strokes:
   separation comes from fills, space, shadow and colour shifts. */
:root {
  --ink: #0b0b0b;
  --paper: #f7f4ee;
  --bg: #0b0b0b;
  --fg: #f7f4ee;
  --accent: #c8974a;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --pad: clamp(20px, 4vw, 56px);
  /* one left/right edge for everything: nav, sections, full-bleed scenes */
  --gutter: max(var(--pad), calc((100vw - 1360px) / 2 + var(--pad)));
  /* section rhythm: 80px top and bottom on web, 32px on phones; inner gaps follow */
  --sec: 80px;
  --gap: 48px;
  --nav-h: 64px;
}
@media (max-width: 900px) { :root { --pad: 20px; --sec: 32px; --gap: 24px; --nav-h: 56px; } }
@view-transition { navigation: auto; }

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { overflow-x: clip; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  background: var(--bg); color: var(--fg);
  font-family: 'Inter', system-ui, sans-serif;
  font-feature-settings: 'ss01', 'cv11';
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--ink); }

/* ── type ── */
.display { font-family: 'Syne', sans-serif; font-weight: 600; letter-spacing: -0.025em; line-height: 1.02; }
h1.display, h1.bodoni { font-weight: 700; line-height: 0.95; }
.serif { font-family: 'Lora', serif; font-style: italic; font-weight: 400; }
.label { font-size: 12px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; }
.muted { opacity: 0.74; }
.faint { opacity: 0.72; }
.lede { font-family: 'Lora', serif; font-size: clamp(22px, 2.6vw, 36px); line-height: 1.45; letter-spacing: -0.005em; }
.body { font-size: 17px; line-height: 1.7; max-width: 60ch; }
.body p + p { margin-top: 1.1em; }
.body strong { font-weight: 500; }
.line { padding-bottom: 0.04em; } /* SplitText line mask breathing room */

/* ── layout ── */
.label + .h2, .label + .display, .label + h2 { margin-top: 16px; }
.wrap > .h2:last-child, .wrap > .h2:has(+ .todo:last-child), .wrap > .h2:has(+ .todo + .todo:last-child) { margin-bottom: 0; }
@media (max-width: 900px) { .h2 { margin-bottom: 20px !important; } .wrap > .h2:last-child { margin-bottom: 0 !important; } }
.wrap { width: 100%; padding-inline: var(--gutter); }
.scene { position: relative; padding-block: var(--sec); }
.scene.tight { padding-block: var(--sec); }
.full { min-height: 100vh; min-height: 100svh; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 8px 14px; border-radius: 99px;
  background: color-mix(in srgb, currentColor 9%, transparent);
}

/* ── nav: blends over any background, no bar ── */
.cs-nav {
  position: fixed; inset: 0 0 auto 0; z-index: 900;
  display: flex; justify-content: space-between; align-items: center;
  padding: 24px var(--gutter);
  color: #fff; mix-blend-mode: difference; pointer-events: none;
  transition: background .45s var(--ease), padding .45s var(--ease);
}
/* past the first screen: a solid bar, white links, no blending */
.cs-nav.solid {
  mix-blend-mode: normal; pointer-events: auto;
  background: rgba(11,11,11,.9); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  padding-block: 16px; box-shadow: 0 1px 0 rgba(255,255,255,.06);
}
html { scroll-padding-top: 72px; }
.cs-nav a { pointer-events: auto; text-decoration: none; }
.cs-logo { font-family: 'Syne', sans-serif; font-weight: 600; font-size: 15px; letter-spacing: 0.14em; }
.cs-back { font-size: 15px; font-weight: 500; letter-spacing: -0.01em; display: inline-flex; gap: 10px; align-items: center; }
.cs-back .arr { display: inline-block; transition: transform 0.4s var(--ease); }
.cs-back:hover .arr { transform: translateX(-5px); }
#progress { position: fixed; left: 0; top: 0; height: 3px; pointer-events: none; width: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); z-index: 950; }

/* ── cursor ── */
@media (hover: hover) and (pointer: fine) { body, a, button { cursor: none; } }
#cur, #cur-ring { position: fixed; z-index: 9999; pointer-events: none; border-radius: 50%; transform: translate(-50%, -50%); mix-blend-mode: difference; top: -100px; left: -100px; }
#cur { width: 12px; height: 12px; background: #fff; transition: width .25s, height .25s; }
#cur-ring { width: 40px; height: 40px; background: rgba(255,255,255,.12); transition: width .35s var(--ease), height .35s var(--ease); }
body.hovering #cur { width: 0; height: 0; }
body.hovering #cur-ring { width: 64px; height: 64px; background: #fff; }
@media (hover: none) { #cur, #cur-ring { display: none; } }

/* ── iPhone 15 Pro mockup (container units keep it crisp at any size) ── */
.iphone { width: var(--w, 300px); container-type: inline-size; position: relative; flex: none; }
.iphone-body {
  position: relative; padding: 4.2cqw; border-radius: 17cqw;
  background: linear-gradient(150deg, #4a4a4e 0%, #1d1d1f 22%, #121214 60%, #3a3a3e 100%);
  box-shadow:
    inset 0 0 0 0.55cqw #08080a,
    inset 0 0 0 0.95cqw #5b5b60,
    0 6cqw 14cqw -3cqw rgba(0,0,0,.55),
    0 2cqw 4cqw -1cqw rgba(0,0,0,.35);
}
.iphone-body::before, .iphone-body::after { content: ''; position: absolute; background: #2c2c2f; }
.iphone-body::before { left: -0.8cqw; top: 22cqw; width: 0.9cqw; height: 8cqw; border-radius: 0.6cqw 0 0 0.6cqw; box-shadow: 0 13cqw 0 #2c2c2f, 0 26cqw 0 #2c2c2f; }
.iphone-body::after { right: -0.8cqw; top: 38cqw; width: 0.9cqw; height: 17cqw; border-radius: 0 0.6cqw 0.6cqw 0; }
.iphone-screen { position: relative; border-radius: 12.8cqw; overflow: hidden; background: var(--sb, #000); isolation: isolate; }
.iphone-screen::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 5; background: linear-gradient(115deg, rgba(255,255,255,.10) 0%, rgba(255,255,255,0) 32%); }
.iphone-screen > img { width: 100%; height: auto; }
.iphone-status {
  height: 12.5cqw; display: flex; align-items: center; justify-content: space-between;
  padding: 1.2cqw 7.2cqw 0 10.2cqw; position: relative; z-index: 3;
  font: 700 3.5cqw/1 'Syne', sans-serif; letter-spacing: 0;
  color: var(--sbfg, #fff);
}
.iphone-status svg { height: 2.9cqw; width: auto; display: block; }
.iphone-island { position: absolute; z-index: 4; top: 2.5cqw; left: 50%; transform: translateX(-50%); width: 28cqw; height: 8cqw; border-radius: 99px; background: #000; }
.iphone-home { position: absolute; z-index: 4; bottom: 1.8cqw; left: 50%; transform: translateX(-50%); width: 31cqw; height: 1.2cqw; border-radius: 99px; background: var(--sbfg, #fff); opacity: .55; }
.iphone-ui { aspect-ratio: 393 / 798; position: relative; }
.iphone-screen > video { width: 100%; height: auto; display: block; }
.media-toggle {
  position: absolute; z-index: 6; right: 6cqw; bottom: 7cqw; width: 12cqw; height: 12cqw; min-width: 36px; min-height: 36px;
  border: 0; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff; display: grid; place-items: center;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.media-toggle svg { width: 40%; height: auto; }
.media-toggle .i-play { display: none; }
.media-toggle[aria-pressed="true"] .i-play { display: block; }
.media-toggle[aria-pressed="true"] .i-pause { display: none; }


/* ── browser window ── */
.browser { border-radius: 14px; overflow: hidden; background: #fff; box-shadow: 0 60px 120px -40px rgba(0,0,0,.5), 0 24px 48px -24px rgba(0,0,0,.3); }
.browser-bar { height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 16px; background: #efede8; position: relative; }
.browser-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.browser-bar i:nth-child(2) { background: #febc2e; }
.browser-bar i:nth-child(3) { background: #28c840; }
.browser-bar span { position: absolute; left: 50%; transform: translateX(-50%); font-size: 11px; color: rgba(0,0,0,.62); background: rgba(255,255,255,.75); padding: 5px 18px; border-radius: 8px; white-space: nowrap; }
.browser.dark { background: #1b1b1d; }
.browser.dark .browser-bar { background: #232326; }
.browser.dark .browser-bar span { background: #2e2e32; color: rgba(255,255,255,.66); }
.browser-view { position: relative; overflow: hidden; }
.browser-view > img { width: 100%; height: auto; }

/* ── captions ── */
.cap { font-size: 14px; line-height: 1.6; margin-top: 18px; opacity: .78; max-width: 60ch; }
.cap b { font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: 11px; margin-right: 10px; opacity: 1; }

/* ── draft notes (?draft) ── */
.todo { display: none; }
html.draft .todo {
  display: block; margin: 20px 0; padding: 14px 18px; border-radius: 10px;
  background: #ffe9a8; color: #5a4300; font-size: 12px; line-height: 1.7; max-width: 60ch;
}
html.draft .todo::before { content: 'TO ADD — '; letter-spacing: .14em; font-weight: 500; }

/* ── next case study ── */
.cs-next { display: block; text-decoration: none; padding: var(--sec) 0; overflow: hidden; }
.cs-next { background: #0b0b0b; color: #f4f2ed; }
.cs-next .label { opacity: .74; }
.cs-next-title { display: block; position: relative; overflow: hidden; margin-top: 16px; font-size: clamp(40px, 7.6vw, 128px); }
.cs-next-title span { display: block; transition: transform .8s var(--ease); }
.cs-next-title span + span { position: absolute; inset: 100% 0 auto 0; color: var(--accent); }
.cs-next:hover .cs-next-title span { transform: translateY(-100%); }
.cs-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 24px var(--gutter); font-size: 14px; background: #0b0b0b; color: rgba(244,242,237,.72); }

/* ── motion setup: hide only when JS + GSAP are running ── */
html.js:not(.rm) [data-reveal],
html.js:not(.rm) [data-stagger] > *,
html.js:not(.rm) [data-split] { visibility: hidden; }

/* ── accessibility ── */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; top: 12px; left: 12px; z-index: 1000; padding: 12px 18px; border-radius: 99px; background: var(--fg); color: var(--bg); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; text-decoration: none; transform: translateY(-160%); transition: transform .3s var(--ease); }
.skip:focus { transform: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
.cs-nav a:focus-visible { outline-color: #fff; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ── responsive ── */
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .cs-nav { padding: 18px var(--gutter); }
  .browser { border-radius: 9px; }
  .browser-bar { height: 26px; gap: 5px; padding: 0 10px; }
  .browser-bar i { width: 7px; height: 7px; }
  .browser-bar span { display: none; }
}
