/* =====================================================================
   Mohan George · Portfolio v2 — case study pages
   Editorial reading column (after crowley.nl) with wide figures,
   flow diagrams, data tables and live prototype frames.
   ===================================================================== */

.cs-progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 100; background: transparent; }
.cs-progress span { display: block; height: 100%; width: calc(var(--rp, 0) * 100%); background: var(--grad); box-shadow: 0 0 10px var(--glow); }

.cs-col { max-width: calc(760px + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.cs-wide { max-width: calc(1160px + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

.bar__links { display: flex; align-items: center; gap: 6px; }
.bar__link { padding: 10px 14px; border-radius: 100px; font-size: 14px; font-weight: 600; color: var(--ink-2); transition: color .2s, background .2s; }
.bar__link:hover { color: var(--ink); background: var(--glow-soft); }

/* ---------- white reading surface: case studies are always light ---------- */
html[data-page="case"] {
  --bg: #ffffff;
  --bg-2: hsl(var(--h) 40% 98%);
  --panel: hsl(var(--h) 45% 97.5%);
  --panel-2: hsl(var(--h) 40% 95%);
  --line: hsl(var(--h) 30% 20% / .1);
  --line-2: hsl(var(--h) 30% 20% / .18);
  --ink: hsl(var(--h) 35% 10%);
  --ink-2: hsl(var(--h) 15% 27%);
  --muted: hsl(var(--h) 10% 42%);
  --dim: hsl(var(--h) 10% 70%);
  --accent: hsl(var(--h) 85% 44%);
  --accent-2: hsl(var(--h2) 80% 48%);
  --accent-ink: #fff;
  --glow: hsl(var(--h) 90% 50% / .25);
  --glow-soft: hsl(var(--h) 90% 50% / .1);
  --solid-bg: hsl(var(--h) 35% 10%);
  --solid-ink: #fff;
  color-scheme: light;
}
html[data-page="case"] body::before { background: radial-gradient(60vw 40vh at 85% -10%, hsl(var(--h) 90% 60% / .1), transparent 70%), #fff; }
html[data-page="case"] .bar.is-solid { background: hsl(0 0% 100% / .82); }
html[data-page="case"] .btn--solid { box-shadow: 0 10px 26px -14px hsl(var(--h) 40% 10% / .5); }
html[data-page="case"] .talk { background: radial-gradient(120% 60% at 100% 0%, hsl(var(--h) 90% 60% / .1), transparent 60%), #fff; box-shadow: 0 40px 120px -30px hsl(var(--h) 40% 10% / .45); }
html[data-page="case"] .field input, html[data-page="case"] .field textarea { background: hsl(var(--h) 40% 97%); }
html[data-page="case"] .field input:focus, html[data-page="case"] .field textarea:focus { background: #fff; }
html[data-page="case"] .field__err, html[data-page="case"] .form__status.is-error { color: hsl(355 70% 44%); }
html[data-page="case"] .tp__toggle { background: hsl(0 0% 100% / .9); box-shadow: 0 10px 30px -12px hsl(var(--h) 40% 10% / .35); }
html[data-page="case"] .tp__panel { background: hsl(0 0% 100% / .97); box-shadow: 0 24px 60px -20px hsl(var(--h) 40% 10% / .35); }
html[data-page="case"] .tp__toggle::before { box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--accent); }
html[data-page="case"] .cs-cover__frame, html[data-page="case"] .proto__frame { border-color: var(--line); }
html[data-page="case"] .proto__chrome span, html[data-page="case"] .proto__chrome a { color: var(--muted); }

/* ---------- table of contents (wide screens) ---------- */
.toc { position: fixed; left: 28px; top: 50%; transform: translateY(-50%); z-index: 50; width: 190px; }
.toc__title { font-size: 12px; color: var(--muted); margin: 0 0 12px; font-family: var(--mono); }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line-2); }
.toc a { display: block; padding: 6px 0 6px 14px; margin-left: -1px; border-left: 2px solid transparent; font-size: 13px; color: var(--muted); line-height: 1.35; transition: color .2s, border-color .2s; }
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--ink); border-left-color: var(--accent); }
@media (max-width: 1639px) { .toc { display: none; } }

/* ---------- hero ---------- */
.cs-hero { padding-top: 150px; padding-bottom: 48px; position: relative; }
.cs-back { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 40px; }
.cs-back:hover { color: var(--accent); }
.cs-kicker { margin: 0 0 16px; font-family: var(--mono); font-size: 13px; color: var(--accent); }
.cs-hero h1 { margin: 0 0 22px; font-family: var(--display); font-weight: 500; font-size: clamp(36px, 5.4vw, 68px); line-height: 1.02; letter-spacing: -0.04em; }
.cs-lede { margin: 0; font-size: clamp(18px, 1.6vw, 21px); line-height: 1.55; color: var(--ink-2); }
.cs-meta { margin: 40px 0 0; padding: 22px 0 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.cs-meta dt { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-bottom: 6px; }
.cs-meta dd { margin: 0; font-size: 14.5px; font-weight: 600; line-height: 1.4; }

.cs-cover { margin: 24px auto 0; }
.cs-cover__frame { position: relative; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line-2); box-shadow: 0 50px 100px -50px hsl(var(--h) 40% 20% / .35); background: #fff; }
.cs-cover__frame img { width: 100%; height: auto; }
.cs-cover__cta { position: absolute; right: 18px; bottom: 18px; }

/* numbers strip */
.cs-stats { margin: 56px auto 0; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); overflow: hidden; }
.cs-stats div { padding: 22px 22px 20px; border-right: 1px solid var(--line); }
.cs-stats div:last-child { border-right: 0; }
.cs-stats b { display: block; font-family: var(--display); font-weight: 500; font-size: clamp(26px, 3vw, 38px); letter-spacing: -0.035em; line-height: 1.05; color: var(--ink); }
.cs-stats span { display: block; margin-top: 6px; font-size: 13.5px; color: var(--muted); line-height: 1.35; }

/* ---------- body copy ---------- */
.cs-sec { padding-top: clamp(72px, 9vw, 112px); scroll-margin-top: 40px; }
.cs-sec__num { display: block; font-family: var(--mono); font-size: 12.5px; color: var(--accent); margin-bottom: 12px; }
.cs-sec h2 { margin: 0 0 22px; font-family: var(--display); font-weight: 500; font-size: clamp(26px, 3vw, 38px); line-height: 1.12; letter-spacing: -0.03em; }
.cs-sec h3 { margin: 40px 0 12px; font-family: var(--display); font-weight: 500; font-size: 20px; letter-spacing: -0.015em; line-height: 1.3; }
.cs-sec p, .cs-sec li { font-size: 17.5px; line-height: 1.72; color: var(--ink-2); }
.cs-sec p { margin: 0 0 18px; }
.cs-sec strong { color: var(--ink); font-weight: 600; }
.cs-sec ul.cs-list { margin: 0 0 18px; padding-left: 0; list-style: none; }
.cs-list li { position: relative; padding-left: 22px; margin-bottom: 8px; }
.cs-list li::before { content: ""; position: absolute; left: 2px; top: .7em; width: 7px; height: 7px; transform: rotate(45deg); background: var(--accent); }
.hl { font-family: var(--mono); font-size: .9em; color: var(--accent); background: var(--glow-soft); padding: 1px 6px; border-radius: 5px; white-space: nowrap; }

.cs-quote { margin: 34px 0; padding: 4px 0 4px 24px; border-left: 2px solid var(--accent); }
.cs-quote p { margin: 0 0 10px; font-family: var(--display); font-weight: 400; font-size: clamp(19px, 2vw, 24px); line-height: 1.4; color: var(--ink); letter-spacing: -0.015em; }
.cs-quote cite { font-style: normal; font-size: 14px; color: var(--muted); }

.cs-callout { margin: 32px 0; padding: 22px 24px; border-radius: var(--r-md); background: linear-gradient(120deg, hsl(var(--h) 90% 60% / .12), hsl(var(--h2) 90% 60% / .07)); border: 1px solid hsl(var(--h) 75% 50% / .25); }
.cs-callout p { margin: 0; color: var(--ink); }
.cs-callout b { display: block; font-family: var(--mono); font-weight: 500; font-size: 12.5px; color: var(--accent); margin-bottom: 8px; }
.cs-callout--warn { background: hsl(38 80% 40% / .12); border-color: hsl(34 90% 48% / .4); }
.cs-callout--warn b { color: hsl(30 90% 36%); }

/* ---------- card grids ---------- */
.cs-grid { display: grid; gap: 14px; margin: 28px 0; }
.cs-grid--2 { grid-template-columns: repeat(2, 1fr); }
.cs-grid--3 { grid-template-columns: repeat(3, 1fr); }
.cs-grid--4 { grid-template-columns: repeat(4, 1fr); }
.cs-card { padding: 22px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--panel); }
.cs-card h4 { margin: 0 0 8px; font-family: var(--display); font-weight: 500; font-size: 16.5px; letter-spacing: -0.01em; color: var(--ink); line-height: 1.3; }
.cs-card p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.cs-card__stat { display: block; font-family: var(--display); font-weight: 500; font-size: 30px; letter-spacing: -0.03em; color: var(--accent); line-height: 1; margin-bottom: 10px; }
.cs-card__tag { display: inline-block; font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-bottom: 10px; }
.cs-card i.bi { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--glow-soft); color: var(--accent); font-size: 18px; margin-bottom: 14px; }
.cs-card ul { margin: 10px 0 0; padding-left: 18px; }
.cs-card li { font-size: 14.5px; line-height: 1.55; margin-bottom: 4px; color: var(--ink-2); }

