/* ============ Tokens ============ */
:root {
  --bg: #f3f2ee;
  --bg-2: #eae8e2;
  --surface: #fbfaf7;
  --ink: #111110;
  --ink-2: #4a4945;
  --muted: #86847d;
  --line: rgba(17, 17, 16, .12);
  --line-2: rgba(17, 17, 16, .06);
  --accent: #ff4d12;
  --accent-ink: #fff;
  --ok: #1f9d55;
  --warn: #c27a00;
  --contour: rgba(17, 17, 16, .2);
  --shadow: 0 1px 0 rgba(0,0,0,.04), 0 20px 50px -24px rgba(0,0,0,.25);

  --f-sans: 'Onest', system-ui, -apple-system, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, monospace;

  --gut: clamp(16px, 4vw, 56px);
  --max: 1440px;
  --r: 14px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e0d; --bg-2: #161614; --surface: #1a1a18;
    --ink: #eeece6; --ink-2: #b4b2ab; --muted: #7a7872;
    --line: rgba(238, 236, 230, .12); --line-2: rgba(238, 236, 230, .06);
    --contour: rgba(238, 236, 230, .14);
    --shadow: 0 1px 0 rgba(255,255,255,.03), 0 30px 60px -30px rgba(0,0,0,.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0e0d; --bg-2: #161614; --surface: #1a1a18;
  --ink: #eeece6; --ink-2: #b4b2ab; --muted: #7a7872;
  --line: rgba(238, 236, 230, .12); --line-2: rgba(238, 236, 230, .06);
  --contour: rgba(238, 236, 230, .14);
  --shadow: 0 1px 0 rgba(255,255,255,.03), 0 30px 60px -30px rgba(0,0,0,.8);
  color-scheme: dark;
}

/* ============ Base ============ */
@view-transition { navigation: auto; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17px/1.55 var(--f-sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background .4s var(--ease), color .4s var(--ease);
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--accent); color: var(--accent-ink); }
mark { background: none; color: var(--accent); font-weight: 500; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); }
.mono { font-family: var(--f-mono); font-size: 12px; letter-spacing: .02em; text-transform: uppercase; }
.muted { color: var(--muted); }

/* grain */
body::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============ Header ============ */
.hdr {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: transform .5s var(--ease), background .3s;
}
.hdr.is-hidden { transform: translateY(-100%); }
.hdr.is-scrolled { background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); border-bottom: 1px solid var(--line-2); }
.hdr__in { display: flex; align-items: center; gap: 24px; height: 68px; }
.logo { display: flex; align-items: center; gap: 12px; font-weight: 500; letter-spacing: -.01em; }
.logo__mark {
  width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--bg);
  display: grid; place-items: center; font-size: 13px; font-weight: 600; letter-spacing: 0;
  transition: transform .6s var(--ease);
}
.logo:hover .logo__mark { transform: rotate(-12deg) scale(1.06); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { padding: 8px 12px; border-radius: 99px; font-size: 15px; color: var(--ink-2); transition: color .2s, background .2s; }
.nav a:hover { color: var(--ink); background: var(--line-2); }
.hdr__tools { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line); transition: background .2s, transform .2s;
}
.icon-btn:hover { background: var(--line-2); }
.icon-btn svg { width: 17px; height: 17px; }
.kbd { font-family: var(--f-mono); font-size: 11px; padding: 0 12px; width: auto; border-radius: 99px; gap: 6px; display: inline-flex; align-items: center; color: var(--ink-2); }

.btn {
  display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 20px;
  border-radius: 99px; font-size: 15px; font-weight: 500; white-space: nowrap;
  background: var(--ink); color: var(--bg); position: relative; overflow: hidden;
  transition: transform .35s var(--ease);
}
.btn::before { content: ''; position: absolute; inset: 0; background: var(--accent); transform: translateY(101%); transition: transform .45s var(--ease); border-radius: inherit; }
.btn:hover::before { transform: none; }
.btn:hover { color: var(--accent-ink); }
.btn > * , .btn { z-index: 0; }
.btn span, .btn svg { position: relative; z-index: 1; }
.btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn--sm { height: 38px; padding: 0 16px; font-size: 14px; }
.btn svg { width: 16px; height: 16px; transition: transform .35s var(--ease); }
.btn:hover svg { transform: translateX(3px) rotate(-45deg); }

.burger { display: none; }

