/* =========================================================== CASE STUDY: shared by every case study page */
:root {
  --ink: #1D1C24; --muted: #5C5B66; --faint: #8A8994; --line: rgba(29, 28, 36, .1);
  --paper: #F8F7F4; --surface: #EEF2FA; --ridge: #2346B8; --dawn: #FF8A3D;
  --paint-sky: linear-gradient(180deg, #163A9E 0%, #2453C2 32%, #4583DE 58%, #86B4EF 80%, #CFE2FA 100%);
  --font: "Bricolage Grotesque", system-ui, sans-serif;
  --t-display: clamp(2.5rem, 5.2vw, 4.5rem);
  --t-h2: clamp(1.75rem, 3vw, 2.5rem);
  --t-h3: clamp(1.25rem, 1.8vw, 1.5rem);
  --t-lead: clamp(1.0625rem, 1.3vw, 1.1875rem);
  --t-body: 1.0625rem; --t-small: .9375rem; --t-label: .8125rem;
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 48px; --s6: 64px; --s7: 96px; --s8: 136px;
  --gutter: clamp(20px, 4vw, 48px); --max: 1200px; --radius: 20px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--paper); scroll-behavior: smooth; }
body { font-family: var(--font); font-size: var(--t-body); line-height: 1.65; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; overflow-x: clip; }
a { color: inherit; }
img, svg { display: block; }
:focus-visible { outline: 2px solid var(--dawn); outline-offset: 3px; border-radius: 6px; }
/* no blue tap box on phones; keyboard focus rings stay */
html { -webkit-tap-highlight-color: transparent; }
:focus:not(:focus-visible) { outline: none; }

.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding-inline: var(--gutter); }
.grainy { position: relative; }
.grainy::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .12; mix-blend-mode: soft-light; background-image: var(--grain); background-size: 220px; border-radius: inherit; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s1); height: 50px; padding: 0 var(--s3); border-radius: 14px; font-weight: 650; font-size: 1rem; line-height: 1; text-decoration: none; white-space: nowrap; transition: transform .15s var(--ease), background .25s; }
.btn.primary { background: var(--dawn); color: var(--ink); box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 8px 22px rgba(255, 138, 61, .35); }
.btn.primary:hover { transform: translateY(-1px); }
.btn.ghost { color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.7); }
.btn.ghost:hover { background: rgba(255,255,255,.12); }

/* reading progress */
.progress { position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: 3px; background: var(--dawn); transform-origin: left; transform: scaleX(0); }