/* personas */
.persona { display: grid; grid-template-columns: auto 1fr; gap: 18px; padding: 22px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--panel); margin-bottom: 14px; }
.persona__avatar { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-family: var(--display); font-weight: 500; font-size: 18px; background: var(--grad); color: var(--accent-ink); }
.persona h4 { margin: 0; font-family: var(--display); font-weight: 500; font-size: 18px; }
.persona__role { margin: 2px 0 10px !important; font-size: 14px !important; color: var(--muted) !important; }
.persona__type { display: inline-block; font-size: 13px; font-weight: 600; color: var(--accent); margin-bottom: 10px; }
.persona blockquote { margin: 0 0 14px; font-size: 16px; line-height: 1.55; color: var(--ink); font-style: italic; }
.persona__stats { display: flex; flex-wrap: wrap; gap: 10px 26px; }
.persona__stats div { font-size: 13.5px; color: var(--muted); max-width: 30ch; line-height: 1.4; }
.persona__stats b { display: block; font-family: var(--display); font-weight: 500; font-size: 20px; color: var(--ink); }

/* empathy map */
.empathy { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 28px 0; }
.empathy .cs-card h4 { display: flex; align-items: center; gap: 10px; }
.empathy .cs-card h4 i.bi { width: 32px; height: 32px; margin: 0; font-size: 15px; border-radius: 10px; }

