/* TeamFlow — portfolio case study
   Self-contained: no web fonts, no CDNs. Brand tokens mirror the app. */

:root {
  --font: "Helvetica Neue", Helvetica, Arial, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --brand: #500000;
  --brand-600: #6e1212;
  --brand-700: #3a0000;
  --bg: #f6f1ee;
  --bg-tint: #efe6e2;
  --surface: #ffffff;
  --border: #e8dedb;
  --border-strong: #d5c6c1;
  --text: #1d0b0a;
  --text-2: #4b3532;
  --muted: #7e6965;
  --danger: #d92d20;
  --danger-bg: #fdecea;
  --warn: #9a5b00;
  --warn-bg: #fdf3e1;
  --ok: #18794e;
  --ok-bg: #e7f4ec;
  --accent: #500000;
  --on-accent: #fff;

  --radius: 18px;
  --shadow: 0 1px 2px rgba(80, 0, 0, .05), 0 8px 30px rgba(80, 0, 0, .08);
  --shadow-lg: 0 30px 80px -20px rgba(40, 0, 0, .35);
  --wrap: 1180px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #120707;
  --bg-tint: #180b0a;
  --surface: #1f0f0e;
  --border: #36201d;
  --border-strong: #4a2c28;
  --text: #f7eeec;
  --text-2: #dcc9c6;
  --muted: #a8908c;
  --danger: #ff6b5e;
  --danger-bg: #2c0f0c;
  --warn: #f2b45a;
  --warn-bg: #2a1d08;
  --ok: #4cc38a;
  --ok-bg: #0c2419;
  --accent: #c43a3a;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03), 0 8px 30px rgba(0, 0, 0, .4);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; line-height: 1.1; letter-spacing: -.02em; }
p { margin: 0; }
code { font-family: var(--mono); font-size: .88em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--brand); color: #fff; padding: 10px 14px; border-radius: 10px; }
.skip:focus { top: 12px; }

.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px;
  border-radius: 999px; font-weight: 600; font-size: 15px; text-decoration: none; border: 1px solid transparent;
  transition: transform .15s, background .2s, border-color .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 24px -8px rgba(80, 0, 0, .6); }