/* ============ Hero ============ */
.hero { position: relative; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; padding: 120px 0 40px; overflow: hidden; }
.hero__topo { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero__topo-fade { position: absolute; inset: 0; z-index: 0; pointer-events: none; background: radial-gradient(ellipse 70% 60% at 30% 70%, var(--bg) 0%, color-mix(in srgb, var(--bg) 60%, transparent) 45%, transparent 75%); }
.hero .wrap { position: relative; z-index: 1; width: 100%; }
.status { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 10px; border: 1px solid var(--line); border-radius: 99px; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(6px); }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: ping 2.2s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); } 70%,100% { box-shadow: 0 0 0 10px transparent; } }
.hero h1 {
  margin: 28px 0 0; font-weight: 500; letter-spacing: -.05em; line-height: .92;
  font-size: clamp(44px, 8.6vw, 156px); max-width: 15ch;
}
.hero h1 em { font-style: normal; color: var(--muted); }
.line { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
.line > span { display: inline-block; transform: translateY(105%); transition: transform 1.1s var(--ease); }
.is-in .line > span { transform: none; }
.hero__bottom { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); align-items: end; }
.hero__intro { grid-column: 1 / span 5; font-size: clamp(17px, 1.4vw, 20px); color: var(--ink-2); margin: 0; }
.hero__intro b { color: var(--ink); font-weight: 500; }
.hero__meta { grid-column: 7 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.hero__meta div span { display: block; color: var(--muted); margin-bottom: 6px; }
.hero__meta div b { font-weight: 500; font-size: 15px; }
.fade { opacity: 0; transform: translateY(16px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.is-in .fade, .fade.is-in { opacity: 1; transform: none; }

/* ============ Sections ============ */
.sec { padding: clamp(80px, 12vw, 160px) 0; position: relative; }
.sec__head { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; margin-bottom: clamp(40px, 6vw, 80px); align-items: end; }
.sec__label { grid-column: 1 / span 3; display: flex; gap: 12px; align-items: center; color: var(--muted); }
.sec__label::before { content: ''; width: 8px; height: 8px; background: var(--accent); border-radius: 2px; }
.sec__title { grid-column: 4 / -1; margin: 0; font-weight: 500; font-size: clamp(34px, 5vw, 72px); letter-spacing: -.04em; line-height: 1; }
.sec__title em { font-style: normal; color: var(--muted); }

.reveal { opacity: 0; transform: translateY(40px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0s); }
.reveal.is-in { opacity: 1; transform: none; }

/* ============ Facts strip ============ */
.facts { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts__grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.fact { padding: 32px 24px 28px; border-left: 1px solid var(--line); }
.fact:first-child { border-left: 0; padding-left: 0; }
.fact b { display: block; font-size: clamp(36px, 4.4vw, 64px); font-weight: 500; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.fact span { display: block; margin-top: 12px; color: var(--ink-2); font-size: 14px; max-width: 24ch; }

/* ============ Case cards ============ */
.cases { display: grid; gap: clamp(56px, 8vw, 120px); }
.card { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; align-items: start; }
.card__media {
  grid-column: 1 / span 8; position: relative; border-radius: var(--r); overflow: hidden;
  background: var(--bg-2); aspect-ratio: 16 / 10; border: 1px solid var(--line-2);
}
.card:nth-child(even) .card__media { grid-column: 5 / -1; grid-row: 1; }
.card:nth-child(even) .card__body { grid-column: 1 / span 4; grid-row: 1; }
.card__media img { width: 100%; height: 100%; object-fit: cover; object-position: top left; transform: scale(1.04); transition: transform 1.2s var(--ease); }
.card:hover .card__media img { transform: scale(1); }
.card__media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,.06)); pointer-events: none; }
.card__body { grid-column: 9 / -1; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 100px; }
.card__top { display: flex; justify-content: space-between; color: var(--muted); }
.card__title { margin: 0; font-size: clamp(26px, 2.4vw, 34px); font-weight: 500; letter-spacing: -.03em; line-height: 1.08; }
.card__lead { margin: 0; color: var(--ink-2); font-size: 16px; }
.card__kpi { padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; gap: 16px; align-items: baseline; }
.card__kpi b { font-size: 48px; font-weight: 500; letter-spacing: -.05em; line-height: 1; color: var(--accent); white-space: nowrap; }
.card__kpi span { font-size: 14px; color: var(--ink-2); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; padding: 5px 10px; border-radius: 99px; border: 1px solid var(--line); color: var(--ink-2); }
.card__more { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; }
.card__more i { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-style: normal; transition: background .3s, color .3s, transform .4s var(--ease); }
.card:hover .card__more i { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); transform: rotate(-45deg); }

/* cursor follower */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none;
  width: 96px; height: 96px; margin: -48px 0 0 -48px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); display: grid; place-items: center;
  font-size: 13px; font-weight: 500; transform: scale(0); transition: transform .35s var(--ease);
}
.cursor.is-on { transform: scale(1); }

