/* =========================================================
   Anastasiia Postryhan portfolio: one design system
   Layout: mint page, near-black sections for rhythm, lime accent on dark
   ========================================================= */
:root {
  /* Colour */
  --bg: #EEF3E1;            /* page */
  --surface: #E0E8CC;       /* light cards */
  --ink: #373634;           /* text, dark sections */
  --muted: #64645C;
  --line: rgba(55, 54, 52, .15);
  --dark: #222221;
  --stage: #373634;         /* covers and media sitting on dark */
  --on-dark: #F7F7F7;
  --on-dark-muted: #A9AAA2;
  --line-dark: rgba(247, 247, 247, .16);
  --accent: #6E7C1A;
  --accent-on-dark: #DCEB7D;  /* accent inside dark sections */
  --warm: #A3B83A;            /* small accent details: logo dot, slider, cover line, bullets */
  --glow: rgba(220, 235, 125, .20);
  --stage-line: rgba(247, 247, 247, .08);
  --num-stroke: rgba(247, 247, 247, .12);

  /* Type families */
  --display: "Anton", "Impact", "Arial Narrow", sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;

  /* Type scale */
  --fs-display: clamp(56px, 9vw, 120px);  /* page titles */
  --fs-h2: clamp(44px, 6.5vw, 88px);      /* section titles, footer, next case */
  --fs-h3: clamp(30px, 3.4vw, 42px);      /* case page section labels */
  --fs-h4: 22px;                          /* card and step titles */
  --fs-lead: clamp(22px, 2.4vw, 28px);    /* serif lead lines */
  --fs-kicker: 22px;                      /* italic serif kickers, years, case numbers */
  --fs-numeral: 40px;                     /* step and principle numbers */
  --fs-body: 17px;
  --fs-card: 15px;
  --fs-small: 14px;
  --fs-caption: 14px;
  --fs-label: 13px;

  /* Spacing */
  --gutter: clamp(16px, 4vw, 48px);
  --wrap: 1200px;
  --sp-section: clamp(72px, 10vw, 112px);
  --sp-block: 32px;
  --gap: 16px;
  --pad-card: 28px;

  /* Shape */
  --r-card: 18px;
  --r-stage: 24px;
  --r-pill: 999px;
  --control-h: 48px;
}

/* Dark containers use the on-dark accent */
.work, .footer, .next, .proto, .cover-d, .tldr__card--dark, .pair > .pair__solution, .role__card--mine, .principle--dark, .ba__notes > div:last-child {
  --accent: var(--accent-on-dark);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--ink); font: 400 var(--fs-body)/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--warm); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { text-wrap: balance; font-weight: 400; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; } }

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