.btn-primary:hover { background: var(--brand-600); }
[data-theme="dark"] .btn-primary { background: #9b2222; }
.btn-ghost { border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: var(--surface); }
.btn-light { background: #fff; color: var(--brand); }
.btn-outline-light { border-color: rgba(255, 255, 255, .4); color: #fff; }
.btn-outline-light:hover { background: rgba(255, 255, 255, .1); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--border); }
.topbar-in { display: flex; align-items: center; gap: 24px; height: 64px; }
.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 700; letter-spacing: -.01em; }
.back svg { width: 18px; height: 18px; transition: transform .2s; }
.back:hover svg { transform: translateX(-3px); }
.back .dim { color: var(--muted); font-weight: 500; }
.toc { display: flex; gap: 4px; margin-left: auto; }
.toc a { text-decoration: none; font-size: 14px; color: var(--text-2); padding: 8px 12px; border-radius: 999px; transition: background .2s, color .2s; }
.toc a:hover, .toc a.active { background: var(--surface); color: var(--text); }
.theme-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface);
  display: grid; place-items: center; flex: none;
}
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn .i-sun { display: none; }
[data-theme="dark"] .theme-btn .i-sun { display: block; }
[data-theme="dark"] .theme-btn .i-moon { display: none; }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 40px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; right: -10%; top: -20%; width: 70%; height: 120%;
  background: radial-gradient(closest-side, rgba(80, 0, 0, .12), transparent 70%); pointer-events: none;
}
[data-theme="dark"] .hero::before { background: radial-gradient(closest-side, rgba(196, 58, 58, .18), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 56px; align-items: center; position: relative; }
.hero h1 { font-size: clamp(56px, 8vw, 104px); font-weight: 800; letter-spacing: -.045em; line-height: .95; margin-bottom: 24px; }
.hero h1 span { color: var(--accent); }
.lede { font-size: 19px; color: var(--text-2); max-width: 30em; }
.lede em { font-style: normal; color: var(--danger); font-weight: 600; }
.meta { display: grid; gap: 10px; margin: 32px 0; padding: 20px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.meta div { display: grid; grid-template-columns: 90px 1fr; gap: 12px; }
.meta dt { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; padding-top: 2px; }
.meta dd { margin: 0; font-weight: 600; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* Devices */
.hero-devices { position: relative; padding: 20px 0 40px; }
.laptop { width: 100%; filter: drop-shadow(0 40px 60px rgba(40, 0, 0, .25)); }
[data-theme="dark"] .laptop { filter: drop-shadow(0 40px 60px rgba(0, 0, 0, .7)); }
.laptop-screen {
  position: relative; background: #0d0606; border-radius: 18px 18px 0 0; padding: 3.2% 2.6% 2.6%;
  border: 1px solid #2a1715;
}
.laptop-screen img { border-radius: 4px; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }
.cam { position: absolute; top: 1.3%; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: #2c2120; }
.laptop-base {
  position: relative; height: 18px; margin: 0 -7%; background: linear-gradient(#d9d0cd, #b8aeab);
  border-radius: 0 0 14px 14px;
}
.laptop-base span { position: absolute; left: 50%; top: 0; width: 16%; height: 7px; margin-left: -8%; background: #a59a97; border-radius: 0 0 8px 8px; }
[data-theme="dark"] .laptop-base { background: linear-gradient(#4a3c3a, #2a201f); }
[data-theme="dark"] .laptop-base span { background: #1d1514; }

.phone {
  position: relative; background: #0d0606; border-radius: 42px; padding: 10px;
  box-shadow: 0 0 0 1px #2a1715, var(--shadow-lg); aspect-ratio: 780 / 1328;
}
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 33px; }
.phone-notch {
  position: absolute; top: 15px; left: 50%; width: 9px; height: 9px; margin-left: -4.5px;
  background: #0d0606; border-radius: 50%; z-index: 2; box-shadow: 0 0 0 2px rgba(255, 255, 255, .06);
}
.phone-hero { position: absolute; right: -2%; bottom: 0; width: 27%; border-radius: 30px; padding: 7px; }
.phone-hero img { border-radius: 24px; }
.phone-hero .phone-notch { top: 10px; width: 6px; height: 6px; margin-left: -3px; }

.float-chip {
  position: absolute; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); padding: 9px 14px; border-radius: 999px;
  box-shadow: var(--shadow); animation: float 6s ease-in-out infinite;
}
.chip-a { left: -4%; bottom: 22%; }
.chip-b { right: 22%; top: -2%; animation-delay: -3s; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.red { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-bg); }
.dot.green { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); }
@keyframes float { 50% { transform: translateY(-8px); } }

.stats {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; margin-top: 56px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden;
}
.stats div { padding: 22px 24px; display: flex; align-items: center; gap: 14px; border-right: 1px solid var(--border); }
.stats div:last-child { border-right: 0; }
.stats b { font-size: 40px; font-weight: 800; letter-spacing: -.04em; color: var(--accent); line-height: 1; }
.stats span { font-size: 13px; color: var(--muted); line-height: 1.35; }

/* ---------- Sections ---------- */
.section { padding: 100px 0; }
.section-tint { background: var(--bg-tint); }
.section-head { max-width: 720px; margin-bottom: 40px; }
.section-head.mt { margin-top: 110px; }
.section-head h2, .two-col h2 { font-size: clamp(32px, 4vw, 48px); font-weight: 800; }
.section-head .sub { margin-top: 16px; font-size: 18px; color: var(--text-2); }

.two-col { display: grid; grid-template-columns: 1fr 1.1fr; gap: 64px; }
.prose p { font-size: 18px; color: var(--text-2); }
.prose p + p { margin-top: 18px; }
.prose em { font-style: normal; color: var(--danger); font-weight: 600; }
.prose strong { color: var(--text); }

/* Toolbar + tabs */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.tabs, .seg {
  display: flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; overflow-x: auto; scrollbar-width: none; max-width: 100%;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button, .seg button {
  border: 0; background: transparent; padding: 9px 16px; border-radius: 999px; font-size: 14px; font-weight: 600;
  color: var(--text-2); white-space: nowrap; transition: background .2s, color .2s;
}
.tabs button[aria-selected="true"], .seg button[aria-pressed="true"] { background: var(--brand); color: #fff; }
[data-theme="dark"] .tabs button[aria-selected="true"], [data-theme="dark"] .seg button[aria-pressed="true"] { background: #9b2222; }

/* Browser frame */
.browser { margin: 0; border-radius: 16px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.browser-bar { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.dots { display: flex; gap: 7px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--border-strong); }
.dots i:nth-child(1) { background: #ff5f57; } .dots i:nth-child(2) { background: #febc2e; } .dots i:nth-child(3) { background: #28c840; }
.url {
  flex: 1; max-width: 420px; margin: 0 auto; display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13px; color: var(--muted); background: var(--bg); border-radius: 8px; padding: 6px 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.url svg { width: 13px; height: 13px; flex: none; }
.browser-view { position: relative; aspect-ratio: 16 / 10; background: var(--bg); cursor: zoom-in; }
.browser-view img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: opacity .25s; }
.browser-view img.fading { opacity: 0; }
.browser figcaption { padding: 16px 20px; font-size: 15px; color: var(--text-2); border-top: 1px solid var(--border); }

/* Phone carousel */
.phones { position: relative; }
.phone-track {
  display: flex; gap: 28px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 20px 4px 40px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.phone-track::-webkit-scrollbar { display: none; }
.phone-card { flex: 0 0 250px; margin: 0; scroll-snap-align: start; }
.phone-card .phone { cursor: zoom-in; transition: transform .3s; }
.phone-card:hover .phone { transform: translateY(-6px); }
.phone-card figcaption { margin-top: 18px; font-size: 14px; color: var(--muted); }
.phone-card figcaption b { display: block; color: var(--text); font-size: 16px; }
.nav-arrow {
  position: absolute; top: 42%; z-index: 3; width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; box-shadow: var(--shadow);
  transition: opacity .2s, transform .2s;
}
.nav-arrow:hover { transform: scale(1.06); }
.nav-arrow:disabled { opacity: 0; pointer-events: none; }
.nav-arrow svg { width: 20px; height: 20px; }
.nav-arrow.prev { left: -20px; } .nav-arrow.next { right: -20px; }

/* Features */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature {
  padding: 28px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.f-icon {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; margin-bottom: 20px;
  background: var(--brand); color: #fff;
}
[data-theme="dark"] .f-icon { background: #3a1a17; color: #ffb4ab; }
.f-icon svg { width: 22px; height: 22px; }
.feature h3 { font-size: 19px; margin-bottom: 8px; }
.feature p { color: var(--text-2); font-size: 15px; }

/* Design system (always dark maroon band) */
.section-ink { background: var(--brand-700); color: #f7eeec; }
[data-theme="dark"] .section-ink { background: #1c0505; }
.section-ink .eyebrow { color: #ffb4ab; }
.section-ink .sub { color: rgba(255, 255, 255, .72); }
.ds-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ds-card { background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12); border-radius: var(--radius); padding: 28px; }
.ds-card h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .14em; color: rgba(255, 255, 255, .6); margin-bottom: 20px; }
.ds-wide { grid-column: 1 / -1; }
.hint { margin-top: 18px; font-size: 13px; color: rgba(255, 255, 255, .55); }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.sw { border: 0; background: none; padding: 0; text-align: left; color: inherit; }
.sw span { display: block; height: 64px; border-radius: 12px; background: var(--c); border: 1px solid rgba(255, 255, 255, .18); margin-bottom: 8px; transition: transform .2s; }
.sw:hover span { transform: scale(1.04); }
.sw b { display: block; font-size: 13px; }
.sw code { font-size: 12px; color: rgba(255, 255, 255, .55); }
.type-specimen > div { line-height: 1.2; }
.type-specimen .t1 { font-size: 46px; font-weight: 800; letter-spacing: -.04em; }
.type-specimen .t2 { font-size: 28px; font-weight: 800; margin-top: 10px; }
.type-specimen .t3 { font-size: 18px; font-weight: 600; margin-top: 12px; }
.type-specimen .t4 { font-size: 15px; color: rgba(255, 255, 255, .65); margin-top: 6px; }
.type-specimen .t5 { font-size: 11px; font-weight: 700; letter-spacing: .18em; color: rgba(255, 255, 255, .6); margin-top: 14px; }

.comp-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 24px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-high { background: #fdecea; color: #d92d20; }
.b-med { background: #fdf3e1; color: #9a5b00; }
.b-low { background: #f1e8e5; color: #4b3532; }
.b-over { background: #d92d20; color: #fff; }
.b-done { background: #e7f4ec; color: #18794e; }
.pill-btn { background: #fff; color: var(--brand); padding: 8px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.demo-task {
  display: flex; gap: 16px; align-items: flex-start; background: #fff; color: #1d0b0a; border-radius: 16px; padding: 20px;
  max-width: 560px; transition: opacity .3s;
}
.check {
  flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid #d5c6c1; background: #fff;
  display: grid; place-items: center; color: transparent; transition: all .2s; padding: 0;
}
.check svg { width: 16px; height: 16px; stroke-width: 2.6; }
.demo-task.done .check { background: #18794e; border-color: #18794e; color: #fff; }
.demo-task.done .dt-title { text-decoration: line-through; color: #7e6965; }
.dt-title { font-weight: 700; font-size: 17px; }
.dt-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.dt-m { font-size: 13px; color: #7e6965; }

/* Flow */
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; counter-reset: s; }
.flow li { position: relative; padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.flow li:not(:last-child)::after {
  content: ""; position: absolute; right: -13px; top: 38px; width: 10px; height: 10px;
  border-top: 2px solid var(--border-strong); border-right: 2px solid var(--border-strong); transform: rotate(45deg);
}
.flow .n { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: 14px; margin-bottom: 16px; }
.flow li:last-child .n { background: var(--ok); }
.flow b { display: block; font-size: 16px; }
.flow p { font-size: 14px; color: var(--muted); margin-top: 4px; }

/* Architecture */
.arch {
  display: grid; grid-template-columns: 1fr 120px 1fr 120px 1fr; align-items: center; gap: 0; margin-bottom: 32px;
}
.node { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; text-align: center; }
.node small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); font-weight: 700; }
.node b { display: block; font-size: 18px; margin: 6px 0 4px; }
.node span { font-size: 13px; color: var(--text-2); }
.node-accent { background: var(--brand); border-color: var(--brand); color: #fff; }
.node-accent small, .node-accent span { color: rgba(255, 255, 255, .72); }
[data-theme="dark"] .node-accent { background: #9b2222; border-color: #9b2222; }
.node-side { grid-column: 3 / 4; margin-top: 16px; position: relative; }
.node-side::before { content: ""; position: absolute; left: 50%; top: -17px; height: 16px; border-left: 2px dashed var(--border-strong); }
.link { position: relative; height: 2px; background: var(--border-strong); margin: 0 8px; }
.link::after { content: ""; position: absolute; right: -1px; top: -4px; border-left: 8px solid var(--border-strong); border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.link span { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; font-weight: 600; }

.stack-list { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 40px; }
.stack-list span { padding: 8px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 14px; font-weight: 600; }
.learn { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.learn div { border-top: 2px solid var(--accent); padding-top: 18px; }
.learn h3 { font-size: 18px; margin-bottom: 8px; }
.learn p { font-size: 15px; color: var(--text-2); }

/* Closing */
.closing { background: var(--brand); color: #fff; padding: 110px 0; text-align: center; position: relative; overflow: hidden; }
[data-theme="dark"] .closing { background: #3a0000; }
.closing::after {
  content: "TF"; position: absolute; right: -2%; bottom: -30%; font-size: 360px; font-weight: 800; letter-spacing: -.06em;
  color: rgba(0, 0, 0, .14); line-height: 1; pointer-events: none;
}
.closing-in { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.closing-logo { width: 220px; height: auto; margin-bottom: 36px; }
.closing h2 { font-size: clamp(36px, 5.5vw, 68px); font-weight: 800; letter-spacing: -.04em; }
.closing p { margin: 16px 0 32px; color: rgba(255, 255, 255, .72); font-size: 18px; }
.closing .cta { justify-content: center; }

.foot { padding: 28px 0; border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.foot-in { display: flex; justify-content: space-between; gap: 16px; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--text); }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(10, 2, 2, .88); display: grid; place-items: center; padding: 24px;
  animation: fade .2s;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.lb-close { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); color: #fff; font-size: 28px; line-height: 1; }
@keyframes fade { from { opacity: 0; } }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero-devices { max-width: 720px; margin: 0 auto; width: 100%; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .flow { grid-template-columns: repeat(3, 1fr); }
  .flow li:nth-child(3)::after { display: none; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stats div:nth-child(3) { border-right: 0; }
  .stats div:nth-child(-n+3) { border-bottom: 1px solid var(--border); }
  .toc { display: none; }
  .back { margin-right: auto; }
  .nav-arrow.prev { left: 0; } .nav-arrow.next { right: 0; }
}
@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .hero { padding: 40px 0 24px; }
  .lede { font-size: 17px; }
  .section { padding: 72px 0; }
  .section-head.mt { margin-top: 72px; }
  .two-col, .ds-grid, .learn { grid-template-columns: 1fr; gap: 24px; }
  .features { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; }
  .flow li::after { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats div { border-right: 1px solid var(--border) !important; border-bottom: 1px solid var(--border); padding: 18px; }
  .stats div:nth-child(2n) { border-right: 0 !important; }
  .stats div:last-child { grid-column: 1 / -1; border-bottom: 0; border-right: 0 !important; }
  .stats b { font-size: 32px; }
  .swatches { grid-template-columns: repeat(2, 1fr); }
  .type-specimen .t1 { font-size: 36px; }
  .arch { grid-template-columns: 1fr; }
  .link { width: 2px; height: 40px; margin: 0 auto; }
  .link::after { right: -4px; top: auto; bottom: -1px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 8px solid var(--border-strong); border-bottom: 0; }
  .link span { left: 14px; bottom: 50%; transform: translateY(50%); }
  .node-side { grid-column: auto; }
  .chip-a { left: 0; bottom: 6%; } .chip-b { right: 30%; top: -6%; }
  .float-chip { font-size: 12px; padding: 7px 11px; }
  .phone-card { flex-basis: 70%; }
  .nav-arrow { display: none; }
  .browser-bar { padding: 10px 12px; }
  .url { font-size: 12px; }
  .closing::after { font-size: 200px; }
  .foot-in { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
