/* ==========================================================================
   Marta Monelli — Portfolio
   Shared stylesheet. Tokens come from 00 Context/type-specimen.html and
   00 Context/visual-direction.md. Mobile-first: base styles are mobile,
   then 768px (tablet), 1024px (desktop), 1440px (large desktop).
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* palette */
  --cream: #F2EFE8;
  --sand: #E4DCC9;
  /* drifting band behind the screen carousel and the Afterwish flow panel */
  --sc-band: linear-gradient(120deg, #F5F0E8 0%, #F0E7F0 25%, #FFE1D6 50%, #FBEFD6 75%, #F5F0E8 100%);
  --ink: #22201F;
  --violet: #4B3FE0;
  --coral: #FF4844;
  --amber: #EDA006;
  --sage: #6C877D;
  --teal: #0B6D86;

  /* roles (light) */
  --bg: var(--cream);
  --surface: var(--sand);
  --text: var(--ink);
  --text-2: #4A4744;
  --line: var(--sand);
  --line-strong: var(--ink);
  --interactive: var(--violet);
  --on-interactive: var(--cream);

  /* type */
  --font-head: "Schibsted Grotesk", system-ui, sans-serif;
  --font-body: "Satoshi", system-ui, sans-serif;
  --h1: 44px; --h2: 32px; --h3: 24px; --h4: 20px;
  --lead: 18px; --body: 16px; --small: 14px; --caption: 12px;

  /* spacing (8px base) */
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px;
  --s6: 48px; --s8: 64px; --s12: 96px; --s16: 128px;
  --gutter: 16px;
  --section: 72px;
  --max: 1200px;
  --radius: 4px;

  /* motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --fast: 200ms;
  --slow: 800ms;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #22201F;
  --surface: #2E2B29;
  --text: #F2EFE8;
  --text-2: #B8B2A8;
  --line: #3A3633;
  --line-strong: #F2EFE8;
  --interactive: #8F87FF;
  --on-interactive: #22201F;
  color-scheme: dark;
}

@media (min-width: 768px) {
  :root {
    --h1: 60px; --h2: 40px; --h3: 28px; --h4: 22px;
    --lead: 20px; --body: 17px; --caption: 13px;
    --gutter: 24px;
  }
}
@media (min-width: 1024px) {
  :root {
    --h1: 80px; --h2: 48px; --h3: 32px; --h4: 24px;
    --gutter: 48px;
    --section: 128px;
  }
}
@media (min-width: 1440px) {
  :root { --gutter: 64px; --max: 1320px; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}

img, svg { display: block; max-width: 100%; height: auto; }

h1, h2, h3, h4 { font-family: var(--font-head); color: var(--text); text-wrap: balance; }
h1 { font-size: var(--h1); font-weight: 700; line-height: 1.05; letter-spacing: -0.025em; }
h2 { font-size: var(--h2); font-weight: 700; line-height: 1.1;  letter-spacing: -0.02em; }
h3 { font-size: var(--h3); font-weight: 600; line-height: 1.2;  letter-spacing: -0.015em; }
h4 { font-size: var(--h4); font-weight: 600; line-height: 1.3;  letter-spacing: -0.01em; }

p { max-width: 65ch; }
.lead  { font-size: var(--lead); line-height: 1.55; max-width: 60ch; }
.small { font-size: var(--small); line-height: 1.5; color: var(--text-2); }
.caption {
  font-weight: 700;
  font-size: var(--caption);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.4;
  color: var(--text);
}

a { color: var(--interactive); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--interactive); outline-offset: 3px; border-radius: 2px; }

/* highlighter: non-clickable emphasis in headlines */
.mark {
  --band-color: var(--amber);
  --band: 34%;
  background-image: linear-gradient(var(--band-color), var(--band-color));
  background-repeat: no-repeat;
  background-position: 0 90%;
  background-size: 100% var(--band);
  padding: 0 0.04em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.mark--coral { --band-color: var(--coral); }
:root[data-theme="dark"] .mark { --band: 100%; color: var(--ink); }
:root[data-theme="dark"] .split .mark .word > span { color: var(--ink); }
/* highlighter draws in after the words have risen */
.split .mark { animation: draw 700ms var(--ease) both; }
@keyframes draw { from { background-size: 0% var(--band); } }

.skip-link {
  position: absolute; left: var(--s2); top: -100px;
  background: var(--interactive); color: var(--on-interactive);
  padding: var(--s1) var(--s2); border-radius: var(--radius); z-index: 100;
}
.skip-link:focus { top: var(--s2); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--section); }
.section--surface { background: var(--surface); }

.stack > * + * { margin-top: var(--s3); }
.caption + h1, .caption + h2 { margin-top: var(--s3); }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex; align-items: center; gap: var(--s1);
  background: var(--interactive); color: var(--on-interactive);
  font-family: var(--font-body); font-weight: 500; font-size: 16px; line-height: 1.2;
  padding: 14px 24px; border: 0; border-radius: var(--radius);
  text-decoration: none; cursor: pointer;
  transition: transform var(--fast) var(--ease), background-color var(--fast) var(--ease);
}
.button:hover { transform: translateY(-2px); }

.arrow-link {
  display: inline-flex; align-items: center; gap: var(--s1);
  font-weight: 500; text-decoration: none;
}
.arrow-link:hover { text-decoration: underline; }
.arrow-link span { transition: transform var(--fast) var(--ease); }
.arrow-link:hover span { transform: translateX(4px); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  transition: background-color var(--fast) var(--ease);
}
.topbar__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s2); min-height: 64px;
}
.brand {
  font-family: var(--font-head); font-weight: 700; font-size: 18px;
  letter-spacing: -0.01em; color: var(--text); text-decoration: none;
  white-space: nowrap;
  display: inline-flex; align-items: center;
}
.brand__logo { display: block; height: 24px; width: auto; }
.brand__logo--dark { display: none; }
:root[data-theme="dark"] .brand__logo--light { display: none; }
:root[data-theme="dark"] .brand__logo--dark { display: block; }
.nav { display: flex; align-items: center; gap: var(--s2); }
.nav a {
  font-weight: 500; font-size: 15px; color: var(--text); text-decoration: none;
  padding-block: var(--s1);
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--interactive); }
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }

/* Case Studies dropdown: full-width panel under the bar on mobile, a small panel from tablet up */
.nav__button {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-weight: 500; font-size: 15px; color: var(--text);
  background: none; border: 0; padding: var(--s1) 0; cursor: pointer; white-space: nowrap;
}
.nav__button:hover, .dropdown.is-open .nav__button { color: var(--interactive); }
.nav__button.is-current { color: var(--interactive); text-decoration: underline; text-underline-offset: 6px; }
.nav__chevron { width: 10px; height: 10px; transition: transform var(--fast) var(--ease); }
.dropdown.is-open .nav__chevron { transform: rotate(180deg); }
.dropdown__panel {
  display: none; position: absolute; left: 0; right: 0; top: 100%;
  background: var(--bg); border-bottom: 1px solid var(--line);
  padding: var(--s2) var(--gutter) var(--s3);
}
.dropdown.is-open .dropdown__panel { display: block; }
.dropdown__list { list-style: none; padding: 0; display: grid; gap: 4px; }
.nav .dropdown__item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px var(--s2); border-radius: var(--radius); text-decoration: none;
  transition: background-color var(--fast) var(--ease);
}
.nav .dropdown__item:hover, .nav .dropdown__item:focus-visible, .nav .dropdown__item[aria-current="page"] { background: var(--surface); }
.dropdown__project { font-weight: 700; font-size: 16px; line-height: 1.4; color: var(--interactive); }
.dropdown__company { font-weight: 400; font-size: var(--small); line-height: 1.4; color: var(--text-2); }
.nav .dropdown__item[aria-current="page"] { text-decoration: none; }
.nav .dropdown__all {
  display: inline-block; margin-top: var(--s1); padding: var(--s1) var(--s2);
  font-size: var(--small); color: var(--interactive); text-decoration: underline; text-underline-offset: 3px;
}

.theme-toggle {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; padding: 0;
  background: transparent; color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
  transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.theme-toggle:hover { color: var(--interactive); border-color: var(--interactive); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

@media (min-width: 768px) {
  .topbar__inner { min-height: 72px; }
  .brand { font-size: 20px; }
  .brand__logo { height: 28px; }
  .nav { gap: var(--s4); }
  .nav a { font-size: 16px; }
  .nav__button { font-size: 16px; }
  .dropdown { position: relative; }
  .dropdown__panel {
    left: calc(var(--s2) * -1); right: auto; top: calc(100% + 12px); width: 300px;
    border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s1);
  }
}

/* ---------- Hero (home) ---------- */
.hero { padding-block: var(--s8) var(--s12); }
.hero h1 { max-width: 14ch; margin-top: var(--s3); }
/* the headline breaks into three set lines from tablet up; on mobile it wraps naturally */
.hero h1 br { display: none; }
@media (min-width: 768px) {
  .hero h1 { max-width: none; }
  .hero h1 br { display: inline; }
}
.hero .lead { margin-top: var(--s4); }
/* typed tagline: Satoshi 300, secondary text color, sized like H2 (48 / 40 / 32) */
.hero__tagline {
  margin-top: var(--s2); min-height: 1.2em;
  font-family: var(--font-body); font-weight: 300; font-size: 32px; line-height: 1.2;
  color: var(--text-2);
}
@media (min-width: 768px) { .hero__tagline { font-size: 40px; } }
@media (min-width: 1024px) { .hero__tagline { font-size: 48px; } }
@media (min-width: 1024px) { .intro--anim .facts { margin-top: var(--s3); padding-top: var(--s2); } }
.hero__tagline.is-typing span { border-right: 2px solid currentColor; padding-right: 2px; animation: caret 1s steps(1) infinite; }
.facts {
  display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3);
  margin-top: var(--s6); padding-top: var(--s3);
  border-top: 1px solid var(--line);
  list-style: none; padding-left: 0;
}
.facts li { font-size: var(--small); color: var(--text-2); }
.facts li strong { color: var(--text); font-weight: 700; }

@media (min-width: 1024px) {
  .hero { padding-block: var(--s16) var(--s16); }
  .hero__grid { display: grid; grid-template-columns: 5fr 7fr; gap: var(--s4) var(--s6); }
  .hero__grid h1 { grid-column: 1 / -1; }
  .hero .lead { grid-column: 2; margin-top: 0; } /* 32px under the tagline, the same as on mobile */
  .hero__tagline { grid-column: 1 / -1; margin-top: calc(var(--s2) - var(--s4)); }
}

/* ---------- Home intro (hands) ----------
   Without JS or with reduced motion this is just the hero.
   With motion: a full-screen stage pinned while you scroll one screen.
   The hand pictures are transparent halftone dots; in dark mode they are inverted to light dots. */
.intro__hands { display: none; }
.intro--anim { --bar: 0px; --p: 0; --fade: 0; height: 200svh; } /* script.js sets the exact height */
/* the top bar floats over the intro and slides away while the hands are on screen */
.has-intro .topbar { position: fixed; left: 0; right: 0; transition: transform 500ms var(--ease), background-color var(--fast) var(--ease); }
.has-intro .topbar.is-hidden { transform: translateY(-100%); }
.has-intro .topbar.is-hidden:focus-within { transform: none; }
.intro--anim .intro__stage {
  position: sticky; top: var(--bar); min-height: 100svh;
  overflow: hidden; display: flex; align-items: center; background: var(--bg);
}
.intro--anim .hero { position: relative; z-index: 1; width: 100%; padding-block: 0; }
/* while the intro plays the hero text must not catch clicks meant for the yo-yo */
.intro--anim:not(.is-done) .hero { pointer-events: none; }
.intro--anim.is-title .hero .tag-button { pointer-events: auto; }
/* the finished hero is centered in the space below the top bar */
.intro--anim .intro__stage { box-sizing: border-box; padding-top: 64px; }
@media (min-width: 768px) { .intro--anim .intro__stage { padding-top: 72px; } }
.intro--anim .hero h1 { will-change: transform; transform-origin: 0 0; }
.intro--anim .intro__fade { opacity: var(--fade); translate: 0 calc((1 - var(--fade)) * 24px); }
.intro--anim .intro__hands { display: block; position: absolute; inset: 0 0 auto 0; height: 100svh; pointer-events: none; }
/* --hw (hand width) and the offsets are set by script.js: on desktop the hands sit where the
   Figma frame image-hands puts them, on smaller screens they leave room for the title.
   Each box is the hand's rotated outline in Figma; the picture is centered and turned inside it. */
.hand { position: absolute; width: var(--hw, 40%); }
.hand--left { width: var(--hwl, var(--hw, 40%)); }
.hand--right { right: var(--rr, 0); top: var(--rt, 0); aspect-ratio: 856.45 / 772.42; transform: translateX(calc(var(--out, 0) * 110%)); }
.hand--left { left: var(--ll, 0); bottom: var(--lb, 0); aspect-ratio: 750.71 / 377.87; transform: translateX(calc(var(--out, 0) * -110%)); }
.hand__in { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.hand img { display: block; flex: none; height: auto; opacity: .85; mix-blend-mode: multiply; }
.hand--right img { width: 83.32%; rotate: 30.52deg; }
.hand--left img { width: 96.71%; rotate: 4.98deg; }
:root[data-theme="dark"] .hand img { filter: invert(1); mix-blend-mode: screen; }

/* entrance: left hand first, then the right one; then they float */
.hand--left .hand__in { animation: hand-in-left 1200ms var(--ease) both; }
.hand--right .hand__in { position: relative; animation: hand-in-right 1200ms var(--ease) 450ms both, float 5s ease-in-out -1300ms infinite; }
.hand--left img { animation: float 5s ease-in-out 1200ms infinite; }
@keyframes hand-in-left { from { transform: translateX(-100%); } }
@keyframes hand-in-right { from { transform: translateX(100%); } }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5%; } }