/* ---------- Type roles ---------- */
.eyebrow, .meta dt, .footer__label {
  font: 500 var(--fs-label)/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.italic { font-family: var(--serif); font-style: italic; font-weight: 400; text-transform: none; letter-spacing: 0; }
.accent { color: var(--accent); }

.hero__title, .cs-hero__title { font: 400 var(--fs-display)/.9 var(--display); text-transform: uppercase; letter-spacing: -.005em; }
.section-title, .footer__cta, .next__title { font: 400 var(--fs-h2)/.95 var(--display); text-transform: uppercase; }
.section-title .italic, .footer__cta .italic, .hero__title .italic { color: var(--accent); }
.cs-label h2 { font: 400 var(--fs-h3)/1 var(--display); text-transform: uppercase; }
.skill h3, .step h3, .pair h3, .principle h3, .timeline-v h3, .stat__num {
  font: 400 var(--fs-h4)/1.1 var(--display); text-transform: uppercase; letter-spacing: .01em;
}
.hero__hi, .kicker, .tldr__card h3, .role__card h3, .impact__card h3, .cs-hero__num, .timeline-v__year {
  font: italic 400 var(--fs-kicker)/1.1 var(--serif); color: var(--accent);
}
.cs-hero__sub, .about-hero__lead, .about-teaser__lead { font: 400 var(--fs-lead)/1.35 var(--serif); }
.step__num, .principle__num { font: italic 400 var(--fs-numeral)/1 var(--serif); color: var(--accent); }

/* ---------- Controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--control-h); padding: 0 22px;
  border-radius: var(--r-pill); border: 1px solid var(--ink);
  font: 500 14px/1 var(--sans); letter-spacing: .05em; text-transform: uppercase;
  transition: transform .2s, background .2s, color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--dark { background: var(--ink); color: var(--on-dark); padding-right: 11px; }
.btn--ghost:hover { background: var(--ink); color: var(--on-dark); }
.btn__dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; background: var(--on-dark); color: var(--ink); }

/* Text link with accent underline */
.link, .case__link, .proto__bar a, .timeline-v a {
  font-size: var(--fs-small); white-space: nowrap;
  border-bottom: 1px solid var(--accent); padding-bottom: 3px;
  transition: color .2s;
}
.link:hover, .case__link:hover, .proto__bar a:hover, .timeline-v a:hover { color: var(--accent); }
.back { display: inline-block; font-size: var(--fs-small); color: var(--muted); margin-bottom: 40px; transition: color .2s; }
.back:hover { color: var(--accent); }

/* Pills: tags, chips, process steps, cover meta */
.tag, .chip, .timeline a, .cover-d__meta span, .review-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: var(--r-pill);
  border: 1px solid var(--line); font-size: var(--fs-caption); line-height: 1.2;
}
.tags, .chips, .timeline, .links { display: flex; flex-wrap: wrap; gap: 8px; }
.links { gap: 12px; margin-top: 24px; }
.chip--solid { background: var(--ink); border-color: var(--ink); color: var(--on-dark); }
.timeline a { transition: background .2s, color .2s, border-color .2s; }
.timeline a span { font: italic 400 15px/1 var(--serif); color: var(--accent); }
.timeline a:hover { background: var(--ink); color: var(--on-dark); border-color: var(--ink); }
.work .tag, .cover-d__meta span { border-color: var(--line-dark); color: var(--on-dark-muted); }

/* ---------- Cards ---------- */
.card, .tldr__card, .pair > div, .role__card, .principle, .impact__card, .ba__notes > div, .note {
  background: var(--surface); border-radius: var(--r-card); padding: var(--pad-card); font-size: var(--fs-card);
}
.card--dark, .tldr__card--dark, .pair > .pair__solution, .role__card--mine, .principle--dark, .ba__notes > div:last-child {
  background: var(--dark); color: var(--on-dark);
}
.tldr__card h3, .role__card h3, .impact__card h3 { margin-bottom: 12px; }

/* ---------- Header ---------- */
.header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); }
.header__inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.logo { display: flex; align-items: center; gap: 10px; font: 400 20px/1 var(--display); letter-spacing: .04em; text-transform: uppercase; }
.logo::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--warm); }
.nav { display: flex; align-items: center; gap: 32px; font-size: var(--fs-small); }
.nav a:not(.btn) { position: relative; }
.nav a:not(.btn)::after { content: ""; position: absolute; left: 0; bottom: -4px; height: 1px; width: 0; background: var(--warm); transition: width .25s; }
.nav a:not(.btn):hover::after { width: 100%; }

/* ---------- Home ---------- */
.hero { padding-block: 40px 72px; }
.hero__grid { display: grid; grid-template-columns: 1.15fr 1fr .55fr; gap: 40px; align-items: center; }
.hero__hi { margin-bottom: 12px; color: var(--ink); font-size: 28px; }
.hero__title .italic { display: block; font-size: 1.05em; line-height: .9; }
.hero__lead { margin: 24px 0 32px; max-width: 380px; font-size: var(--fs-body); color: var(--muted); }
.hero__lead strong { color: var(--ink); font-weight: 500; }
.hero__ctas { display: flex; gap: 12px; flex-wrap: wrap; }

.arch { aspect-ratio: 3 / 4; max-width: 100%; border-radius: 999px 999px var(--r-stage) var(--r-stage); overflow: hidden; background: var(--surface); }
.arch img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }

.facts { display: flex; flex-direction: column; gap: 28px; text-align: right; }
.fact__num { font: 400 40px/1 var(--display); white-space: nowrap; }
.fact__label { font-size: var(--fs-caption); color: var(--muted); margin-top: 4px; }