/* ---------- tables ---------- */
.cs-table-wrap { overflow-x: auto; margin: 26px 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); }
.cs-table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 540px; }
.cs-table th, .cs-table td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.45; }
.cs-table th { font-family: var(--mono); font-weight: 500; font-size: 12px; color: var(--muted); background: hsl(var(--h) 40% 96%); }
.cs-table tr:last-child td { border-bottom: 0; }
.cs-table td { color: var(--ink-2); }
.cs-table td:first-child { color: var(--ink); font-weight: 600; }
.cs-table .up { color: hsl(152 65% 30%); font-family: var(--mono); font-size: 13.5px; white-space: nowrap; }
.cs-table .down { color: hsl(152 65% 30%); font-family: var(--mono); font-size: 13.5px; white-space: nowrap; }
.sev { display: inline-block; font-family: var(--mono); font-size: 11px; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.sev--critical { background: hsl(355 80% 55% / .18); color: hsl(355 70% 44%); }
.sev--serious { background: hsl(25 90% 55% / .18); color: hsl(22 80% 38%); }
.sev--moderate { background: hsl(45 90% 55% / .16); color: hsl(38 85% 32%); }

/* ---------- horizontal bars ---------- */
.hbars { list-style: none; margin: 24px 0; padding: 20px 22px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--panel); display: grid; gap: 12px; }
.hbars__title { font-weight: 600; font-size: 14px !important; color: var(--ink) !important; margin: 0 0 4px !important; }
.hbars li { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; font-size: 14.5px; line-height: 1.4; }
.hbars li b { font-family: var(--mono); font-weight: 500; color: var(--ink); }
.hbars li::after { content: ""; grid-column: 1 / -1; height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--accent) calc(var(--v) * 1%), hsl(var(--h) 30% 90%) 0); }
.hbars li.is-low::after { background: linear-gradient(90deg, hsl(var(--h) 15% 55%) calc(var(--v) * 1%), hsl(var(--h) 30% 90%) 0); }

