/* Charlotte Ririe portfolio
   Layout: one 1240px column, full-bleed bands for contrast (white, ink, tinted), cards only where an object needs setting off.
   Single light look by choice; every color below is set explicitly. */

:root {
  color-scheme: light;

  /* Neutrals: Deep Sea, lightened */
  --ground: #F7F7FA;
  --paper: #FFFFFF;
  --ink: #111B2A;
  --ink-2: #2A3448;
  --ink-3: #475A78;
  --muted: #5F6E86;
  --line: #E2E5EC;
  --line-2: #ECEEF3;

  /* The one accent: Pastel Dreams */
  --accent: #4A53D6;
  --accent-mid: #7F89F2;
  --accent-soft: #E8EBFB;
  --accent-pale: #F2F3FC;
  --accent-line: #C6D0F9;
  --sky: #C6D0F9;

  /* Dark band: Deep Sea */
  --night-text: #E6E9F0;
  --night-muted: #B7C0D0;
  --night-label: #8A97AD;
  --night-track: #1D2538;
  --night-line: #2A3448;
  --night-card: #1D2538;
  --night-bar: #475A78;

  /* Patient (Soft Lavender) and clinician (Summer Sunset peach) */
  --plum: #5A55C8;
  --plum-ink: #4A45B0;
  --plum-soft: #EEEDFC;
  --plum-bg: #E6E4F9;
  --plum-light: #B9B9F5;
  --green: #9A4E22;
  --green-dot: #EC7748;
  --green-soft: #FBEFE2;

  /* Best Mate: Summer Sunset */
  --warm: #D1602F;
  --warm-mid: #EC7748;
  --warm-tan: #EDC3A2;
  --warm-bg: #F6F2E6;
  --warm-track: #F1EFD8;
  --warm-pale: #F3E3D2;
  --warm-label: #7A4E2A;
  --warm-light: #EDC3A2;
  --warm-flag: #FBEFE2;

  /* Placeholder highlight (remove before launch) */
  --todo-bg: #FDE2E1;
  --todo-ink: #B42318;

  --display: 'Inter', 'Helvetica Neue', 'Segoe UI', sans-serif;
  --body: 'Inter', 'Helvetica Neue', 'Segoe UI', sans-serif;
  --mono: 'Source Code Pro', 'SFMono-Regular', Menlo, monospace;

  --gutter: 32px;
  --radius-lg: 24px;
  --radius: 18px;
  --radius-sm: 12px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
figcaption, li { text-wrap: pretty; }

a { color: var(--accent); }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 6px; }

/* ---------- Layout ---------- */

.wrap { max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 760px; margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: 0 80px; }
.band-white { background: var(--paper); border-block: 1px solid var(--line); }
.band-ink { background: var(--ink); color: var(--night-text); }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* ---------- Type ---------- */

.display {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(38px, 5.2vw, 66px);
  line-height: 1.06;
  letter-spacing: -0.03em;
}
.display--xl { font-size: clamp(42px, 5.2vw, 76px); line-height: 1.02; letter-spacing: -0.03em; text-wrap: balance; }

.h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(28px, 3.2vw, 36px);
  line-height: 1.18;
  letter-spacing: -0.02em;
}
.h2--lg { font-size: clamp(32px, 3.8vw, 42px); letter-spacing: -0.025em; }
.h2--md { font-size: clamp(24px, 2.8vw, 32px); }
.h3 { margin: 0; font-size: 19px; line-height: 1.3; letter-spacing: -0.01em; }

.lede { font-size: clamp(18px, 1.6vw, 21px); color: var(--ink-2); max-width: 760px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.kicker { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); }
.label {
  margin: 0;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.note { font-size: 14px; color: var(--muted); }
.muted { color: var(--ink-3); }
.section-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 36px; }
.section-head .muted, .prose p, .lede { text-wrap: pretty; }
.section-head .muted { color: var(--ink-2); }