.skills { border-block: 1px solid var(--line); }
.skills__grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.skill { padding: 28px 24px; border-left: 1px solid var(--line); }
.skill:first-child { border-left: 0; padding-left: 0; }
.skill h3 { margin-bottom: 8px; }
.skill p, .step p { font-size: var(--fs-small); color: var(--muted); }

.section-head { display: flex; justify-content: space-between; align-items: end; gap: 32px; margin-bottom: 56px; }
.section-head p { max-width: 360px; color: var(--muted); }

.work { background: var(--dark); color: var(--on-dark); padding-block: var(--sp-section); margin-top: var(--sp-section); }
.work .section-head p { color: var(--on-dark-muted); }
.cases { display: grid; gap: 72px; }
.case { display: grid; gap: 24px; }
.case__row { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: start; }
.case__desc { max-width: 560px; font-size: var(--fs-body); }
.case .tags { margin-top: 16px; }

.process { padding-block: var(--sp-section); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.step { border-top: 1px solid var(--ink); padding-top: 20px; }
.step h3 { margin: 16px 0 8px; }

.about-teaser { padding-bottom: var(--sp-section); }
.about-teaser__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; border-top: 1px solid var(--line); padding-top: 64px; }
.about-teaser__body p { color: var(--muted); margin-bottom: 24px; }

/* ---------- Footer & next case ---------- */
.footer { background: var(--dark); color: var(--on-dark); padding-block: 96px 32px; }
.footer--spaced { margin-top: var(--sp-section); }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--line-dark); }
.footer__label { color: var(--on-dark-muted); margin-bottom: 12px; }
.footer a:hover { color: var(--accent); }
.footer__email { font: 400 clamp(22px, 2.6vw, 30px)/1.2 var(--serif); }
.footer__bottom { margin-top: 64px; font-size: var(--fs-caption); color: var(--on-dark-muted); display: flex; justify-content: space-between; }

.next { display: block; margin-top: var(--sp-section); background: var(--dark); color: var(--on-dark); border-bottom: 1px solid var(--line-dark); }
.next .wrap { padding-block: 72px; display: flex; justify-content: space-between; align-items: end; gap: 24px; }
.next .eyebrow { color: var(--on-dark-muted); display: block; margin-bottom: 12px; }
.next__title { transition: color .2s; }
.next:hover .next__title { color: var(--accent); }

/* ---------- Case pages ---------- */
.cs-hero { padding-block: 48px 56px; }
.cs-hero__num { margin-bottom: 12px; }
.cs-hero__sub { max-width: 760px; margin-top: 20px; }

.meta { display: grid; grid-template-columns: repeat(5, 1fr); border-bottom: 1px solid var(--line); margin-top: 48px; }
.meta > div { padding: 20px 20px 24px 0; min-width: 0; }
.meta dt { margin-bottom: 6px; }
.meta dd { font-size: var(--fs-card); }

.tldr { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); margin-top: 72px; }

.cs-section { padding-top: var(--sp-section); }
.cs-grid { display: grid; grid-template-columns: 280px 1fr; gap: 48px; }
.cs-grid > * { min-width: 0; }
.cs-label { position: sticky; top: 96px; align-self: start; }
.cs-label .eyebrow { display: block; margin-bottom: 10px; }
.prose p { font-size: var(--fs-body); margin-bottom: 16px; max-width: 680px; }
.prose p.muted { color: var(--muted); }
.prose .lead-in { font-weight: 500; margin-top: 8px; }
.list { list-style: none; display: grid; gap: 10px; margin: 8px 0 24px; max-width: 680px; }
.list li { padding-left: 22px; position: relative; }
.list li::before { content: ""; position: absolute; left: 0; top: .75em; width: 10px; height: 1px; background: var(--warm); }
.block { margin-top: var(--sp-block); }
.block-sm { margin-top: 12px; }

.figure { margin-top: var(--sp-block); }
.figure img, .phones img, .ba__frame, .shot__img, .scrollshot { border-radius: var(--r-card); }
.figure img { width: 100%; background: var(--surface); }
.figure figcaption, .shot figcaption span { font-size: var(--fs-caption); color: var(--muted); margin-top: 10px; }