/* before / after comparison */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 28px 0; }
.compare__col { padding: 22px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--panel); }
.compare__col h4 { margin: 0 0 16px; display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 500; font-size: 16px; }
.compare__col h4::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: hsl(var(--h) 15% 50%); }
.compare__col--after h4::before { background: var(--accent); box-shadow: 0 0 10px var(--glow); }
.compare__col .hbars { margin: 0; padding: 0; border: 0; background: none; }
.compare__col--before .hbars li::after { background: linear-gradient(90deg, hsl(var(--h) 15% 50%) calc(var(--v) * 1%), hsl(var(--h) 30% 90%) 0); }
.compare__col ul.cs-list li { font-size: 15px; }
.compare__col--before ul.cs-list li::before { background: hsl(var(--h) 15% 50%); }

/* ---------- FLOW DIAGRAMS ---------- */
.flow-fig { margin: 36px auto; }
.flow-fig__cap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 16px; }
.flow-fig__cap b { font-family: var(--mono); font-weight: 500; font-size: 12.5px; color: var(--accent); }
.flow-fig__cap span { font-family: var(--display); font-weight: 500; font-size: 18px; letter-spacing: -0.01em; }
.flow-fig__cap small { flex-basis: 100%; font-size: 14px; color: var(--muted); }
.flow-box { padding: clamp(18px, 2.4vw, 30px); border-radius: var(--r-lg); border: 1px solid var(--line-2); background: linear-gradient(150deg, hsl(var(--h) 70% 98.5%), hsl(var(--h) 40% 96%)); position: relative; overflow: hidden; }
.flow-box::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(hsl(var(--h) 40% 30% / .09) 1px, transparent 1px); background-size: 18px 18px; pointer-events: none; }
.flow-box > * { position: relative; }