/* once the hero is reached the intro is over: no pinning, no hands, no way back (script.js adds is-done) */
.intro--anim.is-done { height: auto !important; }
.intro--anim.is-done .intro__stage { position: relative; top: 0; }
.intro--anim.is-done .intro__hands, .intro--anim.is-done .intro__deco { display: none; }

/* ---- Intro, beat 1: left hand, right hand, then the square pops in next to "Hi" ----
   ---- Intro, beat 2 (.is-step2): "Hi" is typed out, "I'm Marta" typed in and out; then (.is-title) the square shrinks to a diamond, the title rises, the arrow appears ---- */
.intro__deco { display: none; }
.intro--anim .intro__deco { display: block; position: absolute; inset: 0 0 auto 0; z-index: 2; height: 100svh; pointer-events: none; opacity: calc(1 - var(--out, 0)); }

/* the title waits for beat 2 */
.intro--anim:not(.is-title) .hero h1 .word > span,
.intro--anim:not(.is-title) .hero h1 .mark { animation-play-state: paused; }

.intro__hi {
  position: absolute; left: var(--hi-x); top: var(--hi-y); translate: -50% -50%;
  font-family: var(--font-head); font-weight: 700; font-size: var(--hi-size, 56px); line-height: 1; letter-spacing: 0.01em;
  color: var(--text); margin: 0;
  display: grid; white-space: pre;
}
/* "Hi" is typed in at 1.5 s and typed out at beat 2, letter by letter with a caret (script.js); then the title rises in */
/* the hidden ghost keeps the box the size of the full word, so it never moves while letters come and go */
.hi__ghost, .hi__text { grid-area: 1 / 1; }
.hi__ghost { visibility: hidden; }
.intro__hi.is-typing .hi__text::after {
  content: ""; display: inline-block; width: 0.06em; height: 0.85em; margin: 0 -0.11em 0 0.05em; vertical-align: -0.04em; /* takes no room, so the word never shifts */
  background: currentColor; animation: hi-caret 0.5s steps(1) infinite;
}
@keyframes hi-caret { 50% { opacity: 0; } }
.intro__hi.is-gone { visibility: hidden; }