.pairs { display: grid; gap: var(--gap); margin-top: 24px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.pair > div:first-child { border-radius: var(--r-card) 0 0 var(--r-card); }
.pair > div:last-child { border-radius: 0 var(--r-card) var(--r-card) 0; }
.pair .eyebrow { display: block; margin-bottom: 12px; }
.pair__solution .eyebrow, .ba__notes > div:last-child .eyebrow { color: var(--accent); }
.pair h3 { margin-bottom: 12px; }
.pair ul, .ba__notes ul { list-style: none; display: grid; gap: 6px; }
.pair__problem ul { color: var(--muted); }
.pair__result { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-dark); }
.pair__result strong { color: var(--accent); font-weight: 500; }

.phones { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); margin-top: var(--sp-block); }
.phones img { height: 520px; width: 100%; object-fit: cover; object-position: top; border: 1px solid var(--line); }

.proto { margin-top: var(--sp-block); background: var(--stage); border-radius: var(--r-stage); padding: 24px; }
.proto iframe { width: 100%; height: 760px; border: 0; border-radius: 12px; display: block; }
.proto__bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; color: var(--on-dark-muted); font-size: var(--fs-small); padding: 4px 4px 20px; }
.proto__bar a { color: var(--on-dark); }

.impact { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }

.role { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin-top: 8px; }