/* ============ Method ============ */
.method { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; }
.method__col { grid-column: span 6; border: 1px solid var(--line); border-radius: var(--r); padding: clamp(24px, 3vw, 40px); background: var(--surface); }
.method__col h3 { margin: 0 0 8px; font-size: 26px; font-weight: 500; letter-spacing: -.03em; }
.method__col > p { margin: 0 0 28px; color: var(--ink-2); font-size: 15px; }
.letters { display: grid; gap: 0; }
.letter { display: grid; grid-template-columns: 44px 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); align-items: baseline; }
.letter b { font-size: 28px; font-weight: 500; letter-spacing: -.04em; color: var(--accent); line-height: 1; }
.letter div { font-size: 15px; }
.letter div span { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ============ Principles ============ */
.principles { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.pr { padding: 28px 24px 0 0; display: flex; flex-direction: column; gap: 14px; }
.pr + .pr { padding-left: 24px; border-left: 1px solid var(--line); }
.pr .mono { color: var(--accent); }
.pr h4 { margin: 0; font-size: 22px; font-weight: 500; letter-spacing: -.02em; line-height: 1.15; }
.pr p { margin: 0; font-size: 15px; color: var(--ink-2); }

/* ============ Lessons marquee ============ */
.lessons { overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 28px 0; }
.lessons__track { display: flex; gap: 56px; width: max-content; animation: marquee 70s linear infinite; }
.lessons:hover .lessons__track { animation-play-state: paused; }
.lesson { display: flex; gap: 20px; align-items: center; max-width: 560px; }
.lesson span { color: var(--accent); font-size: 28px; }
.lesson p { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.lesson small { display: block; color: var(--muted); margin-top: 4px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ============ Experience ============ */
.xp { border-top: 1px solid var(--line); }
.xp__item { border-bottom: 1px solid var(--line); }
.xp__head { width: 100%; display: grid; grid-template-columns: 3fr 3fr 3fr 40px; gap: 24px; align-items: center; padding: 28px 0; text-align: left; }
.xp__head h3 { margin: 0; font-size: clamp(24px, 2.6vw, 36px); font-weight: 500; letter-spacing: -.03em; display: flex; align-items: center; gap: 12px; }
.xp__head .now { font-family: var(--f-mono); font-size: 10px; text-transform: uppercase; color: var(--ok); border: 1px solid currentColor; padding: 3px 8px; border-radius: 99px; letter-spacing: .04em; }
.xp__head > span { color: var(--ink-2); }
.xp__plus { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); position: relative; transition: transform .4s var(--ease), background .3s; }
.xp__plus::before, .xp__plus::after { content: ''; position: absolute; left: 50%; top: 50%; width: 14px; height: 1.5px; background: currentColor; transform: translate(-50%, -50%); }
.xp__plus::after { transform: translate(-50%, -50%) rotate(90deg); transition: transform .4s var(--ease); }
.xp__item.is-open .xp__plus::after { transform: translate(-50%, -50%); }
.xp__item.is-open .xp__plus { background: var(--ink); color: var(--bg); }
.xp__body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s var(--ease); }
.xp__item.is-open .xp__body { grid-template-rows: 1fr; }
.xp__body > div { overflow: hidden; }
.xp__body ul { margin: 0; padding: 0 0 32px; list-style: none; display: grid; grid-template-columns: 3fr 6fr 40px; gap: 24px; }
.xp__body ul li { grid-column: 2; position: relative; padding-left: 20px; color: var(--ink-2); }
.xp__body ul li + li { margin-top: -16px; }
.xp__body ul li::before { content: '—'; position: absolute; left: 0; color: var(--muted); }

/* ============ About ============ */
.about { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; }
.about__photo { grid-column: 1 / span 3; }
.about__photo img { border-radius: var(--r); width: 100%; aspect-ratio: 4/5; object-fit: cover; filter: grayscale(1) contrast(1.05); transition: filter .8s var(--ease); }
.about__photo:hover img { filter: none; }
.about__photo figcaption { margin-top: 12px; color: var(--muted); }
.about__text { grid-column: 5 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.about__big { grid-column: 1 / -1; margin: 0; font-size: clamp(26px, 2.8vw, 40px); line-height: 1.15; letter-spacing: -.03em; font-weight: 500; }
.about__big em { font-style: normal; color: var(--muted); }
.about__text h4 { margin: 0 0 12px; }
.about__text p { margin: 0; color: var(--ink-2); font-size: 16px; }

/* ============ Footer CTA ============ */
.cta { padding: clamp(100px, 14vw, 200px) 0 40px; border-top: 1px solid var(--line); position: relative; overflow: hidden; }
.cta__title { margin: 0; font-size: clamp(48px, 10vw, 180px); font-weight: 500; letter-spacing: -.055em; line-height: .9; }
.cta__title a { display: inline-flex; align-items: center; gap: .2em; transition: color .4s; }
.cta__title a:hover { color: var(--accent); }
.cta__title svg { width: .6em; height: .6em; transition: transform .6s var(--ease); }
.cta__title a:hover svg { transform: rotate(-45deg); }
.cta__row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 48px; }
.foot { display: flex; justify-content: space-between; gap: 24px; margin-top: clamp(80px, 10vw, 140px); padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); flex-wrap: wrap; }
.foot a:hover { color: var(--ink); }

/* ============ Command palette ============ */
.cmdk { position: fixed; inset: 0; z-index: 90; display: none; place-items: start center; padding: 14vh 16px 16px; background: color-mix(in srgb, var(--bg) 50%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.cmdk.is-open { display: grid; animation: fadein .2s var(--ease); }
@keyframes fadein { from { opacity: 0; } }
.cmdk__box { width: min(560px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; animation: pop .3s var(--ease); }
@keyframes pop { from { transform: translateY(-8px) scale(.98); } }
.cmdk input { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); font: 400 17px var(--f-sans); padding: 18px 20px; outline: 0; }
.cmdk ul { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow: auto; }
.cmdk li a { display: flex; gap: 12px; padding: 12px 12px; border-radius: 10px; font-size: 15px; }
.cmdk li a span { margin-left: auto; flex-shrink: 0; color: var(--muted); font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; }
.cmdk li.is-active a { background: var(--line-2); }
.cmdk li.is-active a::before { content: '→'; color: var(--accent); margin-right: -4px; }
.cmdk__foot { padding: 10px 20px; border-top: 1px solid var(--line); color: var(--muted); display: flex; gap: 16px; }

/* ============ Mobile menu ============ */
.mmenu { position: fixed; inset: 0; z-index: 45; background: var(--bg); padding: 100px var(--gut) 32px; display: flex; flex-direction: column; gap: 8px; transform: translateY(-100%); transition: transform .6s var(--ease); }
.mmenu.is-open { transform: none; }
.mmenu a.big { font-size: 44px; font-weight: 500; letter-spacing: -.04em; padding: 4px 0; border-bottom: 1px solid var(--line); }
.mmenu .cta__row { margin-top: auto; }

/* ============================================================
   CASE PAGE
   ============================================================ */
.progress { position: fixed; top: 0; left: 0; height: 2px; background: var(--accent); z-index: 70; width: 100%; transform-origin: 0 50%; transform: scaleX(0); }

.c-hero { padding: 140px 0 0; }
.c-back { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); transition: color .2s, gap .3s var(--ease); }
.c-back:hover { color: var(--ink); gap: 12px; }
.c-hero__top { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 40px; }
.c-title { margin: 0; font-size: clamp(40px, 6.6vw, 112px); font-weight: 500; letter-spacing: -.05em; line-height: .95; max-width: 16ch; view-transition-name: case-title; }
.c-lead { margin: 32px 0 0; font-size: clamp(19px, 1.7vw, 24px); color: var(--ink-2); max-width: 46ch; letter-spacing: -.01em; }
.c-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); }
.c-meta span { display: block; color: var(--muted); margin-bottom: 8px; }
.c-meta b { font-weight: 500; font-size: 15px; display: block; }
.c-cover { margin-top: 56px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line-2); background: var(--bg-2); view-transition-name: case-cover; }
.c-cover img { width: 100%; }