.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 34px; counter-reset: fl; }
.flow__node {
  position: relative; padding: 14px 14px 13px; border-radius: 14px; min-height: 92px;
  background: hsl(var(--h) 60% 98.5%); border: 1px solid hsl(var(--h) 75% 50% / .22);
  box-shadow: 0 8px 20px -14px hsl(var(--h) 40% 20% / .35);
  display: flex; flex-direction: column; gap: 4px;
}
.flow__node:not(:last-child)::after {
  content: ""; position: absolute; top: 50%; left: 100%; width: 34px; height: 2px; transform: translateY(-50%);
  background: linear-gradient(90deg, hsl(var(--h) 75% 50% / .3), var(--accent));
}
.flow__node:not(:last-child)::before {
  content: ""; position: absolute; top: 50%; left: calc(100% + 26px); transform: translateY(-50%);
  border: 5px solid transparent; border-left: 8px solid var(--accent);
}
.flow__step { font-family: var(--mono); font-size: 11px; color: var(--accent); }
.flow__node strong { font-size: 14.5px; line-height: 1.3; color: var(--ink); font-weight: 600; }
.flow__node small { font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.flow__node--start { border-color: hsl(var(--h) 75% 50% / .5); background: linear-gradient(150deg, hsl(var(--h) 90% 60% / .16), hsl(var(--h) 60% 98.5%)); }
.flow__node--end { border-color: hsl(152 60% 40% / .45); background: linear-gradient(150deg, hsl(152 60% 50% / .12), hsl(var(--h) 60% 98.5%)); }
.flow__node--end .flow__step { color: hsl(152 65% 30%); }
.flow__node--decision { border-style: dashed; border-color: hsl(34 90% 48% / .7); background: hsl(38 95% 55% / .12); }
.flow__node--decision .flow__step { color: hsl(30 90% 36%); }
.flow + .flow { margin-top: 18px; }

/* stacked lanes inside one flow box */
.lane + .lane { margin-top: 22px; padding-top: 22px; border-top: 1px dashed var(--line-2); }
.lane__label { display: flex; align-items: center; gap: 10px; margin: 0 0 12px !important; font-size: 14px !important; font-weight: 600; color: var(--ink) !important; }
.lane__label i { color: var(--accent); }

/* decision branches */
.branches { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 30px; position: relative; }
.branches::before { content: ""; position: absolute; top: -30px; right: 8%; width: 2px; height: 30px; background: hsl(34 90% 48% / .7); }
.branch { padding: 16px; border-radius: 16px; border: 1px solid var(--line-2); background: #fff; }
.branch__tag { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 12px !important; font-family: var(--mono); font-size: 12px !important; padding: 4px 10px; border-radius: 100px; }
.branch--yes .branch__tag { background: hsl(152 60% 40% / .2); color: hsl(152 65% 30%) !important; }
.branch--no .branch__tag { background: hsl(38 80% 50% / .18); color: hsl(30 90% 36%) !important; }
.branch .flow { gap: 26px; }
.branch .flow__node:not(:last-child)::after { width: 26px; }
.branch .flow__node:not(:last-child)::before { left: calc(100% + 18px); }
.branch__loop { margin: 12px 0 0 !important; font-size: 13px !important; color: hsl(30 90% 36%) !important; display: flex; gap: 8px; align-items: center; }
.flow-rail { margin-top: 16px; padding: 12px 16px; border-radius: 12px; border: 1px dashed hsl(var(--h) 75% 50% / .35); font-size: 14px; color: var(--ink-2); display: flex; gap: 10px; align-items: center; }
.flow-rail i { color: var(--accent); font-size: 16px; }

/* sitemap tree */
.tree { text-align: center; }
.tree__root { display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; border-radius: 14px; background: var(--grad); color: var(--accent-ink); font-weight: 700; font-size: 15px; box-shadow: 0 0 40px -10px var(--glow); position: relative; }
.tree__root::after { content: ""; position: absolute; top: 100%; left: 50%; width: 2px; height: 24px; background: var(--accent); }
.tree__level { list-style: none; margin: 24px 0 0; padding: 24px 0 0; display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: 12px; position: relative; text-align: left; }
.tree__level::before { content: ""; position: absolute; top: 0; left: calc(100% / var(--n, 5) / 2); right: calc(100% / var(--n, 5) / 2); height: 2px; background: hsl(var(--h) 75% 50% / .35); }
.tree__level > li { position: relative; }
.tree__level > li::before { content: ""; position: absolute; top: -24px; left: 50%; width: 2px; height: 24px; background: hsl(var(--h) 75% 50% / .35); }
.tree__node { display: flex; align-items: center; gap: 8px; justify-content: center; padding: 12px 10px; border-radius: 12px; border: 1px solid hsl(var(--h) 75% 50% / .3); background: hsl(var(--h) 60% 98.5%); font-size: 14px; font-weight: 600; color: var(--ink); text-align: center; }
.tree__node i { color: var(--accent); }
.tree__kids { list-style: none; margin: 10px 0 0 12px; padding: 0 0 0 12px; border-left: 1px dashed hsl(var(--h) 75% 50% / .35); display: grid; gap: 6px; }
.tree__kids li { font-size: 13px; color: var(--ink-2); padding: 6px 10px; border-radius: 8px; background: hsl(var(--h) 40% 97%); border: 1px solid var(--line); line-height: 1.35; }

/* sprint / phase blocks */
.phases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.phase { padding: 18px; border-radius: 16px; border: 1px solid var(--line-2); background: #fff; }
.phase__head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.phase__head b { font-family: var(--mono); font-weight: 500; font-size: 12px; color: var(--accent); }
.phase h4 { margin: 0 0 6px; font-family: var(--display); font-weight: 500; font-size: 17px; }
.phase p { margin: 0 0 12px; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.phase__ids { display: flex; flex-wrap: wrap; gap: 6px; }
.phase__ids span { font-family: var(--mono); font-size: 11.5px; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--ink-2); }
.risk { font-family: var(--mono); font-size: 11px; padding: 3px 8px; border-radius: 6px; white-space: nowrap; height: fit-content; }
.risk--low { background: hsl(152 60% 40% / .18); color: hsl(152 65% 30%); }
.risk--med { background: hsl(38 80% 50% / .18); color: hsl(30 90% 36%); }

/* screen decision list */
.screens { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 28px 0; }
.screen { padding: 20px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; }
.screen__top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.screen__top span { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.screen h4 { margin: 0 0 8px; font-family: var(--display); font-weight: 500; font-size: 16px; line-height: 1.3; }
.screen p { margin: 0 0 14px; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.screen__stat { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); line-height: 1.4; }
.screen__stat b { font-family: var(--display); font-weight: 500; font-size: 22px; color: var(--accent); display: block; letter-spacing: -0.02em; }

/* palette + type */
.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 24px 0; }
.swatch { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--panel); }
.swatch i { display: block; height: 64px; }
.swatch span { display: block; padding: 8px 10px; font-size: 12.5px; color: var(--ink-2); line-height: 1.35; }
.swatch code { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }

/* ---------- live prototype / screen frames ---------- */
.proto { margin: 36px auto; }
.proto__frame { border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line-2); background: #fff; box-shadow: 0 40px 80px -40px hsl(var(--h) 40% 20% / .3); }
.proto__chrome { display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; background: hsl(var(--h) 25% 94%); }
.proto__chrome i { width: 10px; height: 10px; border-radius: 50%; background: hsl(var(--h) 15% 78%); }
.proto__chrome span { margin-left: 10px; font-family: var(--mono); font-size: 12px; color: var(--muted); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proto__chrome button, .proto__chrome a { font-size: 12.5px; font-weight: 600; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }
.proto__chrome button:hover, .proto__chrome a:hover { color: var(--accent); }
.proto iframe { display: block; width: 100%; height: min(78vh, 760px); border: 0; background: #fff; }
.proto__scroll { max-height: min(78vh, 760px); overflow: auto; background: #fff; overscroll-behavior: contain; }
.proto__scroll img { width: 100%; height: auto; }
.proto__cap { margin: 12px 0 0; font-size: 14px; color: var(--muted); }

/* ---------- learnings ---------- */
.learn { list-style: none; margin: 26px 0; padding: 0; counter-reset: l; display: grid; gap: 12px; }
.learn li { counter-increment: l; display: grid; grid-template-columns: 46px 1fr; gap: 14px; padding: 20px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--panel); margin: 0; }
.learn li::before { content: counter(l, decimal-leading-zero); font-family: var(--display); font-weight: 500; font-size: 22px; color: var(--accent); line-height: 1.2; }
.learn h4 { margin: 0 0 6px; font-family: var(--display); font-weight: 500; font-size: 16.5px; color: var(--ink); line-height: 1.3; }
.learn p { margin: 0 !important; font-size: 15.5px !important; line-height: 1.6 !important; }
.learn p + p { margin-top: 8px !important; }
.learn em { font-style: normal; color: var(--muted); }

/* ---------- next project ---------- */
.cs-next { margin: clamp(96px, 12vw, 150px) auto 0; }
.cs-next a { display: grid; grid-template-columns: 1fr 1.1fr; gap: 0; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line-2); background: var(--panel); transition: border-color .3s, transform .4s var(--ease); }
.cs-next a:hover { border-color: hsl(var(--h) 75% 50% / .5); transform: translateY(-3px); }
.cs-next__body { padding: clamp(24px, 3vw, 40px); display: flex; flex-direction: column; gap: 10px; }
.cs-next__body small { font-family: var(--mono); font-size: 12.5px; color: var(--accent); }
.cs-next__body strong { font-family: var(--display); font-weight: 500; font-size: clamp(24px, 2.8vw, 36px); letter-spacing: -0.03em; line-height: 1.1; }
.cs-next__body p { margin: 0; color: var(--ink-2); font-size: 16px; }
.cs-next__body span.link-arrow { margin-top: auto; align-self: flex-start; }
.cs-next__img { min-height: 260px; background-size: cover; background-position: top center; }
.cs-end { padding-bottom: 80px; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .flow { grid-auto-flow: row; grid-auto-columns: auto; gap: 26px; }
  .flow__node { min-height: 0; }
  .flow__node:not(:last-child)::after { top: 100%; left: 50%; width: 2px; height: 26px; transform: translateX(-50%); background: linear-gradient(180deg, hsl(var(--h) 75% 50% / .3), var(--accent)); }
  .flow__node:not(:last-child)::before { top: calc(100% + 18px); left: 50%; transform: translateX(-50%); border: 5px solid transparent; border-top: 8px solid var(--accent); }
  .branch .flow { gap: 22px; }
  .branch .flow__node:not(:last-child)::after { width: 2px; height: 22px; }
  .branch .flow__node:not(:last-child)::before { left: 50%; top: calc(100% + 14px); }
  .screens, .cs-grid--3, .cs-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .phases { grid-template-columns: 1fr; }
  .tree__level { grid-template-columns: repeat(2, 1fr); padding-top: 0; }
  .tree__level::before, .tree__level > li::before { display: none; }
  .tree__root::after { display: none; }
  .tree__kids { margin-left: 0; }
  .tree__kids li { transform: none; max-width: none; width: auto; }
  .swatches { grid-template-columns: repeat(3, 1fr); }
  .cs-next a { grid-template-columns: 1fr; }
  .cs-next__img { order: -1; min-height: 200px; }
  .bar__link { display: none; }
}
@media (max-width: 640px) {
  .cs-hero { padding-top: 110px; }
  .cs-meta { grid-template-columns: 1fr 1fr; }
  .cs-stats { grid-template-columns: 1fr 1fr; }
  .cs-stats div:nth-child(2) { border-right: 0; }
  .cs-stats div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .cs-grid--2, .cs-grid--3, .cs-grid--4, .screens, .compare, .empathy, .branches { grid-template-columns: 1fr; }
  .branches::before { display: none; }
  .cs-sec p, .cs-sec li { font-size: 16.5px; }
  .persona { grid-template-columns: 1fr; }
  .cs-cover__cta { position: static; margin: 12px; }
}

/* logo chip on the white pages */
html[data-page="case"] .brand__chip { fill: hsl(var(--h) 60% 96%); stroke-opacity: .5; }