.ba { margin-top: var(--sp-block); }
.ba__frame { position: relative; overflow: hidden; aspect-ratio: var(--ratio, 1440 / 1600); max-width: 100%; background: #fff; border: 1px solid var(--line); user-select: none; touch-action: pan-y; }
.ba__frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; pointer-events: none; }
.ba__after { clip-path: inset(0 0 0 var(--pos, 50%)); }
.ba__line { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 2px; background: var(--warm); transform: translateX(-1px); pointer-events: none; }
.ba__handle { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: var(--control-h); height: var(--control-h); border-radius: 50%; background: var(--warm); color: #fff; display: grid; place-items: center; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.ba__tag { position: absolute; top: 16px; padding: 7px 14px; border-radius: var(--r-pill); font: 500 var(--fs-label)/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; background: var(--ink); color: var(--on-dark); pointer-events: none; }
.ba__tag--before { left: 16px; }
.ba__tag--after { right: 16px; background: var(--warm); }
.ba__range { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.ba__range:focus-visible + * , .ba__frame:has(.ba__range:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.ba__notes { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin-top: var(--gap); }
.ba__notes .eyebrow { display: block; margin-bottom: 10px; }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); margin-top: var(--sp-block); }
.shot { margin: 0; }
.shot__img { overflow: hidden; aspect-ratio: 4 / 3.4; background: #fff; border: 1px solid var(--line); }
.shot__img img { width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50% 7%); transform: scale(1.35); transform-origin: var(--origin, 32% 0); }
.shot figcaption { margin-top: 10px; font-size: var(--fs-small); }
.shot figcaption span { display: block; margin-top: 2px; }

.scrollshot { margin-top: var(--gap); height: 640px; overflow-y: auto; border: 1px solid var(--line); background: #fff; }
.scrollshot img { width: 100%; }
.note { margin-top: var(--gap); color: var(--muted); }
.note .eyebrow { display: block; margin-bottom: 8px; color: var(--accent); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.stat { border-top: 1px solid var(--ink); padding-top: 16px; }
.stat__num { font-size: 32px; }
.stat__num .italic { color: var(--accent); }
.stat p { font-size: var(--fs-small); color: var(--muted); margin-top: 8px; }

/* ---------- About ---------- */
.about-hero { padding-top: 48px; }
.about-hero__grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 64px; align-items: end; }
.about-hero__lead { margin-top: 28px; max-width: 620px; }
.about-hero .arch { max-width: 420px; justify-self: end; width: 100%; }

.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.principle h3 { margin: 16px 0 8px; }
.principle:not(.principle--dark) p { color: var(--muted); }

.timeline-v { list-style: none; border-left: 1px solid var(--line); margin-left: 6px; }
.timeline-v li { position: relative; padding: 0 0 40px 32px; }
.timeline-v li:last-child { padding-bottom: 0; }
.timeline-v li::before { content: ""; position: absolute; left: -6px; top: 4px; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 1px solid var(--ink); }
.timeline-v li.is-now::before { background: var(--warm); border-color: var(--warm); }
.timeline-v h3 { margin: 8px 0 6px; }
.timeline-v p { color: var(--muted); max-width: 560px; }
.timeline-v a { color: var(--ink); }

.beyond { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.beyond span { font: italic 400 26px/1 var(--serif); padding: 14px 24px; border: 1px solid var(--line); border-radius: var(--r-pill); }

/* ---------- Case cover (dark stage + name) ---------- */
.cover-d {
  container-type: inline-size; position: relative; overflow: hidden;
  aspect-ratio: 16 / 10; max-width: 100%; border-radius: var(--r-stage);
  background: var(--stage); border: 1px solid var(--stage-line); color: var(--on-dark);
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 100%;
}
.cover-d::before { content: ""; position: absolute; inset: 0; z-index: 0; background: radial-gradient(60% 70% at 78% 100%, var(--glow), transparent 70%); }
.cover-d::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--warm); z-index: 4; }
.cover-d__num { position: absolute; left: 4cqw; top: -13cqw; z-index: 1; pointer-events: none; font: 400 40cqw/1 var(--display); color: transparent; -webkit-text-stroke: 1px var(--num-stroke); }
.cover-d__text { position: relative; z-index: 3; align-self: end; padding: 0 0 8cqw 7cqw; }
.cover-d__eyebrow { font: italic 400 max(14px, 3.2cqw)/1 var(--serif); color: var(--accent); }
.cover-d__name { font: 400 11cqw/.88 var(--display); text-transform: uppercase; margin-top: 1.6cqw; }
.cover-d__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2.6cqw; }
.cover-d__media { position: relative; z-index: 2; display: flex; justify-content: center; align-items: flex-end; padding-top: 7cqw; min-height: 0; height: 100%; overflow: hidden; }
.cover-d__media--right { justify-content: flex-end; }
.cover-d__phone, .cover-d__browser { height: 100%; overflow: hidden; background: #fff; transition: transform .5s ease; box-shadow: 0 -10px 60px rgba(0,0,0,.35); }
.cover-d__phone { width: 27cqw; border: 1.1cqw solid #0E0E0D; border-bottom: 0; border-radius: 4cqw 4cqw 0 0; }
.cover-d__browser { width: 56cqw; border-radius: 1.2cqw 0 0 0; }
.cover-d__browser::before { content: ""; display: block; height: 2cqw; background: #E9E6E1; border-bottom: 1px solid rgba(0,0,0,.06); }
.cover-d__phone img, .cover-d__browser img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.cover-d__soon { position: relative; z-index: 2; align-self: center; justify-self: center; font: italic 400 6cqw/1 var(--serif); color: var(--on-dark-muted); }
.case:hover .cover-d__phone, .case:hover .cover-d__browser { transform: translateY(-2cqw); }
/* On case pages the title is already above, so the wide cover shows only the stage and screen */
.cover-d--wide { aspect-ratio: 16 / 8; grid-template-columns: 1fr; }
.cover-d--wide::before { background: radial-gradient(50% 80% at 50% 100%, var(--glow), transparent 70%); }
.cover-d--wide .cover-d__text { display: none; }
.cover-d--wide .cover-d__num { font-size: 30cqw; top: -9cqw; left: 3cqw; }
.cover-d--wide .cover-d__media { justify-content: center; padding-top: 5cqw; }
.cover-d--wide .cover-d__phone { width: 22cqw; border-width: .9cqw; border-radius: 3cqw 3cqw 0 0; }
.cover-d--wide .cover-d__browser { width: 64cqw; border-radius: 1cqw 1cqw 0 0; }
.cover-d--wide .cover-d__browser::before { height: 1.4cqw; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr 1fr; }
  .facts { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; text-align: left; flex-wrap: wrap; }
  .skills__grid, .steps { grid-template-columns: 1fr 1fr; }
  .skill:nth-child(3) { border-left: 0; padding-left: 0; }
  .skill:nth-child(n+3) { border-top: 1px solid var(--line); }
  .meta { grid-template-columns: repeat(3, 1fr); }
  .cs-grid { grid-template-columns: 1fr; gap: 20px; }
  .cs-label { position: static; }
  .phones, .gallery { grid-template-columns: 1fr 1fr; }
  .about-hero__grid { grid-template-columns: 1fr; gap: 40px; }
  .about-hero .arch { justify-self: start; max-width: 360px; }
  .principles { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  :root { --pad-card: 22px; }
  .nav a:not(.btn) { display: none; }
  .hero__grid { grid-template-columns: 1fr; }
  .arch { max-width: 320px; }
  .facts { gap: 20px; }
  .fact__num { font-size: 32px; }
  /* Centre the hero on phones */
  .hero__grid > div:first-child, .about-hero__grid > div:first-child { text-align: center; }
  .hero__lead, .about-hero__lead { margin-inline: auto; }
  .hero__ctas { justify-content: center; }
  .hero .arch, .about-hero .arch { justify-self: center; width: 100%; max-width: 320px; }
  .facts { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 16px; text-align: center; }
  .skills__grid, .steps, .about-teaser__grid, .footer__grid { grid-template-columns: 1fr; }
  .skill { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); }
  .skill:first-child { border-top: 0; }
  .section-head { flex-direction: column; align-items: start; }
  .case__row { grid-template-columns: 1fr; }
  .footer__bottom { flex-direction: column; gap: 8px; }
  .meta { grid-template-columns: 1fr 1fr; }
  .tldr, .pair, .impact, .role, .ba__notes, .gallery, .stats { grid-template-columns: 1fr; }
  .pair > div:first-child { border-radius: var(--r-card) var(--r-card) 0 0; }
  .pair > div:last-child { border-radius: 0 0 var(--r-card) var(--r-card); }
  .phones img { height: 380px; }
  .proto { padding: 12px; }
  .proto iframe { height: 640px; }
  .scrollshot { height: 480px; }
  .next .wrap { flex-direction: column; align-items: start; }
}

/* ---------- Process flow (used where product screens can't be shown) ---------- */
.flow { position: relative; z-index: 2; align-self: center; justify-self: stretch; list-style: none; display: grid; gap: 2.4cqw; padding: 6cqw 7cqw 8cqw 2cqw; counter-reset: flow; }
.flow li { counter-increment: flow; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2cqw; font: 400 max(13px, 2.4cqw)/1.1 var(--display); text-transform: uppercase; letter-spacing: .02em; color: var(--on-dark); }
.flow li::before { content: "0" counter(flow); display: grid; place-items: center; width: 5.6cqw; height: 5.6cqw; min-width: 28px; min-height: 28px; border-radius: 50%; border: 1px solid var(--line-dark); font: italic 400 max(13px, 1.9cqw)/1 var(--serif); color: var(--accent); text-transform: none; }
.flow li:last-child::before { background: var(--warm); border-color: var(--warm); color: var(--on-dark); }
.cover-d--wide .flow { grid-auto-flow: column; grid-template-columns: repeat(5, 1fr); gap: 2cqw; padding: 10cqw 6cqw; align-self: center; }
.cover-d--wide .flow li { grid-template-columns: 1fr; justify-items: center; text-align: center; font-size: max(12px, 1.8cqw); }
.cover-d--wide .flow li::before { width: 6cqw; height: 6cqw; font-size: max(12px, 2cqw); }

/* Challenge -> approach blocks (text-only case content) */
.areas { display: grid; gap: var(--gap); margin-top: var(--sp-block); }
.area { display: grid; grid-template-columns: 220px 1fr 1fr; gap: 0; }
.area > div { background: var(--surface); padding: var(--pad-card); font-size: var(--fs-card); }
.area > div:first-child { border-radius: var(--r-card) 0 0 var(--r-card); background: var(--dark); color: var(--on-dark); --accent: var(--accent-on-dark); }
.area > div:last-child { border-radius: 0 var(--r-card) var(--r-card) 0; border-left: 1px solid var(--line); }
.area h3 { font: 400 var(--fs-h4)/1.1 var(--display); text-transform: uppercase; }
.area .kicker { display: block; margin-bottom: 10px; }
.area .eyebrow { display: block; margin-bottom: 10px; }
.area ul { list-style: none; display: grid; gap: 6px; }
@media (max-width: 760px) {
  .area { grid-template-columns: 1fr; }
  .area > div:first-child { border-radius: var(--r-card) var(--r-card) 0 0; }
  .area > div:last-child { border-radius: 0 0 var(--r-card) var(--r-card); border-left: 0; border-top: 1px solid var(--line); }
  .cover-d--wide:has(.flow) { aspect-ratio: auto; }
  .cover-d--wide .flow { grid-auto-flow: row; grid-template-columns: 1fr; padding: 8cqw; }
  .cover-d--wide .flow li { grid-template-columns: auto 1fr; justify-items: start; text-align: left; }
}

/* ---------- RoomScout case ---------- */
.cover-d__shot { position: relative; z-index: 2; align-self: end; justify-self: center; width: 78cqw; border-radius: 1.4cqw 1.4cqw 0 0; overflow: hidden; box-shadow: 0 -10px 60px rgba(0,0,0,.35); }
.cover-d__shot img { width: 100%; height: auto; display: block; }
.cover-d__shot::before { content: ""; display: block; height: 1.6cqw; min-height: 8px; background: #E9E6E1; border-bottom: 1px solid rgba(0,0,0,.06); }
.cover-d--wide:has(.cover-d__shot) { grid-template-rows: 1fr; padding-top: 5cqw; }
.cover-d:not(.cover-d--wide) .cover-d__shot { width: 50cqw; justify-self: end; border-radius: 1.2cqw 0 0 0; transition: transform .5s ease; }
.case:hover .cover-d__shot { transform: translateY(-1.5cqw); }

.facts-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); margin-top: var(--sp-block); }
.fact-card { border-top: 1px solid var(--ink); padding-top: 16px; }
.fact-card__num { font: 400 40px/1 var(--display); }
.fact-card p { font-size: var(--fs-small); color: var(--muted); margin-top: 8px; }
.fact-card cite { display: block; font-style: normal; font-size: var(--fs-caption); color: var(--muted); margin-top: 6px; }

.compare { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-card); margin-top: var(--sp-block); }
.compare-wrap { overflow-x: auto; }
.compare th, .compare td { text-align: left; padding: 16px 20px; vertical-align: top; border-bottom: 1px solid var(--line); }
.compare thead th { font: 500 var(--fs-label)/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.compare td:last-child, .compare th:last-child { background: var(--dark); color: var(--on-dark); }
.compare thead th:last-child { color: var(--accent-on-dark); border-radius: var(--r-card) var(--r-card) 0 0; }
.compare tr:last-child td:last-child { border-radius: 0 0 var(--r-card) var(--r-card); }
.compare td:first-child { font-weight: 500; }
.compare td:nth-child(2) { color: var(--muted); }

.persona { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: start; }
.persona__avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--dark); color: var(--on-dark); display: grid; place-items: center; font: italic 400 32px/1 var(--serif); }
.persona h3 { font: 400 var(--fs-h4)/1.1 var(--display); text-transform: uppercase; margin-bottom: 6px; }