/* Mode switch */
.mode { display: inline-flex; padding: 4px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); position: relative; }
.mode button { white-space: nowrap; position: relative; z-index: 1; padding: 8px 16px; border-radius: 99px; font-size: 14px; color: var(--ink-2); transition: color .3s; }
.mode button.is-active { color: var(--bg); }
.mode button i { font-style: normal; }
.mode__pill { position: absolute; top: 4px; bottom: 4px; left: 4px; border-radius: 99px; background: var(--ink); transition: transform .45s var(--ease), width .45s var(--ease); }

/* TL;DR */
.tldr { margin-top: clamp(64px, 8vw, 112px); display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; }
.tldr__head { grid-column: 1 / span 3; display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.tldr__head h2 { margin: 0; font-size: 28px; font-weight: 500; letter-spacing: -.03em; line-height: 1.1; }
.tldr__head p { margin: 0; color: var(--muted); font-size: 14px; }
.star { grid-column: 4 / -1; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.star__cell { padding: 24px; position: relative; }
.star__cell + .star__cell { border-left: 1px solid var(--line); }
.star__cell b { display: flex; align-items: baseline; gap: 10px; font-size: 40px; font-weight: 500; letter-spacing: -.04em; line-height: 1; color: var(--accent); }
.star__cell b small { font-family: var(--f-mono); font-size: 11px; color: var(--muted); letter-spacing: .03em; text-transform: uppercase; font-weight: 400; }
.star__cell p { margin: 16px 0 0; font-size: 15px; color: var(--ink-2); line-height: 1.5; }

/* body layout with sticky rail */
.c-body { display: grid; grid-template-columns: 220px 1fr; gap: clamp(32px, 6vw, 96px); margin-top: clamp(80px, 10vw, 140px); }
.c-body > div { min-width: 0; }
.rail { position: sticky; top: 100px; align-self: start; display: flex; flex-direction: column; gap: 2px; }
.rail a { display: grid; grid-template-columns: 28px 1fr; gap: 8px; padding: 8px 0; color: var(--muted); font-size: 14px; transition: color .25s; position: relative; }
.rail a b { font-family: var(--f-mono); font-weight: 500; font-size: 12px; }
.rail a.is-active { color: var(--ink); }
.rail a.is-active b { color: var(--accent); }
.rail a::before { content: ''; position: absolute; left: -16px; top: 50%; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); transform: translateY(-50%) scale(0); transition: transform .3s var(--ease); }
.rail a.is-active::before { transform: translateY(-50%) scale(1); }
.rail__sub { padding-left: 36px; display: flex; flex-direction: column; }
.rail__sub a { grid-template-columns: 1fr; padding: 4px 0; font-size: 13px; }
.rail__sub a::before { display: none; }

.blk { padding-bottom: clamp(64px, 8vw, 112px); scroll-margin-top: 100px; }
.blk__k { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.blk__k b { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 16px; }
.blk__k span { color: var(--muted); }
.blk h2 { margin: 0 0 24px; font-size: clamp(30px, 3.4vw, 52px); font-weight: 500; letter-spacing: -.04em; line-height: 1.02; max-width: 20ch; }
.blk h3 { margin: 0 0 16px; font-size: clamp(22px, 2vw, 30px); font-weight: 500; letter-spacing: -.03em; line-height: 1.1; }
.prose { font-size: 18px; color: var(--ink-2); max-width: 64ch; margin: 0 0 24px; }
.prose--lg { font-size: clamp(20px, 1.8vw, 24px); color: var(--ink); letter-spacing: -.015em; line-height: 1.45; max-width: 40ch; }

/* asks — chat-like */
.asks { display: flex; flex-direction: column; gap: 10px; margin: 32px 0 0; max-width: 620px; }
.ask { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); padding: 14px 18px; border-radius: 18px 18px 18px 4px; font-size: 16px; max-width: 90%; }
.ask:nth-child(even) { align-self: flex-end; border-radius: 18px 18px 4px 18px; }
.asks__cap { margin-top: 12px; color: var(--muted); }

/* steps */
.steps { display: flex; flex-direction: column; gap: clamp(56px, 7vw, 96px); margin-top: 48px; }
.step { scroll-margin-top: 100px; }
.step__n { color: var(--muted); margin-bottom: 12px; display: block; }
.fig { margin: 24px 0 0; }
.fig img { border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface); width: 100%; }
.fig figcaption { margin-top: 10px; color: var(--muted); font-size: 13px; }
.fig--narrow img { max-width: 420px; }
.fig figcaption.mono { text-transform: none; font-size: 12px; }
.fig__scroll { overflow-x: auto; border-radius: var(--r); border: 1px solid var(--line-2); }
.fig--wide img { width: auto; max-width: none; height: 520px; border: 0; border-radius: 0; }
.figs2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.gallery { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 24px calc(var(--gut) * -1) 0 0; padding-right: var(--gut); padding-bottom: 12px; scrollbar-width: thin; }
.gallery img { flex: 0 0 auto; width: min(78%, 760px); scroll-snap-align: start; border-radius: var(--r); border: 1px solid var(--line-2); }
.gallery__hint { margin-top: 6px; color: var(--muted); }

