/* Colours follow the app's Theme (Sources/Unibar/RailViews.swift). */
:root {
  --bg: #050506;
  --bg2: #0c0c0e;
  --card: #141416;
  --card2: #1b1b1e;
  --stroke: rgba(255,255,255,.08);
  --stroke2: rgba(255,255,255,.16);
  --text: #f4f4f5;
  --sec: rgba(255,255,255,.58);
  --ter: rgba(255,255,255,.36);
  --blue: #0a85ff;
  --green: #30d158;
  --amber: #ff9f0a;
  --red: #ff455c;
  --idle: #6b6b6b;
  --claude: #d97857;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", sans-serif;
  --kbd-bg: rgba(255,255,255,.1);
  --kbd-bd: rgba(255,255,255,.12);
  --accent: var(--blue);
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.03em; line-height: 1.05; }
.muted { color: var(--ter); }
kbd {
  font-family: var(--sans); font-size: .78em; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.7em; height: 1.7em; padding: 0 .4em; margin: 0 .1em;
  border-radius: .4em; background: var(--kbd-bg); border: 1px solid var(--kbd-bd);
  color: var(--text); vertical-align: .08em; line-height: 1;
}

/* dots */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--idle); }
.dot-blue { background: var(--blue); box-shadow: 0 0 10px rgba(10,133,255,.7); }
.dot-green { background: var(--green); box-shadow: 0 0 10px rgba(48,209,88,.6); }
.dot-amber { background: var(--amber); box-shadow: 0 0 10px rgba(255,159,10,.7); }
.dot-idle { background: var(--idle); }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.8); } }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 14px max(16px, calc((100vw - 1180px)/2));
  background: rgba(5,5,6,.72); backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--stroke);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.02em; font-size: 17px; }
.brand-mark { width: 24px; height: 24px; color: var(--text); flex: none; }
.nav nav { display: flex; gap: 22px; margin-left: auto; font-size: 14px; color: var(--sec); }
.nav nav a:hover { color: var(--text); }
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 22px;
  border-radius: 999px; background: var(--text); color: #000; font-weight: 600; font-size: 15px;
  transition: transform .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); background: #fff; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--stroke2); }
.btn-ghost:hover { background: rgba(255,255,255,.06); }
.btn-small { height: 34px; padding: 0 16px; font-size: 13.5px; }

/* Hero */
.hero { max-width: 1180px; margin: 0 auto; padding: 96px 16px 40px; text-align: center; }
.hero h1 { font-size: clamp(44px, 8vw, 96px); font-weight: 800; letter-spacing: -.055em; }
.lede { max-width: 680px; margin: 28px auto 0; font-size: clamp(17px, 2vw, 20px); color: var(--sec); }
.lede kbd { font-size: .8em; }
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 36px; }