/* =========================================================== HERO */
.cs-hero { position: relative; isolation: isolate; overflow: hidden; color: #fff; background: var(--paint-sky); }
.cs-hero.grainy::after { -webkit-mask-image: linear-gradient(#000 70%, transparent 92%); mask-image: linear-gradient(#000 70%, transparent 92%); }
.nav { position: relative; z-index: 5; display: flex; align-items: center; justify-content: space-between; height: 84px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.0625rem; letter-spacing: -.01em; text-decoration: none; white-space: nowrap; }
.brand svg { width: 28px; height: 18px; }
.links { display: flex; align-items: center; gap: var(--s4); font-size: var(--t-small); font-weight: 550; }
.links a { text-decoration: none; opacity: .85; }
.links a:hover { opacity: 1; }
.links .cta-link { white-space: nowrap; opacity: 1; padding: 9px 16px; border-radius: 999px; background: rgba(255,255,255,.14); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }

.cs-intro { position: relative; z-index: 3; padding-top: clamp(var(--s4), 6vh, var(--s6)); max-width: 900px; }
.back { display: inline-flex; align-items: center; gap: 8px; font-size: var(--t-small); font-weight: 600; text-decoration: none; opacity: .85; }
.back:hover { opacity: 1; }
.back svg { width: 16px; height: 16px; transition: transform .25s var(--ease); }
.back:hover svg { transform: translateX(-3px); }
.cs-intro .kicker { margin-top: var(--s5); font-size: var(--t-small); font-weight: 600; opacity: .85; }
.cs-intro h1 { margin-top: var(--s2); font-size: var(--t-display); font-weight: 650; font-stretch: 84%; line-height: 1.02; letter-spacing: -.028em; text-wrap: balance; }
.cs-intro .lead { margin-top: var(--s3); max-width: 58ch; font-size: var(--t-lead); line-height: 1.55; opacity: .92; }
.cs-intro .lead.quote { font-style: italic; }

.meta { position: relative; z-index: 3; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); margin-top: var(--s6); padding-top: var(--s3); border-top: 1px solid rgba(255,255,255,.28); }
.meta dt { font-size: var(--t-label); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .72; }
.meta dd { margin-top: 6px; font-weight: 600; line-height: 1.45; }
.meta dd span { display: block; }

.range-wrap { overflow: hidden; display: flex; justify-content: center; }
.range { position: relative; z-index: 1; display: block; width: 100%; min-width: 900px; height: auto; margin-top: var(--s4); margin-bottom: -8px; }

/* the hero screen sits on the painted range like a print on a table */
.cover-shot { position: relative; z-index: 4; margin-top: calc(-1 * clamp(140px, 16vw, 230px)); }
.cover-shot button { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.cover-shot img { width: 100%; height: auto; border-radius: var(--radius); box-shadow: 0 2px 6px rgba(8,17,58,.08), 0 30px 70px rgba(8,17,58,.22); }

/* =========================================================== CHAPTERS */
.chapter { padding-top: var(--s8); }
.ch-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--s4); }
.ch-head { grid-column: 1 / span 4; align-self: start; position: sticky; top: var(--s4); }
.eyebrow { display: flex; align-items: center; gap: 10px; font-size: var(--t-label); font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: #C9631F; }
.eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: var(--dawn); }
.ch-head h2 { margin-top: var(--s2); font-size: var(--t-h2); font-weight: 650; font-stretch: 86%; line-height: 1.08; letter-spacing: -.022em; text-wrap: balance; }
.ch-body { grid-column: 6 / span 7; display: grid; gap: var(--s3); font-size: var(--t-lead); line-height: 1.7; color: #33323C; }
.ch-body > p strong { color: var(--ink); font-weight: 650; }

/* full-bleed figures under a chapter */
.figure { margin-top: var(--s6); }
.figure button { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.figure img { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
.figure figcaption { margin-top: 12px; font-size: var(--t-small); color: var(--faint); }

/* a very wide diagram scrolls sideways */
.wide-scroll { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: #F3F3F3; scrollbar-width: thin; }
.wide-scroll img { width: auto; height: clamp(320px, 42vw, 560px); max-width: none; border: 0; border-radius: 0; }

/* numbered problems */
.problems { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); margin-top: var(--s6); }
.problem { padding: var(--s4); border-radius: var(--radius); background: #fff; border: 1px solid var(--line); }
.problem .n { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--surface); color: var(--ridge); font-weight: 700; font-size: .9375rem; }
.problem h3 { margin-top: var(--s3); font-size: var(--t-h3); font-weight: 650; font-stretch: 92%; line-height: 1.25; letter-spacing: -.01em; }
.problem p { margin-top: var(--s1); color: var(--muted); }

/* callouts */
.callout { padding: var(--s4); border-radius: var(--radius); background: var(--surface); border-left: 4px solid var(--dawn); }
.callout .label { font-size: var(--t-label); font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--ridge); }
.callout p { margin-top: var(--s1); color: var(--ink); }

/* the one big idea of the project, painted */
.principle { position: relative; overflow: hidden; margin-top: var(--s6); padding: clamp(var(--s5), 6vw, var(--s7)) clamp(var(--s4), 6vw, var(--s7)); border-radius: 28px; color: #fff; background: var(--paint-sky); }
.principle .label { position: relative; z-index: 1; font-size: var(--t-label); font-weight: 650; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.principle p { position: relative; z-index: 1; margin-top: var(--s2); max-width: 30ch; font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 600; font-stretch: 88%; line-height: 1.2; letter-spacing: -.015em; text-wrap: balance; }
.principle svg.mini-range { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: auto; opacity: .9; }

/* pull quote */
.pull { margin-top: var(--s6); padding-left: var(--s4); border-left: 3px solid var(--dawn); max-width: 34ch; font-size: clamp(1.375rem, 2.6vw, 2rem); font-weight: 600; font-stretch: 88%; line-height: 1.25; letter-spacing: -.015em; text-wrap: balance; }
.ch-body .pull { margin-top: var(--s2); }

/* status chips (rebuilt from the original diagram so it stays sharp) */
.statuses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); margin-top: var(--s6); }
.status { display: flex; gap: var(--s2); padding: var(--s4); border-radius: var(--radius); background: #fff; border: 1px solid var(--line); }
.status .dot { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: #fff; }
.status .dot svg { width: 20px; height: 20px; }
.status h3 { font-size: var(--t-h3); font-weight: 650; font-stretch: 92%; line-height: 1.2; }
.status p { margin-top: 4px; color: var(--muted); }

/* three-up cards */
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); margin-top: var(--s6); }
.trio article { padding: var(--s4); border-radius: var(--radius); background: #fff; border: 1px solid var(--line); }
.trio .tag { display: inline-flex; height: 28px; align-items: center; padding: 0 12px; border-radius: 999px; background: var(--surface); color: var(--ridge); font-size: var(--t-label); font-weight: 650; }
.trio h3 { margin-top: var(--s3); font-size: var(--t-h3); font-weight: 650; font-stretch: 92%; line-height: 1.25; }
.trio p { margin-top: var(--s1); color: var(--muted); }

/* a step-by-step sequence */
.sequence { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; counter-reset: seq; }
.sequence li { counter-increment: seq; display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: var(--t-small); font-weight: 600; color: var(--ink); }
.sequence li::before { content: counter(seq); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--ridge); color: #fff; font-size: .8125rem; }

/* learnings */
.learnings { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); margin-top: var(--s6); counter-reset: learn; }
.learnings li { counter-increment: learn; padding-top: var(--s3); border-top: 2px solid var(--ink); }
.learnings li::before { content: "0" counter(learn); font-size: var(--t-label); font-weight: 700; color: #C9631F; letter-spacing: .06em; }
.learnings h3 { margin-top: var(--s2); font-size: var(--t-h3); font-weight: 650; font-stretch: 92%; line-height: 1.25; }
.learnings p { margin-top: var(--s1); color: var(--muted); }

/* designs gallery */
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); margin-top: var(--s6); }
.gallery button { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 16px; overflow: hidden; }
.gallery button:first-child { grid-column: 1 / -1; }
.gallery img { width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--line); background: #fff; transition: transform .6s var(--ease); }
.gallery button:hover img { transform: scale(1.015); }

/* next project */
.next { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: var(--s3); margin-top: var(--s8); padding: clamp(var(--s4), 5vw, var(--s6)); border-radius: 28px; color: #fff; text-decoration: none; background: var(--paint-sky); position: relative; overflow: hidden; }
.next .label { position: relative; z-index: 1; font-size: var(--t-label); font-weight: 650; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.next h2 { position: relative; z-index: 1; margin-top: var(--s1); font-size: var(--t-h2); font-weight: 650; font-stretch: 86%; line-height: 1.08; letter-spacing: -.022em; max-width: 22ch; text-wrap: balance; }
.next .go { position: relative; z-index: 1; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: var(--dawn); color: var(--ink); transition: transform .3s var(--ease); }
.next .go svg { width: 22px; height: 22px; }
.next:hover .go { transform: translateX(4px); }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; display: grid; grid-template-rows: auto 1fr; padding: var(--s3) var(--gutter); background: rgba(8,17,58,.95); color: #fff; opacity: 0; transition: opacity .25s var(--ease); }
.lightbox[hidden] { display: none; }
.lightbox.open { opacity: 1; }
.lb-top { display: flex; justify-content: space-between; align-items: center; height: 48px; font-size: var(--t-small); opacity: .85; }
.lb-btn { width: 46px; height: 46px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: #fff; cursor: pointer; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.4); }
.lb-btn:hover { background: rgba(255,255,255,.1); }
.lb-btn svg { width: 18px; height: 18px; }
.lb-stage { display: grid; grid-template-columns: 46px 1fr 46px; align-items: center; gap: var(--s3); min-height: 0; padding-bottom: var(--s3); }
.lb-figure { min-height: 0; height: 100%; display: grid; place-items: center; overflow: auto; }
.lb-figure img { max-width: 100%; max-height: calc(100svh - 120px); border-radius: 12px; background: #fff; }
/* wide diagrams open at a readable height and pan sideways */
.lightbox.wide .lb-figure { place-items: center start; }
.lightbox.wide .lb-figure img { max-width: none; max-height: none; height: calc(100svh - 140px); }
@media (max-width: 760px) { .lb-stage { grid-template-columns: 1fr; } .lb-stage .lb-btn { display: none; } }

/* footer */
.summit { position: relative; margin-top: var(--s8); color: #fff; }
.summit::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .12; mix-blend-mode: soft-light; background-image: var(--grain); background-size: 220px; }
.summit-ridge-wrap { overflow: hidden; display: flex; justify-content: center; }
.summit-ridge { display: block; width: 100%; min-width: 900px; height: auto; margin-bottom: -2px; }
.summit-body { position: relative; isolation: isolate; background: radial-gradient(circle at 86% 16%, rgba(233,238,255,.2) 0, rgba(233,238,255,0) 160px), linear-gradient(180deg, #111C4C 0%, #0B1640 60%, #08113A 100%); }
.summit-body::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .8;
  background-image: radial-gradient(1.4px 1.4px at 8% 30%, #fff 50%, transparent 52%), radial-gradient(1px 1px at 22% 62%, #fff 50%, transparent 52%), radial-gradient(1.6px 1.6px at 37% 18%, #fff 50%, transparent 52%), radial-gradient(1px 1px at 52% 44%, #fff 50%, transparent 52%), radial-gradient(1.2px 1.2px at 64% 72%, #fff 50%, transparent 52%), radial-gradient(1.5px 1.5px at 76% 36%, #fff 50%, transparent 52%), radial-gradient(1px 1px at 92% 58%, #fff 50%, transparent 52%); }
.moon-disc { position: absolute; right: 12%; top: 12%; width: 42px; height: 42px; border-radius: 50%; background: #EEF1FF; box-shadow: 0 0 60px 18px rgba(233,238,255,.16); }
.summit-inner { padding-block: var(--s6) var(--s7); max-width: 760px; }
.summit h2 { font-size: clamp(2.25rem, 4.6vw, 3.75rem); font-weight: 650; font-stretch: 84%; line-height: 1.02; letter-spacing: -.028em; text-wrap: balance; }
.summit .lead { margin-top: var(--s2); font-size: var(--t-lead); opacity: .9; }
.summit .ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: var(--s4); }
.legal { display: flex; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; padding-block: var(--s3); border-top: 1px solid rgba(255,255,255,.14); font-size: var(--t-small); }
.legal span { opacity: .65; }
.legal nav { display: flex; gap: var(--s3); flex-wrap: wrap; }
.legal a { text-decoration: none; opacity: .75; }
.legal a:hover { opacity: 1; }

/* =========================================================== RESPONSIVE */
@media (max-width: 1099px) { .links a[href$="#experience"] { display: none; } }
@media (max-width: 1024px) {
  .ch-grid { grid-template-columns: 1fr; }
  .ch-head, .ch-body { grid-column: 1 / -1; position: static; }
  .ch-body { margin-top: var(--s3); max-width: 720px; }
  .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trio, .learnings { grid-template-columns: 1fr; max-width: 720px; }
}
@media (max-width: 760px) {
  .links a:not(.cta-link) { display: none; }
  .chapter { padding-top: var(--s7); }
  .problems, .statuses, .gallery { grid-template-columns: 1fr; }
  .cover-shot { margin-top: calc(-1 * var(--s7)); }
  .next { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

/* ---- mobile polish: never scroll sideways, and every link is easy to tap ---- */
html { overflow-x: clip; }
.legal nav a, .foot nav a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }
.arrow-link, .back, .brand { min-height: 44px; }