.quotes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.quote { margin: 0; padding: 24px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); display: flex; flex-direction: column; justify-content: space-between; gap: 20px; }
.quote p { margin: 0; font-size: 17px; line-height: 1.45; }
.quote p::before { content: '“'; color: var(--accent); font-size: 32px; line-height: 0; vertical-align: -.35em; margin-right: 4px; }
.quote cite { font-style: normal; color: var(--muted); }
.story { margin-top: 16px; padding: 24px 28px; border-radius: var(--r); background: var(--ink); color: var(--bg); font-size: 19px; line-height: 1.45; letter-spacing: -.01em; }
.story .mono { display: block; opacity: .6; margin-bottom: 12px; }

.decision { margin-top: 28px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.decision__head { padding: 14px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; color: var(--muted); background: var(--surface); }
.decision__head svg { width: 16px; height: 16px; color: var(--accent); }
.decision__opts { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.opt { padding: 20px; position: relative; opacity: .55; transition: opacity .3s; }
.opt + .opt { border-left: 1px solid var(--line); }
.opt.is-chosen { opacity: 1; background: color-mix(in srgb, var(--accent) 7%, transparent); }
.opt h5 { margin: 0 0 6px; font-size: 17px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.opt.is-chosen h5::after { content: 'Выбрали'; font-family: var(--f-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; background: var(--accent); color: var(--accent-ink); padding: 3px 8px; border-radius: 99px; font-weight: 500; }
.opt p { margin: 0; font-size: 14px; color: var(--ink-2); }
.decision__why { padding: 16px 20px; border-top: 1px solid var(--line); font-size: 15px; }
.decision__why b { font-weight: 500; }

.note { display: inline-flex; align-items: center; gap: 10px; margin-top: 20px; padding: 10px 16px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--ink); font-size: 15px; }
.note::before { content: '↯'; color: var(--accent); }

/* before / after */
.ba { position: relative; margin-top: 24px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line-2); user-select: none; touch-action: pan-y; cursor: ew-resize; --x: 50%; }
.ba img { width: 100%; pointer-events: none; }
.ba__after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--x)); }
.ba__after img { height: 100%; object-fit: cover; }
.ba__line { position: absolute; top: 0; bottom: 0; left: var(--x); width: 2px; background: var(--accent); transform: translateX(-1px); }
.ba__knob { position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); transform: translate(-50%, -50%); display: grid; place-items: center; font-size: 14px; box-shadow: var(--shadow); }
.ba__lbl { position: absolute; bottom: 12px; padding: 5px 10px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 80%, transparent); color: var(--bg); }
.ba__lbl--l { left: 12px; } .ba__lbl--r { right: 12px; }