.decisions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin-top: var(--sp-block); }
.decision { background: var(--surface); border-radius: var(--r-card); padding: var(--pad-card); font-size: var(--fs-card); }
.decision .kicker { display: block; margin-bottom: 10px; }
.decision h3 { font: 400 var(--fs-h4)/1.1 var(--display); text-transform: uppercase; margin-bottom: 10px; }
.decision p { color: var(--muted); }
.decision--wide { grid-column: 1 / -1; background: var(--dark); color: var(--on-dark); --accent: var(--accent-on-dark); }
.decision--wide p { color: var(--on-dark-muted); }

.photo-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); margin-top: var(--sp-block); }
.photo-row figure { margin: 0; }
.photo-row img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-card); }
.photo-row figcaption { font-size: var(--fs-caption); color: var(--muted); margin-top: 8px; }

.iter { display: grid; gap: var(--gap); margin-top: var(--sp-block); }
.iter__row { display: grid; grid-template-columns: 200px 1fr 1fr; gap: 0; }
.iter__row > div { padding: 20px 24px; font-size: var(--fs-card); background: var(--surface); }
.iter__row > div:first-child { background: var(--dark); color: var(--on-dark); border-radius: var(--r-card) 0 0 var(--r-card); font: 400 var(--fs-h4)/1.1 var(--display); text-transform: uppercase; display: flex; align-items: center; }
.iter__row > div:nth-child(2) { color: var(--muted); }
.iter__row > div:nth-child(2) s { text-decoration-color: var(--warm); }
.iter__row > div:last-child { border-radius: 0 var(--r-card) var(--r-card) 0; border-left: 1px solid var(--line); }
.iter__row .eyebrow { display: block; margin-bottom: 8px; }