/* Placeholder copy to fill in before launch */
.todo {
  background: var(--todo-bg);
  color: var(--todo-ink);
  font-weight: 600;
  border-radius: 4px;
  padding: 0 4px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* ---------- Header / footer ---------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  padding-block: 28px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { width: 64px; height: auto; color: var(--ink); flex: 0 0 auto; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.nav { display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: center; font-size: 15px; font-weight: 600; }
.nav a { text-decoration: none; color: var(--ink); }
.nav a:hover { color: var(--accent); }

.site-footer { background: var(--paper); border-top: 1px solid var(--line); }
.site-footer .wrap {
  display: flex; flex-wrap: wrap; gap: 24px;
  justify-content: space-between; align-items: center;
  padding-block: 40px;
  font-weight: 700;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font: 700 15px/1.2 var(--body);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--sm { min-height: 44px; padding: 0 18px; }
.btn--accent { background: var(--accent); color: var(--paper); }
.btn--accent:hover { color: var(--paper); background: #3A43C4; }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { color: var(--paper); }
.nav .btn--ink, .nav .btn--ink:hover { color: var(--paper); }
.btn--outline { border-color: var(--ink); color: var(--ink); background: var(--paper); }
.btn--outline:hover { color: var(--ink); }
.btn--sky { background: var(--accent-mid); color: var(--paper); }
.btn--sky:hover { color: var(--paper); }
.btn--white { background: var(--paper); color: var(--ink); }
.btn--white:hover { color: var(--ink); }
.btn--ghost { border-color: currentColor; color: var(--paper); }
.btn--ghost:hover { color: var(--paper); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Bar charts (all bars share one 0 to 100 scale unless noted) ---------- */

.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: flex; align-items: center; gap: 12px; }
.bar-label { flex: 0 0 120px; font-size: 14px; }
.bar-track {
  flex: 1 1 auto;
  height: 18px;
  border-radius: 4px;
  background: var(--track, var(--line-2));
  display: flex;
}
.bar-fill { width: var(--w); background: var(--fill, var(--accent)); border-radius: inherit; }
.bar-value { flex: 0 0 56px; text-align: right; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }

.bars--lg { gap: 20px; }
.bars--lg .bar-label { font-size: 15px; }
.bars--lg .bar-track { height: 30px; border-radius: 6px; }
.bars--lg .bar-value { flex-basis: 80px; font-family: var(--display); font-size: 24px; }
.bars--sm .bar-label { flex-basis: 150px; font-size: 13px; line-height: 1.3; color: var(--night-muted); }
.bars--lg .bar-label { flex-basis: 180px; line-height: 1.3; }
.hero-card-title { font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.25; color: var(--paper); text-wrap: balance; }
.hero-card-key { font-size: 13px; color: var(--night-label); margin-bottom: -6px; }
.result-title { margin-top: 10px; font-family: var(--display); font-weight: 700; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.2; color: var(--paper); text-wrap: balance; }
.bars--sm .bar-track { height: 14px; }
.bars--sm .bar-value { flex-basis: 52px; font-size: 16px; }

.on-dark { --track: var(--night-track); }

@media (max-width: 480px) {
  .bar-label, .bars--lg .bar-label { flex-basis: 84px; font-size: 13px; }
  .bars--lg .bar-value { flex-basis: 64px; font-size: 19px; }
}

/* ---------- Tags ---------- */

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: 13px; padding: 4px 12px; border-radius: 999px; background: var(--accent-pale); color: var(--ink); }
.tag--plum { background: var(--plum-soft); }
.tag--warm { background: var(--warm-pale); }
.tag--ink { background: var(--ink); color: var(--paper); }

/* ---------- Placeholders for real screenshots ---------- */

.shot-slot {
  min-height: 320px;
  border-radius: 24px;
  background: var(--paper);
  border: 1.5px dashed var(--line);
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  font-family: var(--mono);
  font-size: 13px;
}
figure { margin: 0; }
figcaption { margin-top: 12px; font-size: 14px; color: var(--muted); }

/* ---------- Phone mockups (390 x 844 ratio, scaled) ---------- */

.phone {
  position: relative;
  flex: 0 0 auto;
  width: 172px;
  aspect-ratio: 390 / 844;
  max-width: 100%;
  background: var(--paper);
  border: 7px solid var(--ink);
  border-radius: 34px;
  padding: 32px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 18px 40px rgba(20, 24, 31, 0.18);
  font-size: 11px;
  line-height: 1.45;
}
.phone::before {
  content: "";
  position: absolute;
  top: 8px; left: 50%;
  width: 48px; height: 14px;
  margin-left: -24px;
  border-radius: 999px;
  background: var(--ink);
}
.phone-tag { font-family: var(--mono); font-size: 9px; letter-spacing: 0.06em; color: var(--muted); }
.phone-tag--green { color: var(--green); }
.phone-title { font-weight: 700; font-size: 14px; line-height: 1.3; }
.phone-progress { height: 4px; border-radius: 999px; background: var(--plum-soft); display: flex; }
.phone-progress span { width: 50%; background: var(--plum); border-radius: inherit; }
.phone-scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; }
.phone-scale span { text-align: center; padding: 6px 0; border-radius: 7px; background: var(--plum-soft); font-size: 10px; }
.phone-scale .on { background: var(--plum); color: var(--paper); font-weight: 700; }
.phone-ends { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); }
.phone-note { padding: 10px; border-radius: 12px; background: var(--ground); }
.phone-btn { margin-top: auto; text-align: center; padding: 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--ink); color: var(--paper); }
.phone-btn--outline { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.phone-approved { display: flex; align-items: center; gap: 8px; font-size: 10px; color: var(--ink-3); }
.phone-approved::before { content: ""; flex: 0 0 20px; height: 20px; border-radius: 50%; background: var(--green-soft); }
.phone-trend { display: flex; align-items: flex-end; gap: 5px; height: 80px; padding: 8px; border-radius: 12px; background: var(--ground); }
.phone-trend span { flex: 1; height: var(--h); background: var(--plum-light); border-radius: 3px; }
.phone-trend .now { background: var(--plum); }

/* ---------- EHR card (clinician view) ---------- */

.ehr { width: 100%; max-width: 440px; background: var(--paper); border: 1px solid var(--accent-line); border-radius: var(--radius-sm); overflow: hidden; }
.ehr-bar {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 16px;
  background: var(--accent-pale);
  font-family: var(--mono); font-size: 11px; color: var(--muted);
}
.ehr-body { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.ehr-title { font-weight: 700; font-size: 18px; }
.ehr-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; font-size: 12px; }
.ehr-stats > div { padding: 10px; border-radius: 10px; background: var(--ground); }
.ehr-stats span { display: block; color: var(--muted); }
.ehr-stats strong { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.ehr-stats .ok { color: var(--green); }
.ehr-suggest { font-size: 14px; padding: 12px; border-radius: 10px; border: 1px dashed var(--accent-line); }
.ehr-actions { display: flex; gap: 8px; }
.ehr-actions > * { flex: 1; }
.fake-btn { text-align: center; padding: 10px; border-radius: 999px; font-size: 14px; font-weight: 700; background: var(--ink); color: var(--paper); }
.fake-btn--outline { background: transparent; color: var(--ink); border: 1px solid var(--ink); }

/* ---------- Homepage ---------- */

.hero { display: flex; flex-wrap: wrap; gap: 40px 56px; align-items: flex-start; padding-block: 40px 72px; }
.hero-top { flex: 1 1 100%; display: flex; flex-direction: column; gap: 22px; }
.hero-top .display--xl { max-width: 1000px; }
.hero-top .eyebrow { display: inline-flex; align-items: center; gap: 10px; }
.hero-copy { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 24px; padding-top: 8px; }
.hero-claim { font-family: var(--display); font-weight: 600; font-size: clamp(18px, 1.6vw, 21px); line-height: 1.4; color: var(--ink); max-width: 560px; text-wrap: pretty; }
.hero-copy .eyebrow { display: inline-flex; align-items: center; gap: 10px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.hero-copy .lede { max-width: 600px; }
/* Hero art: three pieces of real work, layered */
.hero-art { position: relative; flex: 1.4 1 560px; min-width: 0; height: 560px; }
.hero-art > * { position: absolute; }
.hero-art .hero-art-browser { top: 0; left: 0; width: 100%; }
.hero-art .hero-art-phone { bottom: 0; right: 0; width: 36%; max-width: 250px; border-radius: 22px; z-index: 3; }
@media (max-width: 560px) { .hero-art { height: 400px; } .hero-art .hero-art-phone { width: 42%; } }

.hero-card { flex: 2 1 340px; min-width: 0; background: var(--ink); color: var(--night-text); border-radius: 24px; padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.hero-card .label { color: var(--night-label); }
.hero-card p:last-child { font-size: 14px; color: var(--night-muted); }

.highlights { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 32px; padding-block: 36px; }
.highlight-title { font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1.15; letter-spacing: -0.02em; color: var(--ink); text-wrap: balance; }
.highlight p { margin-top: 8px; font-size: 15px; color: var(--ink-3); }

.work { padding-block: 88px 32px; }
.work-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 40px; }
.case-list { display: flex; flex-direction: column; gap: 28px; }

.case-card {
  display: flex;
  flex-wrap: wrap;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
a.case-card:hover { color: var(--ink); border-color: var(--accent-line); box-shadow: 0 16px 40px rgba(20, 24, 31, 0.08); }
.case-copy { flex: 1 1 420px; min-width: 0; padding: 44px; display: flex; flex-direction: column; gap: 14px; }
.case-meta { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.case-title { font-family: var(--display); font-weight: 700; font-size: clamp(24px, 2.4vw, 32px); line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
.case-copy .muted { color: var(--ink-3); }
.case-cta { margin-top: 10px; font-weight: 700; color: var(--accent); }
a.case-card:hover .case-cta { text-decoration: underline; }
.case-visual { flex: 1 1 420px; min-width: 0; min-height: 340px; padding: 40px; display: flex; align-items: center; justify-content: center; }
.case-visual--eo { background: var(--accent-soft); }
.case-visual--plum { background: var(--plum-bg); min-height: 460px; gap: 22px; padding-inline: 24px; }
.case-visual--eo { background: #D5E7FF; gap: 22px; padding-inline: 24px; } /* EO Blue Highlight, per Charlotte */
.case-visual--eo .screen-phone { width: 44%; max-width: 200px; border-radius: 18px; align-self: center; }
.case-visual--eo .screen-phone + .screen-phone { margin-top: 0; }
.case-visual--warm { background: var(--warm-bg); flex-direction: column; align-items: stretch; gap: 16px; }

@media (max-width: 560px) {
  .case-copy { padding: 28px; }
  .case-visual { padding: 28px 20px; }
  .case-visual--plum, .case-visual--eo { gap: 12px; }
  .case-visual--plum .phone { width: 46%; }
}

.mini-card { width: 100%; max-width: 400px; background: var(--paper); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 14px; border: 1px solid var(--accent-line); }
.mini-head { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.mini-bars { display: flex; gap: 6px; align-items: flex-end; height: 48px; }
.mini-bars span { flex: 1; height: var(--h); background: var(--accent-line); border-radius: 3px; }
.mini-bars .now { background: var(--accent); }
.mini-suggest { font-size: 14px; color: var(--ink-3); padding: 10px 12px; background: var(--ground); border-radius: 10px; }

.pipeline-label { font-family: var(--mono); font-size: 11px; color: var(--warm-label); }
.pipeline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pipeline span { padding: 10px 14px; border-radius: 12px; background: var(--paper); font-size: 13px; font-weight: 700; }
.pipeline .arrow { padding: 0; background: none; color: var(--warm); }
.pipeline .hot { background: var(--warm); color: var(--paper); }
.split-bar { display: flex; gap: 6px; }
.split-bar span { height: 26px; }
.split-bar .shown { flex: 83; border-radius: 6px 0 0 6px; background: var(--warm-tan); }
.split-bar .hidden-part { flex: 17; border-radius: 0 6px 6px 0; background: repeating-linear-gradient(45deg, var(--warm), var(--warm) 4px, var(--warm-bg) 4px, var(--warm-bg) 8px); }
.split-legend { display: flex; justify-content: space-between; font-size: 13px; color: var(--warm-label); }

.clients { padding-block: 48px 96px; }
.client-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
@media (max-width: 760px) { .client-grid { grid-template-columns: 1fr; } }
.client { padding: 22px 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); color: var(--ink); text-decoration: none; }
a.client:hover { color: var(--ink); border-color: var(--accent-line); }
.client strong { display: block; }
.client span { font-size: 15px; color: var(--ink-3); }

.principles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 40px; }
.principle { border-top: 3px solid var(--rule, var(--ink)); padding-top: 22px; display: flex; flex-direction: column; gap: 8px; }
.principle p { color: var(--ink-3); }

.about { display: flex; flex-wrap: wrap; gap: 56px; align-items: center; padding-block: 96px; }
.about-photo { flex: 1 1 280px; min-height: 360px; border-radius: 24px; background: var(--night-card); display: grid; place-items: center; font-family: var(--mono); font-size: 13px; }
.about-copy { flex: 2 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.about-copy h2 { color: var(--paper); }
.about-copy p { max-width: 640px; }
.colophon { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--night-line); font-family: var(--mono); font-size: 13px; color: var(--night-label); }
.email-text { font-family: var(--mono); font-size: 14px; color: var(--night-muted); user-select: all; }

/* ---------- Case study shared ---------- */

.cs-hero { padding-block: 48px; display: flex; flex-direction: column; gap: 24px; }
.cs-hero .display { max-width: 1040px; }

.result-panel { background: var(--ink); color: var(--night-text); border-radius: var(--radius-lg); padding: 48px; display: flex; flex-wrap: wrap; gap: 48px; }
.result-chart { flex: 2 1 440px; min-width: 0; }
.result-chart .label { color: var(--night-label); }
.result-chart .sub { margin: 6px 0 28px; font-size: 14px; color: var(--night-label); }
.result-side { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 28px; border-left: 1px solid var(--night-line); padding-left: 40px; }
.big-stat { font-family: var(--display); font-weight: 700; font-size: 36px; line-height: 1; letter-spacing: -0.02em; color: var(--paper); }
.big-stat + p { margin-top: 6px; font-size: 15px; color: var(--night-muted); }
@media (max-width: 760px) {
  .result-panel { padding: 28px; }
  .result-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--night-line); padding-top: 28px; }
}

.stat-band { background: var(--ink); color: var(--night-text); border-radius: var(--radius-lg); padding: 44px 48px; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 36px; }
.stat-band .big-stat { font-size: 44px; }
.stat-band .big-stat.warm { color: var(--warm-light); }
.stat-band p { margin-top: 8px; font-size: 15px; color: var(--night-muted); }
@media (max-width: 560px) { .stat-band { padding: 28px; } }

.meta-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1px;
  background: var(--line-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.meta-bar > div { background: var(--paper); padding: 26px 28px; display: flex; flex-direction: column; gap: 6px; }
.meta-bar p:last-child { font-size: 15px; }

.prose { display: flex; flex-direction: column; gap: 18px; padding-block: 32px 48px; }
.prose .h2 { margin-bottom: 2px; }

.step-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.step-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; gap: 10px; }
.step-card .num { font-family: var(--display); font-weight: 700; font-size: 44px; line-height: 1; color: var(--line); }
.step-card strong { font-size: 20px; }
.step-card > span:last-child { font-size: 15px; color: var(--ink-3); }
.step-card--dark { background: var(--ink); border-color: var(--ink); color: var(--night-text); }
.step-card--dark .num { color: var(--ink-3); }
.step-card--dark strong { color: var(--paper); }
.step-card--dark > span:last-child { color: var(--night-muted); }
.step-card--warm { background: var(--warm); border-color: var(--warm); color: var(--paper); }
.step-card--warm .num { color: rgba(255, 255, 255, 0.35); }
.step-card--warm > span:last-child { color: #F2E6D8; }
.step-card--warm-num .num { color: var(--warm-pale); }

.role { align-self: flex-start; font-family: var(--mono); font-size: 12px; padding: 4px 10px; border-radius: 999px; }
.role--patient { background: var(--plum-soft); color: var(--plum-ink); }
.role--system { background: var(--accent-pale); color: var(--accent); }
.role--clinician { background: var(--green-soft); color: var(--green); }
.role--patient-dark { background: var(--night-card); color: var(--plum-light); }

.fig-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 24px; }
.fig-wide { grid-column: 1 / -1; }
.fig-stage { min-height: 420px; border-radius: 24px; padding: 36px 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 18px; }
.fig-stage--eo { background: var(--accent-soft); }
.fig-stage--plum { background: var(--plum-bg); }
@media (max-width: 560px) {
  .fig-stage--plum .phone { width: 44%; }
}

.decisions { display: flex; flex-direction: column; }
.decision { display: flex; gap: 24px; padding-block: 24px; border-top: 1px solid var(--line); }
.decision:last-child { border-bottom: 1px solid var(--line); }
.decision .num { flex: 0 0 32px; font-family: var(--display); font-weight: 700; font-size: 28px; color: var(--accent); line-height: 1.2; }
.decision div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.decision p { color: var(--ink-2); }

.live-panel { background: var(--ink); color: var(--paper); border-radius: var(--radius-lg); padding: 48px; display: flex; flex-wrap: wrap; gap: 32px; align-items: center; justify-content: space-between; }
.live-panel > div:first-child { flex: 1 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.live-panel .kicker { color: var(--accent-mid); }
.live-panel p:last-child { color: var(--night-muted); }
@media (max-width: 560px) { .live-panel { padding: 28px; } }

.reflect { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; display: flex; flex-direction: column; gap: 10px; margin-bottom: 88px; }
.reflect h2 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -0.01em; }
.reflect p { color: var(--ink-2); }

/* ---------- Interactive demos ---------- */

.demo { border-radius: var(--radius-lg); padding: 44px; display: flex; flex-wrap: wrap; gap: 40px; align-items: stretch; }
.demo--eo { background: var(--accent-soft); }
.demo--warm { background: var(--warm-bg); align-items: center; }
.demo-intro { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.demo-intro .muted { color: var(--ink-2); }
.demo-note { margin-top: 12px; }
@media (max-width: 560px) { .demo { padding: 24px; gap: 28px; } }

.loop-tabs { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.loop-tab {
  display: flex; gap: 12px; align-items: center;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-line);
  background: var(--paper);
  color: var(--ink);
  font: 600 15px/1.3 var(--body);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.loop-tab span { font-family: var(--mono); font-size: 12px; opacity: 0.7; }
.loop-tab:hover { border-color: var(--ink); }
.loop-tab[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.loop-stage { flex: 1 1 420px; min-width: 0; min-height: 440px; background: var(--paper); border-radius: 22px; padding: 32px; display: flex; align-items: center; justify-content: center; }
.loop-panel { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.loop-panel--wide { max-width: 440px; }
.panel-tag { font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; }
.panel-tag--patient { color: var(--plum-ink); }
.panel-tag--system { color: var(--accent); }
.panel-tag--green { color: var(--green); }
.panel-title { font-weight: 700; font-size: 20px; line-height: 1.3; }
.panel-note { font-size: 15px; padding: 14px; border-radius: 12px; background: var(--ground); }
.score-readout { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.score-readout strong { font-family: var(--display); font-size: 56px; line-height: 1; color: var(--plum); font-variant-numeric: tabular-nums; }
.score-readout span { color: var(--muted); }
.range { width: 100%; height: 28px; accent-color: var(--plum); cursor: pointer; }
.range--warm { accent-color: var(--warm); }
.range-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.flag-bars { display: flex; gap: 8px; align-items: flex-end; height: 70px; }
.flag-bars span { flex: 1; height: var(--h); background: var(--accent-line); border-radius: 4px; transition: height 0.25s ease; }
.flag-bars .now { background: var(--accent); }
.flag-bars .now.calm { background: var(--accent-line); }
.loop-stage .btn { min-height: 48px; }
.loop-stage .ehr { max-width: 440px; }
.loop-stage .ehr-actions .btn { min-height: 46px; font-size: 14px; padding: 0 12px; }

.verifier-grid { flex: 1 1 440px; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.render { background: var(--paper); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 10px; transition: opacity 0.2s ease; }
.render.is-hidden { opacity: 0.45; }
.render-art { aspect-ratio: 4 / 5; max-width: 100%; border-radius: 12px; background: var(--art); display: grid; place-items: center; }
.render.is-hidden .render-art { background: repeating-linear-gradient(45deg, var(--warm-pale), var(--warm-pale) 6px, var(--ground) 6px, var(--ground) 12px); }
.render-art span { width: 46%; aspect-ratio: 1; border-radius: 50% 50% 46% 46%; background: var(--warm-mid); box-shadow: -34px -26px 0 -16px var(--warm), 34px -26px 0 -16px var(--warm); }
.render-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.render-name { font-size: 13px; color: var(--muted); }
.pill { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--green-soft); color: var(--green); white-space: nowrap; }
.render.is-hidden .pill { background: var(--ground); color: var(--muted); }
.render.is-floor .pill { background: var(--warm-flag); color: var(--warm); }
.meter-row { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.meter { flex: 1; height: 6px; border-radius: 999px; background: var(--warm-track); display: flex; }
.meter span { width: var(--w); background: var(--warm); border-radius: inherit; }
.render.below .meter span { background: var(--warm-tan); }
.threshold-label { font-weight: 700; margin-top: 8px; }
.threshold-label output { font-family: var(--display); font-size: 28px; color: var(--warm); font-variant-numeric: tabular-nums; }
.verifier-summary { font-size: 15px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--paper); }
@media (max-width: 420px) {
  .render-art span { box-shadow: -24px -18px 0 -12px var(--warm), 24px -18px 0 -12px var(--warm); }
}

/* Best Mate charts */
.chart-row { display: flex; flex-wrap: wrap; gap: 24px; }
.chart-card { flex: 1 1 480px; min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 24px; padding: 36px; display: flex; flex-direction: column; gap: 6px; }
.chart-card--narrow { flex-basis: 360px; }
.chart-card .bars { margin-top: 18px; }
.chart-card .note:last-child { margin-top: 18px; }
.warm-bars { --track: var(--warm-track); --fill: var(--warm); }
@media (max-width: 560px) { .chart-card { padding: 24px; } }

.columns { display: flex; align-items: flex-end; gap: 18px; height: 220px; margin-top: 18px; padding-bottom: 4px; border-bottom: 1px solid var(--line-2); }
.column { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; font-weight: 700; font-variant-numeric: tabular-nums; }
.column span { width: 100%; height: var(--h); background: var(--fill); border-radius: 8px 8px 0 0; }
.column-labels { display: flex; gap: 18px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.column-labels span { flex: 1; text-align: center; }

.split { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; }
.split > div { flex: 1 1 400px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

/* ---------- Flowchart (after Charlotte's Patient Experience Flow) ---------- */

:root {
  --flow-blue: #2E6BB5;
  --flow-green: #3F8F3A;
  --flow-navy: #1D4F8C;
  --flow-orange: #B8571A;
  --flow-red: #B3322B;
  --flow-slate: #5A6573;
}

.flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr) 56px minmax(0, 1fr);
  grid-template-areas:
    "p  a1 cp a2 tu"
    "d1 .  d2 .  d3"
    "dq .  cr .  nt";
  align-items: stretch;
  row-gap: 0;
}
.flow-card {
  --c: var(--flow-blue);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 15px;
  line-height: 1.45;
}
.flow-card--blue { --c: var(--flow-blue); }
.flow-card--green { --c: var(--flow-green); }
.flow-card--navy { --c: var(--flow-navy); }
.flow-card--orange { --c: var(--flow-orange); }
.flow-card--red { --c: var(--flow-red); }
.flow-card--slate { --c: var(--flow-slate); }
.flow-when { order: -1; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.flow-title {
  margin: 0;
  display: flex; align-items: center; gap: 10px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.15;
  color: var(--c);
}
.flow-title::before { content: ""; width: 12px; height: 12px; border-radius: 4px; background: var(--c); flex: 0 0 auto; }
.flow-card ul { margin: 4px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; }
.flow-card li { position: relative; padding-left: 16px; }
.flow-card li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.flow-card .flow-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 16px; }
.flow-aside { color: var(--muted); }
.flow-timeline { margin: 4px 0 0; display: flex; flex-direction: column; gap: 6px; }
.flow-timeline div { display: flex; gap: 10px; align-items: baseline; }
.flow-timeline dt { flex: 0 0 86px; text-align: center; font-size: 12px; font-weight: 700; padding: 3px 6px; border-radius: 6px; background: var(--ground); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.flow-timeline dd { margin: 0; }

.flow-arrow { display: flex; align-items: center; justify-content: center; color: var(--c); }
.flow-arrow svg { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.flow-arrow--right svg, .flow-arrow--both svg { width: 44px; height: 16px; }
.flow-arrow--down, .flow-arrow--up { height: 52px; }
.flow-arrow--down svg, .flow-arrow--up svg { width: 16px; height: 40px; }

@media (max-width: 900px) {
  .flow { display: flex; flex-direction: column; }
  .flow > * { grid-area: auto !important; }
  .flow-card[style*="grid-area: p"] { order: 1; }
  .flow-arrow[style*="grid-area: a1"] { order: 2; }
  .flow-card[style*="grid-area: cp"] { order: 3; }
  .flow-arrow[style*="grid-area: a2"] { order: 4; }
  .flow-card[style*="grid-area: tu"] { order: 5; }
  .flow-card[style*="grid-area: dq"] { order: 6; }
  .flow-card[style*="grid-area: cr"] { order: 7; }
  .flow-card[style*="grid-area: nt"] { order: 8; }
  .flow-arrow--down, .flow-arrow--up { display: none; }
  .flow-arrow--right, .flow-arrow--both { height: 52px; }
  .flow-arrow--right svg, .flow-arrow--both svg { transform: rotate(90deg); }
  .flow-card--branch { margin-top: 16px; border-style: dashed; }
}

/* ---------- Real screens: flat captures, one light edge, no drawn device ---------- */

.screen-phone {
  width: 100%;
  max-width: 300px;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: 0 14px 32px rgba(20, 24, 31, 0.10);
}
.screen-browser {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: 0 14px 32px rgba(20, 24, 31, 0.08);
  background: var(--paper);
}
.screen-pair { display: flex; flex-wrap: wrap; gap: 48px; justify-content: center; }
.screen-pair figure { flex: 0 1 300px; display: flex; flex-direction: column; align-items: center; }
.screen-pair figcaption { max-width: 300px; color: var(--ink-3); }

.lane { margin-bottom: 48px; }
.lane-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.lane-scroll {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 14px;
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
  scrollbar-width: thin;
}
.lane-item { flex: 0 0 220px; scroll-snap-align: start; display: flex; flex-direction: column; }
.lane-item--wide { flex-basis: min(560px, 82vw); }
.lane-item .screen-phone { max-width: 220px; border-radius: 18px; }
.lane-item figcaption { color: var(--ink-3); font-size: 14px; line-height: 1.5; }
.step { font-weight: 800; color: var(--accent); margin-right: 6px; font-variant-numeric: tabular-nums; }
.step::after { content: "."; }

/* ---------- Live embed of the real patient app ---------- */

.live-embed { background: var(--ink); color: var(--night-text); border-radius: var(--radius-lg); padding: 44px; display: flex; flex-wrap: wrap; gap: 40px; align-items: center; }
.live-copy { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.live-copy h2 { color: var(--paper); }
.live-copy p { color: var(--night-muted); }
.live-frame { flex: 0 1 430px; min-width: 0; width: 100%; max-width: 430px; margin-inline: auto; }
.live-frame iframe { display: block; width: 100%; height: 940px; border: 0; border-radius: 24px; background: #0E1A2B; }
@media (max-width: 560px) {
  .live-embed { padding: 24px 16px; }
  .live-frame iframe { height: 860px; }
}

/* ---------- Best Mate: real verifier batch ---------- */

.verifier { align-items: flex-start; }
.verifier-photo { display: flex; flex-direction: column; gap: 6px; max-width: 220px; }
.verifier-photo img { border-radius: 14px; aspect-ratio: 546 / 526; object-fit: cover; }
.verifier-photo figcaption { margin: 0; font-size: 13px; color: var(--warm-label); }
.view-toggle { display: flex; flex-wrap: wrap; gap: 8px; }
.view-btn {
  min-height: 44px; padding: 0 16px;
  border-radius: 999px;
  border: 1.5px solid var(--warm);
  background: transparent; color: var(--warm);
  font: 700 14px/1.2 var(--body);
  cursor: pointer;
}
.view-btn[aria-pressed="true"] { background: var(--warm); color: var(--paper); }
.verifier-main { flex: 1 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.verifier .verifier-grid { flex: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.verifier.is-customer .verifier-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.verifier .render {
  appearance: none;
  border: 2px solid transparent;
  background: var(--paper);
  border-radius: 16px;
  padding: 8px;
  display: flex; flex-direction: column; gap: 8px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--ink);
  opacity: 1;
}
.verifier .render img { border-radius: 10px; aspect-ratio: 520 / 645; object-fit: cover; width: 100%; }
.verifier .render[aria-pressed="true"] { border-color: var(--warm); }
.verifier .render.is-fail img { filter: saturate(0.6); }
.verifier .render.is-fail .pill { background: #FBE3E1; color: #A2281F; }
.verifier .render-row { flex-wrap: wrap; gap: 4px; }
.verifier .render-name { font-size: 12px; }
.verifier .pill { font-size: 11px; padding: 2px 8px; }
.verifier-note { margin: 0; background: var(--paper); border-radius: var(--radius-sm); padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.55; }
.verifier-note-head { font-weight: 800; color: var(--warm); }
@media (max-width: 640px) {
  .verifier .verifier-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .verifier.is-customer .verifier-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Case card visuals with real screens */
.case-visual--eo .screen-browser { max-width: 520px; }
.case-visual--plum .screen-phone { width: 44%; max-width: 200px; border-radius: 18px; align-self: center; }
.bm-strip { display: flex; align-items: center; gap: 10px; }
.bm-strip figure { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.bm-strip img { border-radius: 10px; aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
.bm-strip figcaption { margin: 0; font-size: 12px; font-weight: 700; color: var(--warm-label); text-align: center; }
.bm-strip .bm-fail img { opacity: 0.5; filter: grayscale(0.4); outline: 2px dashed #A2281F; outline-offset: -2px; }
.bm-strip .bm-fail figcaption { color: #A2281F; }
.bm-arrow { color: var(--warm); font-weight: 700; flex: 0 0 auto; }
.pipeline-label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; }

/* ---------- Case studies as small publications ---------- */

.work-head { flex-direction: column; align-items: flex-start; gap: 10px; }
.work-head .muted { max-width: 560px; }
.pub-list { display: flex; flex-direction: column; gap: 32px; }
.pub {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
}
.pub-masthead { display: flex; flex-direction: column; color: var(--ink); text-decoration: none; border-right: 1px solid var(--line-2); }
a.pub-masthead:hover { color: var(--ink); }
a.pub-masthead:hover .case-cta { text-decoration: underline; }
.pub .case-visual { flex: none; min-height: 300px; padding: 32px; }
.pub .case-visual--plum { min-height: 380px; }
.pub-head { padding: 32px 36px 36px; display: flex; flex-direction: column; gap: 12px; }
.pub-head .muted { color: var(--ink-3); }

.pub-toc { list-style: none; margin: 0; padding: 20px 0; counter-reset: toc; display: flex; flex-direction: column; }
.pub-toc li { counter-increment: toc; }
.pub-toc a, .pub-toc .toc-link {
  display: grid;
  grid-template-columns: 28px 1fr;
  column-gap: 12px;
  padding: 16px 32px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line-2);
}
.pub-toc li:last-child a, .pub-toc li:last-child .toc-link { border-bottom: 0; }
.pub-toc a::before, .pub-toc .toc-link::before {
  content: counter(toc);
  grid-row: span 2;
  font-family: var(--display); font-weight: 700; font-size: 20px; line-height: 1.2;
  color: var(--accent);
}
.pub-toc a:hover { background: var(--ground); color: var(--ink); }
.pub-toc a:hover .toc-title { text-decoration: underline; text-underline-offset: 3px; }
.toc-title { font-weight: 700; font-size: 17px; line-height: 1.35; text-wrap: balance; }
.toc-kind { font-size: 13px; color: var(--muted); }
.pub--soon .pub-toc .toc-link::before { color: var(--line); }
.pub--soon .toc-title { color: var(--ink-3); }
.soon-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--plum-soft); color: var(--plum-ink); font-weight: 700; }

@media (max-width: 900px) {
  .pub { grid-template-columns: minmax(0, 1fr); }
  .pub-masthead { border-right: 0; border-bottom: 1px solid var(--line-2); }
  .pub-toc a, .pub-toc .toc-link { padding-inline: 24px; }
  .pub-head { padding: 24px; }
}

.case-visual--gs { background: var(--accent-pale); gap: 22px; padding-inline: 24px; min-height: 420px; }
.case-visual--gs .screen-phone { width: 42%; max-width: 190px; border-radius: 18px; align-self: center; }

/* Lead cards: big visual left, head + three reads right */
.pub--lead { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.pub-visual { display: flex; text-decoration: none; }
.pub--lead .pub-visual { min-height: 580px; border-right: 1px solid var(--line-2); }
.pub-side { display: flex; flex-direction: column; min-width: 0; }
.pub-side .pub-toc { padding-block: 4px 0; border-top: 1px solid var(--line-2); }
.pub-side .pub-toc li:last-child a { border-bottom: 1px solid var(--line-2); }
.pub-head .case-title { text-decoration: none; color: var(--ink); }
.pub-head .case-title:hover { color: var(--accent); }
.pub-cta { margin-top: auto; padding: 22px 36px 30px; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.pub-cta .case-cta { margin: 0; text-decoration: none; }
.pub-cta .case-cta::after { content: "\00a0→"; }
.pub-cta .case-cta:hover { text-decoration: underline; text-underline-offset: 3px; }

/* The pair: two smaller cards side by side */
.pub-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.pub--small { display: flex; flex-direction: column; }
.pub--small .pub-visual { min-height: 400px; border-bottom: 1px solid var(--line-2); }
.pub--small .pub-head { padding-bottom: 28px; }
.pub--small .pub-toc { padding-block: 4px 0; border-top: 1px solid var(--line-2); }
.pub--small .pub-toc li:last-child a { border-bottom: 1px solid var(--line-2); }
.pub--small .case-title { font-size: clamp(22px, 2vw, 26px); }

/* Four compositions, so the cards don't read as one template */
.case-visual--stagger { gap: 28px; padding: 56px 32px 0; align-items: flex-end; overflow: hidden; }
.case-visual--stagger .screen-phone { width: 42%; max-width: 270px; border-radius: 22px 22px 0 0; }
.case-visual--stagger .screen-phone:last-child { transform: translateY(56px); }
.case-visual--bleed { padding: 56px 0 0 48px; align-items: flex-end; justify-content: flex-start; overflow: hidden; }
.case-visual--bleed .screen-browser { width: 126%; max-width: none; border-radius: 12px 0 0 0; margin-bottom: -2px; }
.case-visual--tall { height: 400px; min-height: 0; overflow: hidden; align-items: flex-start; padding: 40px 32px 0; }
.case-visual--tall .screen-phone { width: 58%; max-width: 260px; border-radius: 22px 22px 0 0; }
.pub--small .case-visual--warm { padding: 40px 32px; align-items: center; justify-content: center; }

@media (max-width: 1000px) {
  .pub--lead { grid-template-columns: minmax(0, 1fr); }
  .pub--lead .pub-visual { min-height: 420px; border-right: 0; border-bottom: 1px solid var(--line-2); }
  .pub-pair { grid-template-columns: minmax(0, 1fr); }
  .pub-cta { padding-inline: 24px; }
}
@media (max-width: 560px) {
  .pub--lead .pub-visual { min-height: 360px; }
  .case-visual--stagger { gap: 16px; padding: 36px 20px 0; }
  .case-visual--stagger .screen-phone:last-child { transform: translateY(32px); }
  .case-visual--bleed { padding: 40px 0 0 24px; }
  .case-visual--tall { height: 340px; }
  .pub-cta { flex-direction: column; align-items: flex-start; gap: 6px; padding-block: 18px 24px; }
}

/* How I work, folded into About */
.how-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; max-width: 640px; color: var(--night-muted); }
.how-list strong { color: var(--paper); }
.work--other .pub { background: var(--ground); }
.work--other .pub-toc a:hover { background: var(--paper); }


.client--wide { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 24px; align-items: baseline; }
.client--wide strong { flex: 0 0 auto; }
.client--wide span { flex: 1 1 400px; }


/* ---------- Then / now cards ---------- */
  .then-now { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 24px; }
  .then-now > div { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 12px; }
  .then-now h3 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -0.01em; }
  .then-now ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; color: var(--ink-2); font-size: 15px; }
  .then-now .year { font-weight: 800; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--plum-ink); }

/* ---------- Diagram figures (case pages) ---------- */

.diagram { margin-top: 36px; display: flex; flex-direction: column; align-items: center; }
.diagram img { width: 100%; max-width: 980px; }
.diagram--wide img { max-width: 1160px; }
.diagram-link { display: block; width: 100%; max-width: 1160px; }
.diagram figcaption { max-width: 760px; text-align: center; color: var(--ink-3); }

/* ---------- Phones (kept last so it wins) ---------- */

@media (max-width: 640px) {
  :root { --gutter: 20px; }
  body { font-size: 16px; }
  .site-header { flex-wrap: nowrap; padding-block: 18px; gap: 16px; }
  .site-header .nav .btn { display: none; }
  .brand { gap: 10px; }
  .brand-mark { width: 40px; }
  .brand-name { display: none; }
  .nav { flex-wrap: nowrap; gap: 16px; font-size: 13px; letter-spacing: 0.01em; }
  .nav a { white-space: nowrap; }
  .hero-copy .eyebrow { display: flex; align-items: flex-start; }
  .hero-copy .status-dot { flex: 0 0 auto; margin-top: 5px; }
  .hero .btn-row { flex-direction: column; }
  .hero .btn-row .btn { width: 100%; }
  .about-photo { min-height: 240px; }
}