/* square: shown from desktop up, where it has room beside the title */
.intro__square { display: none; }
@media (min-width: 1024px) {
  .intro__square {
    display: block; position: absolute; overflow: visible;
    left: var(--sq-x); top: var(--sq-y); width: var(--sq-size); height: var(--sq-size); translate: -50% -50%;
    animation: square-pop 1.4s cubic-bezier(0.22, 1, 0.36, 1) 1.3s both;
  }
}
@keyframes square-pop {
  from { opacity: 0; transform: scale(0.3) rotate(220deg); }
  40% { opacity: 1; }
  to { opacity: 1; transform: none; }
}
.intro__square { --sq-color: var(--coral); }
.sq__line { fill: none; stroke: #AEAFAF; stroke-width: 1.14; }
.sq__fill { fill: var(--sq-color); fill-opacity: 0.2; transition: fill 800ms var(--ease); }
.sq__dot rect { fill: var(--sq-color); fill-opacity: 0.5; transition: fill 800ms var(--ease); }
/* both turn slowly, always; the small diamond keeps turning after beat 2 */
.sq__big { transform-box: view-box; transform-origin: 0 0; animation: square-spin 16s linear infinite; transition: scale 900ms var(--ease), opacity 600ms var(--ease); }
.sq__dot rect { transform-box: fill-box; transform-origin: center; animation: square-spin 12s linear infinite; }
.sq__dot { transition: transform 1100ms cubic-bezier(0.22, 1, 0.36, 1); }
.is-title .sq__big { scale: 0.2; opacity: 0; }
.is-title .sq__dot { transform: translate(-131.6px, -185px); } /* left edge in line with the title (x 200 in the Figma frame) */
@keyframes square-spin { to { rotate: -360deg; } }
/* a click spins the square fast and gives it the next color (script.js) */
.sq__burst { pointer-events: auto; cursor: pointer; }
.is-title .sq__big { pointer-events: none; }
.sq__b { transform-box: fill-box; transform-origin: center; }
.sq__burst.is-bursting .sq__b { animation: square-burst 2.6s cubic-bezier(0.15, 0.6, 0.25, 1); }
@keyframes square-burst { to { transform: rotate(-720deg); } }

/* round arrow at the bottom: scrolls one screen */
.intro__cue {
  position: absolute; left: var(--cue-x); top: var(--cue-y); translate: -50% -50%;
  width: 48px; height: 48px; border-radius: 50%; border: 0; padding: 0;
  display: grid; place-items: center; cursor: pointer; pointer-events: auto;
  background: var(--text); color: var(--bg);
  opacity: 0; visibility: hidden; transition: opacity 600ms var(--ease) 300ms, visibility 0s 900ms;
}
.intro__cue svg { width: 22px; height: 22px; animation: cue-nudge 1.8s ease-in-out infinite; }
.is-title .intro__cue { opacity: 1; visibility: visible; transition: opacity 600ms var(--ease) 300ms, visibility 0s; }
.intro__cue:focus-visible { outline: 2px solid var(--interactive); outline-offset: 3px; }
@keyframes cue-nudge { 0%, 100% { translate: 0 -2px; } 50% { translate: 0 3px; } }

/* yo-yo on the right hand, desktop only; sits on the hand in the hand picture's proportions */
.yy { display: none; }
@media (min-width: 1024px) {
  .yy {
    display: block; position: absolute; overflow: visible;
    left: 6.78%; top: 39.05%; width: 25.92%; height: auto; /* loop on the index finger, as in Figma frame image-hands (169:23185) */
    rotate: 10.2deg;
  }
}
.yy__string { fill: none; stroke: var(--text); stroke-width: 2; stroke-dasharray: 652 1000; }
.yy__rim { fill: var(--sand); stroke: #AEAFAF; stroke-width: 1.14; }
.yy__groove { fill: none; stroke: #AEAFAF; stroke-width: 1.2; }
.yy__body { fill: #8F87FF; }
.yy__core { fill: var(--violet); }
.yy__hint { font-family: var(--font-body); font-weight: 500; font-size: 14px; fill: var(--cream); user-select: none; transition: opacity var(--fast) var(--ease); }
.yy__disc { pointer-events: auto; cursor: pointer; }
.yy__swing { transform-box: view-box; transform-origin: 39.6px 19.9px; animation: yy-swing 3.2s ease-in-out -0.8s infinite; }
.yy__drop { transform: translate(16px, -226.7px); }
/* beat 2: unwinds, bounces twice and settles (from the old site) */
.yy.is-unwinding .yy__drop { animation: yy-unwind-disc 1.6s linear both; }
.yy.is-unwinding .yy__string { animation: yy-unwind-string 1.6s linear both; }
.yy.is-open .yy__drop { transform: none; }
.yy.is-open .yy__string { stroke-dasharray: 1000 1000; }
/* click: wound up it hops, unwound it climbs the string and drops back */
.yy.is-hopping .yy__disc { animation: yy-hop 900ms both; }
.yy.is-hopping .yy__string { animation: yy-hop-string 900ms both; }
.yy.is-throwing .yy__hint, .yy.is-hopping .yy__hint { opacity: 0; transition-duration: 150ms; }
.yy.is-throwing .yy__disc { animation: yy-throw 1.4s both; }
.yy.is-throwing .yy__string { animation: yy-throw-string 1.4s both; }
@keyframes yy-swing { 0%, 100% { transform: rotate(-9deg); } 50% { transform: rotate(9deg); } }
/* wound up: a real jump, the string shortens with it */
@keyframes yy-hop {
  0% { transform: translateY(0); animation-timing-function: cubic-bezier(0.2, 0.7, 0.3, 1); }
  40% { transform: translateY(-90px); animation-timing-function: cubic-bezier(0.5, 0, 0.8, 0.4); }
  80% { transform: translateY(6px); animation-timing-function: ease-out; }
  100% { transform: translateY(0); }
}
@keyframes yy-hop-string {
  0% { stroke-dasharray: 652 1000; animation-timing-function: cubic-bezier(0.2, 0.7, 0.3, 1); }
  40% { stroke-dasharray: 491 1000; animation-timing-function: cubic-bezier(0.5, 0, 0.8, 0.4); }
  80% { stroke-dasharray: 662 1000; animation-timing-function: ease-out; }
  100% { stroke-dasharray: 652 1000; }
}
@keyframes yy-unwind-disc {
  0% { transform: translate(16px, -226.7px); animation-timing-function: cubic-bezier(0.5, 0, 0.8, 0.4); }
  40% { transform: translateY(8px); animation-timing-function: cubic-bezier(0.2, 0.7, 0.3, 1); }
  58% { transform: translateY(-30px); animation-timing-function: cubic-bezier(0.5, 0, 0.8, 0.4); }
  74% { transform: translateY(3px); animation-timing-function: cubic-bezier(0.2, 0.7, 0.3, 1); }
  86% { transform: translateY(-8px); animation-timing-function: cubic-bezier(0.5, 0, 0.8, 0.4); }
  100% { transform: translateY(0); }
}
@keyframes yy-unwind-string {
  0% { stroke-dasharray: 652 1000; animation-timing-function: cubic-bezier(0.5, 0, 0.8, 0.4); }
  40%, 100% { stroke-dasharray: 1000 1000; }
}
@keyframes yy-throw {
  0% { transform: translateY(0); animation-timing-function: cubic-bezier(0.2, 0.7, 0.3, 1); }
  45% { transform: translateY(-220px); animation-timing-function: cubic-bezier(0.5, 0, 0.8, 0.4); }
  85% { transform: translateY(8px); animation-timing-function: ease-out; }
  100% { transform: translateY(0); }
}
@keyframes yy-throw-string {
  0% { stroke-dasharray: 1000 1000; animation-timing-function: cubic-bezier(0.2, 0.7, 0.3, 1); }
  45% { stroke-dasharray: 660 1000; animation-timing-function: cubic-bezier(0.5, 0, 0.8, 0.4); }
  85%, 100% { stroke-dasharray: 1000 1000; }
}

/* split-word title animation */
.split .word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.split .word > span { display: inline-block; transform: translateY(105%); animation: rise 1000ms var(--ease) forwards; }
@keyframes rise { from { opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---------- Section heads ---------- */
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: var(--s2); margin-bottom: var(--s6); }
@media (min-width: 1024px) { .section-head { margin-bottom: var(--s8); } }

/* ---------- Work cards: fluid bento grid ---------- */
/* Ink tiles with 24px corners (an exception to the 4px rule, for this grid only).
   Mobile: one column. Tablet: 2 columns. Desktop: 4 columns.
   Square tiles set the row height (--row = one column's width); .tile--tall spans two rows.
   grid-auto-flow: dense packs the 9 tiles without holes.
   Bridges between tiles are added by script.js. */
.work-grid {
  --tile: var(--ink); --tile-r: 24px; --flare: 28px;
  position: relative; display: grid; gap: var(--s2); list-style: none; padding: 0;
}
:root[data-theme="dark"] .work-grid { --tile: var(--surface); }
.tile { display: flex; min-height: 320px; }
.tile--empty { min-height: 120px; }
@media (min-width: 768px) {
  .work-grid {
    --row: calc((min(100vw, var(--max) + 2 * var(--gutter)) - 2 * var(--gutter) - var(--s2)) / 2);
    grid-template-columns: repeat(2, 1fr); grid-auto-rows: var(--row); grid-auto-flow: dense;
  }
  .tile, .tile--empty { min-height: 0; }
  .tile--tall { grid-row: span 2; }
}
@media (min-width: 1024px) {
  .work-grid {
    --row: calc((min(100vw, var(--max) + 2 * var(--gutter)) - 2 * var(--gutter) - 3 * var(--s3)) / 4);
    grid-template-columns: repeat(4, 1fr); gap: var(--s3);
  }
}

.card {
  position: relative; z-index: 1; flex: 1;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: var(--s3); border-radius: var(--tile-r); overflow: hidden;
  background: var(--tile); color: var(--cream); text-decoration: none;
  transition: transform 500ms var(--ease), color 300ms var(--ease);
}
/* hover preview: the project's own brand color (--accent, set on each card) and its picture in full color.
   The brand colors belong to each product, outside the portfolio palette, and appear only here. */
.card__media {
  position: absolute; inset: 0; background: var(--accent);
  opacity: 0; transform: scale(1.06);
  transition: opacity 400ms var(--ease), transform 700ms var(--ease);
}
.card__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card__media--img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 35%, color-mix(in srgb, var(--accent) 92%, transparent) 78%); }
/* Afterwish tile: a crop of the case study header, the welcome screen in front of the
   marigold card with the hand and photo, the violet dot and the coral pill (same images as .proto--scene) */
.card__media--afterwish { background: #FEE7A3; }
.card__media--afterwish img { position: absolute; height: auto; max-width: none; object-fit: contain; }
.card__media--afterwish .aw-hand { top: var(--s2); right: -18%; width: 92%; }
.card__media--afterwish .aw-phone {
  top: var(--s4); left: var(--s3); width: 46%;
  border-radius: 12% / 5.6%; box-shadow: 0 24px 48px -16px rgba(42, 31, 51, 0.5);
}
.card__media--afterwish .aw-dot { position: absolute; top: 10%; right: 12%; width: 18px; aspect-ratio: 1; border-radius: 50%; background: #4B3FE0; }
.card__media--afterwish .aw-pill { position: absolute; top: 46%; right: 6%; width: 30px; aspect-ratio: 56 / 32; border-radius: 999px; background: linear-gradient(90deg, #F25A4E 0%, #F7B5A5 100%); }
.card__media--afterwish::after { background: linear-gradient(transparent 5%, color-mix(in srgb, var(--accent) 96%, transparent) 50%); }
@media (min-width: 1024px) {
  .card__media--afterwish .aw-hand { top: 20%; right: -42%; width: 130%; }
  .card__media--afterwish .aw-phone { width: 54%; }
  .card__media--afterwish .aw-dot { top: 26%; }
  .card__media--afterwish .aw-pill { top: 38%; }
  .card__media--afterwish::after { background: linear-gradient(transparent 45%, color-mix(in srgb, var(--accent) 96%, transparent) 78%); }
}
/* Targets tile: a crop of the case study header, the Seerene gradient with the dashboard
   bleeding off the right edge (same two images as .cs-hero-bg, so nothing new to download) */
.card__media--seerene { background: #1d1a50 url("images/seerene-targets/target-background.jpg") left center / cover no-repeat; }
.card__media--seerene img {
  position: absolute; top: var(--s4); left: var(--s3);
  width: max(640px, 200%); height: auto; max-width: none; object-fit: contain;
  border-radius: 12px; box-shadow: 0 24px 48px rgba(10, 8, 40, 0.45);
}
/* the dashboard is white: on the short mobile and tablet tile the fade starts higher so the text stays readable */
.card__media--seerene::after { background: linear-gradient(transparent 5%, color-mix(in srgb, var(--accent) 96%, transparent) 50%); }
@media (min-width: 1024px) {
  .card__media--seerene img { width: max(760px, 230%); }
  .card__media--seerene::after { background: linear-gradient(transparent 35%, color-mix(in srgb, var(--accent) 96%, transparent) 72%); }
}
/* active state: mouse hover, keyboard focus, or (on touch screens) the tile in the middle
   of the screen while scrolling (.is-active, set by script.js) */
.card:focus-visible, .card.is-active { transform: translateY(-10px); color: var(--on-accent, var(--cream)); z-index: 2; }
.card:focus-visible .card__media, .card.is-active .card__media { opacity: 1; transform: none; }
@media (hover: hover) {
  .card:hover { transform: translateY(-10px); color: var(--on-accent, var(--cream)); z-index: 2; }
  .card:hover .card__media { opacity: 1; transform: none; }
  .card:hover h3 .card__arrow { transform: translateX(6px); }
}
.card:focus-visible { outline: 2px solid var(--interactive); outline-offset: 3px; }
.card__body { position: relative; }
.card .caption { color: inherit; }
.card h3 { color: inherit; margin-top: var(--s1); font-size: var(--h4); line-height: 1.3; letter-spacing: -0.01em; }
.card h3 .card__arrow { display: inline-block; transition: transform var(--fast) var(--ease); }
.card p:not(.caption) { margin-top: var(--s1); font-size: var(--small); line-height: 1.5; max-width: 40ch; }
/* square tiles on desktop are small: the short description shows on tall tiles only */
@media (min-width: 1024px) {
  .tile:not(.tile--tall) .card p:not(.caption) { display: none; }
}

.tile__empty {
  flex: 1; display: flex; align-items: flex-end; padding: var(--s3);
  background: var(--tile); color: #B8B2A8; border-radius: var(--tile-r);
}
.tile__empty .caption { color: inherit; }

/* bridge: fills the gap between two tiles, with concave flares at both ends */
.bridge {
  position: absolute; z-index: 0; background: var(--tile); opacity: 0;
  transition: opacity 600ms var(--ease), transform 400ms var(--ease);
}
.work-grid.is-joined .bridge { opacity: 1; }
.bridge--h {
  -webkit-mask:
    radial-gradient(50% 100% at 50% 0, transparent 98%, #000 100%) top / 100% var(--flare) no-repeat,
    radial-gradient(50% 100% at 50% 100%, transparent 98%, #000 100%) bottom / 100% var(--flare) no-repeat,
    linear-gradient(#000, #000) center / 100% calc(100% - 2 * var(--flare)) no-repeat;
  mask:
    radial-gradient(50% 100% at 50% 0, transparent 98%, #000 100%) top / 100% var(--flare) no-repeat,
    radial-gradient(50% 100% at 50% 100%, transparent 98%, #000 100%) bottom / 100% var(--flare) no-repeat,
    linear-gradient(#000, #000) center / 100% calc(100% - 2 * var(--flare)) no-repeat;
}
.bridge--v {
  -webkit-mask:
    radial-gradient(100% 50% at 0 50%, transparent 98%, #000 100%) left / var(--flare) 100% no-repeat,
    radial-gradient(100% 50% at 100% 50%, transparent 98%, #000 100%) right / var(--flare) 100% no-repeat,
    linear-gradient(#000, #000) center / calc(100% - 2 * var(--flare)) 100% no-repeat;
  mask:
    radial-gradient(100% 50% at 0 50%, transparent 98%, #000 100%) left / var(--flare) 100% no-repeat,
    radial-gradient(100% 50% at 100% 50%, transparent 98%, #000 100%) right / var(--flare) 100% no-repeat,
    linear-gradient(#000, #000) center / calc(100% - 2 * var(--flare)) 100% no-repeat;
}
.bridge--h.is-off { transform: scaleY(0); }
.bridge--v.is-off { transform: scaleX(0); }
@media (prefers-reduced-motion: reduce) {
  .card, .card__media, .bridge { transition: opacity 200ms linear; }
  .card:hover, .card:focus-visible, .card.is-active { transform: none; }
}

/* image placeholders until real covers exist */
.placeholder {
  width: 100%; height: 100%;
  display: grid; place-items: center; text-align: center;
  font-family: var(--font-head); font-weight: 700; font-size: var(--h3);
  letter-spacing: -0.02em; padding: var(--s3);
}
.accent-teal  { background: var(--teal);  color: var(--cream); }
.accent-amber { background: var(--amber); color: var(--ink); }
.accent-sage  { background: var(--sage);  color: var(--cream); }
.accent-ink   { background: var(--ink);   color: var(--cream); }
:root[data-theme="dark"] .accent-ink { background: var(--surface); }
.accent-sand  { background: var(--surface); color: var(--text-2); }

/* ---------- How I work ---------- */
.principles { display: grid; gap: var(--s6); list-style: none; padding: 0; counter-reset: p; }
.principles li { border-top: 2px solid var(--line-strong); padding-top: var(--s3); }
.principles li h3 { margin-top: var(--s2); }
.principles li p { margin-top: var(--s2); color: var(--text-2); }
@media (min-width: 768px) { .principles { grid-template-columns: repeat(3, 1fr); gap: var(--s3); } }
@media (min-width: 1024px) { .principles { gap: var(--s6); } }

.tools {
  margin-top: var(--s8);
  font-family: var(--font-head); font-weight: 600; font-size: var(--h4); line-height: 1.3;
}
.tools__typed { color: var(--text); border-right: 2px solid var(--text); padding-right: 2px; animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { border-color: transparent; } }

/* ---------- Footer / contact ---------- */
.footer { border-top: 2px solid var(--line-strong); padding-block: var(--s8) var(--s6); }
.footer h2 { max-width: 16ch; }
.footer__links { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin-top: var(--s4); list-style: none; padding: 0; }
.footer__links a { font-weight: 500; }
.footer__meta {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2);
  margin-top: var(--s8); padding-top: var(--s3); border-top: 1px solid var(--line);
}
.footer__meta a { color: var(--text-2); }
@media (min-width: 1024px) { .footer { padding-block: var(--s12) var(--s6); } }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(32px); transition: opacity var(--slow) var(--ease), transform var(--slow) var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- About ---------- */
.about-intro { padding-block: var(--s8) var(--s8); }
.about-intro h1 { max-width: 14ch; margin-top: var(--s3); }
.about-intro__body { margin-top: var(--s6); display: grid; gap: var(--s6); }
.about-intro__body .stack p { color: var(--text); }
.portrait { aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; max-width: 360px; }
@media (min-width: 1024px) { .portrait { max-width: none; } }
@media (min-width: 1024px) {
  .about-intro { padding-block: var(--s12) var(--s12); }
  .about-intro__body { grid-template-columns: 5fr 7fr; gap: var(--s8); align-items: start; }
}

.tags { display: flex; flex-wrap: wrap; gap: var(--s1); margin-top: var(--s2); list-style: none; padding: 0; }
.tags li {
  font-size: var(--small); line-height: 1.3; color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 4px 10px;
}
/* Career path: a winding line that draws itself as you scroll.
   Mobile and tablet: a vertical line with the circles on it.
   Desktop: a serpentine line on a 1200 x 2260 canvas, hugging each circle. */
.path { --p: 1; --dot: 56px; --rail: 2px; position: relative; }
.path__svg { display: none; }
.path::before, .path::after {
  content: ""; position: absolute; top: 0; bottom: 0;
  left: calc(var(--dot) / 2 - var(--rail) / 2); width: var(--rail);
}
.path::before { background: var(--text); opacity: 0.15; }
.path::after { background: var(--sage); transform-origin: top; transform: scaleY(var(--p)); }
.path__pen { display: none; }
.path__stops { position: relative; z-index: 1; list-style: none; padding: 0; display: grid; gap: var(--s8); }
.stop { position: relative; padding-left: calc(var(--dot) + var(--s3)); min-height: var(--dot); }
.stop__dot {
  position: absolute; left: 0; top: 0;
  width: var(--dot); aspect-ratio: 1; border-radius: 50%; background: var(--coral);
}
.stop__num { display: block; margin-bottom: var(--s1); }
.stop h3 { font-size: var(--h4); line-height: 1.3; letter-spacing: -0.01em; }
.stop .caption { margin-top: var(--s2); }
.stop p:not(.caption) { margin-top: var(--s1); color: var(--text-2); }

/* Motion: hidden until the line reaches each stop (only with JS and motion allowed) */
.path--anim .stop__dot { transform: scale(0); transition: transform 700ms var(--ease); }
.path--anim .stop__text { opacity: 0; translate: 0 32px; transition: opacity var(--slow) var(--ease), translate var(--slow) var(--ease); }
.path--anim .stop.is-reached .stop__dot { transform: scale(1); }
.path--anim .stop.is-reached .stop__text { opacity: 1; translate: 0 0; }
.path--anim .path__pen {
  display: block; position: absolute; z-index: 0; left: calc(var(--dot) / 2); top: calc(var(--p) * 100%);
  width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--text);
}

@media (min-width: 768px) {
  .path { --dot: 88px; }
  .stop { padding-left: calc(var(--dot) + var(--s4)); }
}

@media (min-width: 1024px) {
  .path { aspect-ratio: 1200 / 2260; }
  .path::before, .path::after { display: none; }
  .path__svg { display: block; position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
  .path__svg path { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
  .path__track { stroke: var(--text); opacity: 0.15; }
  .path__draw { stroke: var(--sage); }
  .path__stops { display: block; position: static; }
  .stop { position: static; padding: 0; min-height: 0; }
  .stop__dot { left: calc((var(--cx) - 96) / 12 * 1%); top: calc((var(--cy) - 96) / 22.6 * 1%); width: 16%; }
  .stop__text {
    position: absolute; z-index: 1;
    left: calc(var(--tx) / 12 * 1%); width: calc(var(--tw) / 12 * 1%);
    top: calc(var(--ty) / 22.6 * 1%); transform: translateY(-100%);
  }
  .stop__num { display: inline; margin: 0 var(--s1) 0 0; }
  .path--anim .path__pen { left: 0; top: 0; }
}

.offstage { display: grid; gap: var(--s6); }
@media (min-width: 768px) { .offstage { grid-template-columns: 1fr 1fr; } }

/* ---------- Case study ---------- */
.cs-hero { padding-block: var(--s8) var(--s6); }
.cs-hero h1 { max-width: 18ch; margin-top: var(--s3); }
.cs-hero .lead { margin-top: var(--s4); }
.cs-meta {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3);
  margin-top: var(--s6); padding-top: var(--s3); border-top: 1px solid var(--line);
}
.cs-meta dt { font-weight: 700; font-size: var(--caption); text-transform: uppercase; letter-spacing: 0.08em; }
.cs-meta dd { margin-top: 4px; font-size: var(--small); color: var(--text-2); }
@media (min-width: 768px) { .cs-meta { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1024px) { .cs-hero { padding-block: var(--s12) var(--s8); } }

.cs-cover { aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; }

.cs-layout { display: grid; gap: var(--s6); padding-block: var(--s8) var(--section); }
@media (min-width: 1024px) {
  .cs-layout { grid-template-columns: 220px 1fr; gap: var(--s8); }
}

.cs-index { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding-block: var(--s2); }
.cs-index ol { list-style: none; padding: 0; display: grid; gap: 4px; }
.cs-index a {
  display: block; padding: 6px 0; font-size: var(--small); font-weight: 500;
  color: var(--text-2); text-decoration: none;
  transition: color var(--fast) var(--ease), padding var(--fast) var(--ease);
}
.cs-index a:hover { color: var(--interactive); }
.cs-index a.is-active { color: var(--interactive); padding-left: var(--s1); border-left: 2px solid var(--interactive); }
@media (min-width: 1024px) {
  .cs-index { position: sticky; top: 104px; align-self: start; border: 0; padding: 0; }
}

.cs-section { scroll-margin-top: 96px; }
.cs-section + .cs-section { margin-top: var(--s12); }
.cs-section h2 { max-width: 20ch; }
.cs-section > p, .cs-section .lead { margin-top: var(--s3); }
.cs-section > p + p { margin-top: var(--s2); }
.cs-figure { margin-top: var(--s6); }
.cs-figure .placeholder-box { aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden; }
.cs-figure figcaption { margin-top: var(--s2); }

.stats { display: grid; gap: var(--s3); margin-top: var(--s6); list-style: none; padding: 0; }
.stats li { border-top: 2px solid var(--line-strong); padding-top: var(--s2); }
.stats strong { display: block; font-family: var(--font-head); font-weight: 700; font-size: var(--h2); line-height: 1; letter-spacing: -0.02em; }
.stats span { display: block; margin-top: var(--s1); font-size: var(--small); color: var(--text-2); }
@media (min-width: 768px) { .stats { grid-template-columns: repeat(3, 1fr); } }

/* Next project: a full-width ink band at the end of a case study. "Back to projects"
   on the left, "Read case study" on the right, on one line from 768. In dark mode the
   page is already ink, so the band steps up to the dark surface. */
.next-project {
  --np-bg: var(--ink); --np-text: var(--cream);
  background: var(--np-bg); color: var(--np-text); padding-block: var(--s6);
}
:root[data-theme="dark"] .next-project { --np-bg: var(--surface); --np-text: var(--text); }
.next-project .caption { color: var(--np-text); }
.next-project h2 { margin-top: var(--s2); color: var(--np-text); }
.next-project__actions {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--s3); margin-top: var(--s4);
}
.next-project__back {
  display: inline-flex; align-items: center; gap: var(--s1);
  color: var(--np-text); font-weight: 500; text-decoration: none;
}
.next-project__back:hover { text-decoration: underline; }
.next-project__back span, .next-project .button span { transition: transform var(--fast) var(--ease); }
.next-project__back:hover span { transform: translateX(-4px); }
.next-project .button:hover span { transform: translateX(4px); }
@media (min-width: 1024px) { .next-project { padding-block: var(--s8); } }

/* Next project, layout B (every case study): previous and next case study as two cards side by side,
   then a centered "Back to gallery" button. Each card shows the project's cover; on hover the cover
   zooms in and the title takes the project's brand color (--accent). */
.np-pair { padding-block: var(--s8); border-top: 1px solid var(--line); }
.np-pair__grid { display: grid; gap: var(--s3); }
.np-card { display: grid; overflow: hidden; border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; }
.np-card__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--accent); }
.np-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 800ms var(--ease); }
.np-card__word { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: var(--h2); color: var(--cream); transition: transform 800ms var(--ease); }
.np-card__body { display: grid; gap: var(--s1); padding: var(--s4); }
.np-card__body h3 { font-size: var(--h3); line-height: 1.2; transition: color var(--fast) var(--ease); }
.np-card__body .small { color: var(--text-2); }
.np-card__cta { margin-top: var(--s2); font-weight: 500; color: var(--interactive); }
.np-card:hover .np-card__media img, .np-card:hover .np-card__word { transform: scale(1.04); }
.np-card:hover h3 { color: var(--accent); }
:root[data-theme="dark"] .np-card:hover h3 { color: var(--interactive); }
.np-card:focus-visible { outline: 2px solid var(--interactive); outline-offset: 3px; }
.np-pair__all { display: flex; justify-content: center; max-width: none; margin-top: var(--s6); }
.np-pair__all .button span { transition: transform var(--fast) var(--ease); }
.np-pair__all .button:hover span { transform: translateX(-4px); }

@media (min-width: 768px) {
  .np-pair__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .np-pair { padding-block: var(--s12); }
  .np-card__body { padding: var(--s6); }
}

/* ---------- Case study: Afterwish components ---------- */
.cs-hero__note { margin-top: var(--s3); color: var(--text-2); }

/* Hero with the prototype beside the title: stacked on mobile, side by side from desktop.
   --bar is the top bar height; the phone never gets taller than the screen below it,
   and from desktop the whole hero (text and phone) fits in one screen. */
/* one column below desktop, kept at the screen width so the prototype scene never widens the page */
.cs-hero--phone { --bar: 65px; --hero-pad: var(--s6); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s6); padding-block: var(--hero-pad); }
@media (min-width: 768px) { .cs-hero--phone { --bar: 73px; } }
@media (min-width: 1024px) {
  .cs-hero--phone {
    --hero-pad: var(--s4);
    grid-template-columns: minmax(0, 1fr) auto; gap: var(--s8); align-items: center;
    min-height: calc(100svh - var(--bar));
  }
  /* the title shrinks on short screens so the text column fits too */
  .cs-hero--phone h1 { font-size: min(var(--h1), 8.5svh); max-width: 15ch; }
  .cs-hero--phone .lead { font-size: min(var(--lead), 2.4svh); }
  .cs-hero--phone .cs-hero__note { font-size: min(var(--body), 2.1svh); }
}

/* Interactive prototype in the hero: the app screen on its own, no device frame.
   iPhone 16 proportions (393 x 852). Height is capped by the screen height, width follows. */
.proto { --proto-h: min(560px, calc(100svh - var(--bar, 65px) - 2 * var(--hero-pad, 48px) - 2rem)); justify-self: center; margin: 0; display: grid; justify-items: center; gap: var(--s2); }
.proto__screen {
  display: block; height: var(--proto-h); width: auto; aspect-ratio: 393 / 852;
  border: 0; border-radius: 12% / 5.6%; background: #fff;
  box-shadow: 0 0 0 1px rgba(42,31,51,.08), 0 40px 70px -36px rgba(42,31,51,.45), 0 12px 28px -14px rgba(42,31,51,.26);
}
.proto figcaption { font-size: var(--small); color: var(--text-2); text-align: center; }
@media (min-width: 1024px) { .proto { --proto-h: min(680px, calc(100svh - var(--bar) - 2 * var(--hero-pad) - 2rem)); } }
@media (min-width: 1440px) { .proto { --proto-h: min(760px, calc(100svh - var(--bar) - 2 * var(--hero-pad) - 2rem)); } }

/* Prototype scene: the phone sits in front of a flat marigold card with the Photos
   illustration, a violet dot and a coral pill. Proportions from the Figma hero: the card
   starts two thirds of the way under the phone, a sixth of the way down, and ends above
   the phone's bottom edge, where the caption sits.
   --pw is the phone width; --reach is how far the card's right edge sits from the phone's
   left edge, in phone widths. The card is decoration only (aria-hidden). */
.proto--scene {
  --proto-h: min(580px, calc(100svh - var(--bar, 65px) - 2 * var(--hero-pad, 48px) - 2rem));
  --pw: calc(var(--proto-h) * 393 / 852);
  --reach: 2.5;
  justify-self: stretch; justify-items: start; min-width: 0; grid-template-columns: minmax(0, 1fr);
}
/* Mobile: the phone, its caption, then the card below, full width.
   The stage steps aside (display: contents) so the three line up in the figure's grid. */
.proto__stage { display: contents; }
.proto--scene .proto__screen { position: relative; z-index: 1; justify-self: center; }
.proto--scene figcaption { order: 1; justify-self: center; }
.proto__card {
  order: 2; position: relative; width: 100%; aspect-ratio: 658 / 538; margin-top: var(--s3);
  overflow: hidden; border-radius: 24px; background: #FEE7A3;
}
/* the hand and photo, cut out of the Figma card (hero-hand.png, 658 x 538, transparent),
   fill the card and keep their bottom right corner when the card's proportions change */
.proto__card img {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none;
  object-fit: cover; object-position: right bottom;
}
.proto__dot, .proto__pill { position: absolute; z-index: 2; }
/* positions and sizes measured on the Figma card */
.proto__dot { top: 17.8%; right: 14.1%; width: 5.2%; aspect-ratio: 1; border-radius: 50%; background: #4B3FE0; }
.proto__pill {
  top: 30%; right: 3.3%; width: 8.5%; aspect-ratio: 56 / 32; border-radius: 999px;
  background: linear-gradient(90deg, #F25A4E 0%, #F7B5A5 100%);
}
@media (prefers-reduced-motion: no-preference) {
  .proto__dot { animation: proto-float 6s ease-in-out infinite alternate; }
  .proto__pill { animation: proto-float 7s ease-in-out -2s infinite alternate-reverse; }
}
@keyframes proto-float { to { transform: translateY(-8px); } }
/* When the scene comes into view (.reveal adds is-in), the hand rises into the card
   from below, holding the photo. Plays once. Without JavaScript it simply shows. */
@media (prefers-reduced-motion: no-preference) {
  .js .proto--scene .proto__card img { transform: translateY(100%) rotate(10deg); transform-origin: 85% 100%; }
  .js .proto--scene.is-in .proto__card img { animation: proto-hand 1.3s cubic-bezier(.22, 1, .36, 1) .4s both; }
}
@keyframes proto-hand {
  /* rises while turning a little counterclockwise, from 10° to straight */
  from { transform: translateY(100%) rotate(10deg); }
  to   { transform: none; }
}

/* From tablet: the card sits behind the phone, as in the Figma, and the caption
   sits right of the phone, just under the card */
@media (min-width: 768px) {
  .proto--scene {
    --proto-h: min(640px, calc(100svh - var(--bar) - 2 * var(--hero-pad) - 2rem));
    position: relative; justify-self: center;
  }
  .proto__stage {
    display: block; position: relative;
    width: calc(var(--pw) * var(--reach)); max-width: 100%;
    height: var(--proto-h);
  }
  .proto--scene .proto__screen { justify-self: start; }
  .proto__card {
    position: absolute; left: calc(var(--pw) * .68); right: 0;
    top: calc(var(--proto-h) * .16); bottom: calc(var(--proto-h) * .16);
    width: auto; aspect-ratio: auto; margin-top: 0;
  }
  .proto--scene figcaption {
    position: absolute; left: calc(var(--pw) + 1rem); top: calc(var(--proto-h) * .84 + .75rem);
    text-align: left; justify-self: start;
  }
}
/* From desktop the facts row sits under the hero, so the scene leaves room for it (--facts-h) */
@media (min-width: 1024px) {
  .cs-hero--phone { --facts-h: 7rem; grid-template-rows: minmax(0, 1fr) auto; row-gap: var(--s4); }
  .proto--scene { --proto-h: min(560px, calc(100svh - var(--bar) - 2 * var(--hero-pad) - 2rem - var(--facts-h))); --reach: 2.1; }
}
@media (min-width: 1440px) {
  .proto--scene { --proto-h: min(660px, calc(100svh - var(--bar) - 2 * var(--hero-pad) - 2rem - var(--facts-h))); --reach: 2.5; }
}

/* Afterwish design system collage: the collage from case-study-v2.css with
   the Afterwish tokens. These colors belong to the product, not to the site. */
.aw-ds {
  --bg-dark: #4D2C5F;
  --text-on-dark: #FFFFFF;
  --accent: #2F5D62;
  --accent-light: #F9C74F;
  --text-headline: #2A1F33;
  --text-secondary: #655A6E;
  --bg-surface: #FDF7EE;
  --font-heading: "Bricolage Grotesque", ui-rounded, system-ui, sans-serif;
  margin-top: var(--s6);
}

/* animated visuals: each animation is drawn at 1600 x 1000 and scales to its frame */
/* the cover never gets taller than the screen below the top bar */
.cs-cover--anim {
  aspect-ratio: 16 / 10; background: var(--surface);
  width: min(100%, (100svh - 65px - var(--s6)) * 1.6);
  margin-inline: auto;
}
@media (min-width: 768px) { .cs-cover--anim { width: min(100%, (100svh - 73px - var(--s6)) * 1.6); } }
.cs-frame { aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.cs-anim { display: block; width: 100%; height: 100%; border: 0; pointer-events: none; }

.cs-subhead { margin-top: var(--s8); max-width: 24ch; }
.cs-subhead + p, .cs-subhead + .cs-quote, .cs-subhead + ol { margin-top: var(--s3); }
.cs-section .cs-quote + p { margin-top: var(--s3); }

.cs-facts { display: grid; gap: var(--s3); margin-top: var(--s6); }
.cs-facts > div { border-top: 1px solid var(--line); padding-top: var(--s2); }
.cs-facts dt, .cs-contrast dt, .cs-credit dt, .cs-persona__grid dt, .cs-decisions dt {
  font-weight: 700; font-size: var(--caption); text-transform: uppercase; letter-spacing: 0.08em; line-height: 1.4;
}
.cs-facts dd { margin-top: var(--s1); color: var(--text-2); }
.cs-facts dd strong { display: block; color: var(--text); font-weight: 700; }
@media (min-width: 768px) { .cs-facts { grid-template-columns: 1fr 1fr; gap: var(--s4) var(--s3); } }

/* Facts as one row along the bottom of the case study header:
   stacked on mobile, two by two on tablet, four in a row from desktop. */
.cs-facts--hero { grid-column: 1 / -1; margin-top: 0; }
.cs-facts--hero dd { font-size: var(--small); }
.cs-facts--hero dd strong { font-size: 15px; font-weight: 400; }
@media (min-width: 1024px) {
  .cs-facts--hero { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); align-self: end; }
}


.cs-points { list-style: none; padding: 0; display: grid; gap: var(--s4); margin-top: var(--s6); }
.cs-points li { border-top: 2px solid var(--line-strong); padding-top: var(--s2); }
.cs-points__title { font-size: var(--h4); line-height: 1.3; letter-spacing: -0.01em; }
.cs-points .caption + .cs-points__title { margin-top: var(--s1); }
.cs-points p:not(.caption) { margin-top: var(--s1); color: var(--text-2); }
@media (min-width: 768px) { .cs-points { grid-template-columns: repeat(3, 1fr); gap: var(--s3); } }

.cs-contrast { display: grid; gap: var(--s3); margin-top: var(--s6); }
.cs-contrast > div { background: var(--surface); border-radius: var(--radius); padding: var(--s3); }
.cs-contrast dd { margin-top: var(--s1); font-size: var(--lead); line-height: 1.45; }
@media (min-width: 768px) { .cs-contrast { grid-template-columns: 1fr 1fr; } }

/* who did what: me and the AI tools */
.cs-credit { display: grid; gap: var(--s2); margin-top: var(--s6); padding-left: var(--s3); border-left: 2px solid var(--line-strong); }
.cs-credit > div { display: grid; gap: 4px; }
.cs-credit dd { font-size: var(--small); color: var(--text-2); max-width: 65ch; }
@media (min-width: 768px) {
  .cs-credit > div { grid-template-columns: 48px 1fr; gap: var(--s2); align-items: baseline; }
}

.cs-persona { margin-top: var(--s8); background: var(--surface); border-radius: var(--radius); padding: var(--s3); }
.cs-persona h3 { margin-top: var(--s2); }
.cs-persona .small { margin-top: var(--s1); }
.cs-persona__grid { display: grid; gap: var(--s3); margin-top: var(--s4); }
.cs-persona__grid dd { margin-top: var(--s1); color: var(--text-2); }
@media (min-width: 768px) {
  .cs-persona { padding: var(--s6); }
  .cs-persona__grid { grid-template-columns: 1fr 1fr; gap: var(--s4); }
}

.cs-quote { margin-top: var(--s6); }
.cs-quote p { font-size: var(--h4); line-height: 1.4; font-weight: 500; max-width: 40ch; }
.cs-quote footer { margin-top: var(--s2); }

.cs-decisions { list-style: none; padding: 0; display: grid; gap: var(--s6); margin-top: var(--s6); }
.cs-decisions li { border-top: 2px solid var(--line-strong); padding-top: var(--s3); display: grid; gap: var(--s2); }
.cs-decisions__num { font-family: var(--font-head); font-weight: 700; font-size: var(--h3); line-height: 1; letter-spacing: -0.015em; }
.cs-decisions dl { display: grid; gap: var(--s2); }
.cs-decisions dd { margin-top: 4px; max-width: 60ch; }
.cs-decisions div:last-child dd { color: var(--text); font-weight: 500; }
@media (min-width: 768px) {
  .cs-decisions li { grid-template-columns: 80px 1fr; gap: var(--s3); }
  .cs-decisions dl > div { display: grid; grid-template-columns: 112px 1fr; gap: var(--s2); align-items: baseline; }
  .cs-decisions dd { margin-top: 0; }
}

.cs-screens { list-style: none; padding: 0; display: grid; gap: var(--s6); margin-top: var(--s4); }
.cs-screens li { border-top: 1px solid var(--line); padding-top: var(--s2); display: flex; flex-direction: column; }
.cs-screens h4 { margin-top: var(--s1); }
.cs-screens p:not(.caption) { margin-top: var(--s1); color: var(--text-2); }
.cs-screens p:not(.caption) { margin-bottom: var(--s3); }
/* phones sit at the bottom of each item, so side-by-side screens line up */
.cs-phone { margin-top: auto; width: 100%; max-width: 280px; border-radius: 24px; box-shadow: 0 0 0 1px var(--line); }
@media (min-width: 768px) { .cs-screens { grid-template-columns: 1fr 1fr; gap: var(--s6) var(--s4); } }

.cs-next { padding-left: 1.4em; margin-top: var(--s3); display: grid; gap: var(--s1); max-width: 65ch; }
.cs-next li::marker { font-weight: 700; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .js .up-goal.reveal .up-goal__body { opacity: 1; transform: none; }
  .split .word > span { transform: none; }
  .tools__typed { animation: none; }
}

/* Certification tag: opens the neuefische badge */
.tags .tags__item--button { border: 0; padding: 0; }
.tag-button {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: var(--small); line-height: 1.3; color: var(--interactive);
  background: none; cursor: pointer;
  border: 1px solid var(--interactive); border-radius: var(--radius);
  padding: 4px 10px;
  transition: background-color 200ms var(--ease, ease), color 200ms var(--ease, ease);
}
.tag-button:hover { background: var(--interactive); color: var(--on-interactive); }
.tag-button__icon { width: 14px; height: 14px; flex: none; }

/* Badge dialog: the card tilts with the pointer and flips on click.
   The card keeps its own colors, like the intro hands. */
.badge {
  width: 100%; max-width: none; height: 100%; max-height: none;
  margin: 0; padding: var(--s2); border: 0;
  background: transparent; color: var(--text);
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: var(--s3);
}
.badge[open] { display: flex; }
/* ::backdrop does not inherit the color tokens, so the cream and ink are written out */
.badge::backdrop { background: rgba(242, 239, 232, 0.96); }
:root[data-theme="dark"] .badge::backdrop { background: rgba(34, 32, 31, 0.96); }
.badge__close {
  position: absolute; top: var(--s2); right: var(--s2);
  width: 48px; height: 48px; display: grid; place-items: center;
  background: none; border: 0; color: var(--interactive); cursor: pointer;
}
.badge__close svg { width: 24px; height: 24px; }
.badge__scene { perspective: 1150px; width: min(340px, 78vw, calc(66svh * 0.6759)); aspect-ratio: 684 / 1012; }
.badge__card {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d; cursor: grab; border-radius: 13.0155% / 8.797%;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}
.badge__face {
  position: absolute; inset: 0; width: 100%; height: 100%;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  user-select: none; -webkit-user-drag: none; pointer-events: none;
  /* the pictures have black corners: round them off like the original card */
  border-radius: 13.0155% / 8.797%; object-fit: cover;
}
.badge__face--back { transform: rotateY(180deg); }
.badge__hint { font-size: var(--small); color: var(--text-2); margin: 0; }
.badge[open] .badge__scene { animation: badge-in 700ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes badge-in { from { opacity: 0; transform: translateY(32px); } }

@media (min-width: 1024px) {
  .badge__scene { width: min(400px, calc(66svh * 0.6759)); }
}

@media (prefers-reduced-motion: reduce) {
  .badge[open] .badge__scene { animation: none; }
}

/* ---------- Screen carousel (Afterwish case study) ----------
   Endless row of app screens. Scrolls left on its own and pauses on hover.
   Speed: data-speed on .screen-carousel, in pixels per second (default 40).
   Add .screen-carousel--reverse to scroll the other way.
   Reduced motion: no animation, the row scrolls by hand instead.
   Without JavaScript the screens show as a static row (script.js duplicates them for the loop). */
.screen-carousel {
  /* sand band behind the screens. The gradient is three times wider than the band
     and drifts slowly, so the color shifts softly between sand, lilac, blush and a pale marigold. */
  --sc-screen-bg: #FFFFFF;
  --sc-gap: 24px;
  --sc-phone-w: 200px;
  --sc-pad-block: 48px;

  overflow: hidden;
  padding-block: var(--sc-pad-block);
  background: var(--sc-band);
  background-size: 300% 300%;
  animation: sc-band 24s ease-in-out infinite alternate;
}
@keyframes sc-band {
  0%   { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}
@media (min-width: 1024px) {
  .screen-carousel {
    --sc-phone-w: 240px;
    --sc-pad-block: 64px;
  }
}
.screen-carousel *,
.screen-carousel *::before,
.screen-carousel *::after { box-sizing: border-box; }
.screen-carousel__track { display: flex; width: max-content; }
.screen-carousel__track > * { margin-right: var(--sc-gap); }
.sc-js .screen-carousel__track { animation: screen-carousel var(--dur, 40s) linear infinite; }
.screen-carousel--reverse .screen-carousel__track { animation-direction: reverse; }
@keyframes screen-carousel { to { transform: translate3d(-50%, 0, 0); } }

/* The screen on its own, no device frame: the same proportions as the mocks
   (393 x 852), so nothing is cropped. Rounded corners and a soft shadow. */
.screen-carousel__phone {
  flex: none;
  width: var(--sc-phone-w);
  aspect-ratio: 393 / 852;
}
.screen-carousel__screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 12% / 5.6%;
  background: var(--sc-screen-bg);
  box-shadow:
    0 0 0 1px rgba(31, 27, 15, 0.08),
    0 2px 4px rgba(31, 27, 15, 0.06),
    0 16px 32px -12px rgba(31, 27, 15, 0.22);
}
.screen-carousel__screen > img {
  position: absolute; inset: 0; display: block;
  width: 100%; height: 100%;
  object-fit: cover; object-position: top;
}
.screen-carousel__screen > .cs2-ph { position: absolute; inset: 0; }
/* Layouts used by the case study builder */
.screen-carousel--still { animation: none; background-position: 0% 50%; }
.screen-carousel--large { --sc-phone-w: 240px; }
@media (min-width: 1024px) { .screen-carousel--large { --sc-phone-w: 300px; } }
@media (prefers-reduced-motion: reduce) {
  .sc-js .screen-carousel__track { animation: none; }
  .screen-carousel { animation: none; }
  .screen-carousel { overflow-x: auto; }
}

/* Case study header: subtitle under the project name (h3 size) and a small violet tag */
.cs-hero__sub {
  margin-top: var(--s2);
  font-family: var(--font-head); font-size: var(--h3); font-weight: 600; line-height: 1.2; letter-spacing: -0.015em;
  color: var(--text); text-wrap: balance; max-width: 30ch;
}
/* Tags under the description: the same shape as the site's tags (.tags li).
   The first one (AI-assisted) is violet, the skills are gray. */
.cs-hero__tags { display: flex; flex-wrap: wrap; gap: var(--s1); margin-top: var(--s3); list-style: none; padding: 0; }
.cs-hero__tags li {
  font-size: 15px; font-weight: 400; line-height: 1.3; color: var(--text-2);
  border: 1px solid var(--text-2); border-radius: var(--radius);
  padding: 4px 10px;
}
.cs-hero__tags .cs-hero__tag { font-size: 16px; font-weight: 500; color: var(--interactive); border-color: var(--interactive); }

/* Proto-persona with its card image (Afterwish): image on the left, text on the right
   from tablet, stacked on mobile. The new logo sits on an aubergine label that covers
   the old logo printed in the image (sizes in % of the image width, so it scales). */
.cs-persona--image { display: grid; gap: var(--s4); }
.cs-persona__media { position: relative; margin: 0; }
.cs-persona__media > img { display: block; width: 100%; height: auto; border-radius: var(--radius); }
.cs-persona__logo {
  position: absolute; left: 5%; top: 2.9%; width: 31%;
  padding: 1.8% 2.8%; border-radius: 10px; background: #4D2C5F;
}
.cs-persona__logo img { display: block; width: 100%; height: auto; }
.cs-persona__body > .caption:first-child { margin-top: 0; }
@media (min-width: 768px) {
  .cs-persona--image { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--s6); align-items: start; }
  .cs-persona--image .cs-persona__grid { grid-template-columns: 1fr; gap: var(--s3); }
}
@media (min-width: 1024px) {
  .cs-persona--image .cs-persona__grid { grid-template-columns: 1fr 1fr; }
}

/* Source line under a cited figure (Afterwish Problem: 16%) */
.cs-source { margin-top: var(--s1); font-size: var(--small); color: var(--text-2); }

/* Key findings (Afterwish Research): the finding large on the left under a 2px rule,
   synthesis and design on the right under a hairline. Stacked on mobile, the right pair
   side by side from tablet, two columns (5fr / 7fr) from desktop. */
.cs-findings { display: grid; gap: var(--s6); margin-top: var(--s8); }
.cs-findings__lead { border-top: 2px solid var(--line-strong); padding-top: var(--s2); }
.cs-findings__rest { display: grid; gap: var(--s6); border-top: 1px solid var(--line-strong); padding-top: var(--s2); }
.cs-findings .caption + .cs-findings__num { margin-top: var(--s3); }
.cs-findings__num {
  font-family: var(--font-head); font-weight: 700; line-height: 1; letter-spacing: -0.02em;
  font-size: var(--h2); font-variant-numeric: tabular-nums;
}
.cs-findings__lead .cs-findings__num { font-size: var(--h1); }
.cs-findings__num small { font-size: 0.5em; font-weight: 600; letter-spacing: -0.01em; color: var(--text-2); }
.cs-findings__lead .cs-findings__num small { font-size: 0.4em; }
.cs-findings__text { margin-top: var(--s2); color: var(--text-2); max-width: 36ch; }
.cs-findings__lead .cs-findings__text { font-size: var(--lead); color: var(--text); }
@media (min-width: 768px) {
  .cs-findings__rest { grid-template-columns: 1fr 1fr; gap: var(--s4); }
}
@media (min-width: 1024px) {
  .cs-findings { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s6); align-items: start; }
}
/* Count-up states (script.js): hidden until the block is in view, then each part arrives */
.js .cs-findings [data-findings="fade"] { opacity: 0; transition: opacity 600ms ease; }
.js .cs-findings__then { opacity: 0; transition: opacity 250ms ease; }
.js .cs-findings.is-done [data-findings="fade"],
.js .cs-findings .is-then .cs-findings__then { opacity: 1; }

/* The research at a glance (Afterwish Overview): five figures in one row under a hairline.
   Two per row on mobile, three on tablet, five from desktop. */
.cs-glance {
  list-style: none; padding: var(--s3) 0 0; margin-top: var(--s6);
  border-top: 1px solid var(--line-strong);
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4) var(--s3);
}
.cs-glance strong {
  display: block; font-family: var(--font-head); font-weight: 700; font-size: var(--h3);
  line-height: 1; letter-spacing: -0.015em; font-variant-numeric: tabular-nums;
}
.cs-glance span { display: block; font-size: var(--small); line-height: 1.4; }
.cs-glance strong + span { margin-top: var(--s1); color: var(--text); }
.cs-glance span + span { color: var(--text-2); }
@media (min-width: 768px) { .cs-glance { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .cs-glance { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* Methods as a list (Afterwish Research): one row per method between hairlines,
   label, title and text side by side from tablet, instead of three blocks. */
.cs-points--list { display: block; }
.cs-points--list li {
  border-top: 1px solid var(--line-strong); padding-block: var(--s3);
}
.cs-points--list li:last-child { border-bottom: 1px solid var(--line-strong); }
@media (min-width: 768px) {
  .cs-points--list li {
    display: grid; grid-template-columns: 8rem minmax(0, 2fr) minmax(0, 3fr); gap: var(--s3); align-items: baseline;
  }
  .cs-points--list .caption + .cs-points__title,
  .cs-points--list p:not(.caption) { margin-top: 0; }
}

/* Problem (Afterwish): same split as the key findings. The right-hand points have no number,
   so their titles sit level with the label on the left. */
.cs-findings--problem .cs-findings__lead .caption { font-family: var(--font-body); }
.cs-findings--problem .cs-findings__rest .cs-findings__text { margin-top: var(--s1); }
.cs-findings--problem .cs-source { margin-top: var(--s2); }

/* One line under a findings block (Afterwish Problem) */
.cs-section > .cs-findings__after { margin-top: var(--s6); font-size: var(--lead); color: var(--text); }

/* A large number set in context (Afterwish: "0 of 4" in the I found box, "41 → 5" above
   the accounts animation). The small part is secondary. "0 of 4" fades in with the box;
   "→ 5" appears once 41 has counted up (script.js adds is-counted). */
.cs-bignum {
  display: block; font-family: var(--font-head); font-weight: 700; font-size: var(--h2);
  line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--text);
}
.cs-bignum small { font-size: 0.5em; font-weight: 600; letter-spacing: -0.01em; color: var(--text-2); }
.cs-contrast .cs-bignum { margin-block: var(--s2) var(--s2); }
.cs-figure > .cs-bignum { margin-bottom: var(--s3); }
[data-count] { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: no-preference) {
  .js .cs-bignum--then small { opacity: 0; transition: opacity 250ms ease; }
  .js .cs-bignum--then.is-counted small { opacity: 1; }
}

/* The discovery (Afterwish Research), after the earlier site: two blocker cards side by side,
   "And yet" highlighted below in the middle (ink card, inverted text), a thin connector line,
   then the How Might We question centered at h4 size with the amber highlight. */
.cs-blockers { display: grid; gap: var(--s3); margin-top: var(--s4); }
.cs-blocker {
  margin: 0; background: var(--surface); border-radius: var(--radius); padding: var(--s3);
}
.cs-blocker__title { font-family: var(--font-head); font-size: var(--h4); font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
.cs-blocker blockquote { margin: var(--s2) 0 0; }
.cs-blocker blockquote p { font-size: var(--lead); line-height: 1.45; }
.cs-blocker__who { margin-top: var(--s2); font-size: var(--caption); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.cs-blocker--yet { background: var(--text); color: var(--bg); }
.cs-blocker--yet .cs-blocker__title { color: var(--bg); }
@media (min-width: 768px) {
  .cs-blockers { grid-template-columns: 1fr 1fr; gap: var(--s3); }
  .cs-blockers .cs-blocker--yet { grid-column: 1 / -1; justify-self: center; width: min(100%, 40rem); padding: var(--s4); }
}
.cs-hmw { margin-top: var(--s4); text-align: center; }
.cs-hmw::before {
  content: ""; display: block; width: 1px; height: var(--s8); margin: 0 auto var(--s4);
  background: var(--line-strong);
}
.cs-hmw__problem { max-width: 52ch; margin-inline: auto; color: var(--text-2); }
.cs-hmw__q {
  margin: var(--s3) auto 0; max-width: 32ch;
  font-family: var(--font-head); font-weight: 600; font-size: var(--h4); line-height: 1.3; letter-spacing: -0.01em;
  text-wrap: balance;
}
.cs-hmw__q .mark { -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* Five concepts (Afterwish Making), after the earlier site: one sand card per lens,
   the selected concept (C4) as an ink card with inverted text. One column on mobile,
   three on tablet and small desktop, five in a row from 1440. */
.cs-concepts { list-style: none; padding: 0; margin-top: var(--s4); display: grid; gap: var(--s2); }
.cs-concept {
  display: flex; flex-direction: column; gap: var(--s1);
  background: var(--surface); border-radius: var(--radius); padding: var(--s3);
}
.cs-concept .caption { color: inherit; }
.cs-concept__code {
  margin-top: var(--s2); font-family: var(--font-head); font-weight: 700; font-size: var(--h3);
  line-height: 1; letter-spacing: -0.015em;
}
.cs-concept__name { font-size: var(--lead); line-height: 1.35; }
.cs-concept__tag {
  align-self: flex-start; margin-top: auto; padding: 4px 10px; transform: translateY(var(--s1));
  font-size: var(--small); line-height: 1.3; border: 1px solid currentColor; border-radius: var(--radius);
}
.cs-concept--selected { background: var(--text); color: var(--bg); }
@media (min-width: 768px) { .cs-concepts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1440px) { .cs-concepts { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* Why C4: two short notes under the concept cards, stacked on mobile,
   side by side from 768 under a dark rule. */
.cs-why {
  display: grid; gap: var(--s3); margin-top: var(--s6);
  padding-top: var(--s3); border-top: 2px solid var(--line-strong);
}
.cs-why .caption + p { margin-top: var(--s1); max-width: 48ch; }
@media (min-width: 768px) { .cs-why { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s6); } }
/* From 768 the C4 card sits on the last row, so a 2px line drops from its center
   to the rule above Why C4. Hidden on mobile, where C5 sits below C4. */
@media (min-width: 768px) {
  .cs-concept--selected { position: relative; }
  .cs-concept--selected::after {
    content: ""; position: absolute; left: 50%; top: 100%;
    width: 2px; height: var(--s6); margin-left: -1px;
    background: var(--line-strong); transform-origin: top;
  }
}
@media (prefers-reduced-motion: no-preference) and (min-width: 768px) {
  .js .cs-concept--selected.reveal::after { transform: scaleY(0); transition: transform 500ms var(--ease) 900ms; }
  .js .cs-concept--selected.reveal.is-in::after { transform: none; }
}

/* Concept cards slide in from the right, one after another. The list clips sideways
   so the cards waiting off to the right never cause a horizontal scroll. */
@media (prefers-reduced-motion: no-preference) {
  .cs-concepts { overflow-x: clip; }
  .js .cs-concept.reveal { transform: translateX(64px); }
  .js .cs-concept.reveal.is-in { transform: none; }
}
@media (prefers-reduced-motion: no-preference) and (min-width: 768px) {
  .js .cs-concept.reveal:nth-child(2) { transition-delay: 120ms; }
  .js .cs-concept.reveal:nth-child(3) { transition-delay: 240ms; }
  .js .cs-concept.reveal:nth-child(5) { transition-delay: 120ms; }
}
@media (prefers-reduced-motion: no-preference) and (min-width: 1440px) {
  .js .cs-concept.reveal:nth-child(4) { transition-delay: 360ms; }
  .js .cs-concept.reveal:nth-child(5) { transition-delay: 480ms; }
}

/* Short note under the pinned flow (Afterwish Making) */
.cs-section > .cs-flow-note { margin-top: var(--s4); color: var(--text-2); }

/* Static fallback for an animation frame: hidden on screen (so it never downloads),
   shown instead of the iframe when the page is printed. Used by the logo blueprint. */
.cs-print-still { display: none; }
@media print {
  .cs-frame .cs-anim { display: none; }
  .cs-frame .cs-print-still { display: block; width: 100%; height: auto; }
}

/* Contact form in the footer of every page: intro on the left, form on the right from desktop.
   Fields are a line, no box. Labels use the caption style. */
.footer__contact { display: grid; gap: var(--s8); }
.footer__lead { margin-top: var(--s3); max-width: 36ch; font-size: var(--lead); color: var(--text-2); }
.contact-form { display: grid; gap: var(--s4); }
.contact-form__field { display: grid; gap: var(--s1); }
.contact-form input,
.contact-form textarea {
  width: 100%; padding: var(--s1) 0; border: 0; border-bottom: 1px solid var(--line-strong); border-radius: 0;
  background: transparent; color: var(--text); font: inherit; font-size: var(--lead);
}
.contact-form textarea { resize: vertical; min-height: 7.5rem; }
.contact-form input:focus-visible,
.contact-form textarea:focus-visible {
  outline: 2px solid var(--interactive); outline-offset: 4px; border-bottom-color: var(--interactive);
}
.contact-form__foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2) var(--s4); }
.contact-form__foot .small { color: var(--text-2); max-width: 46ch; }
.contact-form__send {
  padding: var(--s1) 0; border: 0; background: none; cursor: pointer; color: var(--text);
  font: inherit; font-weight: 700; font-size: var(--small); letter-spacing: 0.08em; text-transform: uppercase;
}
.contact-form__send:hover { color: var(--interactive); }
.contact-form__send:focus-visible { outline: 2px solid var(--interactive); outline-offset: 4px; }
.contact-form__status:empty { display: none; }
@media (min-width: 1024px) {
  .footer__contact { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s8); align-items: start; }
}

/* ---------- Targets case study (Seerene) ---------- */
/* Cover photo fills the 16:9 frame */
.cs-cover img { width: 100%; height: 100%; object-fit: cover; }
/* Product screenshots: flat, no frame, same corners as the rest of the site */
.cs-shot { width: 100%; border-radius: var(--radius); }
/* Four figures in the overview instead of five */
@media (min-width: 1024px) { .cs-glance--four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* Three short points side by side from tablet */
@media (min-width: 768px) { .cs-points--three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Targets results: the Afterwish pinned flow (cs2-pin--panel) with screenshots instead of a phone.
   Image on the left like the Afterwish phone; the panel uses the hero's navy background, drifting slowly. */
.tg-results.cs2-pin--panel .cs2-pin__inline,
.tg-results.cs2-pin--panel .cs2-pin__media {
  background: #1d1a50 url("images/seerene-targets/target-background.jpg") 0% 50% / cover no-repeat;
  animation: tg-drift 24s ease-in-out infinite alternate;
}
@keyframes tg-drift { to { background-position: 100% 50%; } }
.tg-results.cs2-pin--panel .cs2-pin__inline img { display: block; width: 100%; height: auto; max-height: 60svh; object-fit: contain; border-radius: var(--radius); }
@media (min-width: 1024px) {
  .tg-results.cs2-pin { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .tg-results.cs2-pin--panel .cs2-pin__media { order: -1; }
  .tg-results .cs2-pin__screen { inset: var(--s4); }
  .tg-results .cs2-pin__screen > img { object-fit: contain; object-position: center; border-radius: var(--radius); }
}
@media (prefers-reduced-motion: reduce) {
  .tg-results.cs2-pin--panel .cs2-pin__inline, .tg-results.cs2-pin--panel .cs2-pin__media { animation: none; }
}
/* Targets overview numbers in builder card style: four cards need room, so two per row until large desktop */
.cs-glance-cards .cs2-card { padding: 0; background: none; }
@media (min-width: 1024px) { .cs-glance-cards.cs2-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1440px) { .cs-glance-cards.cs2-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Case study opening with a full-bleed background image (Targets).
   Title on the left, screenshot on the right, facts in a row at the bottom.
   The background is always dark, so text is cream in both themes. Cream holds 4.98:1 at the lightest
   point of the image; the secondary gray (#B8B2A8) drops to 2.7:1 there, so the hero never uses it. */
.cs-hero-bg {
  --on-hero: #F2EFE8; --hero-line: rgba(242, 239, 232, 0.28);
  background: #1d1a50 url("images/seerene-targets/target-background.jpg") left center / cover no-repeat;
  color: var(--on-hero);
}
.cs-hero-bg__inner { display: flex; flex-direction: column; padding-block: var(--s6) var(--s6); }
.cs-hero-bg__eyebrow { color: var(--on-hero); }
.cs-hero-bg__main { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: var(--s6); align-items: center; padding-block: var(--s6); }
.cs-hero-bg h1 { color: var(--on-hero); }
.cs-hero-bg .cs-hero__sub { color: var(--on-hero); }
.cs-hero-bg__lead { margin-top: var(--s3); font-size: var(--lead); line-height: 1.55; color: var(--on-hero); max-width: 46ch; }
.cs-hero-bg__shot { position: relative; border-radius: 2.2% / 3.1%; overflow: hidden; }
.cs-hero-bg__shot > img { display: block; width: 100%; height: auto; }
/* Widgets appear one by one: each is a slice of the same screenshot, placed over a patch of the
   dashboard's own gray (#FAFAFA) that hides the widget underneath. Values are pixels of the 1600 x 1125 image. */
.dash-mask, .dash-piece {
  position: absolute; display: none;
  left: calc(var(--x) / 1600 * 100%); top: calc(var(--y) / 1125 * 100%);
  width: calc(var(--w) / 1600 * 100%); height: calc(var(--h) / 1125 * 100%);
}
.dash-mask { background: #FAFAFA; }
.dash-piece { overflow: hidden; }
.dash-piece img {
  position: absolute; max-width: none;
  left: calc(var(--x) / var(--w) * -100%); top: calc(var(--y) / var(--h) * -100%);
  width: calc(1600 / var(--w) * 100%);
}
.dash-piece--fab { border-radius: 50%; }
.js .dash-mask, .js .dash-piece { display: block; }
.js .dash-piece { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease), transform 900ms var(--ease); transition-delay: calc(var(--i) * 160ms); }
.js .dash-piece--fab { transform: scale(0.4); }
.js [data-dash].is-in .dash-piece { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .dash-mask, .js .dash-piece { display: none; }
}
.cs-hero-bg__meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3) var(--s4); padding-top: var(--s3); border-top: 1px solid var(--hero-line); margin: 0; }
.cs-hero-bg__meta dt { color: var(--on-hero); }
.cs-hero-bg__meta dd { margin: var(--s1) 0 0; color: var(--on-hero); }
@media (min-width: 768px) {
  .cs-hero-bg__meta { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .cs-hero-bg__inner { min-height: calc(100svh - 73px); padding-block: var(--s6) var(--s4); }
  .cs-hero-bg__main { flex: 1; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s8); }
}
/* Targets: closing statement at the end of Results. Sand panel, H3-size line with an amber band, body below */
.tg-closing {
  margin-top: var(--s8); padding: var(--s4) var(--s3);
  background: var(--surface); border-radius: var(--radius);
}
.tg-closing__line {
  margin-top: var(--s3); max-width: 24ch;
  font-family: var(--font-head); font-weight: 600; font-size: var(--h3); line-height: 1.2; letter-spacing: -0.015em;
  color: var(--text); text-wrap: balance;
}
.tg-closing__body { margin-top: var(--s3); max-width: 50ch; font-size: var(--lead); line-height: 1.55; color: var(--text-2); }
@media (min-width: 768px) { .tg-closing { padding: var(--s6); } }
@media (min-width: 1024px) { .tg-closing { padding: var(--s8); } }
/* Targets: one text size for the page. The hero description stays at lead size (20px);
   every description in the case study sections, and the hero facts, are 16px. Captions,
   small text, labels, numbers and headings keep their own sizes. */
.page-targets .cs-hero-bg__meta dd,
.page-targets article :is(p, li, dd):not(.caption, .small, .p-small, .label, .cs2-stat__num, .cs-decisions__num, .tg-closing__line) {
  font-size: 16px;
}
/* Targets: the roadmap is square, so it stays at a readable size instead of filling the column */
/* User permissions, Research: what Customer Success asked for, a numbered list with big bold numbers.
   Each row has .reveal, so it fades in on its own as it scrolls into view. */
.up-asks { list-style: none; padding: 0; margin: var(--s4) 0 0; display: grid; }
.up-asks li {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s3); align-items: start;
  border-top: 2px solid var(--line-strong); padding-block: var(--s3);
}
/* the number column is sized in the number's own font (2ch), so the title never runs under it */
.up-asks__num { min-width: 2ch; font-family: var(--font-head); font-weight: 700; font-size: var(--h2); line-height: 1; letter-spacing: -0.02em; color: var(--text); }
.up-asks h4 { font-size: var(--h4); line-height: 1.3; letter-spacing: -0.01em; }
.up-asks p { margin-top: var(--s1); color: var(--text-2); }

@media (min-width: 1024px) {
  .up-asks li { gap: var(--s4); padding-block: var(--s4); }
}

/* User permissions, Problem: the three goals from the original Challenge slide.
   Header card on the sand surface, details in an outlined panel tucked under it.
   Columns rise in one after another (--d), then each panel slides out from under its card. */
.up-goals { list-style: none; padding: 0; margin: var(--s4) 0 0; display: grid; gap: var(--s4); }
.up-goal { display: flex; flex-direction: column; }
.up-goal.reveal { transition-delay: var(--d, 0ms); }
.up-goal__head { position: relative; z-index: 1; background: var(--surface); border-radius: var(--radius); padding: var(--s3); }
.up-goal__num { display: block; font-family: var(--font-head); font-weight: 700; font-size: var(--h2); line-height: 1; letter-spacing: -0.02em; }
.up-goal__head h4 { margin-top: var(--s2); font-size: var(--h4); line-height: 1.3; letter-spacing: -0.01em; }
.up-goal__head p { margin-top: var(--s1); color: var(--text-2); }
.up-goal__body {
  flex: 1; margin: calc(var(--s2) * -1) var(--s2) 0; padding: calc(var(--s2) + var(--s3)) var(--s3) var(--s3);
  border: 1px solid var(--line-strong); border-top: 0; border-radius: 0 0 var(--radius) var(--radius);
  display: grid; gap: var(--s2); align-content: start; font-size: var(--small); color: var(--text-2);
}
.up-goal__body em { font-style: normal; font-weight: 700; color: var(--text); }
.up-goal__body ul { margin: 0; padding-left: 1.1em; display: grid; gap: var(--s1); }
.up-goal__abc { list-style: lower-alpha; }
.js .up-goal.reveal .up-goal__body { opacity: 0; transform: translateY(-24px); transition: opacity var(--slow) var(--ease), transform var(--slow) var(--ease); transition-delay: calc(var(--d, 0ms) + 400ms); }
.js .up-goal.reveal.is-in .up-goal__body { opacity: 1; transform: none; }

/* Large screens: the Challenge text, illustration and goals share one 3-column grid.
   The goals step down in a diagonal (01 highest, 03 lowest) and the illustration
   fills the empty corner above 03, so the section loses its empty block.
   Below 1440px the article column is too narrow for three goals side by side, so they stack. */
@media (min-width: 1440px) {
  .up-chal { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--s3); align-items: start; }
  .up-chal .up-side, .up-chal .up-goals { display: contents; }
  .up-chal .up-side > p { grid-column: 1 / 3; grid-row: 1; margin-top: var(--s3); }
  .up-chal .cs-subhead { grid-column: 1 / 3; grid-row: 2; }
  .up-chal .up-side__art { grid-column: 3; grid-row: 3; z-index: 0; width: 100%; max-width: none; justify-self: stretch; }
  .up-chal .up-goal { grid-row: 3; margin-top: var(--s4); }
  .up-chal .up-goal:nth-child(1) { grid-column: 1; }
  .up-chal .up-goal:nth-child(2) { grid-column: 2; margin-top: calc(var(--s4) + 160px); }
  .up-chal .up-goal:nth-child(3) { grid-column: 3; margin-top: calc(var(--s4) + 340px); position: relative; z-index: 1; }
}

/* User permissions, Research: typewriter micro animation.
   Four lines are typed onto the blank sheet one after another (each grows from the left),
   a caret blinks at the end of the line being typed, then the sheet clears and it starts again.
   One 8s loop: each line takes 1s, the full page holds, then everything fades. Runs once the image is in view. */
.up-type { position: relative; }
.up-type img { display: block; width: 100%; height: auto; }
.up-type__layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.up-type__line { fill: #E1EBF7; transform-box: fill-box; transform-origin: left center; transform: scaleX(0); }
.up-type__caret { fill: #4A4FBF; opacity: 0; }
/* every line runs on the same 8s timeline (no delays), so the loop never drifts out of step */
.up-type.is-in .up-type__line { animation: 8s linear infinite; }
.up-type.is-in .up-type__line:nth-child(1) { animation-name: up-type-line-1; }
.up-type.is-in .up-type__line:nth-child(2) { animation-name: up-type-line-2; }
.up-type.is-in .up-type__line:nth-child(3) { animation-name: up-type-line-3; }
.up-type.is-in .up-type__line:nth-child(4) { animation-name: up-type-line-4; }
.up-type.is-in .up-type__caret { animation: up-type-caret 8s linear infinite, up-type-blink 0.6s steps(1) infinite; }

@keyframes up-type-line-1 {
  0% { transform: scaleX(0); opacity: 1; animation-timing-function: steps(14, end); }
  12.5% { transform: scaleX(1); animation-timing-function: linear; }
  80% { transform: scaleX(1); opacity: 1; }
  90%, 100% { transform: scaleX(1); opacity: 0; }
}
@keyframes up-type-line-2 {
  0%, 12.5% { transform: scaleX(0); opacity: 1; animation-timing-function: steps(14, end); }
  25.0% { transform: scaleX(1); animation-timing-function: linear; }
  80% { transform: scaleX(1); opacity: 1; }
  90%, 100% { transform: scaleX(1); opacity: 0; }
}
@keyframes up-type-line-3 {
  0%, 25.0% { transform: scaleX(0); opacity: 1; animation-timing-function: steps(14, end); }
  37.5% { transform: scaleX(1); animation-timing-function: linear; }
  80% { transform: scaleX(1); opacity: 1; }
  90%, 100% { transform: scaleX(1); opacity: 0; }
}
@keyframes up-type-line-4 {
  0%, 37.5% { transform: scaleX(0); opacity: 1; animation-timing-function: steps(14, end); }
  50.0% { transform: scaleX(1); animation-timing-function: linear; }
  80% { transform: scaleX(1); opacity: 1; }
  90%, 100% { transform: scaleX(1); opacity: 0; }
}
/* the caret follows the end of each line: x and y set in the overlay's own units */
@keyframes up-type-caret {
  0% { transform: translate(0, 0); }
  12.5% { transform: translate(336px, 0); }
  12.6% { transform: translate(0, 54px); }
  25% { transform: translate(286px, 54px); }
  25.1% { transform: translate(0, 108px); }
  37.5% { transform: translate(346px, 108px); }
  37.6% { transform: translate(0, 162px); }
  50%, 100% { transform: translate(216px, 162px); }
}
@keyframes up-type-blink { 0% { opacity: 1; } 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .up-type.is-in .up-type__line, .up-type .up-type__line { animation: none; transform: none; }
  .up-type.is-in .up-type__caret { animation: none; opacity: 0; }
}

/* User permissions: big image right under the header */
.cs2-sec.up-hero { padding-bottom: 0; }
.up-showcase { margin: var(--s4) 0 0; }
.up-showcase img { display: block; width: 100%; height: auto; }

/* User permissions, Challenge and Research: intro text with a decorative illustration beside it */
.up-side { display: grid; gap: var(--s4); margin-top: var(--s3); align-items: start; }
.up-side > p { margin: 0; }
.up-side__art { display: block; width: 100%; max-width: 320px; height: auto; justify-self: center; }

@media (min-width: 768px) {
  .up-side__art { max-width: 380px; }
}

@media (min-width: 1024px) {
  .up-side { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--s6); }
  .up-side__art { max-width: none; }
}

.tg-roadmap { max-width: 560px; }
/* Targets: roadmap next to its three phases. Stacked on mobile and tablet, side by side from 1024px */
.tg-roadmap-wrap { display: grid; gap: var(--s4); margin-top: var(--s4); align-items: center; }
.tg-roadmap-wrap .tg-roadmap { margin: 0; }
.tg-roadmap figcaption { margin-top: var(--s2); }
.tg-phases { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s3); }
.tg-phases li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s2); border-top: 2px solid var(--line-strong); padding-top: var(--s2); }
.tg-phases__num { font-family: var(--font-head); font-weight: 700; font-size: var(--h3); line-height: 1; letter-spacing: -0.015em; min-width: 1.2ch; }
.tg-phases h4 { margin-top: var(--s1); }
.tg-phases p:not(.caption) { margin-top: var(--s1); color: var(--text-2); }
@media (min-width: 1024px) { .tg-roadmap-wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s6); } }

/* Targets 02 Ideate: Jobs to be Done infographic. Three job stories (When, I want to, So I can)
   on white product cards, joined by cyan lines that meet in one indigo node: the feature.
   Colors come from the Seerene product (same values as the card anatomy animation), on request,
   so the infographic reads as part of the product rather than the portfolio. */
.tg-jtbd {
  --sr-indigo: #1d1a50; --sr-indigo-2: #2a2463; --sr-cyan: #14a5e8; --sr-green: #10a35a; --sr-mint: #b2e7cb;
  --sr-ink: #222326; --sr-ink-2: #6b6d72; --sr-rule: #d4d5d8; --sr-card: #ffffff;
  margin: var(--s6) 0 0;
}
.tg-jtbd__tag { display: inline-block; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); }
.tg-jtbd__cards { list-style: none; padding: 0; margin: var(--s4) 0 0; display: grid; gap: var(--s3); }
.tg-jtbd__card { display: grid; align-content: start; gap: var(--s2); padding: var(--s4) var(--s3); background: var(--sr-card); border: 1px solid var(--sr-rule); border-radius: var(--radius); color: var(--sr-ink); }
.tg-jtbd__card :is(.caption, h3, dt) { color: var(--sr-ink); }
.tg-jtbd__head { display: flex; align-items: center; justify-content: space-between; }
.tg-jtbd__icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--radius); background: var(--sr-indigo); color: #ffffff; }
.tg-jtbd__icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tg-jtbd__role { font-size: var(--h4); line-height: 1.3; letter-spacing: -0.01em; margin-top: var(--s1); }
/* The story reads down a cyan line, one dot per step; the last dot, the outcome, is Seerene's On track green */
.tg-jtbd__story { margin: var(--s2) 0 0; display: grid; gap: var(--s2); position: relative; padding-left: var(--s3); }
.tg-jtbd__story::before { content: ""; position: absolute; left: 4px; top: 8px; bottom: 8px; width: 2px; background: var(--sr-cyan); }
.tg-jtbd__story > div { position: relative; }
.tg-jtbd__story > div::before { content: ""; position: absolute; left: calc(-1 * var(--s3)); top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--sr-cyan); }
.tg-jtbd__story > div:last-child::before { background: var(--sr-green); }
.tg-jtbd__story dd { margin: 2px 0 0; color: var(--sr-ink-2); }
.tg-jtbd__lines { display: none; }
.tg-jtbd__goal { max-width: none; margin: var(--s3) auto 0; width: fit-content; display: grid; justify-items: center; gap: 2px;
  padding: var(--s2) var(--s4); border-radius: var(--radius); background: linear-gradient(160deg, var(--sr-indigo) 0%, var(--sr-indigo-2) 100%); color: #ffffff; }
.tg-jtbd__goal .caption { color: var(--sr-mint); }
.tg-jtbd__goal strong { font-family: var(--font-head); font-weight: 700; font-size: var(--h3); line-height: 1.1; letter-spacing: -0.015em; }
.js .tg-jtbd__card.reveal { transition-delay: calc(var(--i) * 120ms); }
@media (min-width: 1024px) {
  .tg-jtbd__cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* Lines from the bottom of each card meet in the feature node; they draw in when they scroll into view */
  .tg-jtbd__lines { display: block; width: 100%; height: 64px; overflow: visible; }
  .tg-jtbd__lines path { fill: none; stroke: var(--sr-cyan); stroke-width: 2; vector-effect: non-scaling-stroke; }
  .js .tg-jtbd__lines.reveal { opacity: 1; transform: none; }
  .js .tg-jtbd__lines.reveal path { stroke-dasharray: 1000; stroke-dashoffset: 1000; transition: stroke-dashoffset 900ms var(--ease) 300ms; }
  .js .tg-jtbd__lines.reveal.is-in path { stroke-dashoffset: 0; }
  .tg-jtbd__goal { margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .js .tg-jtbd__lines.reveal path { stroke-dashoffset: 0; transition: none; }
}

/* ---------- Seerene gallery (work/seerene-visuals.html) ----------
   A gallery rather than a case study: no index, sections of images with a short intro each.
   Images are flat, no frames or shadows; they keep Seerene's own colors. */
/* Showcase menu: its own drop-down from tablet up. On phones the top bar has no room for a
   second button, so Showcase shows as a group at the end of the Case Studies menu instead. */
.dropdown--showcase { display: none; }
@media (min-width: 768px) {
  .dropdown--showcase { display: block; }
  /* the Showcase button sits near the right edge, so its panel opens toward the left */
  .dropdown--showcase .dropdown__panel { left: auto; right: calc(var(--s2) * -1); }
  .dropdown__phone-only { display: none; }
}
.dropdown__group {
  margin-top: var(--s2); padding: var(--s1) var(--s2) 0;
  font-weight: 700; font-size: var(--caption); text-transform: uppercase; letter-spacing: 0.08em; color: var(--text);
}
.cs-more { margin-top: var(--s6); }
.cs-more a { color: var(--interactive); text-decoration: underline; text-underline-offset: 3px; }

.gallery-page { padding-block: var(--s8) var(--section); }
.gallery-section + .gallery-section { margin-top: var(--s12); }
.gallery-section h2 { max-width: 20ch; margin-top: var(--s3); }
.gallery-section > p:not(.caption) { margin-top: var(--s3); max-width: 65ch; }

.gallery { list-style: none; padding: 0; margin-top: var(--s6); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4) var(--s3); }
@media (min-width: 768px) {
  .gallery--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.gallery__item { display: block; border-radius: var(--radius); overflow: hidden; cursor: zoom-in; }
.gallery__item img { display: block; width: 100%; height: auto; aspect-ratio: 1600 / 968; object-fit: cover; transition: transform var(--fast) var(--ease); }
.gallery--3 .gallery__item img { aspect-ratio: 16 / 9; }
.cs-figure .gallery__item img { aspect-ratio: auto; }
.gallery__item:hover img { transform: scale(1.02); }
/* Seerene visuals header: the platform layers from the old homepage, on the dotted indigo panel.
   On load the layers rise into place one after another, bottom to top, then each floats gently on its own rhythm.
   Rise uses transform and opacity, the float uses translate, so the two animations never overwrite each other. */
.vis-hero { display: grid; gap: var(--s6); align-items: center; }
.vis-hero .cs-meta { grid-column: 1 / -1; }
.vis-layers {
  position: relative; width: 100%; max-width: 420px; justify-self: center; aspect-ratio: 1039 / 1107;
  overflow: hidden; border-radius: 8px 100px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.14) 1.2px, transparent 1.6px) 0 0 / 18px 18px,
    linear-gradient(100deg, #474abe 12%, #20214f 68%);
}
.vis-layers__layer { position: absolute; left: 25.31%; top: 4.63%; width: 49.28%; height: 90.05%; max-width: none; }
@media (prefers-reduced-motion: no-preference) {
  .vis-layers__layer {
    opacity: 0;
    animation: vis-rise 0.9s var(--ease) both, vis-float 6s ease-in-out infinite;
    animation-delay: calc(0.3s + var(--n) * 0.35s), calc(1.8s + var(--n) * 0.4s);
  }
}
@keyframes vis-rise { from { opacity: 0; transform: translateY(6%); } to { opacity: 1; transform: none; } }
@keyframes vis-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 calc(-4px - var(--n) * 2px); } }
@media (min-width: 768px) {
  .vis-layers { max-width: 460px; }
}
@media (min-width: 1024px) {
  .vis-hero { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: var(--s8); }
  .vis-layers { max-width: none; }
}

/* Posters and infographics (Seerene visuals): one column on phones; from desktop the tall poster
   fills the left column, two infographics stack on the right, the race track runs full width below. */
.poster-grid { display: grid; gap: var(--s6) var(--s4); margin-top: var(--s6); }
.poster-grid__item { margin: 0; }
.poster-grid .gallery__item img { aspect-ratio: auto; }
@media (min-width: 1024px) {
  .poster-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .poster-grid__item--tall { grid-row: span 2; }
  .poster-grid__item--wide { grid-column: 1 / -1; }
}
.gallery__caption { margin-top: var(--s1); font-size: var(--small); color: var(--text-2); }

.icon-grid {
  list-style: none; padding: var(--s4) var(--s3); margin-top: var(--s6);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3);
  background: var(--surface); border-radius: var(--radius); max-width: 720px;
}
.icon-grid img { display: block; width: 100%; max-width: 112px; height: auto; margin-inline: auto; }
@media (min-width: 768px) { .icon-grid { padding: var(--s6); gap: var(--s4); } }

.lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: var(--s8) var(--s2) var(--s4);
  border: 0; background: rgba(34, 32, 31, .94); color: var(--cream);
}
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: transparent; }
.lightbox__figure { margin: 0; display: grid; justify-items: center; gap: var(--s2); max-width: 100%; }
.lightbox__img { display: block; max-width: 100%; max-height: calc(100vh - 180px); width: auto; height: auto; border-radius: var(--radius); }
.lightbox__caption { font-size: var(--small); color: var(--cream); }
.lightbox__btn {
  position: absolute; display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  background: transparent; color: var(--cream); border: 1px solid rgba(242, 239, 232, .4); border-radius: var(--radius); cursor: pointer;
  transition: border-color var(--fast) var(--ease);
}
.lightbox__btn:hover { border-color: var(--cream); }
.lightbox__btn:focus-visible { outline: 2px solid #8F87FF; outline-offset: 3px; }
.lightbox__btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lightbox__close { top: var(--s2); right: var(--s2); }
.lightbox__prev, .lightbox__next { bottom: var(--s2); }
.lightbox__prev { left: calc(50% - 52px); }
.lightbox__next { right: calc(50% - 52px); }
.lightbox__btn[hidden] { display: none; }
@media (min-width: 1024px) {
  .lightbox { padding: var(--s8) var(--s12); }
  .lightbox__prev, .lightbox__next { bottom: auto; top: 50%; transform: translateY(-50%); }
  .lightbox__prev { left: var(--s4); }
  .lightbox__next { right: var(--s4); }
}
@media (prefers-reduced-motion: reduce) { .gallery__item img { transition: none; } .gallery__item:hover img { transform: none; } }

/* ---------- Resume Mentor (work/resume-mentor.html) ---------- */
.rm-cover { margin: 0; }
.rm-cover img { display: block; width: 100%; height: auto; border-radius: var(--radius); }

/* Figures that open in the lightbox keep the image's own proportions */
.cs-figure > .gallery__item img { aspect-ratio: auto; }

/* UI kit: three tall boards, cropped to the same height (top kept), each opens full size.
   Phones stack them, so the crop is shorter there. */
.rm-kit .gallery__item img,
.gallery--3.rm-kit .gallery__item img { aspect-ratio: 4 / 5; object-fit: cover; object-position: top; }
@media (min-width: 768px) {
  .rm-kit .gallery__item img,
  .gallery--3.rm-kit .gallery__item img { aspect-ratio: 3 / 5; }
}
.rm-kit .reveal { transition-delay: var(--d, 0ms); }

/* Glyphs: 11 pictures, so 4 / 6 columns leave one tidy last row.
   Micro animation: the glyphs rise in one after another, then take turns giving a
   small hop, one every 0.6s, so a slow wave runs through the set. Hover lifts one. */
.rm-glyphs { max-width: none; }
.rm-glyphs img { max-width: 96px; }
@media (min-width: 768px) { .rm-glyphs { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.js .rm-glyphs.reveal { opacity: 1; transform: none; }
.rm-glyphs li { transition: transform var(--fast) var(--ease); }
.rm-glyphs li:hover { transform: translateY(-6px); }
.js .rm-glyphs.reveal li { opacity: 0; translate: 0 32px; transition: opacity 600ms var(--ease), translate 700ms var(--ease), transform var(--fast) var(--ease); transition-delay: calc(var(--i) * 60ms), calc(var(--i) * 60ms), 0ms; }
.js .rm-glyphs.reveal.is-in li { opacity: 1; translate: 0 0; }
.rm-glyphs.is-in img { animation: rm-hop 6.6s var(--ease) infinite; animation-delay: calc(1.4s + var(--i) * 0.6s); }
@keyframes rm-hop {
  0%, 9%, 100% { transform: none; }
  4% { transform: translateY(-8px); }
}
@media (prefers-reduced-motion: reduce) {
  .js .rm-glyphs.reveal li { opacity: 1; translate: 0 0; transition: none; }
  .rm-glyphs.is-in img { animation: none; }
  .rm-glyphs li:hover { transform: none; }
}

/* Design system collage: the collage from case-study-v2.css with the Resume Mentor
   tokens. These colors, the pill button and Work Sans belong to the product, not to the site. */
.rm-ds {
  --bg-dark: #381757;
  --text-on-dark: #FFFFFF;
  --accent: #A54ED1;
  --accent-light: #FFBB42;
  --text-headline: #1A1722;
  --text-secondary: #76747A;
  --text-disabled: #D1D1D3;
  --bg-surface: #F7EDE8;
  --bg-gray-panel: #F4F4F4;
  --hairline: #D1D1D3;
  --font-heading: "Work Sans", system-ui, sans-serif;
  margin-top: var(--s6);
}
.rm-ds .ds-btn { border-radius: 999px; background: linear-gradient(90deg, #381757 55%, #A54ED1); font-family: "Work Sans", system-ui, sans-serif; }
.rm-ds .ds-chip { border-radius: 999px; }
.rm-ds .ds-input { border-radius: 8px; background: #FFFFFF; }
.rm-ds .ds-tile--violet .ds-check__box { background: #FFFFFF; }

/* Corners tile: the five radii, growing one after another */
.rm-corners { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.rm-corners span { display: block; width: calc(20px + var(--i) * 6px); aspect-ratio: 1; border: 1.5px solid #381757; border-radius: var(--r); background: #FFFFFF; }
.rm-corners__note { position: absolute; left: var(--s-4); right: var(--s-4); bottom: 20px; margin: 0; font-size: 13px; color: var(--text-secondary); }
.cs2-js .rm-ds .rm-corners span { transition: transform 0.6s var(--ease); transition-delay: calc(0.3s + var(--i) * 90ms); transform-origin: bottom left; }
.cs2-js .rm-ds:not(.is-in) .rm-corners span { transform: scale(0); }
.rm-ds.is-in .rm-corners span { animation: rm-corner 5s var(--ease) infinite; animation-delay: calc(1.5s + var(--i) * 0.25s); }
@keyframes rm-corner {
  0%, 16%, 100% { border-color: #381757; }
  6%, 10% { border-color: #A54ED1; background: #F3E6FA; }
}

/* Alerts tile: the four status colors light up in turn */
.rm-alerts { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.rm-alerts span { outline-offset: -1.5px; display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 8px; background: #FFFFFF; font-size: 12px; line-height: 16px; color: var(--text-headline); }
.rm-alerts span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.rm-ds.is-in .rm-alerts span { animation: rm-alert 4s linear infinite; }
.rm-ds.is-in .rm-alerts span:nth-child(2) { animation-delay: 1s; }
.rm-ds.is-in .rm-alerts span:nth-child(3) { animation-delay: 2s; }
.rm-ds.is-in .rm-alerts span:nth-child(4) { animation-delay: 3s; }
@keyframes rm-alert {
  0%, 25%, 100% { outline: 1.5px solid transparent; }
  5%, 20% { outline: 1.5px solid var(--c); }
}
@media (prefers-reduced-motion: reduce) {
  .rm-ds .rm-corners span, .rm-ds .rm-alerts span { animation: none !important; transform: none !important; }
}

/* Preference test: one dot per participant, so each row is as long as its vote.
   Resume Mentor takes the project accent, Enhancv the text color, Zety the secondary text. */
.vote { margin: var(--s6) 0 0; padding: var(--s3); background: var(--surface); border-radius: var(--radius); }
.vote__question { margin: 0; font-family: var(--font-head); font-weight: 600; font-size: var(--h4); line-height: 1.3; letter-spacing: -0.01em; }
.vote__note { margin-top: var(--s1); color: var(--text-2); }
.vote__rows { display: grid; gap: var(--s3); margin-top: var(--s4); padding: 0; list-style: none; }
.vote__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name result" "dots dots"; align-items: baseline; gap: var(--s1) var(--s2); }
.vote__name { grid-area: name; font-weight: 500; }
.vote__result { grid-area: result; white-space: nowrap; }
.vote__pct { font-family: var(--font-head); font-weight: 700; font-size: var(--h4); line-height: 1; font-variant-numeric: tabular-nums; }
.vote__people { margin-left: var(--s1); font-size: var(--small); color: var(--text-2); }
/* 23 columns, the biggest vote, so every row shares one scale and never wraps */
.vote__dots { grid-area: dots; display: grid; grid-template-columns: repeat(23, minmax(0, 1fr)); gap: 3px; max-width: calc(23 * 22px); }
.vote__dots span { aspect-ratio: 1; border-radius: 50%; background: var(--dot); }
.vote__row--rm { --dot: var(--amber); }
.vote__row--enhancv { --dot: var(--text); }
.vote__row--zety { --dot: var(--text-2); }
.js .vote.reveal .vote__dots span { transform: scale(0); transition: transform 350ms var(--ease); transition-delay: calc(300ms + var(--i) * 45ms); }
.js .vote.reveal.is-in .vote__dots span { transform: none; }
@media (min-width: 768px) {
  .vote { padding: var(--s6); }
  .vote__dots { gap: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  .js .vote.reveal .vote__dots span { transform: none; transition: none; }
}
/* Resume Mentor collage: labels stay readable on the light product tiles in both themes,
   and long color names (Eucalyptus) wrap instead of running into the next one */
.rm-ds .ds-tile > .label { color: var(--text-headline); }
.rm-ds .ds-tile--dark > .label { color: var(--accent-light); }
.rm-ds .ds-pal { font-size: 12px; }
.rm-ds .ds-pal > span { overflow-wrap: anywhere; }
.rm-ds .ds-pal small { white-space: nowrap; }
.rm-ds .ds-btn { min-width: 0; padding: 0 18px; }
/* On tablet the color tile spans the full width, so the chips cap their height to stay inside it */
@media (min-width: 768px) {
  .rm-ds .ds-pal::before { max-height: 56px; }
}

/* ---------- Password page (password.html) ----------
   Same plain hero as the case studies, with one field in the contact form's line style */
.gate { padding-block: var(--s8) var(--section); }
.gate h1 { max-width: 16ch; margin-top: var(--s3); }
.gate .lead { margin-top: var(--s4); max-width: 52ch; }
.gate__form { margin-top: var(--s6); max-width: 420px; }
.gate__error { color: var(--text); font-weight: 500; }
.gate__error[hidden] { display: none; }
.gate input[aria-invalid="true"] { border-bottom: 2px solid var(--text); }