.ds { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin-top: var(--sp-block); }
.ds__panel { background: var(--surface); border-radius: var(--r-card); padding: var(--pad-card); }
.ds__panel .eyebrow { display: block; margin-bottom: 16px; }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.swatch span { display: block; aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--line); }
.swatch b { display: block; font-weight: 500; font-size: var(--fs-caption); margin-top: 8px; }
.swatch small { font-size: var(--fs-label); color: var(--muted); }
.type-sample__display { font: 400 44px/1 "Fraunces", Georgia, serif; }
.type-sample__display i { font-weight: 300; color: #A65A3E; }
.type-sample__body { font: 400 16px/1.5 "Manrope", system-ui, sans-serif; margin-top: 12px; color: var(--muted); }
.type-sample__ui { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.type-sample__ui span { font: 700 15px/1 "Manrope", system-ui, sans-serif; padding: 14px 22px; border-radius: 999px; }

.embed { margin-top: var(--sp-block); background: var(--stage); border-radius: var(--r-stage); padding: 24px; }
.embed iframe { width: 100%; height: 780px; border: 0; border-radius: 12px; display: block; background: #fff; }

@media (max-width: 960px) {
  .decisions, .ds { grid-template-columns: 1fr; }
  .iter__row { grid-template-columns: 1fr; }
  .iter__row > div:first-child { border-radius: var(--r-card) var(--r-card) 0 0; }
  .iter__row > div:last-child { border-radius: 0 0 var(--r-card) var(--r-card); border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .facts-row, .photo-row { grid-template-columns: 1fr; }
  .swatches { grid-template-columns: repeat(2, 1fr); }
  .embed { padding: 12px; }
  .embed iframe { height: 640px; }
  .compare th, .compare td { padding: 12px 14px; }
}

/* Feature rows: text + real UI screenshot */
.features { display: grid; gap: clamp(56px, 8vw, 96px); margin-top: var(--sp-block); }
.feature { display: grid; grid-template-columns: 1fr 1.6fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.feature:nth-child(even) { grid-template-columns: 1.6fr 1fr; }
.feature:nth-child(even) .feature__text { order: 2; }
.feature__text .kicker { display: block; margin-bottom: 10px; }
.feature__text h3 { font: 400 var(--fs-h3)/1 var(--display); text-transform: uppercase; margin-bottom: 14px; }
.feature__text p { color: var(--muted); }
.feature__media { display: grid; gap: 12px; min-width: 0; }
.ui-shot { margin: 0; }
.ui-shot__frame { aspect-ratio: 1600 / 906; max-width: 100%; overflow: hidden; border-radius: var(--r-card); border: 1px solid var(--line); background: #F4F0E8; box-shadow: 0 20px 50px rgba(17, 32, 49, .12); }
.ui-shot__frame img { width: 100%; height: 100%; object-fit: cover; object-position: bottom; }
.ui-shot figcaption { font-size: var(--fs-caption); color: var(--muted); margin-top: 10px; }
@media (max-width: 860px) {
  .feature, .feature:nth-child(even) { grid-template-columns: 1fr; }
  .feature:nth-child(even) .feature__text { order: 0; }
}
.case__cover { display: block; }
.case__links { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.timeline-v .links { margin-top: 12px; gap: 20px; }
@media (max-width: 640px) { .case__links { flex-direction: row; align-items: center; gap: 20px; } }
.footer__grid > div > a + a { display: block; margin-top: 8px; }
.footer__grid > div > a { display: block; }