.marquee {
  margin-top: 64px; overflow: hidden; position: relative;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track { display: flex; gap: 36px; width: max-content; animation: marquee 50s linear infinite; }
.marquee-track span { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; color: var(--sec); white-space: nowrap; font-weight: 500; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Demo stage ---------- */
.demo { max-width: 1280px; margin: 0 auto; padding: 24px 16px 40px; }
.scenes {
  list-style: none; margin: 0 auto 22px; padding: 4px; display: flex; gap: 4px; justify-content: center;
  flex-wrap: wrap; width: fit-content; max-width: 100%;
  border: 1px solid var(--stroke); border-radius: 999px; background: var(--bg2);
}
.scenes li {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 7px 14px 7px 8px; border-radius: 999px; font-size: 14px; color: var(--sec);
  position: relative; overflow: hidden; transition: color .2s, background .2s;
}
.scenes li b { font-weight: 600; }
.scenes li kbd { font-size: 11px; min-width: 26px; height: 22px; }
.scenes li:hover { color: var(--text); }
.scenes li.on { background: rgba(255,255,255,.1); color: var(--text); }
.scenes li.on::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; background: var(--blue);
  width: var(--progress, 0%);
}
.scene-caption { text-align: center; color: var(--sec); margin: 18px auto 0; max-width: 640px; min-height: 3.2em; font-size: 15.5px; }

/* ---------- Sections ---------- */
.section { max-width: 1180px; margin: 0 auto; padding: 120px 16px 0; }
.kicker { color: var(--accent); font-weight: 600; font-size: 14px; margin: 0 0 16px; display: flex; gap: 6px; align-items: center; }
.kicker kbd { font-size: 12px; }
.section h2 { font-size: clamp(34px, 5.2vw, 60px); font-weight: 750; letter-spacing: -.045em; }
.body { color: var(--sec); font-size: 17px; max-width: 560px; margin: 22px 0 0; }
.body em { color: var(--text); font-style: normal; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; }
.split h2 { font-size: clamp(32px, 4vw, 48px); }
.ticks { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-direction: column; gap: 12px; color: var(--sec); }
.ticks li { padding-left: 26px; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.ticks b { color: var(--text); }
.cue-demo { display: flex; flex-direction: column; gap: 10px; margin-top: 26px; }
.cue-pill { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 16px; font-size: 14px; }
.cue-pill small { color: var(--ter); font-size: 13px; }
.cue-pill:nth-child(3) b { color: var(--sec); }

.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 48px; }
.card { background: var(--card); border: 1px solid var(--stroke); border-radius: 22px; padding: 26px; position: relative; overflow: hidden; }
.card h3 { font-size: 21px; letter-spacing: -.02em; margin-bottom: 10px; }
.card p { color: var(--sec); margin: 0; font-size: 15px; }
.card kbd { font-size: .72em; }
.card .note { color: var(--ter); font-size: 13.5px; margin-top: 12px; }
.c-wide { grid-column: span 3; }
.c-phone, .c-server { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; }
.c-phone { grid-column: span 3; }
.c-server { grid-column: span 3; }
.phone-mini {
  justify-self: center; width: 230px; height: 260px; border-radius: 34px 34px 0 0; border: 6px solid #2a2a2e; border-bottom: 0;
  background: var(--p-bg); color: var(--p-label); padding: 26px 14px 0; display: flex; flex-direction: column; gap: 7px; margin-bottom: -27px;
}
.pm-row { display: flex; align-items: center; gap: 8px; background: var(--p-card); padding: 9px 11px; border-radius: 12px; font-size: 12.5px; }
.pm-opt { font-size: 12px; padding: 7px 11px; border-radius: 10px; background: var(--p-blue); color: #fff; align-self: flex-start; }
.pm-mic { width: 46px; height: 46px; border-radius: 50%; background: var(--p-card); align-self: center; margin-top: 4px; }
.ssh-mini { margin: 0; background: #0b0d0f; border: 1px solid var(--stroke); border-radius: 14px; padding: 18px; font-family: var(--mono); font-size: 12.5px; color: #ddd; white-space: pre-wrap; line-height: 1.7; }
.feat-rail { display: flex; gap: 14px; margin-top: 22px; padding: 14px 18px; border-radius: 99px; width: fit-content; }
.feat-rail .dot { width: 11px; height: 11px; }

.router { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; }
.chooser { border-radius: 20px; padding: 16px; }

/* Harness grid */
.harnesses { text-align: center; }
.harnesses .kicker { justify-content: center; }
.huge { font-size: clamp(48px, 9vw, 120px) !important; letter-spacing: -.06em !important; font-weight: 800 !important; }
.stats { display: flex; justify-content: center; gap: clamp(20px, 5vw, 64px); margin: 40px 0 0; flex-wrap: wrap; }
.stat b { display: block; font-size: clamp(40px, 6vw, 64px); letter-spacing: -.04em; font-weight: 750; line-height: 1; }
.stat span { color: var(--sec); font-size: 14px; }
.filters { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin: 48px auto 0; padding: 4px; border: 1px solid var(--stroke); border-radius: 999px; background: var(--bg2); }
.filters button {
  font: inherit; font-size: 14px; color: var(--sec); background: none; border: 0; cursor: pointer;
  padding: 8px 16px; border-radius: 999px; transition: background .2s, color .2s;
}
.filters button:hover { color: var(--text); }
.filters button.on { background: var(--text); color: #000; font-weight: 600; }
.filters button small { opacity: .55; margin-left: 4px; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; margin: 22px auto 0; max-width: 900px; font-size: 13px; color: var(--ter); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.lv { width: 9px; height: 9px; border-radius: 3px; }
.lv-full { background: var(--green); } .lv-chat { background: var(--blue); } .lv-status { background: var(--idle); }
.lv-reads { background: #b48cff; } .lv-term { background: #5eead4; } .lv-types { background: var(--amber); }

.hgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-top: 36px; text-align: left; }
.htile {
  position: relative; background: var(--card); border: 1px solid var(--stroke); border-radius: 20px;
  padding: 22px 20px 20px; min-height: 196px; display: flex; flex-direction: column; gap: 12px;
  transition: transform .25s, border-color .25s, background .25s, opacity .3s;
  animation: tileIn .45s both;
}
.htile:hover { transform: translateY(-3px); border-color: var(--stroke2); background: var(--card2); }
.htile.big { grid-column: span 2; }
@keyframes tileIn { from { opacity: 0; transform: translateY(12px); } }
.mono-mark {
  width: 60px; height: 60px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 20px; letter-spacing: -.03em; color: #fff;
  background: linear-gradient(145deg, hsl(var(--h) 70% 55%), hsl(calc(var(--h) + 30) 70% 38%));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 8px 24px hsl(var(--h) 70% 40% / .35);
}
.mono-mark.mono { background: linear-gradient(145deg, #f4f4f5, #a1a1aa); color: #000; box-shadow: inset 0 1px 0 #fff; }
.htile h4 { font-size: 17px; letter-spacing: -.02em; }
.htile .grp { font-size: 12px; color: var(--ter); margin-top: 2px; }
.htile .lvl { margin-top: auto; display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--sec); }
.htile p { margin: 0; color: var(--sec); font-size: 13.5px; }
.fine { color: var(--ter); font-size: 14px; max-width: 640px; margin: 32px auto 0; }

/* FAQ */
.faq { max-width: 820px; }
.faq h2 { margin-bottom: 28px; }
details { border-bottom: 1px solid var(--stroke); padding: 20px 0; }
summary { cursor: pointer; font-size: 18px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--ter); font-weight: 400; font-size: 22px; line-height: 1; transition: transform .2s; }
details[open] summary::after { transform: rotate(45deg); }
details p { color: var(--sec); margin: 12px 0 0; }

.closing { text-align: center; padding: 160px 16px 120px; }
.closing h2 { font-size: clamp(40px, 7vw, 88px); font-weight: 800; letter-spacing: -.055em; }
.foot { display: flex; justify-content: space-between; padding: 28px max(16px, calc((100vw - 1180px)/2)); border-top: 1px solid var(--stroke); color: var(--ter); font-size: 13px; }

@media (max-width: 860px) {
  .nav nav { display: none; }
  .nav .btn-small { margin-left: auto; }
  .split, .router, .c-phone, .c-server { grid-template-columns: 1fr; gap: 40px; }
  .bento { grid-template-columns: 1fr; }
  .c-wide { grid-column: span 1; }
  .htile.big { grid-column: span 1; }
  .hgrid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .section { padding-top: 88px; }
  .scenes li { padding: 6px 10px 6px 6px; font-size: 13px; }
  .stage-wrap { border-radius: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Theme toggle (both themes) */
.theme-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.08); color: var(--text);
}
.theme-btn svg { width: 16px; height: 16px; }
.theme-btn .moon { display: none; }
[data-theme="light"] .theme-btn .sun { display: none; }
[data-theme="light"] .theme-btn .moon { display: block; }

/* ---------- Light theme: gallery tiles, one blue, flat chrome ----------
   The dark design above is untouched. In light mode the page becomes white / parchment
   tiles with Action Blue; anything that depicts Unibar's own UI stays dark, because the
   app is dark, and carries the one product shadow. */
[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --bg2: #f5f5f7;
  --card: #ffffff;
  --card2: #ffffff;
  --stroke: #e0e0e0;
  --stroke2: #d2d2d7;
  --text: #1d1d1f;
  --sec: #333333;
  --ter: #7a7a7a;
  --kbd-bg: #f5f5f7;
  --kbd-bd: #d2d2d7;
  --accent: #0066cc;
  --product-shadow: rgba(0,0,0,.22) 3px 5px 30px 0;
}
/* Dark tiles inside the light page keep dark text tokens. */
[data-theme="light"] :is(.ssh-mini, .tile-dark) {
  --stroke: rgba(255,255,255,.08);
  --stroke2: rgba(255,255,255,.16);
  --text: #f4f4f5;
  --sec: rgba(255,255,255,.58);
  --ter: rgba(255,255,255,.36);
  --kbd-bg: rgba(255,255,255,.1);
  --kbd-bd: rgba(255,255,255,.12);
  color: var(--text);
}
[data-theme="light"] body { font-size: 17px; line-height: 1.47; letter-spacing: -.022em; font-feature-settings: "ss03"; }
[data-theme="light"] h1, [data-theme="light"] h2, [data-theme="light"] h3, [data-theme="light"] h4 { font-weight: 600 !important; }
[data-theme="light"] .muted { color: #7a7a7a; }

/* Full-bleed tiles: the colour change is the divider. */
[data-theme="light"] .tile-parchment,
[data-theme="light"] .tile-dark { clip-path: inset(0 -100vmax); padding-bottom: 96px; }
[data-theme="light"] .tile-parchment { background: #f5f5f7; box-shadow: 0 0 0 100vmax #f5f5f7; }
[data-theme="light"] .tile-dark { background: #272729; box-shadow: 0 0 0 100vmax #272729; --accent: #2997ff; }
[data-theme="light"] .section { padding-top: 96px; }
[data-theme="light"] .section:not(.tile-parchment):not(.tile-dark) { padding-bottom: 16px; }

/* Nav: frosted parchment bar */
[data-theme="light"] .nav {
  background: rgba(245,245,247,.8); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0,0,0,.08); padding-top: 9px; padding-bottom: 9px;
}
[data-theme="light"] .brand { font-size: 21px; font-weight: 600; letter-spacing: .01em; }
[data-theme="light"] .nav nav { font-size: 14px; color: #333; letter-spacing: -.016em; }
[data-theme="light"] .nav nav a:hover { color: #0066cc; }
[data-theme="light"] .theme-btn { background: rgba(210,210,215,.64); }

/* Buttons: blue pill + ghost pill, press = scale(.95) */
[data-theme="light"] .btn {
  background: #0066cc; color: #fff; font-weight: 400; font-size: 17px; height: auto; padding: 11px 22px; letter-spacing: -.022em;
  transition: transform .1s;
}
[data-theme="light"] .btn:hover { transform: none; background: #0066cc; }
[data-theme="light"] .btn:active { transform: scale(.95); }
[data-theme="light"] .btn:focus-visible { outline: 2px solid #0071e3; outline-offset: 2px; }
[data-theme="light"] .btn-ghost { background: transparent; color: #0066cc; border: 1px solid #0066cc; }
[data-theme="light"] .btn-ghost:hover { background: transparent; }
[data-theme="light"] .btn-small { font-size: 14px; padding: 6px 15px; }

/* Hero */
[data-theme="light"] .hero { padding-top: 88px; }
[data-theme="light"] .lede { font-size: clamp(19px, 2vw, 24px); font-weight: 300; line-height: 1.5; color: #1d1d1f; letter-spacing: 0; }
[data-theme="light"] .lede kbd { font-weight: 600; }
[data-theme="light"] .marquee-track span { color: #7a7a7a; font-weight: 400; }

/* Demo tile */
[data-theme="light"] .demo { padding-top: 72px; padding-bottom: 72px; }
[data-theme="light"] .scenes { background: transparent; border: 0; gap: 8px; }
[data-theme="light"] .scenes li { background: #fff; color: #1d1d1f; padding: 9px 16px 9px 10px; box-shadow: inset 0 0 0 1px #e0e0e0; }
[data-theme="light"] .scenes li:hover { color: #1d1d1f; }
[data-theme="light"] .scenes li.on { background: #fff; box-shadow: inset 0 0 0 2px #0071e3; }
[data-theme="light"] .scenes li.on::after { background: #0066cc; }
[data-theme="light"] .stage-wrap { box-shadow: var(--product-shadow); }
[data-theme="light"] .scene-caption { color: #333; font-size: 17px; }

/* Section type */
[data-theme="light"] .kicker { font-size: 17px; font-weight: 600; letter-spacing: -.022em; }
[data-theme="light"] .section h2 { font-size: clamp(32px, 4.4vw, 56px); letter-spacing: -.02em; line-height: 1.07; }
[data-theme="light"] .split h2 { font-size: clamp(30px, 3.4vw, 40px); line-height: 1.1; }
[data-theme="light"] .body { color: #1d1d1f; font-size: 17px; }
[data-theme="light"] .ticks { color: #333; }
[data-theme="light"] .ticks li::before { background: #0066cc; }
[data-theme="light"] .cue-pill { box-shadow: var(--product-shadow); border: 0; }

/* Utility cards: white, no shadow, 18px */
[data-theme="light"] .card { background: #fff; border: 0; border-radius: 18px; padding: 32px; }
[data-theme="light"] .card h3 { font-size: 24px; }
[data-theme="light"] .card p { color: #333; font-size: 17px; }
[data-theme="light"] .card .note { color: #7a7a7a; font-size: 14px; }
[data-theme="light"] .phone-mini, [data-theme="light"] .ssh-mini { box-shadow: var(--product-shadow); }

/* Router: dark tile */
[data-theme="light"] .tile-dark .body { color: #ccc; }
[data-theme="light"] .tile-dark .body em, [data-theme="light"] .tile-dark h2 { color: #fff; }
[data-theme="light"] .tile-dark .ticks { color: #ccc; }
[data-theme="light"] .tile-dark .ticks li::before { background: #2997ff; }

/* Harness grid: store-style utility cards */
[data-theme="light"] .huge { font-size: clamp(44px, 7vw, 88px) !important; letter-spacing: -.03em !important; }
[data-theme="light"] .stat b { font-weight: 600; letter-spacing: -.02em; }
[data-theme="light"] .stat span { color: #7a7a7a; }
[data-theme="light"] .filters { background: transparent; border: 0; gap: 8px; }
[data-theme="light"] .filters button { background: #fff; color: #1d1d1f; box-shadow: inset 0 0 0 1px #e0e0e0; padding: 10px 18px; font-size: 14px; }
[data-theme="light"] .filters button.on { background: #fff; color: #1d1d1f; font-weight: 600; box-shadow: inset 0 0 0 2px #0071e3; }
[data-theme="light"] .legend { color: #7a7a7a; }
[data-theme="light"] .htile { background: #fff; border: 1px solid #e0e0e0; border-radius: 18px; }
[data-theme="light"] .htile:hover { transform: none; background: #fff; border-color: #d2d2d7; }
[data-theme="light"] .htile .lvl, [data-theme="light"] .htile p { color: #333; }
[data-theme="light"] .htile .grp { color: #7a7a7a; }
[data-theme="light"] .mono-mark { background: hsl(var(--h) 62% 48%); box-shadow: none; border-radius: 14px; font-weight: 600; }
[data-theme="light"] .mono-mark.mono { background: #1d1d1f; color: #fff; box-shadow: none; }
[data-theme="light"] .fine { color: #7a7a7a; }

/* FAQ, closing, footer */
[data-theme="light"] details { border-bottom-color: #d2d2d7; }
[data-theme="light"] summary { font-size: 21px; font-weight: 600; letter-spacing: .01em; }
[data-theme="light"] summary::after { color: #0066cc; }
[data-theme="light"] details p { color: #333; }
[data-theme="light"] .closing { padding: 120px 16px; }
[data-theme="light"] .closing h2 { font-size: clamp(36px, 5.6vw, 64px); letter-spacing: -.025em; }
[data-theme="light"] .foot { background: #f5f5f7; border-top: 1px solid #d2d2d7; color: #7a7a7a; font-size: 12px; letter-spacing: -.01em; padding-top: 32px; padding-bottom: 32px; }
[data-theme="light"] .foot a { color: #333; }

/* Light / Dark switch above the demo */
.demo-bar { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.demo-bar .scenes { margin: 0; }
.mode-switch { display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--stroke); }
.mode-switch button {
  font: inherit; font-size: 13.5px; border: 0; cursor: pointer; padding: 7px 14px; border-radius: 999px;
  background: transparent; color: var(--sec); transition: background .2s, color .2s;
}
.mode-switch button.on { background: rgba(255,255,255,.12); color: var(--text); font-weight: 600; }
[data-theme="light"] .mode-switch { background: #fff; border: 0; box-shadow: inset 0 0 0 1px #e0e0e0; }
[data-theme="light"] .mode-switch button.on { background: #1d1d1f; color: #fff; }

/* ---------- Type and spacing, shared by both themes ----------
   Light and dark differ only in color; every size, weight, line height and letter-spacing lives here. */
body { font-size: 17px; line-height: 1.47; letter-spacing: -.022em; font-feature-settings: "ss03"; }
h1, h2, h3, h4 { font-weight: 600 !important; }
.brand { font-size: 21px; font-weight: 600; letter-spacing: .01em; }
.nav { padding-top: 9px; padding-bottom: 9px; }
.nav nav { font-size: 14px; letter-spacing: -.016em; }
.btn { font-weight: 400; font-size: 17px; height: auto; padding: 11px 22px; letter-spacing: -.022em; transition: transform .1s; }
.btn:hover { transform: none; }
.btn:active { transform: scale(.95); }
.btn-small { font-size: 14px; padding: 6px 15px; }
.hero { padding-top: 88px; }
.hero h1 { font-size: clamp(40px, 6.4vw, 80px); letter-spacing: -.025em; line-height: 1.07; }
.lede { font-size: clamp(19px, 2vw, 24px); font-weight: 300; line-height: 1.5; letter-spacing: 0; }
.lede kbd { font-weight: 600; }
.marquee-track span { font-weight: 400; }
.demo { padding-top: 72px; padding-bottom: 72px; }
.scenes li { padding: 9px 16px 9px 10px; }
.scene-caption { font-size: 17px; }
.section { padding-top: 96px; }
.section:not(.tile-parchment):not(.tile-dark) { padding-bottom: 16px; }
.tile-parchment, .tile-dark { padding-bottom: 96px; }
.kicker { font-size: 17px; font-weight: 600; letter-spacing: -.022em; }
.section h2 { font-size: clamp(32px, 4.4vw, 56px); letter-spacing: -.02em; line-height: 1.07; }
.split h2 { font-size: clamp(30px, 3.4vw, 40px); line-height: 1.1; }
.body { font-size: 17px; }
.card { border-radius: 18px; padding: 32px; }
.card h3 { font-size: 24px; }
.card p { font-size: 17px; }
.card .note { font-size: 14px; }
.huge { font-size: clamp(44px, 7vw, 88px) !important; letter-spacing: -.03em !important; }
.stat b { font-weight: 600; letter-spacing: -.02em; }
.filters button { padding: 10px 18px; font-size: 14px; }
.filters button.on { font-weight: 600; }
.mono-mark { font-weight: 600; }
summary { font-size: 21px; font-weight: 600; letter-spacing: .01em; }
.closing { padding: 120px 16px; }
.closing h2 { font-size: clamp(36px, 5.6vw, 64px); letter-spacing: -.025em; }
.foot { font-size: 12px; letter-spacing: -.01em; padding-top: 32px; padding-bottom: 32px; }

/* ---------- Demo pinned in view ----------
   The tabs, the desktop and the caption fit the visible window under the nav. While it's pinned,
   scrolling steps through the scenes; tabs light up as you reach them. */
.scenes li { transition: color .2s, background .2s, opacity .35s; }
.story .scenes li.ahead { opacity: .4; }
.scene-caption { transition: opacity .3s; }
.scene-caption.swap { opacity: 0; }
:root { --nav-h: 52px; }
.demo-pin { display: flex; flex-direction: column; justify-content: center; }
.demo-pin .stage-wrap { margin: 0 auto; }
@media (min-width: 860px) and (min-height: 560px) {
  /* one screen to arrive, then about 80% of a screen of scrolling per scene */
  .demo, [data-theme="light"] .demo { height: 1140vh; padding-top: 0; padding-bottom: 0; }
  .demo-pin {
    position: sticky; top: var(--nav-h);
    height: calc(100vh - var(--nav-h)); height: calc(100dvh - var(--nav-h));
    padding: 16px 0 12px; box-sizing: border-box;
  }
  .demo-pin .demo-bar { margin-bottom: 14px; }
  /* 16:10 desktop sized to the height that's left after the tabs and the caption */
  .demo-pin .stage-box { width: min(100%, calc((100dvh - var(--nav-h) - 180px) * 1.6)); }
  .demo-pin .scene-caption { margin-top: 12px; min-height: 3em; font-size: 15px; }
}

/* Router section: what's in front first, then the router */
.router-side { display: flex; flex-direction: column; gap: 10px; }
.rs-label { margin: 6px 0 0; font-size: 13px; font-weight: 600; color: var(--sec); }
.rs-label:first-child { margin-top: 0; }
.router-side .cue-pill { display: flex; }

/* Story order: caption above the desktop, scene tabs below it */
.demo-pin .scene-caption { margin: 0 auto 14px; }
.demo-pin .demo-bar { margin: 16px 0 0; }
/* Bigger caption over the desktop; the desktop gives up the room */
.demo-pin .scene-caption { font-size: 21px; line-height: 1.35; max-width: 780px; min-height: 2.7em; color: var(--text); }
@media (min-width: 860px) and (min-height: 560px) {
  .demo-pin .stage-box { width: min(100%, calc((100dvh - var(--nav-h) - 215px) * 1.6)); }
}

/* ---------- Hero over the desktop ----------
   Pinned: the hero text sits on the desktop and fades as you scroll; then the story starts.
   Not pinned (phones, short windows): the hero sits above the desktop as a normal block. */
.stage-box { position: relative; margin: 0 auto; width: 100%; }
.hero-ov { max-width: none; width: 100%; margin: 0; padding: 40px 16px 32px; }
.hero-scroll { display: none; }
.story .hero-ov {
  position: absolute; inset: 0; z-index: 5; margin: 0; padding: 0 7%; border-radius: 18px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(ellipse 80% 75% at 50% 50%, color-mix(in srgb, var(--bg) 94%, transparent) 30%, color-mix(in srgb, var(--bg) 62%, transparent));
  opacity: var(--hero, 1); transform: translateY(calc((1 - var(--hero, 1)) * -24px)) scale(calc(.97 + var(--hero, 1) * .03));
}
.story .hero-ov.gone { visibility: hidden; }
.story .hero-ov h1 { font-size: clamp(34px, 4.6vw, 68px); }
.story .hero-ov .lede { font-size: clamp(15px, 1.45vw, 20px); margin-top: 18px; max-width: 720px; }
.story .hero-ov .cta-row { margin-top: 24px; }
.story .hero-ov .marquee { margin-top: 30px; width: 100%; }
.story .hero-scroll { display: block; margin: 22px 0 0; font-size: 14px; color: var(--ter); animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(5px); } }

/* ---------- Scene caption ----------
   A key, a short title and a two-line body. Its height is fixed, so captions of any length never
   move the desktop; a change drops the old one out and pops the new one in. */
.scene-caption, .demo-pin .scene-caption {
  display: grid; justify-items: center; align-content: center; gap: 4px; text-align: center;
  height: calc(38px + 2 * 1.4em + 12px); min-height: 0; margin: 0 auto 14px; max-width: 920px; overflow: hidden;
  font-size: 20px; line-height: 1.4; color: var(--sec); transition: none;
}
.sc-key { display: none; }
.sc-title { font-size: 31px; line-height: 38px; font-weight: 600; color: var(--text); letter-spacing: -.02em; }
.sc-body { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; height: calc(2 * 1.4em); }
.scene-caption.swap > * { opacity: 0; transform: translateY(-14px); filter: blur(6px); transition: opacity .22s, transform .22s, filter .22s; }
.scene-caption.pop > * { animation: cap-in .6s cubic-bezier(.2,1.25,.35,1) both; }
.scene-caption.pop .sc-body { animation-delay: .08s; }
@keyframes cap-in { from { opacity: 0; transform: translateY(22px) scale(.96); filter: blur(8px); } }
.scene-caption.intro > * { opacity: 0; }
/* Stacked (not pinned): the hero first, then the caption, the desktop and the tabs */
.demo:not(.story) .stage-box { display: contents; }
.demo:not(.story) .hero-ov { order: -1; padding-top: 24px; }
@media (max-width: 700px) {
  .scene-caption, .demo-pin .scene-caption { height: calc(30px + 4 * 1.4em + 10px); font-size: 17px; }
  .sc-title { font-size: 24px; line-height: 30px; }
  .sc-body { -webkit-line-clamp: 4; height: calc(4 * 1.4em); }
}
/* Ten tabs and the Light/Dark switch stay on one row under the pinned desktop */
@media (min-width: 860px) and (min-height: 560px) {
  .demo-pin .demo-bar { flex-wrap: nowrap; gap: 10px; }
  .demo-pin .scenes, [data-theme="light"] .demo-pin .scenes { gap: 6px; flex-wrap: nowrap; }
  .demo-pin .scenes li, [data-theme="light"] .demo-pin .scenes li { padding: 7px 12px 7px 8px; font-size: 14px; white-space: nowrap; }
}
@media (min-width: 860px) and (max-width: 1560px) and (min-height: 560px) {
  .demo-pin .scenes li kbd { display: none; }
  .demo-pin .scenes li, [data-theme="light"] .demo-pin .scenes li { padding: 7px 12px; }
}
