/* ==========================================================
   Portfolio design system
   ========================================================== */
:root {
  --bg: #01010D;
  --surface: #08081A;
  --surface-2: #0E0E26;
  --line: rgba(236, 236, 243, 0.10);
  --line-strong: rgba(236, 236, 243, 0.18);
  --text: #ECECF3;
  --muted: #A3A3B8;      /* 8.3:1 on --bg */
  --label: #8A8AA3;      /* 5.9:1 on --bg, small uppercase labels */
  --purple: #6331FB;     /* glows, borders, large text only */
  --mint: #88F9C0;

  --serif: "Yeseva One", "Georgia", "Times New Roman", serif;
  --sans: "Josefin Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 82rem;
  --gutter: clamp(1.25rem, 4.5vw, 4.5rem);
  --section: clamp(5rem, 11vw, 9rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; text-wrap: balance; }
p, li, dd, figcaption { text-wrap: pretty; }
p { margin: 0; }

:focus-visible { outline: 2px solid var(--mint); outline-offset: 4px; border-radius: 4px; }

.skip {
  position: absolute; left: 1rem; top: -5rem; z-index: 100;
  background: var(--mint); color: var(--bg); padding: .7rem 1rem; border-radius: 999px;
  font-family: var(--sans); font-size: .8rem; text-decoration: none;
}
.skip:focus { top: 1rem; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.page { position: relative; z-index: 1; overflow-x: clip; }

/* Cursor glow layer sits behind content */
.cursor-layer { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.glow-cursor { position: fixed; inset: 0; overflow: hidden; }
.glow-cursor__canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* ---------- Type helpers ---------- */
.label {
  font-family: var(--sans); font-size: .75rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--label);
}
.label.mint { color: var(--mint); }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--mint); margin-right: .7em; vertical-align: .1em; box-shadow: 0 0 10px var(--mint); }
.accent { color: var(--mint); }
.display { font-family: var(--serif); line-height: .95; letter-spacing: -.02em; }

.eyebrow { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.eyebrow .num { color: var(--mint); }
.eyebrow .rule { width: 2.5rem; height: 1px; background: var(--line-strong); }

.section-title { font-family: var(--serif); font-size: clamp(2.4rem, 4.6vw, 3.75rem); line-height: 1; letter-spacing: -.02em; }

.arrow-link {
  font-family: var(--sans); font-size: .75rem; letter-spacing: .16em; text-transform: uppercase;
  text-decoration: none; color: var(--muted); display: inline-flex; gap: .6em; align-items: center;
  border-bottom: 1px solid transparent; padding-bottom: .2em;
}
.arrow-link:hover { color: var(--text); border-bottom-color: var(--text); }

/* ---------- Buttons (StarBorder base) ---------- */
.star-border {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  margin: 0; padding: .85rem 1.4rem; border: 0;
  border-radius: var(--star-border-radius, 999px);
  background: var(--star-border-surface, transparent);
  color: var(--star-border-text, var(--text));
  font-family: var(--sans); font-size: .75rem; letter-spacing: .16em; text-transform: uppercase;
  line-height: 1.25; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.star-border::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 var(--star-border-thickness, 1px) var(--star-border-track, var(--line-strong));
}
.star-border__light {
  position: absolute; top: -48px; left: -48px; z-index: -1;
  width: calc(100% + 96px); height: calc(100% + 96px); pointer-events: none;
}
.star-border:focus-visible { outline: 2px solid var(--mint); outline-offset: 4px; }
.btn-primary { --star-border-surface: var(--mint); --star-border-text: var(--bg); font-weight: 600; }
.btn-primary:focus-visible { outline-color: var(--text); }
.btn-ghost { --star-border-surface: rgba(1, 1, 13, .6); }
.btn-small { padding: .6rem 1.1rem; }

/* ---------- Header ---------- */
.site-head { position: absolute; top: 0; left: 0; right: 0; z-index: 10; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 5.5rem; gap: 1rem; }
.brand { text-decoration: none; display: inline-flex; align-items: center; }
.brand-name { font-family: "Sarina", var(--serif), Georgia, serif; font-weight: 400; font-size: 2.25rem; line-height: 1; letter-spacing: 0; text-transform: none; color: var(--text); }
.site-nav { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.25rem); }
.site-nav a.nav-link { text-decoration: none; color: var(--muted); }
.site-nav a.nav-link:hover, .site-nav a.nav-link[aria-current="page"] { color: var(--text); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; padding-top: 5.5rem; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 80% 70% at 30% 35%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 30% 35%, #000 20%, transparent 75%);
  opacity: .45;
}
.hero::after {
  content: ""; position: absolute; pointer-events: none;
  width: 70vw; height: 70vw; max-width: 1100px; max-height: 1100px;
  left: -25vw; top: -20vw;
  background: radial-gradient(circle, rgba(99, 49, 251, .38), rgba(99, 49, 251, 0) 62%);
}
.hero .wrap { position: relative; z-index: 1; width: 100%; }
/* Hero background: LetterGlitch canvas, behind the content */
.hero-glitch { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.hero-glitch .letter-glitch-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.hero-strip { position: relative; z-index: 1; }
.hero-main { flex: 1; display: flex; align-items: center; padding: clamp(3rem, 8vh, 6rem) 0; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 2rem 3rem; }
.hero h1 { font-size: clamp(3.25rem, 8.6vw, 8.5rem); max-width: 11ch; }
.hero-intro { margin-top: 2.25rem; max-width: 34rem; color: var(--muted); font-size: 1.25rem; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; }

/* Keyword (TechText) */
.kw { position: relative; display: inline-block; }
.kw-text { position: relative; }
.kw.tt-ready .kw-text { color: transparent; }
.kw-layer { position: absolute; z-index: 2; touch-action: pan-y; user-select: none; }
.tech-text { position: absolute; }
.tech-text-canvas { display: block; width: 100%; height: 100%; }

.hero-strip { border-top: 1px solid var(--line); }
.hero-strip .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; flex-wrap: wrap; }
.skills .mint { color: var(--mint); }
.skills li { display: inline-flex; align-items: center; gap: .55rem; }
.skill-icon { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.skills { display: flex; flex-wrap: wrap; gap: .5rem 2.25rem; list-style: none; margin: 0; padding: 0; }

/* Ticker */
.ticker { position: relative; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; display: flex; align-items: center; }
.ticker-track { display: flex; width: max-content; animation: ticker 40s linear infinite; }
.ticker-list { display: flex; list-style: none; margin: 0; padding: 1.1rem 0; }
.ticker-list li { display: flex; align-items: center; white-space: nowrap; padding: 0 2rem; }
.ticker-list li::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--mint); margin-left: 4rem; }
.ticker.is-paused .ticker-track { animation-play-state: paused; }
.ticker-toggle {
  position: absolute; right: var(--gutter); top: 50%; transform: translateY(-50%);
  background: var(--bg); border: 1px solid var(--line-strong); color: var(--muted);
  border-radius: 999px; padding: .4rem .8rem; cursor: pointer;
}
.ticker-toggle:hover { color: var(--text); }
@keyframes ticker { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation-play-state: paused; } }

/* ---------- Sections ---------- */
.section { padding: var(--section) 0; border-top: 1px solid var(--line); position: relative; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; flex-wrap: wrap; padding-bottom: 2.5rem; border-bottom: 1px solid var(--line); }

/* Selected work: stacked cards (ScrollStack) */
.work-list { position: relative; padding-top: 2.5rem; display: grid; gap: 1.25rem; }
.scroll-stack.is-stacked { display: block; }
.scroll-stack__slot { position: sticky; }
.scroll-stack-card {
  position: relative; box-sizing: border-box; width: 100%;
  border-radius: 20px; border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: 0 -12px 40px -16px rgba(0, 0, 0, .6), 0 24px 48px -24px rgba(0, 0, 0, .6);
  transform-origin: 50% 0; will-change: transform;
  transition: border-color .3s ease;
}
.scroll-stack-card__shade {
  position: absolute; inset: 0; border-radius: inherit; background: #000;
  opacity: var(--scroll-stack-dim, 0); pointer-events: none; z-index: 2;
}
.work-row {
  display: grid; grid-template-columns: 3rem minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 2rem; align-items: center; padding: clamp(1.25rem, 2.6vw, 2.25rem);
}
.work-row .idx { align-self: start; padding-top: .4rem; }
.work-row h3 { font-family: var(--serif); font-size: clamp(2rem, 3.4vw, 2.75rem); line-height: 1.05; letter-spacing: -.015em; }
.work-row h3 a { text-decoration: none; }
.work-row h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.work-row h3 a:focus-visible { outline: none; }
.work-row:has(h3 a:focus-visible) { outline: 2px solid var(--mint); outline-offset: 4px; }
.work-row .tags { display: flex; gap: .9rem; align-items: center; margin: 1rem 0 1.1rem; flex-wrap: wrap; }
.work-row .tags .rule { width: 2rem; height: 1px; background: var(--line-strong); }
.work-row .sum { color: var(--muted); max-width: 30rem; font-size: 1.0625rem; }
.work-row:hover { border-color: rgba(136, 249, 192, .35); }
.work-row:hover h3 { color: var(--mint); }

/* Image placeholders */
.media {
  position: relative; overflow: hidden; border-radius: 6px; border: 1px solid var(--line);
  background:
    radial-gradient(60% 70% at 55% 45%, rgba(99, 49, 251, .35), transparent 70%),
    radial-gradient(30% 35% at 70% 60%, rgba(136, 249, 192, .14), transparent 70%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
  transition: border-color .3s ease;
}
.media::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px; opacity: .5;
}
.media .ph-label { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); white-space: nowrap; }
.media .cap { position: absolute; left: 1rem; bottom: .9rem; color: var(--text); }
.media .go { position: absolute; right: 1rem; bottom: .8rem; color: var(--muted); font-family: var(--sans); font-size: .8rem; }
.ratio-3-2 { aspect-ratio: 3 / 2; }
.ratio-4-5 { aspect-ratio: 4 / 5; }