/* CASTLE */
.castle { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-top: 32px; }
.cm { background: var(--surface); padding: 24px; display: flex; flex-direction: column; gap: 12px; min-height: 220px; transition: background .3s; }
.cm:hover { background: var(--bg); }
.cm__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.cm__l { font-size: 44px; font-weight: 500; letter-spacing: -.04em; line-height: .9; }
.cm__name { color: var(--muted); margin-top: 6px; display: block; }
.cm__v { font-size: 22px; font-weight: 500; letter-spacing: -.02em; line-height: 1.15; margin-top: auto; }
.cm p { margin: 0; color: var(--ink-2); font-size: 14px; }
.badge { font-family: var(--f-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; padding: 4px 8px; border-radius: 99px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--measured { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.badge--qual { color: var(--ink-2); background: var(--line-2); }
.badge--design { color: var(--ink); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.badge--target { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.cm--measured .cm__l { color: var(--accent); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 16px; color: var(--muted); font-size: 13px; align-items: center; }

.feedback { display: flex; flex-direction: column; gap: 10px; margin-top: 32px; max-width: 620px; }

.insight { padding: clamp(28px, 4vw, 48px); border-radius: var(--r); background: var(--ink); color: var(--bg); }
.insight .mono { opacity: .6; }
.insight p { margin: 20px 0 0; font-size: clamp(22px, 2.2vw, 32px); line-height: 1.25; letter-spacing: -.025em; font-weight: 500; }

.c-team { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.c-team span { display: block; color: var(--muted); margin-bottom: 8px; }
.c-team p { margin: 0; font-size: 15px; }

/* next case */
.next { display: block; padding: clamp(64px, 10vw, 140px) 0; border-top: 1px solid var(--line); position: relative; overflow: hidden; }
.next .mono { color: var(--muted); }
.next h3 { margin: 16px 0 0; font-size: clamp(36px, 6vw, 96px); font-weight: 500; letter-spacing: -.05em; line-height: .95; max-width: 18ch; transition: color .4s; }
.next:hover h3 { color: var(--accent); }
.next__img { position: absolute; right: var(--gut); top: 50%; width: min(36vw, 480px); border-radius: var(--r); transform: translateY(-50%) rotate(4deg) scale(.9); opacity: 0; transition: opacity .5s var(--ease), transform .7s var(--ease); pointer-events: none; box-shadow: var(--shadow); }
.next:hover .next__img { opacity: 1; transform: translateY(-50%) rotate(-2deg); }

/* short mode: hide details */
body.is-short .detail { display: none; }

/* ============ Responsive ============ */
@media (max-width: 1080px) {
  .card__media, .card:nth-child(even) .card__media { grid-column: 1 / -1; grid-row: auto; }
  .card__body, .card:nth-child(even) .card__body { grid-column: 1 / -1; grid-row: auto; position: static; }
  .method__col { grid-column: 1 / -1; }
  .principles { grid-template-columns: 1fr 1fr; }
  .pr:nth-child(3) { border-left: 0; padding-left: 0; }
  .star { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
  .star__cell:nth-child(3) { border-left: 0; }
  .star__cell:nth-child(n+3) { border-top: 1px solid var(--line); }
  .tldr__head { grid-column: 1 / -1; }
  .c-body { grid-template-columns: 1fr; }
  .rail { display: none; }
  .castle { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  body { font-size: 16px; }
  .nav, .hdr__tools .kbd, .hdr__tools .btn { display: none; }
  .burger { display: grid; margin-left: auto; }
  .hero__bottom { grid-template-columns: 1fr; }
  .hero__intro, .hero__meta { grid-column: 1 / -1; }
  .hero__meta { grid-template-columns: 1fr 1fr; }
  .sec__head { grid-template-columns: 1fr; gap: 16px; }
  .sec__label, .sec__title { grid-column: 1 / -1; }
  .facts__grid { grid-template-columns: 1fr; }
  .fact { padding: 24px 0; border-left: 0; }
  .fact + .fact { border-top: 1px solid var(--line); }
  .principles { grid-template-columns: 1fr; }
  .pr + .pr { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); margin-top: 28px; }
  .xp__head { grid-template-columns: 1fr 40px; gap: 4px 16px; }
  .xp__head h3 { grid-column: 1; }
  .xp__head > span { grid-column: 1; font-size: 14px; }
  .xp__plus { grid-column: 2; grid-row: 1 / span 3; }
  .xp__body ul { grid-template-columns: 1fr; }
  .xp__body ul li { grid-column: 1; }
  .about__photo { grid-column: 1 / -1; max-width: 240px; }
  .about__text { grid-column: 1 / -1; grid-template-columns: 1fr; gap: 28px; }
  .c-meta { grid-template-columns: 1fr 1fr; }
  .star { grid-template-columns: 1fr; }
  .star__cell + .star__cell { border-left: 0; border-top: 1px solid var(--line); }
  .quotes, .figs2, .c-team { grid-template-columns: 1fr; }
  .decision__opts { grid-auto-flow: row; }
  .opt + .opt { border-left: 0; border-top: 1px solid var(--line); }
  .castle { grid-template-columns: 1fr; }
  .mode button i { display: none; }
  .cm { min-height: 0; }
  .gallery img { width: 86%; }
  .fig--wide img { height: 360px; }
  .next__img { display: none; }
  .cursor { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal, .fade, .line > span { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