/* Capabilities */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(2rem, 6vw, 6rem); }
.split .lede { color: var(--muted); margin-top: 1.5rem; max-width: 20rem; font-size: 1.0625rem; }
.cap-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 3rem; }
.cap-grid li { display: grid; grid-template-columns: minmax(0, 1fr); gap: .5rem; padding: 1.4rem 0 1.6rem; border-top: 1px solid var(--line); }
.cap-grid li .label { padding-top: .25rem; }
.cap-grid h3 { font-family: var(--sans); font-size: 1.0625rem; font-weight: 600; margin-bottom: .4rem; }
.cap-grid p { color: var(--muted); font-size: 1rem; }
.cap-grid .cap-icon { display: block; width: 1.75rem; height: 1.75rem; margin: 0 0 .85rem; }
.cap-icon--1 { stroke: #8B6BFF; }
.cap-icon--2 { stroke: #8B6BFF; }
.cap-icon--3 { stroke: #8B6BFF; }
.cap-icon--4 { stroke: #8B6BFF; }
.cap-icon--5 { stroke: #8B6BFF; }
.cap-icon--6 { stroke: #8B6BFF; }

/* Process */
.process { overflow: hidden; }
.process::before {
  content: ""; position: absolute; pointer-events: none; left: 0; right: 0; top: 0; height: 60%;
  background: radial-gradient(50% 80% at 30% 0%, rgba(99, 49, 251, .22), transparent 70%);
}
.process .section-head { border-bottom: 0; }
.process .side-note { color: var(--muted); font-size: 1.0625rem; max-width: 22rem; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.steps li { padding: 1.5rem 1.5rem 2.5rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(8, 8, 26, .55); min-height: 13rem; }
.steps .top { display: flex; justify-content: space-between; margin-bottom: 2.5rem; }
.steps h3 { font-family: var(--serif); font-size: 1.6rem; margin-bottom: .6rem; }
.steps li { perspective: 1200px; padding: 0; background: none; }
.step-inner { position: relative; height: 100%; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.2,.7,.2,1); }
.step-face { padding: 1.5rem 1.5rem 2.5rem; min-height: 13rem; box-sizing: border-box; background: rgba(8, 8, 26, .55); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.step-back { position: absolute; inset: 0; transform: rotateY(180deg); display: flex; align-items: center; background: var(--surface); }
.step-back p { margin: 0; }
@media (hover: hover) and (pointer: fine) {
  .steps li:hover .step-inner { transform: rotateY(180deg); }
}
@media (hover: none) {
  .step-inner { transform: none !important; }
  .step-back { position: relative; inset: auto; transform: none; border-top: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) { .step-inner { transition: none; } }
.steps p { color: var(--muted); font-size: 1rem; }

/* About teaser */
.about-teaser { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 6rem); align-items: center; }
/* About photo: the ProfileCard (assets/css/profile-card.css) sits in .about-card */
.about-teaser h2 { font-family: var(--serif); font-size: clamp(2rem, 3.6vw, 2.9rem); line-height: 1.05; letter-spacing: -.015em; max-width: 18ch; }
.about-teaser .body { color: var(--muted); margin: 1.5rem 0 2rem; max-width: 32rem; font-size: 1.0625rem; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; margin: 0 0 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.facts dt { margin-bottom: .35rem; }
.facts dd { margin: 0; font-size: 1.0625rem; }
.facts dd.mint { color: var(--mint); }

/* Contact */
.contact { overflow: hidden; }
.contact::before {
  content: ""; position: absolute; pointer-events: none; inset: 0;
  background: radial-gradient(45% 70% at 25% 85%, rgba(99, 49, 251, .3), transparent 70%);
}
.contact .wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: clamp(2.5rem, 7vw, 7rem); }
.contact h2 { font-size: clamp(2.6rem, 4.4vw, 3.6rem); max-width: 100%; overflow-wrap: break-word; }
.contact h2 .accent { display: block; }
.contact .lede { color: var(--muted); margin: 1.5rem 0 2.5rem; max-width: 24rem; font-size: 1.0625rem; }
.details { margin: 0; border-top: 1px solid var(--line); }
.details div { display: flex; justify-content: space-between; gap: 1rem; padding: .85rem 0; }
.details dd { margin: 0; font-size: 1.0625rem; text-align: right; }
.details a { text-decoration: none; }
.details a:hover { text-decoration: underline; }

.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 1.5rem; align-content: start; }
.field { display: flex; flex-direction: column; gap: .6rem; }
.field.full { grid-column: 1 / -1; }
.field label { color: var(--muted); }
.field input, .field textarea {
  background: transparent; border: 0; border-bottom: 1px solid var(--line-strong); color: var(--text);
  font: inherit; font-size: 1rem; padding: .5rem 0 .8rem; border-radius: 0; resize: vertical;
}
.field textarea { min-height: 6.5rem; }
.field input::placeholder, .field textarea::placeholder { color: #6E6E86; }
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--mint); box-shadow: 0 1px 0 0 var(--mint); }
.form-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.hp { position: absolute; left: -9999px; }

/* Footer */
.site-foot { border-top: 1px solid var(--line); padding: clamp(4rem, 8vw, 6rem) 0 2rem; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; }
.mail-link { font-family: var(--sans); font-size: clamp(1rem, 1.4vw, 1.125rem); text-decoration: none; border-bottom: 1px solid var(--line-strong); padding-bottom: .35rem; }
.mail-link:hover { border-bottom-color: var(--mint); color: var(--mint); }
.foot-col ul { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: .65rem; }
.foot-col a { text-decoration: none; color: var(--muted); font-size: 1.0625rem; }
.foot-col a:hover { color: var(--text); text-decoration: underline; }
.foot-bar { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: clamp(3.5rem, 7vw, 5rem); padding-top: 1.5rem; border-top: 1px solid var(--line); }

/* Visually hidden */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 64rem) {
  .work-row { grid-template-columns: 3rem minmax(0, 1fr) minmax(0, 1fr); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split, .about-teaser, .contact .wrap { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 44rem) {
  .site-nav { gap: 1rem; }
  .brand-name { font-size: 1.9rem; }
  .hero-grid { grid-template-columns: 1fr; }
  .work-row { grid-template-columns: 1fr; gap: 1.25rem; }
  .work-row .idx { display: none; }
  .work-row .media { order: -1; }
  .cap-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .steps li { min-height: 0; }
  .facts { grid-template-columns: 1fr 1fr; }
  .form { grid-template-columns: 1fr; }
  .ticker-toggle { right: .75rem; }
}

/* ---------- Hero: centred layout ---------- */
.hero { text-align: center; --hero-step: 2.5rem; --hero-tight: 1.5rem; --hero-label: 1rem; }
/* Spacing rhythm: label + headline + intro read as one group (tight), then one even step to the buttons and one to the badge */
.hero-copy { display: flex; flex-direction: column; align-items: center; }
.hero-label { margin: 0 0 var(--hero-label); }
.hero-main { padding: clamp(5.5rem, 12vh, 8rem) 0 clamp(2.5rem, 6vh, 4rem); }
.hero::after { left: 50%; top: -35vw; transform: translateX(-50%); }
.hero::before {
  mask-image: radial-gradient(ellipse 70% 65% at 50% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 65% at 50% 40%, #000 20%, transparent 75%);
}
.hero-grid { grid-template-columns: 1fr; justify-items: center; gap: var(--hero-step); }
.hero h1 { margin: 0 auto; max-width: 13ch; }
.hero-intro { margin: var(--hero-tight) auto 0; }
.hero-actions { justify-content: center; }
.hero-strip .wrap { justify-content: center; gap: .75rem 2.25rem; padding-block: 1rem; }
.hero-strip .skills { justify-content: center; }

.kw.kw-active .kw-layer { z-index: 3; }
.hero h1 { max-width: none; }
.br-wide { display: none; }
@media (min-width: 44rem) { .br-wide { display: inline; } }

/* ---------- Yeseva One + Josefin Sans type tuning ---------- */
.display, .section-title, .hero h1, .work-row h3, .steps h3, .about-teaser h2, .contact h2 {
  font-weight: 400; letter-spacing: -.01em; line-height: 1.08; text-transform: none;
}
.hero h1 { font-size: clamp(3rem, 7.5vw, 7.5rem); line-height: 1; }
.section-title { font-size: clamp(2.4rem, 4.8vw, 4rem); }
@media (min-width: 64.01rem) { .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); } }
.split .section-title { font-size: clamp(2.4rem, 3.6vw, 3.4rem); }
.split .section-title .accent { display: block; }
.work-row h3 { font-size: clamp(1.9rem, 3.2vw, 2.6rem); }
.steps h3 { font-size: 1.5rem; }
.about-teaser h2 { font-size: clamp(2rem, 3.4vw, 2.8rem); line-height: 1.05; }
body { font-size: 1.125rem; }
.hero-intro { font-size: 1.25rem; }
/* Scroll badge: ring of text turns slowly around a static arrow */
.scroll-badge {
  position: relative; display: inline-grid; place-items: center; width: 7rem; height: 7rem;
  margin: 0; border-radius: 50%; color: var(--text); text-decoration: none;
}
.scroll-badge__ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; animation: badge-turn 8s linear infinite; }
.scroll-badge__ring text { font-family: var(--sans); font-size: 14px; font-weight: 700; fill: currentColor; }
.scroll-badge .sb-star path { stroke: var(--mint); stroke-width: 2.4; fill: none; }
.scroll-badge__arrow { width: 2.1rem; height: 2.1rem; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s ease, stroke .3s ease; }
.scroll-badge:hover, .scroll-badge:focus-visible { color: var(--mint); }
.scroll-badge:hover .scroll-badge__arrow { transform: translateY(4px); }
.scroll-badge:focus-visible { outline: 2px solid var(--mint); outline-offset: 4px; }
@keyframes badge-turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .scroll-badge__ring { animation: none; } }

/* Scroll badge transition */
.scroll-badge.is-pressed .scroll-badge__arrow { animation: badge-drop 1.1s cubic-bezier(.65,0,.35,1); }
@keyframes badge-drop { 0% { transform: translateY(0); opacity: 1; } 40% { transform: translateY(1.4rem); opacity: 0; } 41% { transform: translateY(-1.4rem); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } }
#work.is-arriving .section-head { animation: section-arrive .8s cubic-bezier(.22,1,.36,1) both; }
#work:focus { outline: none; }
@keyframes section-arrive { from { opacity: 0; transform: translateY(2rem); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .scroll-badge.is-pressed .scroll-badge__arrow, #work.is-arriving .section-head { animation: none; } }

/* ==========================================================
   Case study pages
   ========================================================== */
@media (prefers-reduced-motion: no-preference) { html:has(.cs-body) { scroll-behavior: smooth; } }

.ratio-16-9 { aspect-ratio: 16 / 9; }
.ratio-4-3 { aspect-ratio: 4 / 3; }
.ratio-16-5 { aspect-ratio: 16 / 5; }
.ratio-16-6 { aspect-ratio: 16 / 6; }
.ratio-16-7 { aspect-ratio: 16 / 7; }
.ratio-16-8 { aspect-ratio: 16 / 8; }
.ratio-16-10 { aspect-ratio: 16 / 10; }
/* Ingredient Swap hero (2000 x 1222): frame matches the image so nothing is cropped */
.ratio-swap-hero { aspect-ratio: 2000 / 1222; }

/* Title block */
.cs-head { position: relative; padding: calc(5.5rem + clamp(2.5rem, 6vw, 4.5rem)) 0 clamp(2.5rem, 5vw, 3.5rem); overflow: hidden; }
.cs-head::after {
  content: ""; position: absolute; pointer-events: none; z-index: -1;
  width: 60vw; height: 60vw; max-width: 900px; max-height: 900px; left: -20vw; top: -30vw;
  background: radial-gradient(circle, rgba(99, 49, 251, .3), rgba(99, 49, 251, 0) 62%);
}
.cs-back { margin-bottom: 2.5rem; }
.cs-head .eyebrow { margin-bottom: 1.25rem; flex-wrap: wrap; gap: .6rem 1rem; }
/* the floor shrinks with the screen on phones, so long words ("Companion") fit the column */
.cs-head h1 { font-size: clamp(min(3rem, 11.5vw), 7.5vw, 6.5rem); line-height: 1; max-width: 16ch; }
.cs-summary { margin-top: 1.5rem; max-width: 42rem; color: var(--muted); font-size: 1.25rem; }
.cs-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem 2rem; margin: clamp(2.5rem, 5vw, 3.5rem) 0 0; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.cs-meta dt { margin-bottom: .5rem; }
.cs-meta dd { margin: 0; font-size: 1.0625rem; line-height: 1.5; }
.cs-meta dd.mint { color: var(--mint); }

/* Figures */
.cs-fig { margin: clamp(2.25rem, 4vw, 3rem) 0; }
.cs-fig figcaption { margin-top: 1rem; display: grid; gap: .35rem; max-width: 44rem; }
.cs-fig figcaption .label { color: var(--text); }
.cs-fig figcaption span:last-child { color: var(--muted); font-size: 1rem; line-height: 1.5; }
.cs-hero { margin: 0 0 clamp(3rem, 6vw, 5rem); }
.cs-hero .media { border-radius: 12px; }

/* Body: sticky mini menu + reading column */
.cs-body { display: grid; grid-template-columns: minmax(11rem, 14rem) minmax(0, 1fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; padding-bottom: var(--section); }
.cs-toc { position: sticky; top: 2rem; padding-top: clamp(3rem, 6vw, 5rem); }
.cs-toc > .label { margin-bottom: 1rem; }
.cs-toc ol { list-style: none; margin: 0; padding: 0; display: grid; }
.cs-toc a {
  display: flex; gap: .75rem; padding: .55rem 0 .55rem 1rem; border-left: 1px solid var(--line-strong);
  font-family: var(--sans); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; line-height: 1.4;
  color: var(--label); text-decoration: none; transition: color .2s ease, border-color .2s ease;
}
.cs-toc a .n { color: inherit; opacity: .8; }
.cs-toc a:hover { color: var(--text); }
.cs-toc a.is-current { color: var(--mint); border-left-color: var(--mint); }

.cs-chapter { padding: clamp(3rem, 6vw, 5rem) 0; border-top: 1px solid var(--line); scroll-margin-top: 1rem; }
.cs-chapter:first-child { border-top: 0; }
/* H2 scale matches the homepage .section-title */
.cs-chapter h2 { font-family: var(--serif); font-size: clamp(2.4rem, 4.8vw, 4rem); line-height: 1.08; letter-spacing: -.01em; margin-bottom: 1.75rem; }
.cs-chapter p { color: var(--muted); max-width: 44rem; }
.cs-chapter p + p { margin-top: 1.25rem; }
.cs-chapter .media .ph-label, .cs-hero .media .ph-label { color: var(--label); }
.cs-lead { margin: 2rem 0 1rem; color: var(--text); }
.cs-list { list-style: none; margin: 0; padding: 0; max-width: 44rem; display: grid; gap: .7rem; }
.cs-list li { position: relative; padding-left: 1.5rem; color: var(--muted); }
.cs-list strong { color: var(--text); font-weight: 600; }
.cs-chapter p:not(.cs-lead) + .cs-list { margin-top: 1rem; }
.cs-list li::before { content: ""; position: absolute; left: .2rem; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: var(--mint); }
* + .cs-list { margin-top: 0; }
.cs-list + p { margin-top: 1.75rem; }

/* Snapshot */
.cs-snapshot { display: grid; gap: 0; border: 1px solid var(--line-strong); border-radius: 12px; background: linear-gradient(180deg, var(--surface-2), var(--surface)); max-width: 52rem; }
.cs-snapshot > div { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 1.5rem; padding: 1.5rem clamp(1.25rem, 2.5vw, 2rem); border-top: 1px solid var(--line); }
.cs-snapshot > div:first-child { border-top: 0; }
.cs-snapshot dt { padding-top: .3rem; }
.cs-snapshot dd { margin: 0; color: var(--text); font-size: 1.0625rem; line-height: 1.6; }

/* Compare figure: side by side on desktop, toggle below 64rem */
.cs-compare__toggle { display: none; gap: .4rem; margin-bottom: 1rem; padding: .3rem; border: 1px solid var(--line-strong); border-radius: 999px; width: max-content; }
.cs-compare__toggle button {
  background: transparent; border: 1px solid transparent; border-radius: 999px; padding: .5rem 1rem; cursor: pointer;
  font-family: var(--sans); font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.cs-compare__toggle button:hover { color: var(--text); }
.cs-compare__toggle button[aria-pressed="true"] { color: var(--mint); border-color: rgba(136, 249, 192, .55); background: rgba(136, 249, 192, .06); }
.cs-compare__panes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.cs-compare__pane { display: grid; gap: .75rem; align-content: start; }
.cs-compare__pane[hidden] { display: none; }
.cs-compare__tag { display: flex; align-items: center; gap: .6rem; }
.cs-compare__tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.cs-compare__pane:last-child .cs-compare__tag::before { background: var(--mint); }

/* More case studies */
.cs-more .section-head { margin-bottom: 2.5rem; }
.cs-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.cs-card {
  position: relative; display: grid; gap: 1.25rem; align-content: start; padding: clamp(1rem, 2vw, 1.5rem);
  border-radius: 20px; border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, var(--surface-2), var(--surface)); transition: border-color .3s ease;
}
.cs-card h3 { font-family: var(--serif); font-size: clamp(1.9rem, 3.2vw, 2.6rem); line-height: 1.08; letter-spacing: -.01em; }
.cs-card h3 a { text-decoration: none; }
.cs-card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.cs-card h3 a:focus-visible { outline: none; }
.cs-card:has(h3 a:focus-visible) { outline: 2px solid var(--mint); outline-offset: 4px; }
.cs-card .tags { display: flex; gap: .9rem; align-items: center; flex-wrap: wrap; margin-top: .9rem; }
.cs-card .tags .rule { width: 2rem; height: 1px; background: var(--line-strong); }
.cs-card .sum { color: var(--muted); font-size: 1.0625rem; margin-top: .9rem; }
.cs-card:hover { border-color: rgba(136, 249, 192, .35); }
.cs-card:hover h3 { color: var(--mint); }

@media (max-width: 64rem) {
  .cs-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-body { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .cs-toc {
    top: 0; z-index: 5; padding: .75rem 0; margin: 0 calc(var(--gutter) * -1); padding-inline: var(--gutter);
    background: rgba(1, 1, 13, .92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  }
  .cs-toc > .label { display: none; }
  .cs-toc ol { display: flex; gap: .5rem; overflow-x: auto; scrollbar-width: none; }
  .cs-toc ol::-webkit-scrollbar { display: none; }
  .cs-toc a { white-space: nowrap; border: 1px solid var(--line-strong); border-radius: 999px; padding: .45rem .85rem; }
  .cs-toc a.is-current { border-color: rgba(136, 249, 192, .55); }
  .cs-chapter { scroll-margin-top: 4.5rem; }
  .cs-chapter:first-child { border-top: 0; }
  .cs-compare.is-enhanced .cs-compare__toggle { display: inline-flex; }
  .cs-compare.is-enhanced .cs-compare__panes { grid-template-columns: minmax(0, 1fr); }
  .cs-compare.is-enhanced .cs-compare__tag { display: none; }
}
@media (max-width: 64rem) and (prefers-reduced-motion: no-preference) {
  .cs-compare.is-enhanced .cs-compare__pane:not([hidden]) { animation: cs-fade .25s ease; }
}
@keyframes cs-fade { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 44rem) {
  .cs-meta { grid-template-columns: minmax(0, 1fr); }
  .cs-snapshot > div { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
  .cs-compare__panes { grid-template-columns: minmax(0, 1fr); }
  .cs-cards { grid-template-columns: minmax(0, 1fr); }
}

/* ==========================================================
   All work page
   ========================================================== */
.work-count { margin-top: clamp(2rem, 4vw, 2.75rem); padding-top: 1.25rem; border-top: 1px solid var(--line); }
.work-all { border-top: 0; padding-top: clamp(1rem, 3vw, 2rem); }
.work-grid {
  list-style: none; margin: 0; padding: 0; display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2.5rem, 4vw, 3.5rem) clamp(1.25rem, 2.5vw, 2rem);
}
.work-grid > li:nth-child(even) { margin-top: clamp(3rem, 8vw, 6rem); }
.work-card { position: relative; display: grid; gap: 1.25rem; }
.work-card .media { border-radius: 12px; }
.work-card .go { transition: transform .3s ease, color .3s ease; }
.work-card__text { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.work-card__text .idx { padding-top: .5rem; }
.work-card h3 { font-family: var(--serif); font-size: clamp(1.9rem, 3.2vw, 2.6rem); line-height: 1.08; letter-spacing: -.01em; transition: color .3s ease; }
.work-card h3 a { text-decoration: none; }
.work-card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: 12px; }
.work-card h3 a:focus-visible { outline: none; }
.work-card:has(h3 a:focus-visible) { outline: 2px solid var(--mint); outline-offset: 6px; border-radius: 12px; }
.work-card .tags { display: flex; gap: .9rem; align-items: center; flex-wrap: wrap; margin-top: .75rem; }
.work-card .tags .rule { width: 2rem; height: 1px; background: var(--line-strong); }
.work-card:hover h3 { color: var(--mint); }
.work-card:hover .media { border-color: rgba(136, 249, 192, .35); }
.work-card:hover .go { color: var(--mint); transform: translate(4px, -4px); }
@media (prefers-reduced-motion: reduce) { .work-card:hover .go { transform: none; } }
@media (max-width: 44rem) {
  .work-grid { grid-template-columns: minmax(0, 1fr); }
  .work-grid > li:nth-child(even) { margin-top: 0; }
}

/* ==========================================================
   Case 01 light theme (Public Health Navigation Hub)
   Scoped to <body data-theme="phnh">. Palette from the project:
   #0A3C32 primary · #6E9673 sage · #FFC328 yellow.
   Contrast on --bg: text 11.4:1, muted 6.4:1, label 5.5:1.
   Sage is 3.1:1: large text and borders only. Yellow is never text.
   ========================================================== */
[data-theme="phnh"] {
  --bg: #F7F8F3;
  --surface: #FFFFFF;
  --surface-2: #EEF2EA;
  --line: rgba(10, 60, 50, .12);
  --line-strong: rgba(10, 60, 50, .24);
  --text: #0A3C32;
  --muted: #4A5F57;
  --label: #55695F;
  --purple: #6E9673;   /* glows and borders */
  --mint: #0A3C32;     /* small accent text and focus rings stay on primary */
  --sage: #6E9673;
  --yellow: #FFC328;
  color-scheme: light;
}
[data-theme="phnh"] .accent { color: var(--sage); }
[data-theme="phnh"] .dot { background: var(--yellow); box-shadow: 0 0 0 2px rgba(10, 60, 50, .15); }
[data-theme="phnh"] .eyebrow .num { color: var(--text); }
[data-theme="phnh"] .cs-list li::before,
[data-theme="phnh"] .cs-compare__pane:last-child .cs-compare__tag::before { background: var(--yellow); box-shadow: 0 0 0 1px rgba(10, 60, 50, .25); }
[data-theme="phnh"] .skip { background: var(--yellow); color: var(--text); }
[data-theme="phnh"] .cs-head::after {
  background: radial-gradient(circle, rgba(110, 150, 115, .28), rgba(110, 150, 115, 0) 62%);
}
[data-theme="phnh"] .cs-toc a.is-current { color: var(--text); border-left-color: var(--yellow); font-weight: 600; }
[data-theme="phnh"] .cs-snapshot { background: var(--surface); }
[data-theme="phnh"] .media {
  background:
    radial-gradient(60% 70% at 55% 45%, rgba(110, 150, 115, .22), transparent 70%),
    radial-gradient(30% 35% at 70% 60%, rgba(255, 195, 40, .18), transparent 70%),
    linear-gradient(180deg, var(--surface), var(--surface-2));
}
[data-theme="phnh"] .cs-compare__toggle button[aria-pressed="true"] { color: var(--text); border-color: var(--text); background: var(--yellow); }
[data-theme="phnh"] .cs-card:hover,
[data-theme="phnh"] .work-card:hover .media { border-color: var(--sage); }
[data-theme="phnh"] .cs-card:hover h3,
[data-theme="phnh"] .work-card:hover h3,
[data-theme="phnh"] .work-card:hover .go { color: var(--text); }
[data-theme="phnh"] .contact::before {
  background: radial-gradient(45% 70% at 25% 85%, rgba(110, 150, 115, .22), transparent 70%);
}
[data-theme="phnh"] .field input::placeholder,
[data-theme="phnh"] .field textarea::placeholder { color: #6B7D75; }
[data-theme="phnh"] .mail-link:hover { color: var(--text); border-bottom-color: var(--yellow); }
[data-theme="phnh"] .btn-ghost { --star-border-surface: rgba(255, 255, 255, .7); }
@media (max-width: 64rem) {
  [data-theme="phnh"] .cs-toc { background: rgba(247, 248, 243, .94); }
  [data-theme="phnh"] .cs-toc a.is-current { border-color: var(--text); background: var(--yellow); }
}

/* ==========================================================
   Case 02 light theme (Readiness Care Companion)
   Scoped to <body data-theme="rcc">. Palette from the project
   (swatch hex labels were all #202879; RGB values are the truth):
   Dark Navy #202878 · Blue #146EE6 · Light Teal #E6F5FA · Light Blue #EBF5FF.
   Contrast on --bg: text 11.6:1, muted 6.8:1, label 5.3:1.
   Blue is 4.3:1 on --bg (4.8:1 on white): large text, fills, borders only;
   small text stays navy. White text on a blue fill passes (4.8:1).
   ========================================================== */
[data-theme="rcc"] {
  --bg: #EBF5FF;
  --surface: #FFFFFF;
  --surface-2: #E6F5FA;
  --line: rgba(32, 40, 120, .12);
  --line-strong: rgba(32, 40, 120, .24);
  --text: #202878;
  --muted: #4B5280;
  --label: #5A6190;
  --purple: #146EE6;   /* glows and borders */
  --mint: #202878;     /* small accent text and focus rings stay on navy */
  --blue: #146EE6;
  color-scheme: light;
}
[data-theme="rcc"] .accent { color: var(--blue); }
[data-theme="rcc"] .dot { background: var(--blue); box-shadow: 0 0 0 2px rgba(32, 40, 120, .15); }
[data-theme="rcc"] .eyebrow .num { color: var(--text); }
[data-theme="rcc"] .cs-list li::before,
[data-theme="rcc"] .cs-compare__pane:last-child .cs-compare__tag::before { background: var(--blue); box-shadow: 0 0 0 1px rgba(32, 40, 120, .25); }
[data-theme="rcc"] .skip { background: var(--blue); color: #FFFFFF; }
[data-theme="rcc"] .cs-head::after {
  background: radial-gradient(circle, rgba(20, 110, 230, .22), rgba(20, 110, 230, 0) 62%);
}
[data-theme="rcc"] .cs-toc a.is-current { color: var(--text); border-left-color: var(--blue); font-weight: 600; }
[data-theme="rcc"] .cs-snapshot { background: var(--surface); }
[data-theme="rcc"] .media {
  background:
    radial-gradient(60% 70% at 55% 45%, rgba(20, 110, 230, .16), transparent 70%),
    linear-gradient(180deg, var(--surface), var(--surface-2));
}
[data-theme="rcc"] .cs-compare__toggle button[aria-pressed="true"] { color: #FFFFFF; border-color: var(--blue); background: var(--blue); }
[data-theme="rcc"] .cs-card:hover,
[data-theme="rcc"] .work-card:hover .media { border-color: var(--blue); }
[data-theme="rcc"] .cs-card:hover h3,
[data-theme="rcc"] .work-card:hover h3,
[data-theme="rcc"] .work-card:hover .go { color: var(--text); }
[data-theme="rcc"] .contact::before {
  background: radial-gradient(45% 70% at 25% 85%, rgba(20, 110, 230, .16), transparent 70%);
}
[data-theme="rcc"] .field input::placeholder,
[data-theme="rcc"] .field textarea::placeholder { color: #6B7299; }
[data-theme="rcc"] .mail-link:hover { color: var(--text); border-bottom-color: var(--blue); }
[data-theme="rcc"] .btn-ghost { --star-border-surface: rgba(255, 255, 255, .7); }
@media (max-width: 64rem) {
  [data-theme="rcc"] .cs-toc { background: rgba(235, 245, 255, .94); }
  [data-theme="rcc"] .cs-toc a.is-current { border-color: var(--blue); background: var(--blue); color: #FFFFFF; }
}

/* ==========================================================
   Case 03 light theme (Ingredient Swap)
   Scoped to <body data-theme="planbee">. Palette sampled from
   the live product, getplanbee.app: cream #F7FFF7, slate #2C3B44,
   yellow #FFC914, teal #17BEBB. Type: the site stack (Yeseva One and Josefin Sans) only.
   Contrast on --bg: text ~10:1, muted 5.6:1, deep teal ink 4.7:1.
   Yellow is a fill only (slate text on it, ~8:1). Teal is borders,
   glows and fills only; teal ink (#0F7F7C) is the text-safe teal.
   ========================================================== */
[data-theme="planbee"] {
  --bg: #F7FFF7;
  --surface: #FFFFFF;
  --surface-2: #EAF5EA;
  --line: rgba(44, 59, 68, .12);
  --line-strong: rgba(44, 59, 68, .24);
  --text: #2C3B44;
  --muted: #5E6770;
  --label: #5E6770;
  --purple: #17BEBB;   /* glows and borders */
  --mint: #2C3B44;     /* small accent text and focus rings stay slate */
  /* Type stays on the homepage stack (Yeseva One + Josefin Sans only) */
  --yellow: #FFC914;
  --teal: #17BEBB;
  --teal-ink: #0F7F7C;
  color-scheme: light;
}
[data-theme="planbee"] .accent { color: var(--teal-ink); }
[data-theme="planbee"] .dot { background: var(--yellow); box-shadow: 0 0 0 2px rgba(44, 59, 68, .18); }
[data-theme="planbee"] .eyebrow .num { color: var(--text); }
[data-theme="planbee"] .cs-list li::before,
[data-theme="planbee"] .cs-compare__pane:last-child .cs-compare__tag::before { background: var(--teal); box-shadow: 0 0 0 1px rgba(15, 127, 124, .3); }
[data-theme="planbee"] .skip { background: var(--yellow); color: var(--text); }
[data-theme="planbee"] .cs-head::after {
  background: radial-gradient(circle, rgba(255, 201, 20, .26), rgba(255, 201, 20, 0) 62%);
}
[data-theme="planbee"] .cs-toc a.is-current { color: var(--text); border-left-color: var(--teal-ink); font-weight: 600; }
[data-theme="planbee"] .cs-snapshot { background: var(--surface); }
[data-theme="planbee"] .media {
  background:
    radial-gradient(60% 70% at 55% 45%, rgba(255, 201, 20, .22), transparent 70%),
    linear-gradient(180deg, var(--surface), var(--surface-2));
}
[data-theme="planbee"] .cs-compare__toggle button[aria-pressed="true"] { color: var(--text); border-color: var(--text); background: var(--yellow); }
[data-theme="planbee"] .cs-card:hover,
[data-theme="planbee"] .work-card:hover .media { border-color: var(--teal-ink); }
[data-theme="planbee"] .cs-card:hover h3,
[data-theme="planbee"] .work-card:hover h3,
[data-theme="planbee"] .work-card:hover .go { color: var(--text); }
[data-theme="planbee"] .contact::before {
  background: radial-gradient(45% 70% at 25% 85%, rgba(255, 201, 20, .22), transparent 70%);
}
[data-theme="planbee"] .field input::placeholder,
[data-theme="planbee"] .field textarea::placeholder { color: #6B747C; }
[data-theme="planbee"] .mail-link:hover { color: var(--text); border-bottom-color: var(--yellow); }
[data-theme="planbee"] .btn-ghost { --star-border-surface: rgba(255, 255, 255, .7); }
@media (max-width: 64rem) {
  [data-theme="planbee"] .cs-toc { background: rgba(247, 255, 247, .94); }
  [data-theme="planbee"] .cs-toc a.is-current { border-color: var(--teal-ink); background: var(--yellow); color: var(--text); }
}

/* ==========================================================
   Research loop diagram (PHNH Artifact 1, research-loop.js)
   Stacked stage cards; the wires run down a rail on the left.
   ========================================================== */
.rloop { position: relative; padding-left: 3.5rem; font-family: var(--sans); color: #0A3C32; }
.rloop__wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.rloop__wires .w-path { fill: none; stroke: #6E9673; stroke-width: 1.25; }
.rloop__wires .w-end { fill: #F7F8F3; stroke: #6E9673; stroke-width: 1.25; }
.rloop__wires .w-tag { font-family: var(--sans); font-size: 11px; font-weight: 500; letter-spacing: .14em; fill: #0A3C32; opacity: .5; }
.rloop__wires .w-dot { fill: #FFC328; stroke: #0A3C32; stroke-width: 1.5; transition: opacity .25s ease; }
.rloop__wires .w-halo { fill: #FFC328; opacity: .35; transition: opacity .25s ease; }
.rloop__stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.75rem; }
.rloop__stage {
  display: grid; grid-template-columns: 3rem 11rem minmax(0, 1fr); align-items: center; gap: 1.5rem;
  padding: 1.1rem 1.5rem; border: 1px solid rgba(110, 150, 115, .28); border-radius: 12px; background: #F1F6EE;
}
.rloop__icon { display: block; width: 3rem; height: auto; overflow: visible; }
.rloop__icon .i-line { fill: none; stroke: #0A3C32; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.rloop__icon .i-fill { fill: #F1F6EE; }
.rloop__icon .i-accent { fill: none; stroke: #6E9673; stroke-width: 3.5; stroke-linecap: round; }
.rloop__icon .i-sage { fill: #6E9673; }
.rloop__icon .i-dark { fill: #0A3C32; }
.rloop__title { margin: 0; color: #0A3C32 !important; font-weight: 700; text-transform: uppercase; letter-spacing: .01em; font-size: 1.125rem; line-height: 1.2; }
.rloop__list { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 2rem; font-size: .875rem; line-height: 1.45; color: #0A3C32; }
.rloop__list li { break-inside: avoid; padding: .1rem 0; }
.rloop__toggle {
  display: block; margin: .75rem 0 0 auto;
  background: #FFFFFF; border: 1px solid rgba(10, 60, 50, .24); color: #0A3C32;
  border-radius: 999px; padding: .35rem .8rem; cursor: pointer;
}
.rloop__toggle:hover { border-color: #0A3C32; }
@media (max-width: 52rem) {
  .rloop__stage { grid-template-columns: 2.5rem minmax(0, 1fr); gap: .75rem 1rem; }
  .rloop__icon { width: 2.5rem; }
  .rloop__list { grid-column: 1 / -1; }
}
@media (max-width: 30rem) {
  .rloop { padding-left: 2.75rem; }
  .rloop__stage { padding: 1rem 1.1rem; }
  .rloop__list { columns: 1; }
}

/* ==========================================================
   Persona flip cards (PHNH, case-study.js [data-flip-cards])
   Front: sage profile card. Back: white card with goals and pain points.
   Flips on hover (mouse) and with the card's button (keyboard, touch).
   ========================================================== */
.pcards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .75rem; font-family: var(--sans); }
.pcard { perspective: 1400px; }
.pcard__inner { position: relative; display: grid; height: 100%; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.2, .7, .2, 1); }
.pcard__face {
  grid-area: 1 / 1; display: flex; flex-direction: column; padding: 1.5rem 1.5rem 1.25rem; border-radius: 12px;
  -webkit-backface-visibility: hidden; backface-visibility: hidden; color: #0A3C32;
}
.pcard__front { background: #E3EDE4; border: 1px solid rgba(110, 150, 115, .28); }
.pcard__back { background: #FFFFFF; border: 1px solid rgba(10, 60, 50, .14); box-shadow: 0 10px 30px -18px rgba(10, 60, 50, .35); transform: rotateY(180deg); }
.pcard.is-flipped .pcard__inner { transform: rotateY(180deg); }
@media (hover: hover) and (pointer: fine) {
  .pcard:hover .pcard__inner { transform: rotateY(180deg); }
  .pcard:hover:not(.is-flipped) .pcard__back .pcard__flip { visibility: hidden; }   /* hover-only flip needs no way back */
}
.pcard__top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.25rem; }
.pcard__icon { width: 3.25rem; height: auto; overflow: visible; }
.pcard__icon .i-line { fill: none; stroke: #0A3C32; stroke-width: 3.25; stroke-linecap: round; stroke-linejoin: round; }
.pcard__icon .i-sage-f { fill: #6E9673; }
.pcard__num { color: #0A3C32; font-weight: 500; }
.pcard__name { font-weight: 700; font-size: 1.5rem; line-height: 1.15; margin: 0 0 .5rem; color: #0A3C32; }
.cs-chapter .pcard p { max-width: none; }
.cs-chapter .pcard__tag { margin: 0 0 .9rem; color: #55695F; font-size: .6875rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.pcard__profile, .pcard__list { list-style: none; margin: 0; padding: 0; font-size: .9375rem; line-height: 1.45; }
.pcard__profile { display: grid; gap: .15rem; }
.cs-chapter .pcard__head { margin: 0 0 .5rem; color: #0A3C32; font-weight: 700; font-size: 1.0625rem; }
.cs-chapter .pcard__list + .pcard__head { margin-top: 1rem; }
.pcard__list { display: grid; gap: .3rem; font-size: .8125rem; line-height: 1.4; }
.pcard__back { padding: 1.25rem 1.25rem 1rem; }
.pcard__list li { position: relative; padding-left: 1rem; }
.pcard__list li::before { content: ""; position: absolute; left: 0; top: .6em; width: 5px; height: 5px; border-radius: 50%; background: #6E9673; }
.pcard__flip {
  margin-top: auto; align-self: flex-start; display: inline-flex; gap: .4rem; align-items: center;
  background: transparent; border: 0; border-top: 1px solid transparent; padding: 1rem 0 0; cursor: pointer; color: #0A3C32;
}
.pcard__flip:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  .pcard__inner, .pcard:hover .pcard__inner, .pcard.is-flipped .pcard__inner { transform: none; transition: none; }
  .pcard__face { transition: opacity .2s ease; }
  .pcard__back { transform: none; opacity: 0; visibility: hidden; }
  .pcard.is-flipped .pcard__back { opacity: 1; visibility: visible; }
  .pcard.is-flipped .pcard__front { opacity: 0; visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) and (hover: hover) and (pointer: fine) {
  .pcard:hover .pcard__back { opacity: 1; visibility: visible; }
  .pcard:hover .pcard__front { opacity: 0; visibility: hidden; }
}

/* ==========================================================
   Global navigation sitemap (PHNH Artifact 4, sitemap.js)
   Arrows draw from the root down to each section, then each branch fills in.
   ========================================================== */
.smap { --note: #94560D; position: relative; font-family: var(--sans); color: #0A3C32; text-align: center; padding: .25rem 0 .5rem; }
.smap__wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.smap__wires path { fill: none; stroke: #0A3C32; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.smap .smap__node {
  display: block; width: max-content; max-width: 100%; margin: 0 auto 1.1rem; padding: .45rem 1.15rem;
  border: 1.4px solid #0A3C32; border-radius: 999px; background: #F7F8F3;
  color: #0A3C32; font-weight: 600; font-size: 1rem; line-height: 1.25;
}
.smap .smap__node--root { margin-bottom: 0; padding: .8rem 1.6rem; background: #FFC328; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.smap__branches { list-style: none; margin: 4.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; }
.smap__branch { display: flex; flex-direction: column; align-items: center; }
.smap__items { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; font-size: .9375rem; line-height: 1.35; }
.smap__items li { display: flex; flex-direction: column; align-items: center; }
.smap__note { font-family: var(--sans); font-size: .625rem; letter-spacing: .12em; text-transform: uppercase; color: var(--note); line-height: 1.4; }
.smap__brace { display: block; width: 85%; height: 12px; margin-top: .85rem; overflow: visible; }
.smap__brace path { fill: none; stroke: #6E9673; stroke-width: 1.4; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.smap .smap__sum { margin: .45rem 0 0; max-width: 12rem; color: var(--note); font-weight: 600; font-size: .9375rem; line-height: 1.3; }
.smap__replay {
  display: block; margin: 1.25rem 0 0 auto;
  background: #FFFFFF; border: 1px solid rgba(10, 60, 50, .24); color: #0A3C32;
  border-radius: 999px; padding: .35rem .8rem; cursor: pointer;
}
.smap__replay:hover { border-color: #0A3C32; }

/* animation states (only when sitemap.js runs and motion is allowed) */
.smap.is-anim .smap__node,
.smap.is-anim .smap__items li,
.smap.is-anim .smap__brace,
.smap.is-anim .smap__sum { opacity: 0; transform: translateY(6px); transition: opacity .45s ease var(--d, 0s), transform .45s ease var(--d, 0s); }
.smap.is-anim .smap__node--root { transform: scale(.92); }
.smap.is-anim .smap__wires path { transition: stroke-dashoffset .7s cubic-bezier(.4, 0, .2, 1) var(--d, 0s), opacity .2s ease var(--d, 0s); }
.smap.is-anim.is-on .smap__node,
.smap.is-anim.is-on .smap__items li,
.smap.is-anim.is-on .smap__brace,
.smap.is-anim.is-on .smap__sum { opacity: 1; transform: none; }
.smap.is-anim.is-on .smap__wires path { stroke-dashoffset: 0 !important; opacity: 1 !important; }
.smap.no-trans *, .smap.no-trans *::before { transition: none !important; }

@media (max-width: 44rem) {
  .smap { text-align: left; }
  .smap .smap__node--root { margin: 0; }
  .smap__branches { grid-template-columns: 1fr; gap: 2rem; margin-top: 2rem; padding-left: 2.75rem; }
  .smap__branch, .smap__items li { align-items: flex-start; }
  .smap .smap__node { margin: 0 0 .9rem; }
  .smap__brace { width: 100%; max-width: 14rem; }
}

/* ==========================================================
   Mobile wireframe flow (PHNH Artifact 5 mobile, wireflow.js)
   A 300x600 wireframe phone, scaled to the pane; a hand taps through 4 steps.
   ========================================================== */
.wf { display: flex; align-items: center; gap: 6%; padding: clamp(1.25rem, 7%, 2.25rem) 7%; background: #EEF2EA !important; border-color: #6E9673; font-family: var(--sans); color: #0A3C32; }
.wf::before { display: none; }
.wf__stage { position: relative; flex: none; }
.wf__inner { position: absolute; left: 0; top: 0; width: 300px; height: 600px; transform-origin: 0 0; transform: scale(var(--s, .5)); }
.wf__phone { position: absolute; inset: 0; overflow: hidden; border: 7px solid #0A3C32; border-radius: 26px; background: #A6CBA6; box-shadow: 0 10px 24px rgba(10, 60, 50, .18); }
.wf__screen { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 8px; padding: 22px 14px 0; font-size: 13px; line-height: 1.3; color: #0A3C32; transition: transform .5s cubic-bezier(.4, 0, .2, 1); }
.wf__home { background: #A6CBA6; }
.wf__edit { background: #7FA584; gap: 6px; padding-bottom: 14px; transform: translateX(100%); }
.wf.show-edit .wf__edit { transform: none; }
.wf.show-edit .wf__home { transform: translateX(-30%); }
.wf .wf__h { margin: 0 0 4px; color: #0A3C32; font-size: 14px; font-weight: 600; }
.wf__edit .wf__h { font-size: 15px; }
.wf__box { background: #FFFFFF; padding: 9px 11px; border-radius: 3px; }
.wf__cards { display: flex; flex-direction: column; gap: 6px; transition: filter .15s ease; }
.wf__new-topic { display: none; }
.wf.is-new .wf__new-topic { display: block; animation: wf-pop .5s ease; }
.wf__tag { display: inline-block; margin-right: 4px; padding: 1px 5px; border-radius: 3px; background: #FFC328; font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; vertical-align: 1px; }
.wf__feed { flex: 1; display: flex; align-items: center; }
.wf__nav { display: flex; justify-content: space-around; margin: 0 -14px; padding: 10px 4px 14px; background: #E6E9E3; font-size: 10.5px; }
.wf .wf__cat { margin: 10px 0 2px; color: #0A3C32; font-size: 12px; font-weight: 600; }
.wf__rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.wf__row { display: flex; justify-content: space-between; padding: 11px 10px; border-radius: 3px; background: #FFFFFF; font-size: 12px; }
.wf__pin b { font-weight: 400; transition: color .2s ease; }
.wf__p { color: #0A3C32; font-weight: 700 !important; }
.wf__u { color: #A3ADA8; }
.wf__row.is-pinned .wf__p { color: #A3ADA8; font-weight: 400 !important; }
.wf__row.is-pinned .wf__u { color: #0A3C32; font-weight: 700; }
.wf__banner { margin-top: auto; padding: 9px; border-radius: 3px; background: #111; color: #FFFFFF; font-size: 12px; text-align: center; opacity: 0; transform: translateY(6px); transition: opacity .3s ease, transform .3s ease; }
.wf.has-banner .wf__banner { opacity: 1; transform: none; }
.wf__btn { padding: 10px; border-radius: 3px; background: #0A3C32; color: #FFFFFF; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; text-align: center; transition: filter .15s ease; }
.wf__btn.is-swap { animation: wf-pop .4s ease; }
.wf .is-pressed { filter: brightness(.88); }
.wf__ripple { position: absolute; left: 0; top: 0; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: rgba(255, 195, 40, .6); opacity: 0; pointer-events: none; }
.wf__ripple.is-tap { animation: wf-ripple .55s ease-out; }
.wf__hand {
  position: absolute; left: 0; top: 0; width: 44px; height: 44px; margin: -4px 0 0 -14px; overflow: visible; pointer-events: none; opacity: 0;
  fill: #FFFFFF; stroke: #0A3C32; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 3px 4px rgba(10, 60, 50, .3));
  transform: translate(var(--x, 330px), var(--y, 560px)) scale(var(--k, 1)); transform-origin: 14px 4px;
  transition: transform .85s cubic-bezier(.45, 0, .2, 1), opacity .3s ease;
}
.wf__hand.is-down { --k: .86; transition-duration: .12s, .3s; }
.wf.hand-on .wf__hand { opacity: 1; }
.wf__notes { flex: 1; min-width: 0; }
.wf .wf__step { margin: 0 0 .6rem; color: #55695F; }
.wf__list { list-style: none; margin: 0; padding: 0; font-size: clamp(.8125rem, 1.6vw, .9375rem); line-height: 1.45; color: #0A3C32; }
.wf__list li { display: none; }
.wf__list li.is-current { display: block; animation: cs-fade-wf .35s ease; }
.wf.is-static .wf__step { display: none; }
.wf.is-static .wf__list { list-style: decimal; padding-left: 1.1em; display: grid; gap: .4rem; font-size: .8125rem; }
.wf.is-static .wf__list li { display: list-item; }
.wf__toggle {
  position: absolute; right: .65rem; bottom: .65rem; z-index: 1;
  background: #FFFFFF; border: 1px solid rgba(10, 60, 50, .24); color: #0A3C32;
  border-radius: 999px; padding: .3rem .75rem; cursor: pointer;
}
.wf__toggle:hover { border-color: #0A3C32; }
@keyframes wf-ripple { 0% { opacity: .9; transform: scale(.2); } 100% { opacity: 0; transform: scale(1.4); } }
@keyframes wf-pop { from { opacity: .35; } to { opacity: 1; } }
@keyframes cs-fade-wf { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 30rem) {
  .wf { gap: 5%; padding: 1rem 5%; }
  .wf__list { font-size: .75rem; }
}

/* Desktop variant: a 640x400 wireframe browser, scaled to fit above the step caption */
.wf--desk { flex-direction: column; align-items: stretch; gap: .75rem; padding: 1rem 1.25rem; }
.wf--desk .wf__stage { flex: 1 1 auto; min-height: 0; }
.wf--desk .wf__inner { width: 640px; height: 400px; }
.wf--desk .wf__notes { flex: none; min-height: 4.3rem; padding-right: 4.5rem; }
.wf--desk .wf__step { margin-bottom: .3rem; }
.wf--desk .wf__list { font-size: .8125rem; }
.wf__browser { position: absolute; inset: 0; overflow: hidden; display: flex; flex-direction: column; border: 2px solid #0A3C32; border-radius: 10px; background: #7FA584; box-shadow: 0 10px 24px rgba(10, 60, 50, .18); }
.wf__chrome { display: flex; gap: 5px; align-items: center; height: 20px; padding: 0 10px; background: #0A3C32; }
.wf__chrome i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .45); }
.wf__page { position: relative; flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 14px; font-size: 11px; line-height: 1.3; color: #0A3C32; }
.wf__topnav { display: flex; gap: 22px; align-self: flex-start; padding: 7px 12px; background: #F1F2EF; }
.wf__search { padding: 6px; background: #E6E8E4; text-align: center; }
.wf__main { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 176px; gap: 14px; margin-top: 4px; }
.wf__news { display: flex; align-items: center; justify-content: center; background: #DADDD8; }
.wf__panel, .wf__window { display: flex; flex-direction: column; gap: 5px; padding: 9px 9px 10px; overflow: hidden; }
.wf__panel { grid-column: 2; grid-row: 1; background: #DADDD8; transition: opacity .3s ease; }
.wf__window { grid-column: 2; grid-row: 1; position: relative; background: #0A3C32; color: #FFFFFF; opacity: 0; transform: translateY(8px); transition: opacity .3s ease, transform .3s ease; pointer-events: none; }
.wf.show-edit .wf__window { opacity: 1; transform: none; }
.wf.show-edit .wf__panel { opacity: 0; }
.wf .wf__ptitle { margin: 0 0 3px; color: inherit; font-size: 11px; font-weight: 600; line-height: 1.25; }
.wf--desk .wf__cat { margin: 3px 0 0; color: #FFFFFF; font-size: 10.5px; font-weight: 500; }
.wf--desk .wf__rows { gap: 5px; }
.wf--desk .wf__row, .wf__srow { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px; background: #FFFFFF; color: #0A3C32; font-size: 10.5px; }
.wf__srow.wf__new-topic { display: none; }
.wf.is-new .wf__srow.wf__new-topic { display: flex; animation: wf-pop .5s ease; }
.wf--desk .wf__tag { font-size: 7.5px; padding: 1px 4px; }
.wf--desk .wf__btn { padding: 7px 10px; font-size: 10px; border-radius: 2px; }
.wf__add { margin-top: auto; align-self: flex-start; }
.wf__window .wf__btn { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); white-space: nowrap; box-shadow: 0 0 0 2px #0A3C32; background: #0F4A3E; }
.wf__window .wf__btn.is-swap { animation: wf-pop-c .4s ease; }
.wf--desk .wf__banner { position: absolute; right: 6px; bottom: 44px; width: 220px; margin: 0; padding: 9px; font-size: 11px; border-radius: 2px; pointer-events: none; }
@keyframes wf-pop-c { from { opacity: .35; transform: translateX(-50%); } to { opacity: 1; transform: translateX(-50%); } }

/* ==========================================================
   Edit Shortcut screens (PHNH Artifact 6 before/after, wireflow.js)
   300x600 phone with a bottom sheet over a dimmed Home.
   ========================================================== */
.es-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.wf__phone.es { background: #3B413E; }
.es__home { padding: 9px 14px; color: rgba(255, 255, 255, .55); font-size: 9px; font-weight: 700; }
.es__sheet { position: absolute; top: 24px; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; padding: 8px 12px 0; border-radius: 16px 16px 0 0; background: #F7F7F5; color: #0A3C32; font-size: 9px; line-height: 1.3; }
.es__handle { display: block; width: 40px; height: 3px; margin: 0 auto 12px; border-radius: 2px; background: #C2C6C4; }
.es .es__title { margin: 0 0 8px; color: #18201D; font-size: 13px; font-weight: 700; }
.es .es__help { margin: -2px -4px 8px; padding: 2px 4px; border-radius: 3px; color: #2E3532; font-size: 8.5px; transition: background-color .4s ease, box-shadow .4s ease; }
.es .es__help.is-flag { background: #FFE7A1; box-shadow: 0 0 0 2px #FFC328; }
.es__search { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; padding: 7px 10px; border-radius: 8px; background: #FFFFFF; box-shadow: 0 1px 5px rgba(0, 0, 0, .12); font-size: 9px; transition: box-shadow .25s ease; }
.es__search.is-focus { box-shadow: 0 0 0 1.5px #0A3C32, 0 1px 5px rgba(0, 0, 0, .12); }
.es__search .es__i { width: 12px; height: 12px; }
.es__ph { color: #8A908D; }
.es__query:not(:empty) + .es__ph { display: none; }
.es__search.is-focus .es__query::after { content: ""; display: inline-block; width: 1px; height: 10px; margin-left: 1px; background: #0A3C32; vertical-align: -1px; animation: es-caret 1s steps(1) infinite; }
.es__scroll { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.es__list { display: flex; flex-direction: column; gap: 6px; padding: 2px 0 70px; transition: transform .65s cubic-bezier(.4, 0, .2, 1); }
.es .es__sec { height: 14px; margin: 4px 0 0; overflow: hidden; color: #18201D; font-size: 9.5px; font-weight: 700; transition: height .3s ease, opacity .3s ease, margin .3s ease; }
.es__row { flex: none; display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 9px; overflow: hidden; border-radius: 6px; background: #FFFFFF; box-shadow: 0 1px 3px rgba(0, 0, 0, .1); font-size: 8.5px; font-weight: 700; transition: background-color .35s ease, box-shadow .35s ease, height .3s ease, opacity .3s ease, margin .3s ease; }
.es__row.is-out, .es .es__sec.is-out { height: 0; margin: 0 0 -6px; opacity: 0; box-shadow: none; }
.es__label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.es__i { flex: none; width: 13px; height: 13px; fill: none; stroke: #0A3C32; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.es__pin { flex: none; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; transition: filter .15s ease; }
.es__pin svg { width: 10px; height: 10px; fill: none; stroke: #4E5552; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: fill .3s ease, stroke .3s ease; }
/* before: pinned rows show the pin-off icon, others the pin; both tiny and grey */
.es--before .es__off, .es--before .es__row.is-pinned .es__on { display: none; }
.es--before .es__row.is-pinned .es__off { display: block; }
/* after: one pin icon; pinned = solid pin on a tinted row */
.es--after .es__off { display: none; }
.es--after .es__pin svg { width: 11px; height: 11px; stroke: #8A938F; }
.es--after .es__row.is-pinned { background: #E1E8E1; box-shadow: none; }
.es--after .es__row.is-pinned .es__pin svg { fill: #0A3C32; stroke: #0A3C32; }
.es__btn { position: absolute; left: 12px; right: 12px; bottom: 12px; padding: 10px; border-radius: 4px; background: #0A3C32; color: #FFFFFF; font-size: 8.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; text-align: center; box-shadow: 0 -10px 14px #F7F7F5; }
.es__toast { position: absolute; left: 12px; right: 12px; bottom: 50px; z-index: 1; display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 7px; background: #2B302E; color: #C9CECB; font-size: 7.5px; line-height: 1.35; opacity: 0; transform: translateY(8px); transition: opacity .3s ease, transform .3s ease; }
.es__toast.is-on { opacity: 1; transform: none; }
.es__toast strong { display: block; color: #FFFFFF; font-size: 9px; }
.es__ti { flex: none; width: 15px; height: 15px; fill: none; stroke-width: 2.2; stroke-linecap: round; }
@keyframes es-caret { 50% { opacity: 0; } }

/* Compare figure that always uses the toggle (Final UI: Mobile app / Web app) */
.cs-compare--tabs.is-enhanced .cs-compare__toggle { display: inline-flex; }
.cs-compare--tabs.is-enhanced .cs-compare__panes { grid-template-columns: minmax(0, 1fr); }
.cs-compare--tabs.is-enhanced .cs-compare__tag { display: none; }
.cs-compare--tabs .cs-compare__pane:not([hidden]) { animation: cs-fade-wf .25s ease; }

/* ==========================================================
   Final UI walkthroughs (PHNH Final Solution, wireflow.js)
   Real screens: 271x586 phone screen; 1000-wide web home page.
   ========================================================== */
.fx--app { justify-content: center; gap: 7%; }
.fx--app .wf__notes { flex: 0 1 22rem; }
/* stack all step captions in one cell so the tallest sets a constant height (the phone is scaled from this box, so a changing height made it bob) */
.fx--app:not(.is-static) .wf__list { display: grid; }
.fx--app:not(.is-static) .wf__list li { display: block; grid-area: 1 / 1; visibility: hidden; }
.fx--app:not(.is-static) .wf__list li.is-current { visibility: visible; }
.fx__phone { background: #FFFFFF; }
.fx__screen { position: absolute; inset: 0; overflow: hidden; background: #FFFFFF; opacity: 0; transition: opacity .4s ease; }
.fx__screen.is-on { opacity: 1; }
.fx__screen img { display: block; width: 100%; height: auto; }
.fx__sheet { opacity: 1; transform: translateY(105%); transition: transform .5s cubic-bezier(.4, 0, .2, 1); background: transparent; }
.fx__sheet.is-on { transform: none; }
.fx__added { position: absolute; left: 0; top: 0; opacity: 0; transition: opacity .35s ease; }
.fx.is-added .fx__added { opacity: 1; }
.fx__scroll { position: absolute; inset: 0; overflow: hidden; }
.fx__scroll img { transition: transform .9s cubic-bezier(.4, 0, .2, 1); }
.fx__nav { position: absolute; left: 0; right: 0; bottom: 0; height: 44px; background-size: 100% auto; background-position: center bottom; background-repeat: no-repeat; }
.fx__hot { position: absolute; pointer-events: none; }
.fx__view { position: relative; flex: 1; overflow: hidden; background: #FFFFFF; }
.fx__page { position: relative; transition: transform 1s cubic-bezier(.4, 0, .2, 1); }
.fx__page img { display: block; width: 100%; height: auto; }
.fx__spot { position: absolute; left: 0; top: 0; width: 0; height: 0; border: 2px solid #FFC328; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(10, 60, 50, .26); opacity: 0; pointer-events: none; transition: left .5s ease, top .5s ease, width .5s ease, height .5s ease, opacity .35s ease; }
.fx.has-spot .fx__spot { opacity: 1; }

/* Project cover images inside .media frames */
.media.has-img::before { display: none; }
.media.has-img { background: #0D3D33; }
.media__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.has-img--full .media__img, .has-img--cover .media__img { object-fit: cover; }
.media.has-img::after { content: ""; position: absolute; inset: auto 0 0 0; height: 40%; background: linear-gradient(to top, rgba(1, 1, 13, .55), transparent); pointer-events: none; }
.media.has-img--full::after { display: none; }
.media.has-img .cap, .media.has-img .go { z-index: 1; color: #ECECF3; }
.media.has-img .cap.mint { color: #88F9C0; }

/* ==========================================================
   Persona board (RCC Artifact 1, persona.js): static image, scroll-in animation only
   ========================================================== */
.persona-img { background: none; }
.persona-img img { display: block; width: 100%; height: auto; }
.persona-img.is-anim { opacity: 0; transform: translateY(24px) scale(.985); }
.persona-img.is-anim.is-in { opacity: 1; transform: none; transition: opacity .8s ease, transform .9s cubic-bezier(.2, .7, .2, 1); }
@media (prefers-reduced-motion: reduce) { .persona-img.is-anim, .persona-img.is-anim.is-in { opacity: 1; transform: none; transition: none; } }

/* ==========================================================
   Journey map (RCC Artifact 2)
   Static: no animation or interaction.
   ========================================================== */
.jm { --jm-brown: #C87814; --jm-yellow: #FFC328; background: #fff; border: 1px solid rgba(20, 110, 230, .25); border-radius: 1.25rem; padding: clamp(1rem, 3vw, 2rem); font-family: var(--sans); color: #202878; }
.jm__scroll { overflow-x: auto; }
.jm__grid { display: grid; grid-template-columns: 9.5rem repeat(4, minmax(0, 1fr)); column-gap: .5rem; min-width: 42rem; }
.jm__rl { padding: .5rem .75rem 1rem 0; border-bottom: 3px solid #202878; display: flex; flex-direction: column; justify-content: center; }
.jm .jm__rt { margin: 0 0 .35rem; font-weight: 700; font-size: 1rem; line-height: 1.15; color: #202878; }
.jm .jm__rd { margin: 0; font-size: .75rem; line-height: 1.35; color: #4B5280; max-width: none; }
.jm__rl--hmw .jm__rt { color: #1B7F3A; }
.jm__rl--pain .jm__rt { color: #C62828; }
.jm__sh { border-bottom: 1px solid #202878; }
.jm__stage { display: block; width: 100%; text-align: left; font: inherit; color: inherit; background: none; border: 0; border-radius: .6rem; padding: .5rem .5rem 1rem; position: relative; margin: 0; }
.jm__stage-t { display: block; font-weight: 700; font-size: 1.1rem; line-height: 1.15; color: #146EE6; }
.jm__stage-d { display: block; margin-top: .35rem; font-size: .75rem; color: #4B5280; }
.jm__cell { display: flex; align-items: center; justify-content: center; gap: .7rem; padding: 1rem 0; border-bottom: 1px solid rgba(32, 40, 120, .08); min-height: 7.5rem; }
.jm__note { position: relative; display: block; width: 3.7rem; height: 3.3rem; }
.jm__note i { position: absolute; border-radius: .35rem; box-shadow: 0 6px 12px rgba(32, 40, 120, .14); }
.jm__note i:first-child { left: 0; top: 0; width: 2.3rem; height: 2.15rem; background: var(--jm-brown); }
.jm__note i:last-child { right: 0; bottom: 0; width: 2.3rem; height: 2.15rem; background: var(--jm-yellow); }
.jm__cell--1 { min-height: 7.5rem; }
.jm__cell--bar { min-height: 6.5rem; }
.jm__bar-b, .jm__bar-y { display: block; width: 74%; height: 3rem; border-radius: .4rem; box-shadow: 0 6px 12px rgba(32, 40, 120, .14); }
.jm__bar-b { background: var(--jm-brown); }
.jm__bar-y { background: var(--jm-yellow); }
.jm__emo { grid-column: 2 / 6; position: relative; height: 8rem; border-bottom: 1px solid rgba(32, 40, 120, .08); }
.jm__curve { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.jm__curve polyline { fill: none; stroke: #0A3C32; stroke-width: 1.5; stroke-linejoin: round; }
.jm__face-w { position: absolute; width: 3.8rem; height: 3.8rem; transform: translate(-50%, -50%); }
.jm__face { display: block; width: 100%; height: 100%; }
.jm__rl--phase { border-bottom-color: #202878; }
}

/* RCC Artifact 3: low-fidelity wireframes (inline SVG, lofi.js)
   Entrance: the phones rise in, then the boxes inside appear one after another. */
.lofi__svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--sans); fill: #111; }
.lofi__svg text { fill: #111; }
.lofi__svg .lf-nav text { fill: #fff; }
.lofi--anim:not(.is-in) .lf, .lofi--anim:not(.is-in) .lf-phone { opacity: 0; }
.lofi--anim.is-in .lf-phone { animation: lf-rise .7s cubic-bezier(.2, .7, .2, 1) backwards; animation-delay: var(--d); }
.lofi--anim.is-in .lf { animation: lf-pop .45s cubic-bezier(.2, .8, .3, 1) backwards; animation-delay: var(--d); transform-box: fill-box; transform-origin: center; }
@keyframes lf-rise { from { opacity: 0; transform: translateY(24px); } }
@keyframes lf-pop { from { opacity: 0; transform: scale(.92); } }

/* ==========================================================
   Scope pivot, Home before / after (RCC Artifact 4, pivot.js)
   Toggle swaps the phone with a slide; numbered points outline what changed.
   ========================================================== */
.pv { font-family: var(--sans); color: #202878; }
.pv__bar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin-bottom: 1rem; }
.pv__toggle { display: inline-flex; border: 1px solid #202878; border-radius: 999px; overflow: hidden; }
.pv__toggle button { font: inherit; font-weight: 600; font-size: .9375rem; color: #202878; background: transparent; border: 0; padding: .45rem 1.25rem; cursor: pointer; transition: background .25s ease, color .25s ease; }
.pv__toggle button[aria-pressed="true"] { background: #146EE6; color: #fff; }
.pv__hint { margin: 0; color: #4B5280; }
.pv button:focus-visible { outline: 2px solid #202878; outline-offset: 2px; }
.pv__stage { display: grid; max-width: 26rem; margin: 0 auto; aspect-ratio: 820 / 1280; }
.pv__phone { grid-area: 1 / 1; position: relative; align-self: start; visibility: hidden; opacity: 0; transform: translateX(3rem); transition: opacity .45s ease, transform .55s cubic-bezier(.2, .7, .2, 1), visibility 0s .55s; }
.pv__phone--before { justify-self: center; width: 69%; transform: translateX(-3rem); }
.pv__phone--after { width: 100%; }
.pv__phone.is-on { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
.pv__phone img { display: block; width: 100%; height: auto; }
.pv__hs { position: absolute; pointer-events: none; }
.pv__box { position: absolute; inset: 0; border-radius: .6rem; outline: 3px solid #146EE6; box-shadow: 0 0 0 3px #fff; opacity: 0; transform: scale(1.03); transition: opacity .25s ease, transform .3s cubic-bezier(.2, .7, .2, 1); }
.pv__hs.is-active .pv__box, .pv__dot:hover ~ .pv__box, .pv__dot:focus-visible ~ .pv__box { opacity: 1; transform: none; }
.pv__dot { position: absolute; left: -1.5rem; top: -.6rem; width: 1.8rem; height: 1.8rem; border-radius: 50%; border: 2px solid #fff; background: #146EE6; color: #fff; font: 700 .8125rem/1 var(--sans); cursor: pointer; pointer-events: auto; padding: 0; box-shadow: 0 0 0 0 rgba(20, 110, 230, .5); }
.pv__dot[aria-pressed="true"] { background: #202878; }
.pv__phone.is-on .pv__dot { animation: pv-pulse 2s ease-out infinite; }
.pv__phone.is-on .pv__dot[aria-pressed="true"], .pv__phone.is-on .pv__dot:hover { animation: none; }
@keyframes pv-pulse { 0% { box-shadow: 0 0 0 0 rgba(20, 110, 230, .5); } 70%, 100% { box-shadow: 0 0 0 .8rem rgba(20, 110, 230, 0); } }
.pv__body { display: grid; grid-template-columns: minmax(0, 26rem) minmax(0, 1fr); column-gap: clamp(1rem, 4vw, 3rem); align-items: start; justify-content: center; }
.pv__body .pv__stage { margin: 0; max-width: none; }
/* note card: white card with a detached navy pill on its left edge; slides to sit beside the selected area */
.pv__note { position: relative; margin: 0; padding: 1.5rem 1.5rem 1.5rem 3.25rem; min-height: 5.5rem; background: #fff; border-radius: .9rem; box-shadow: 0 14px 30px -18px rgba(32, 40, 120, .4); font-size: 1rem; line-height: 1.55; font-weight: 500; color: #000; transition: transform .45s cubic-bezier(.2, .7, .2, 1); transform: translateY(var(--ny, 0px)); }
.pv__note::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: .75rem; border-radius: 999px; background: #202878; }
.pv__note:empty { background: transparent; box-shadow: none; padding-left: 1.25rem; font-weight: 400; }
.pv__note:empty::before { content: none; }
.pv__note:empty::after { content: "Select a numbered point on the phone."; color: #4B5280; }
@media (max-width: 44rem) {
  .pv__body { grid-template-columns: minmax(0, 1fr); row-gap: 1.25rem; }
  .pv__body .pv__stage { max-width: 26rem; margin: 0 auto; }
  .pv__note { transform: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .pv__phone, .pv__box, .pv__toggle button, .pv__note { transition: none; }
  .pv__phone { transform: none; }
  .pv__phone.is-on .pv__dot { animation: none; }
}

/* ==========================================================
   Clickable prototype (RCC Final Solution, prototype.js)
   Real screens in a phone; pulsing outlines mark the clickable areas.
   ========================================================== */
.proto { display: grid; grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 4rem); align-items: center; justify-content: center; background: var(--surface-2); border: 1px solid rgba(20, 110, 230, .3); border-radius: 1.25rem; padding: clamp(1.25rem, 4vw, 2.5rem); font-family: var(--sans); color: #202878; }
.proto__stage { display: flex; justify-content: center; }
/* frame is drawn outside the box (shadow ring) so the screen area is exactly 393:852 and bottom tab bars sit flush at the bottom */
.proto__phone { position: relative; width: calc(100% - 16px); max-width: 20rem; margin: 8px; aspect-ratio: 393 / 852; border-radius: 2rem; background: #F5F5F5; overflow: hidden; box-shadow: 0 0 0 8px #202878, 0 24px 50px -14px rgba(32, 40, 120, .55); }
.proto__screen { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .35s ease, visibility 0s .35s; }
.proto__screen.is-on { opacity: 1; visibility: visible; transition-delay: 0s; }
.proto__sheet { transform: translateY(6%); transition: opacity .35s ease, transform .45s cubic-bezier(.2, .7, .2, 1), visibility 0s .45s; }
.proto__sheet.is-on { transform: none; }
.proto__scroll { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; overscroll-behavior: contain; }
.proto__scroll::-webkit-scrollbar { display: none; }
.proto__sc { position: relative; }
.proto__sc img { display: block; width: 100%; height: auto; }
.proto__nav { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background-size: 100% auto; background-position: center bottom; background-repeat: no-repeat; }
.proto__hot { position: absolute; display: block; padding: 0; margin: 0; border: 0; background: transparent; cursor: pointer; border-radius: .7rem; outline: 2px solid #146EE6; box-shadow: 0 0 0 2px #fff, 0 0 0 0 rgba(20, 110, 230, .55); animation: proto-pulse 1.8s ease-out infinite; }
.proto__hot:hover { background: rgba(20, 110, 230, .12); }
.proto__hot:focus-visible { outline: 3px solid #202878; box-shadow: 0 0 0 3px #fff; animation: none; }
.proto__hot.is-pressed { background: rgba(20, 110, 230, .22); }
.proto__hot.is-done { animation: none; outline-color: transparent; box-shadow: none; }
.proto.is-quiet .proto__hot { outline-color: transparent; box-shadow: none; animation: none; }
.proto.is-quiet .proto__hot:focus-visible { outline: 3px solid #202878; box-shadow: 0 0 0 3px #fff; }
@keyframes proto-pulse { 0% { box-shadow: 0 0 0 2px #fff, 0 0 0 2px rgba(20, 110, 230, .55); } 70%, 100% { box-shadow: 0 0 0 2px #fff, 0 0 0 .85rem rgba(20, 110, 230, 0); } }
.proto__panel { max-width: 26rem; }
.proto__eyebrow { margin: 0 0 .75rem; color: #4B5280; }
.proto .proto__title { margin: 0 0 .6rem; font: 700 1.6rem/1.15 var(--sans); color: #202878; }
.proto .proto__hint { margin: 0 0 1.25rem; font-size: 1rem; line-height: 1.55; color: #202878; max-width: none; }
.proto .proto__legend { display: flex; align-items: center; gap: .6rem; margin: 0 0 1.25rem; font-size: .8125rem; line-height: 1.4; color: #4B5280; max-width: none; }
.proto__swatch { flex: none; width: 1.6rem; height: 1rem; border-radius: .35rem; outline: 2px solid #146EE6; box-shadow: 0 0 0 2px #fff; }
.proto__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; }
.proto__btn { font: inherit; font-weight: 600; font-size: .9375rem; color: #202878; background: #fff; border: 1px solid #202878; border-radius: 999px; padding: .45rem 1.25rem; cursor: pointer; }
.proto__btn:hover { background: #202878; color: #fff; }
.proto__check { display: inline-flex; align-items: center; gap: .5rem; font-size: .875rem; color: #202878; cursor: pointer; }
.proto__check input { width: 1.05rem; height: 1.05rem; accent-color: #146EE6; }
.proto button:focus-visible, .proto__check input:focus-visible { outline: 2px solid #202878; outline-offset: 2px; }
@media (max-width: 44rem) {
  .proto { grid-template-columns: minmax(0, 1fr); }
  .proto__panel { max-width: none; text-align: center; }
  .proto .proto__legend, .proto__actions { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .proto__screen, .proto__sheet { transition: none; transform: none; }
  .proto__hot { animation: none; }
}

/* RCC hero image: no outline border */
[data-theme="rcc"] .cs-hero .media { border: 0; }

/* Case header meta with three items (Ingredient Swap): split evenly, no empty fourth column */
@media (min-width: 44.01rem) { .cs-meta--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 44rem) { .cs-meta--3 { grid-template-columns: minmax(0, 1fr); } }

/* Clickable things get a mint ring cursor (site accent) instead of the default pointer */
a[href], button:not([disabled]), [role="button"], label[for], summary, select, input[type="checkbox"], input[type="radio"], [data-star], [data-pick], [data-ticker-toggle], [data-replay], .smap__replay, .rloop__toggle, .wf__toggle, .cs-compare__toggle button, .pv__dot, .proto__hot {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='11' fill='%2388F9C0'/%3E%3Ccircle cx='16' cy='16' r='3.5' fill='%2301010D'/%3E%3C/svg%3E") 16 16, pointer;
}
