/* ==========================================================================
   Zenless website
   Palettes live in themes.css (generated from the apps' theme.rs).
   Everything here is expressed in those 15 tokens + a few derived ones,
   so switching data-theme on <html> (or any element) re-colors it.
   ========================================================================== */

/* ---------- Derived tokens (recomputed on every themed element) ---------- */
:root,
[data-theme] {
  --line: color-mix(in oklab, var(--border) 70%, transparent);
  --line-soft: color-mix(in oklab, var(--border) 42%, transparent);
  --muted: color-mix(in oklab, var(--dim) 72%, var(--text));
  --faint: var(--dim);
  --accent-ink: var(--accent);
  --accent2-ink: var(--accent2);
  --card: color-mix(in oklab, var(--surface) 82%, transparent);
  --card-strong: color-mix(in oklab, var(--surface) 94%, transparent);
  --grad: linear-gradient(100deg, var(--accent) 0%, var(--accent2) 100%);
  --glow-a: color-mix(in oklab, var(--accent) 24%, transparent);
  --glow-b: color-mix(in oklab, var(--accent2) 20%, transparent);
  --shadow-lg: 0 40px 120px -40px rgb(0 0 0 / 0.75), 0 18px 40px -24px rgb(0 0 0 / 0.6);
  --shadow-md: 0 18px 50px -28px rgb(0 0 0 / 0.7);
}

/* Light palettes: darker "ink" versions of the accents for text, softer glows. */
[data-theme="paper"],
[data-theme="solarized-light"] {
  --accent-ink: color-mix(in oklab, var(--accent) 80%, #000);
  --accent2-ink: color-mix(in oklab, var(--accent2) 80%, #000);
  --muted: color-mix(in oklab, var(--dim) 60%, var(--text));
  --faint: color-mix(in oklab, var(--dim) 60%, var(--text));
  --card: color-mix(in oklab, var(--surface) 88%, transparent);
  --glow-a: color-mix(in oklab, var(--accent) 16%, transparent);
  --glow-b: color-mix(in oklab, var(--accent2) 13%, transparent);
  --shadow-lg: 0 40px 100px -40px rgb(30 30 40 / 0.35), 0 12px 30px -20px rgb(30 30 40 / 0.25);
  --shadow-md: 0 18px 44px -28px rgb(30 30 40 / 0.35);
}

[data-theme="high-contrast"] {
  --line: var(--border);
  --line-soft: color-mix(in oklab, var(--border) 60%, transparent);
  --muted: var(--dim);
}

:root {
  --font-display: "Bricolage Grotesque", "Geist", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --font-body: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --radius: 20px;
  --header-h: 64px;
  interpolate-size: allow-keywords;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

code,
kbd,
samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

:not(pre) > code {
  padding: 0.12em 0.4em;
  border-radius: 6px;
  background: color-mix(in oklab, var(--surface2) 80%, transparent);
  border: 1px solid var(--line-soft);
  color: var(--text);
  overflow-wrap: anywhere;
}

kbd {
  display: inline-block;
  padding: 0.05em 0.45em;
  border-radius: 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  background: var(--surface2);
  color: var(--text);
  font-size: 0.85em;
}

::selection {
  background: color-mix(in oklab, var(--accent) 38%, transparent);
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s var(--ease-out);
}

.skip-link:focus {
  top: 12px;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-fill {
  fill: currentColor;
  stroke: none;
}

.wrap {
  width: min(100% - 32px, 1200px);
  margin-inline: auto;
}

@media (min-width: 768px) {
  .wrap {
    width: min(100% - 64px, 1200px);
  }
}

.wrap-narrow {
  width: min(100% - 32px, 760px);
  margin-inline: auto;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  -webkit-backdrop-filter: saturate(1.5) blur(16px);
  backdrop-filter: saturate(1.5) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background-color 0.3s;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line-soft);
  background: color-mix(in oklab, var(--bg) 82%, transparent);
}

.nav {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  border-radius: 10px;
}

.brand:hover {
  text-decoration: none;
}

.mark {
  width: 32px;
  height: 32px;
  flex: none;
}

.mark .mark-bg {
  fill: var(--surface2);
  stroke: var(--line);
  stroke-width: 8;
}

.mark .mark-z {
  fill: none;
  stroke-width: 28;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mark .stop-a {
  stop-color: var(--accent);
}

.mark .stop-b {
  stop-color: var(--accent2);
}

.nav-primary {
  margin-left: auto;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-menu a {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 500;
  transition: color 0.2s, background-color 0.2s;
}

.nav-menu a:hover,
.nav-menu a[aria-current="page"] {
  color: var(--text);
  background: color-mix(in oklab, var(--surface2) 70%, transparent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: color-mix(in oklab, var(--surface2) 50%, transparent);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.icon-btn:hover {
  border-color: var(--line);
  background: var(--surface2);
}

.nav-toggle {
  display: none;
}

.nav-toggle .icon-close {
  display: none;
}

.site-header[data-open] .nav-toggle .icon-open {
  display: none;
}

.site-header[data-open] .nav-toggle .icon-close {
  display: block;
}

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-grid;
  }

  .nav-actions {
    margin-left: auto;
  }

  .nav-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: var(--header-h);
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    margin: 0;
    padding: 12px 16px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
  }

  .nav-menu a {
    height: 48px;
    font-size: 1.05rem;
  }

  .site-header[data-open] .nav-menu {
    display: flex;
  }

  /* backdrop-filter on the header makes the overflowing menu render
     translucent in Chromium, so drop it while the (opaque) menu is open. */
  .site-header[data-open] {
    background: var(--bg);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (max-width: 420px) {
  .nav-actions .gh-link {
    display: none;
  }
}

/* ---------- Buttons ---------- */
.btn {
  --h: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--h);
  padding: 0 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  font: 600 1rem/1.2 var(--font-body);
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s var(--ease-out), box-shadow 0.25s, background-color 0.2s, border-color 0.2s, color 0.2s;
}

.btn:hover {
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn .icon {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
  box-shadow:
    inset 0 1px 0 0 rgb(255 255 255 / 0.28),
    inset 0 0 0 1px color-mix(in oklab, var(--accent) 75%, #000),
    0 12px 32px -12px color-mix(in oklab, var(--accent) 75%, transparent);
}

.btn-primary:hover {
  transform: translateY(-1px);
  background: color-mix(in oklab, var(--accent) 90%, #fff);
  box-shadow:
    inset 0 1px 0 0 rgb(255 255 255 / 0.35),
    inset 0 0 0 1px color-mix(in oklab, var(--accent) 75%, #000),
    0 18px 44px -12px color-mix(in oklab, var(--accent) 85%, transparent);
}

.btn-ghost {
  background: color-mix(in oklab, var(--surface2) 55%, transparent);
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--surface2);
  border-color: color-mix(in oklab, var(--accent) 45%, var(--border));
}

.btn-lg {
  --h: 56px;
  padding: 0 26px;
  font-size: 1.06rem;
  border-radius: 14px;
}

.btn-sm {
  --h: 38px;
  padding: 0 14px;
  font-size: 0.92rem;
  border-radius: 10px;
  gap: 8px;
}

.btn-sm .icon {
  width: 16px;
  height: 16px;
}

.btn-sm.btn-primary {
  box-shadow:
    inset 0 1px 0 0 rgb(255 255 255 / 0.28),
    inset 0 0 0 1px color-mix(in oklab, var(--accent) 75%, #000),
    0 6px 18px -10px color-mix(in oklab, var(--accent) 70%, transparent);
}

.btn .btn-sub {
  font-weight: 500;
  opacity: 0.72;
  font-size: 0.85em;
}

@media (max-width: 480px) {
  .btn-block-sm {
    width: 100%;
  }
  /* Long labels may wrap on phones instead of overflowing. */
  .btn {
    white-space: normal;
    text-align: center;
  }
  .btn-lg {
    padding: 12px 18px;
  }
  .featured-cta {
    padding: 14px;
  }
}

/* ---------- Generic section chrome ---------- */
.section {
  position: relative;
  padding-block: clamp(64px, 8.5vw, 112px);
}

.section-tight {
  padding-block: clamp(40px, 5vw, 72px);
}

.section-tight + .section {
  padding-top: clamp(40px, 5vw, 72px);
}

.hero + .section-tight {
  padding-top: clamp(8px, 2vw, 24px);
}

.section + .section-tight {
  padding-top: 0;
}

.section-head {
  max-width: 760px;
  margin-bottom: clamp(36px, 5vw, 56px);
}

.section-head.center {
  margin-inline: auto;
  text-align: center;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

.kicker::before {
  content: "";
  width: 20px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.center .kicker::after {
  content: "";
  width: 20px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.h2 {
  margin-top: 16px;
  font-size: clamp(2rem, 4.8vw, 3.5rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.lead {
  margin-top: 18px;
  color: var(--muted);
  font-size: clamp(1.03rem, 1.5vw, 1.18rem);
  line-height: 1.6;
}

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.divider {
  height: 1px;
  border: 0;
  margin: 0;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

.muted {
  color: var(--muted);
}

.mono {
  font-family: var(--font-mono);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow-x: clip;
  padding-top: clamp(40px, 7vw, 88px);
  padding-bottom: clamp(24px, 4vw, 48px);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1000px;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--line-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 65% 55% at 50% 0%, #000 25%, transparent 78%);
  mask-image: radial-gradient(ellipse 65% 55% at 50% 0%, #000 25%, transparent 78%);
  opacity: 0.8;
}

.hero-glow {
  position: absolute;
  z-index: -1;
  top: -300px;
  left: 50%;
  width: min(1200px, 160vw);
  height: 760px;
  transform: translateX(-50%);
  pointer-events: none;
  background:
    radial-gradient(closest-side at 38% 50%, var(--glow-a), transparent),
    radial-gradient(closest-side at 66% 56%, var(--glow-b), transparent);
  filter: blur(10px);
  animation: drift 18s ease-in-out infinite alternate;
}

@keyframes drift {
  from {
    transform: translateX(-52%) translateY(0) scale(1);
  }
  to {
    transform: translateX(-48%) translateY(30px) scale(1.06);
  }
}

.hero-inner {
  display: grid;
  justify-items: center;
  text-align: center;
}

.hero-mark {
  position: relative;
  width: 76px;
  height: 76px;
  margin-bottom: 26px;
}

.hero-mark .mark {
  width: 76px;
  height: 76px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 14px 30px color-mix(in oklab, var(--accent) 30%, transparent));
}

.hero-mark::after {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: 36px;
  background: conic-gradient(from 180deg, var(--accent), var(--accent2), var(--accent));
  filter: blur(26px);
  opacity: 0.35;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px 5px 5px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 0.86rem;
  text-decoration: none;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

a.pill:hover {
  color: var(--text);
  border-color: color-mix(in oklab, var(--accent) 45%, var(--border));
  text-decoration: none;
}

.pill-badge {
  padding: 3px 9px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--accent) 16%, transparent);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.pill .icon {
  width: 14px;
  height: 14px;
}

.hero-title {
  margin-top: 26px;
  font-size: clamp(2.7rem, 8.4vw, 6.2rem);
  font-weight: 750;
  line-height: 0.96;
  letter-spacing: -0.042em;
  font-variation-settings: "opsz" 96;
}

.hero-title .line {
  display: block;
}

.hero-lead {
  max-width: 42rem;
  margin: 26px auto 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.7vw, 1.26rem);
  line-height: 1.6;
}

.hero-lead strong {
  color: var(--text);
  font-weight: 600;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 36px;
}

.fineprint {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 16px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  color: var(--faint);
  font-size: 0.86rem;
}

.fineprint li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.fineprint .icon {
  width: 15px;
  height: 15px;
  color: var(--success);
}

@media (max-width: 480px) {
  .cta-row .btn {
    width: 100%;
  }
}

/* Entrance animation for the hero (JS-independent, respects reduced motion) */
.rise {
  animation: rise 0.9s var(--ease-out) both;
}

.rise-1 {
  animation-delay: 0.05s;
}
.rise-2 {
  animation-delay: 0.14s;
}
.rise-3 {
  animation-delay: 0.23s;
}
.rise-4 {
  animation-delay: 0.32s;
}
.rise-5 {
  animation-delay: 0.45s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Mock stage */
.stage {
  position: relative;
  margin-top: clamp(48px, 7vw, 80px);
  perspective: 1800px;
}

.stage::before {
  content: "";
  position: absolute;
  inset: 8% 6% -6%;
  z-index: -1;
  background: radial-gradient(60% 55% at 50% 45%, var(--glow-a), transparent 72%);
  filter: blur(40px);
}

.stage .dm {
  transform-origin: 50% 0;
  animation: tilt-in 1.4s var(--ease-out) 0.35s both;
}

@keyframes tilt-in {
  from {
    opacity: 0;
    transform: rotateX(14deg) translateY(40px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.stage-caption {
  margin-top: 18px;
  text-align: center;
  color: var(--faint);
  font-size: 0.85rem;
}

/* ---------- Download Manager window mock ---------- */
.dm {
  --cols: minmax(0, 2.5fr) 78px minmax(110px, 1.35fr) 86px 70px 104px;
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-lg), 0 0 0 1px color-mix(in oklab, var(--border) 35%, transparent);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
  -webkit-user-select: none;
  user-select: none;
  cursor: default;
}

.dm .icon {
  width: 16px;
  height: 16px;
  stroke-width: 1.7;
}

.dm-titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding-left: 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.dm-titlebar img {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

.dm-title {
  color: var(--faint);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dm-winbtns {
  display: flex;
  margin-left: auto;
  align-self: stretch;
}

.dm-winbtns span {
  display: grid;
  place-items: center;
  width: 44px;
  color: var(--faint);
}

.dm-winbtns .icon {
  width: 13px;
  height: 13px;
}

.dm-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  min-width: 0;
  overflow: hidden;
}

.dm-tb {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 10px;
  border-radius: 7px;
  color: var(--text);
  font-size: 12.5px;
  white-space: nowrap;
  flex: none;
}

.dm-tb .icon {
  color: var(--faint);
}

.dm-tb.primary {
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
}

.dm-tb.primary .icon {
  color: currentColor;
}

.dm-tb.idle {
  color: var(--faint);
}

.dm-sep {
  flex: none;
  width: 1px;
  height: 20px;
  margin: 0 5px;
  background: var(--border);
}

.dm-search {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 1 210px;
  min-width: 0;
  height: 30px;
  margin-left: auto;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--input);
  color: var(--faint);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
}

.dm-body {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
}

.dm-side {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 10px 8px;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.dm-lbl {
  padding: 10px 8px 5px;
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.dm-lbl:first-child {
  padding-top: 2px;
}

.dm-nav {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 7px;
  white-space: nowrap;
}

.dm-nav .icon {
  color: var(--faint);
  width: 15px;
  height: 15px;
}

.dm-nav .n {
  margin-left: auto;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 11px;
}

.dm-nav.on {
  background: color-mix(in oklab, var(--accent) 13%, var(--surface2));
}

.dm-nav.on .icon {
  color: var(--accent);
}

.dm-side-foot {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.dm-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--faint);
  white-space: nowrap;
}

.dm-switch {
  position: relative;
  width: 26px;
  height: 15px;
  border-radius: 99px;
  background: var(--surface2);
  border: 1px solid var(--border);
  flex: none;
}

.dm-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--dim);
}

.dm-switch.on {
  background: var(--accent);
  border-color: var(--accent);
}

.dm-switch.on::after {
  left: 13px;
  background: var(--accent-fg);
}

.dm-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dm-th,
.dm-tr {
  display: grid;
  grid-template-columns: var(--cols);
  gap: 12px;
  align-items: center;
  padding: 0 14px;
}

.dm-th {
  height: 32px;
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.dm-tr {
  height: 39px;
  border-bottom: 1px solid var(--line-soft);
}

.dm-tr:nth-child(even) {
  background: var(--stripe);
}

.dm-tr.sel {
  background: color-mix(in oklab, var(--accent) 11%, var(--bg));
  box-shadow: inset 2px 0 0 var(--accent);
}

.dm-name {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.dm-name > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ficon {
  --c: var(--info);
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: color-mix(in oklab, var(--c) 17%, transparent);
  color: var(--c);
}

.dm .ficon .icon {
  width: 13px;
  height: 13px;
  stroke-width: 2;
}

.c-accent2 {
  --c: var(--accent2);
}
.c-danger {
  --c: var(--danger);
}
.c-warning {
  --c: var(--warning);
}
.c-success {
  --c: var(--success);
}
.c-accent {
  --c: var(--accent);
}
.c-info {
  --c: var(--info);
}

.num {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--faint);
  white-space: nowrap;
}

.num.hi {
  color: var(--text);
}

.dm-prog {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.bar {
  --bar: var(--accent);
  position: relative;
  flex: 1;
  height: 6px;
  min-width: 30px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface2);
}

.bar > i {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--p, 0) * 100%);
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in oklab, var(--bar) 75%, var(--accent2)), var(--bar));
}

[data-state="downloading"] .bar > i::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.45), transparent);
  background-size: 50% 100%;
  background-repeat: no-repeat;
  animation: shimmer 1.8s linear infinite;
}

@keyframes shimmer {
  from {
    background-position: -100% 0;
  }
  to {
    background-position: 200% 0;
  }
}

[data-state="paused"] .bar {
  --bar: var(--warning);
}
[data-state="completed"] .bar,
[data-state="seeding"] .bar {
  --bar: var(--success);
}
[data-state="queued"] .bar {
  --bar: var(--dim);
}

.pct {
  width: 38px;
  text-align: right;
}

.st {
  --c: var(--dim);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: start;
  padding: 2px 9px 2px 7px;
  border-radius: 99px;
  background: color-mix(in oklab, var(--c) 14%, transparent);
  color: var(--c);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}

.st::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

[data-state="downloading"] .st {
  --c: var(--accent-ink);
}
[data-state="downloading"] .st::before {
  animation: blink 1.2s ease-in-out infinite;
}
[data-state="paused"] .st {
  --c: var(--warning);
}
[data-state="completed"] .st,
[data-state="seeding"] .st {
  --c: var(--success);
}
[data-state="queued"] .st {
  --c: var(--info);
}

@keyframes blink {
  50% {
    opacity: 0.25;
  }
}

/* Detail pane with the segment map */
.dm-detail {
  display: grid;
  gap: 10px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.dm-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
}

.dm-detail-head strong {
  font-weight: 600;
  font-size: 12.5px;
}

.dm-detail-head .num {
  font-size: 11px;
}

.dm-detail-head .grow {
  margin-left: auto;
}

.segmap {
  position: relative;
  height: 22px;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid var(--border);
  background:
    repeating-linear-gradient(90deg, transparent 0 7px, color-mix(in oklab, var(--border) 45%, transparent) 7px 8px),
    var(--input);
}

.seg {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid var(--input);
}

.seg > i {
  position: absolute;
  inset: 0 auto 0 0;
  background: color-mix(in oklab, var(--accent) 82%, var(--surface));
}

.seg.live > i {
  background: linear-gradient(90deg, color-mix(in oklab, var(--accent) 78%, var(--surface)), var(--accent));
}

.seg.live > i::after {
  content: "";
  position: absolute;
  top: 0;
  right: -1px;
  bottom: 0;
  width: 2px;
  background: var(--accent2);
  box-shadow: 0 0 8px 1px var(--accent2);
}

.dm-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  color: var(--faint);
  font-size: 11px;
}

.dm-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dm-legend i {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: color-mix(in oklab, var(--accent) 82%, var(--surface));
}

.dm-legend i.l2 {
  background: var(--accent2);
}

.dm-legend i.l3 {
  background: var(--input);
  border: 1px solid var(--border);
}

.dm-conns {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 4px;
}

.dm-conn {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
}

.dm-conn b {
  font-weight: 500;
  color: var(--text);
}

.dm-conn.off b {
  color: var(--faint);
}

.dm-statusbar {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 30px;
  padding: 0 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--faint);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
}

.dm-statusbar > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dm-statusbar .icon {
  width: 13px;
  height: 13px;
}

.dm-statusbar .spd {
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.dm-spark {
  width: 90px;
  height: 18px;
  margin-left: auto;
  flex: none;
}

.dm-spark polyline {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.dm-spark polygon {
  fill: color-mix(in oklab, var(--accent) 16%, transparent);
  stroke: none;
}

/* Responsive mock: reflow instead of scaling */
@media (max-width: 1080px) {
  .dm {
    --cols: minmax(0, 2.3fr) 74px minmax(100px, 1.3fr) 82px 66px;
  }
  .dm .col-status {
    display: none;
  }
  .dm-body {
    grid-template-columns: 170px minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .dm-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .dm-side {
    display: none;
  }
  .dm-tb .tb-label {
    display: none;
  }
  .dm-tb.primary .tb-label {
    display: inline;
  }
  .dm-search {
    flex-basis: 150px;
  }
}

@media (max-width: 640px) {
  .dm {
    --cols: minmax(0, 1.6fr) minmax(84px, 1fr) 70px;
    font-size: 12.5px;
  }
  .dm .col-size,
  .dm .col-eta {
    display: none;
  }
  .dm-tr.extra,
  .dm-conns,
  .dm-tb.opt,
  .dm-sep.opt,
  .dm-statusbar .opt {
    display: none;
  }
  .dm-search {
    flex: 0 0 auto;
    width: 30px;
    padding: 0;
    justify-content: center;
  }
  .dm-search .search-text {
    display: none;
  }
  .dm-winbtns span {
    width: 34px;
  }
}

@media (max-width: 420px) {
  .dm {
    --cols: minmax(0, 1.25fr) minmax(76px, 1fr);
  }
  .dm .col-speed {
    display: none;
  }
  .dm-th,
  .dm-tr {
    padding: 0 10px;
    gap: 10px;
  }
  .dm-detail {
    padding: 10px;
  }
  .dm-legend {
    display: none;
  }
}

/* ---------- Stats band ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}

.stat {
  padding: clamp(20px, 3vw, 30px) clamp(16px, 2.5vw, 28px);
}

.stat + .stat {
  border-left: 1px solid var(--line-soft);
}

.stat-num {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}

.stat-label {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.4;
}

@media (max-width: 720px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat:nth-child(3) {
    border-left: 0;
  }
  .stat:nth-child(n + 3) {
    border-top: 1px solid var(--line-soft);
  }
}

/* ---------- Cards / bento ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  grid-column: span 12;
  display: flex;
  flex-direction: column;
  padding: clamp(22px, 3vw, 32px);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--card-strong), var(--card));
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, -30%), color-mix(in oklab, var(--accent) 10%, transparent), transparent 62%);
  opacity: 0;
  transition: opacity 0.4s;
}

.card:hover::before {
  opacity: 1;
}

@media (min-width: 940px) {
  .span-7 {
    grid-column: span 7;
  }
  .span-6 {
    grid-column: span 6;
  }
  .span-5 {
    grid-column: span 5;
  }
  .span-4 {
    grid-column: span 4;
  }
}

.card-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.app-icon {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 14px;
  box-shadow: 0 10px 26px -10px rgb(0 0 0 / 0.55);
}

.card h3 {
  font-size: clamp(1.3rem, 2vw, 1.55rem);
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.card-file {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--faint);
}

.card-desc {
  margin-top: 18px;
  color: var(--muted);
}

.feats {
  display: grid;
  gap: 10px 22px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 560px) {
  .feats.two {
    grid-template-columns: 1fr 1fr;
  }
}

.feats li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.95rem;
  line-height: 1.45;
}

.feats .icon {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--accent-ink);
}

.card-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 26px;
}

.card-visual {
  margin-top: 22px;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  padding: 14px;
}

/* DM card: 32 connection bars */
.conn-viz {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 56px;
}

.conn-viz span {
  flex: 1;
  min-width: 0;
  height: var(--h, 60%);
  border-radius: 3px 3px 1px 1px;
  background: linear-gradient(180deg, var(--accent), color-mix(in oklab, var(--accent) 40%, transparent));
  transform-origin: bottom;
  animation: eq 2.4s ease-in-out infinite alternate;
  animation-delay: var(--d, 0s);
}

/* Pseudo-random heights/phases without inline styles (CSP-friendly). */
.conn-viz span:nth-child(2n) {
  --h: 80%;
  --d: -0.4s;
}
.conn-viz span:nth-child(3n) {
  --h: 52%;
  --d: -1.1s;
}
.conn-viz span:nth-child(5n) {
  --h: 95%;
  --d: -1.7s;
}
.conn-viz span:nth-child(7n) {
  --h: 64%;
  --d: -0.8s;
}
.conn-viz span:nth-child(4n + 1) {
  --d: -2s;
}
.conn-viz span:nth-child(11n) {
  --h: 42%;
}

@keyframes eq {
  0% {
    transform: scaleY(0.55);
  }
  100% {
    transform: scaleY(1);
  }
}

.viz-caption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

/* Torrent card: piece map */
.pieces {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  gap: 3px;
}

.pieces i {
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--surface2);
  transition: background-color 0.5s;
}

.pieces i.have {
  background: var(--accent2);
}

.pieces i.part {
  background: color-mix(in oklab, var(--accent2) 45%, var(--surface2));
}

/* Extension card: browser chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--surface2) 60%, transparent);
  font-size: 0.86rem;
  white-space: nowrap;
}

.chip .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

/* Setup card: component checklist */
.checklist {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.checklist li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: color-mix(in oklab, var(--surface) 70%, transparent);
  font-size: 0.92rem;
}

.checklist .box {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 5px;
  border: 1.5px solid var(--border);
}

.checklist .on .box {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}

.checklist .box .icon {
  width: 12px;
  height: 12px;
  stroke-width: 3;
}

.checklist .size {
  margin-left: auto;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

/* ---------- Themes section ---------- */
.themes-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

@media (min-width: 1000px) {
  .themes-grid {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 32px;
  }
  .themes-aside {
    position: sticky;
    top: calc(var(--header-h) + 24px);
  }
}

/* 34 swatches + 1 "custom" tile: fixed column counts so the custom tile
   always fills the last row exactly (5 cols → span 1, 3 → 2, 2 → 2). */
.swatches {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.swatches .swatch-custom {
  grid-column: span 1;
}

@media (max-width: 620px) {
  .swatches {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
  .swatches .swatch-custom {
    grid-column: span 2;
  }
}

@media (max-width: 440px) {
  .swatches {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .swatches .swatch-custom {
    grid-column: span 2;
  }
}

.swatch {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 8px 8px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), border-color 0.2s, box-shadow 0.25s;
}

.swatch:hover {
  transform: translateY(-2px);
  border-color: color-mix(in oklab, var(--accent) 55%, var(--border));
  box-shadow: 0 14px 30px -18px color-mix(in oklab, var(--accent) 60%, transparent);
}

.swatch[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 14px 34px -18px color-mix(in oklab, var(--accent) 80%, transparent);
}

.sw-preview {
  display: grid;
  grid-template-columns: 26% 1fr;
  grid-template-rows: 10px 1fr;
  height: 72px;
  overflow: hidden;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.sw-top {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 5px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.sw-top i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--dim);
}

.sw-side {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 6px 5px;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.sw-side i {
  height: 4px;
  border-radius: 2px;
  background: var(--surface2);
}

.sw-side i:first-child {
  background: var(--accent);
}

.sw-rows {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 8px 7px;
}

.sw-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 5px;
  align-items: center;
}

.sw-row b {
  height: 4px;
  border-radius: 2px;
  background: var(--text);
  opacity: 0.55;
}

.sw-row s {
  position: relative;
  height: 4px;
  border-radius: 2px;
  background: var(--surface2);
  overflow: hidden;
}

.sw-row s::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--w, 60%);
  border-radius: inherit;
  background: var(--grad);
}

.sw-row:nth-child(2) s::after {
  --w: 35%;
}

.sw-row:nth-child(3) s::after {
  --w: 85%;
  background: var(--success);
}

.sw-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 4px;
}

.sw-name {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
}

.sw-dots {
  display: flex;
  flex: none;
}

.sw-dots i {
  width: 11px;
  height: 11px;
  margin-left: -3px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  background: var(--c);
}

.sw-check {
  position: absolute;
  top: 14px;
  right: 14px;
  display: none;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-fg);
}

.sw-check .icon {
  width: 12px;
  height: 12px;
  stroke-width: 3;
}

.swatch[aria-pressed="true"] .sw-check {
  display: grid;
}

.swatch-custom {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: center;
  align-items: center;
  gap: 4px 12px;
  min-height: 100%;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.swatch-custom strong {
  color: var(--text);
  font-size: 0.95rem;
}

.swatch-custom .icon {
  grid-row: span 2;
  width: 26px;
  height: 26px;
  color: var(--accent-ink);
}

.swatch-custom span {
  grid-column: 2;
}

@media (max-width: 440px) {
  .swatch-custom {
    grid-template-columns: 1fr;
    align-content: start;
    padding: 12px;
    font-size: 0.8rem;
  }
  .swatch-custom .icon {
    grid-row: auto;
  }
  .swatch-custom span {
    grid-column: 1;
  }
}

.palette {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 6px;
  margin-top: 16px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
}

.palette-title {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-weight: 600;
}

.palette-title .mono {
  color: var(--faint);
  font-size: 0.78rem;
  font-weight: 400;
}

.pal {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 4px;
  font-size: 0.8rem;
}

.pal i {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 6px;
  background: var(--c);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--text) 18%, transparent);
}

.pal span {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}

.pal span b {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pal code {
  padding: 0;
  border: 0;
  background: none;
  color: var(--faint);
  font-size: 0.74rem;
}

.note {
  display: flex;
  gap: 14px;
  margin-top: 16px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid color-mix(in oklab, var(--accent) 30%, var(--border));
  background: color-mix(in oklab, var(--accent) 6%, var(--surface));
}

.note .icon {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  color: var(--accent-ink);
}

.note p {
  color: var(--muted);
  font-size: 0.95rem;
}

.note strong {
  color: var(--text);
}

/* Torrent mini window (theme preview) */
.tm {
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg);
  box-shadow: var(--shadow-md);
  font-size: 12.5px;
  line-height: 1.35;
  -webkit-user-select: none;
  user-select: none;
}

.tm .icon {
  width: 15px;
  height: 15px;
}

.tm-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 6px 14px;
  align-items: center;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.tm-row:nth-child(even) {
  background: var(--stripe);
}

.tm-row .dm-name {
  grid-column: 1 / -1;
}

.tm-row .tm-sub {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  justify-self: end;
}

.tm-row > .num:not(.tm-sub) {
  font-size: 11px;
}

.tm-pieces {
  display: grid;
  grid-template-columns: repeat(48, minmax(0, 1fr));
  gap: 2px;
  padding: 14px 14px 0;
}

.tm-pieces i {
  height: 10px;
  border-radius: 2px;
  background: var(--surface2);
  transition: background-color 0.4s;
}

.tm-pieces i.have {
  background: var(--accent2);
}

.tm-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 10px 14px 12px;
  color: var(--faint);
  font-size: 11.5px;
}

.tm-foot span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tm-foot .up {
  color: var(--accent2-ink);
  font-family: var(--font-mono);
}

.tm-foot .down {
  color: var(--accent-ink);
  font-family: var(--font-mono);
}

/* ---------- Rust section ---------- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  align-items: center;
}

@media (min-width: 980px) {
  .split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 64px;
  }
}

.stack-list {
  display: grid;
  gap: 2px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.stack-list li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px;
  align-items: start;
  padding: 14px 0;
  border-top: 1px solid var(--line-soft);
}

.stack-list li:last-child {
  border-bottom: 1px solid var(--line-soft);
}

.stack-ico {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--surface2) 70%, transparent);
  color: var(--accent-ink);
}

.stack-list strong {
  display: block;
  font-weight: 600;
}

.stack-list span {
  color: var(--muted);
  font-size: 0.94rem;
}

.code-win {
  overflow: hidden;
  min-width: 0;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--input);
  box-shadow: var(--shadow-lg);
}

.code-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 10px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.code-tabs .dots {
  display: flex;
  gap: 6px;
  margin-right: 10px;
  padding-bottom: 8px;
}

.code-tabs .dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
}

.code-tab {
  position: relative;
  padding: 8px 14px 10px;
  border: 0;
  border-radius: 8px 8px 0 0;
  background: none;
  color: var(--faint);
  font: 500 0.82rem var(--font-mono);
  cursor: pointer;
  white-space: nowrap;
}

.code-tab[aria-selected="true"] {
  color: var(--text);
  background: var(--input);
}

.code-tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
}

.code-tab:focus-visible {
  outline-offset: -2px;
}

.code {
  margin: 0;
  padding: 18px 20px 22px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.75;
  color: var(--text);
  tab-size: 2;
}

.code .c {
  color: var(--faint);
  font-style: italic;
}
.code .s {
  color: var(--success);
}
.code .h {
  color: var(--accent2-ink);
  font-weight: 600;
}
.code .k {
  color: var(--text);
}
.code .p {
  color: var(--faint);
}
.code .b {
  color: var(--warning);
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.mini-stat {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
}

.mini-stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.mini-stat span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

@media (max-width: 520px) {
  .mini-stats {
    grid-template-columns: 1fr;
  }
}

/* ---------- Privacy section ---------- */
.flow {
  position: relative;
  display: grid;
  gap: 14px;
  margin: 0;
  padding: clamp(20px, 3vw, 30px);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
}

.flow-apps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 440px) {
  .flow-apps {
    grid-template-columns: 1fr;
  }
}

.flow-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.vline {
  width: 2px;
  height: 22px;
  border-radius: 2px;
  background: repeating-linear-gradient(180deg, var(--accent) 0 5px, transparent 5px 9px);
  background-size: 2px 18px;
  animation: flow-v 0.9s linear infinite;
}

.xline {
  position: relative;
  width: 2px;
  height: 34px;
  background: repeating-linear-gradient(180deg, var(--line) 0 4px, transparent 4px 8px);
}

.xline::before,
.xline::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 2px;
  margin: -1px 0 0 -8px;
  border-radius: 2px;
  background: var(--danger);
  transform: rotate(45deg);
}

.xline::after {
  transform: rotate(-45deg);
}

@keyframes flow-v {
  to {
    background-position: 0 18px;
  }
}

.node {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.node img,
.node .node-ico {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 10px;
}

.node .node-ico {
  display: grid;
  place-items: center;
  background: var(--surface2);
  color: var(--accent-ink);
}

.node b {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.25;
}

.node small {
  display: block;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  overflow-wrap: anywhere;
}

.node.blocked {
  border-style: dashed;
  background: transparent;
  color: var(--faint);
}

.node.blocked .node-ico {
  color: var(--danger);
  background: color-mix(in oklab, var(--danger) 12%, transparent);
}

.node.blocked b {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--danger);
}

.cta-row.cta-left {
  justify-content: flex-start;
  margin-top: 32px;
}

.checks {
  display: grid;
  gap: 14px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.checks li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.checks .icon {
  width: 22px;
  height: 22px;
  margin-top: 1px;
  color: var(--success);
}

.checks b {
  display: block;
  font-weight: 600;
}

.checks span {
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- FAQ ---------- */
.faq-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
}

@media (min-width: 980px) {
  .faq-grid {
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
    gap: 64px;
  }
  .faq-grid .section-head {
    position: sticky;
    top: calc(var(--header-h) + 32px);
    align-self: start;
  }
}

.faq {
  border-top: 1px solid var(--line);
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 4px;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  border-radius: 8px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary:hover {
  color: var(--accent-ink);
}

.faq .plus {
  position: relative;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--line);
  transition: transform 0.3s var(--ease-out), background-color 0.2s, border-color 0.2s;
}

.faq .plus::before,
.faq .plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 1.5px;
  margin: -0.75px 0 0 -5.5px;
  background: currentColor;
  border-radius: 1px;
}

.faq .plus::after {
  transform: rotate(90deg);
  transition: transform 0.3s var(--ease-out);
}

.faq details[open] .plus {
  transform: rotate(180deg);
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}

.faq details[open] .plus::after {
  transform: rotate(0deg);
}

.faq details::details-content {
  block-size: 0;
  overflow: hidden;
  transition: block-size 0.35s var(--ease-out), content-visibility 0.35s allow-discrete;
}

.faq details[open]::details-content {
  block-size: auto;
}

.faq-body {
  display: grid;
  gap: 12px;
  padding: 0 4px 24px;
  color: var(--muted);
  max-width: 64ch;
}

.faq-body ol,
.faq-body ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 1.3em;
}

.faq-body strong {
  color: var(--text);
}

/* ---------- Open source ---------- */
.repos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 12px;
}

.repo {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s var(--ease-out), background-color 0.2s;
}

.repo:hover {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: color-mix(in oklab, var(--accent) 50%, var(--border));
  background: var(--card-strong);
}

.repo img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.repo-name {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.repo-desc {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.repo-lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: var(--faint);
  font-size: 0.8rem;
}

.repo-lang::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--lc, #dea584);
}

.repo-lang.js {
  --lc: #f1e05a;
}

.repo-lang.html {
  --lc: #e34c26;
}

.repo .arrow {
  color: var(--faint);
  transition: color 0.2s, transform 0.2s var(--ease-out);
}

.repo:hover .arrow {
  color: var(--accent-ink);
  transform: translate(2px, -2px);
}

/* ---------- Final CTA ---------- */
.cta-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(40px, 7vw, 88px) clamp(20px, 5vw, 64px);
  border-radius: 28px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: center;
}

.cta-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 80% at 20% 0%, var(--glow-a), transparent 70%),
    radial-gradient(60% 80% at 85% 100%, var(--glow-b), transparent 70%);
}

.cta-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, var(--line-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000, transparent 70%);
  mask-image: radial-gradient(ellipse at center, #000, transparent 70%);
  opacity: 0.6;
}

.cta-card .h2 {
  font-size: clamp(2.1rem, 5.4vw, 4rem);
}

.cta-card .lead {
  max-width: 40rem;
  margin-inline: auto;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: clamp(24px, 4vw, 48px);
  padding: 56px 0 36px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 0.93rem;
}

.foot-grid {
  display: grid;
  gap: 36px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 860px) {
  .foot-grid {
    grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  }
}

.foot-brand {
  grid-column: 1 / -1;
  display: grid;
  gap: 14px;
  align-content: start;
}

@media (min-width: 860px) {
  .foot-brand {
    grid-column: auto;
  }
}

.foot-brand p {
  max-width: 34ch;
}

.foot-col h2 {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.foot-col ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot-col a {
  color: var(--muted);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.foot-col a:hover {
  color: var(--text);
  text-decoration: underline;
}

.theme-picker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
  padding: 4px 4px 4px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 0.86rem;
}

.theme-picker .icon {
  width: 16px;
  height: 16px;
  color: var(--accent-ink);
}

.theme-picker select {
  height: 34px;
  padding: 0 32px 0 10px;
  border-radius: 9px;
  border: 1px solid var(--line-soft);
  background-color: var(--surface2);
  background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  color: var(--text);
  font: 500 0.88rem var(--font-body);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.foot-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
  color: var(--faint);
  font-size: 0.85rem;
}

.foot-bottom a {
  color: var(--muted);
}

/* ---------- Page hero (download / privacy / 404) ---------- */
.page-hero {
  position: relative;
  isolation: isolate;
  overflow: clip;
  padding: clamp(48px, 8vw, 96px) 0 clamp(32px, 5vw, 56px);
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(50% 70% at 20% 0%, var(--glow-a), transparent 70%),
    radial-gradient(40% 60% at 90% 10%, var(--glow-b), transparent 70%);
  opacity: 0.8;
}

.page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, var(--line-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 90%);
  mask-image: linear-gradient(to bottom, #000, transparent 90%);
  opacity: 0.5;
}

.page-title {
  margin-top: 16px;
  font-size: clamp(2.4rem, 6.4vw, 4.6rem);
  font-weight: 750;
  line-height: 1;
  letter-spacing: -0.05em;
}

/* ---------- Download page ---------- */
.featured {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  padding: clamp(22px, 4vw, 40px);
  border-radius: 24px;
  border: 1px solid color-mix(in oklab, var(--accent) 35%, var(--border));
  background:
    radial-gradient(80% 120% at 100% 0%, color-mix(in oklab, var(--accent) 9%, transparent), transparent 60%),
    var(--card-strong);
  box-shadow: var(--shadow-md);
}

@media (min-width: 900px) {
  .featured {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    align-items: center;
    gap: 48px;
  }
}

.featured-head {
  display: flex;
  align-items: center;
  gap: 18px;
}

.featured-head img {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  box-shadow: 0 14px 30px -12px rgb(0 0 0 / 0.55);
}

.featured h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.3rem);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--accent) 16%, transparent);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.featured-cta {
  display: grid;
  gap: 12px;
  justify-items: stretch;
  padding: 22px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg) 60%, transparent);
}

.featured-cta .btn {
  width: 100%;
}

.meta-list {
  display: grid;
  gap: 6px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.88rem;
}

.meta-list li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.meta-list .icon {
  width: 16px;
  height: 16px;
  color: var(--success);
}

.featured-chips {
  margin-top: 22px;
}

.small-link {
  display: inline-flex;
  align-items: center;
  justify-self: center;
  gap: 6px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.86rem;
  text-decoration: none;
}

.small-link:hover {
  color: var(--text);
  text-decoration: underline;
}

.small-link .icon {
  width: 14px;
  height: 14px;
}

.steps.steps-after {
  margin-top: 16px;
}

.page-hero + .section-tight {
  padding-top: 8px;
}

.after-note {
  margin-top: 18px;
  color: var(--faint);
  font-size: 0.9rem;
}

.cta-card.cta-compact {
  padding-block: clamp(32px, 5vw, 56px);
}

.cta-card.cta-compact .h2 {
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
}

.guide .note {
  margin-top: 24px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps > li {
  counter-increment: step;
  position: relative;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
}

.steps > li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-ink);
}

.steps b {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

.steps span {
  color: var(--muted);
  font-size: 0.93rem;
}

.dl-list {
  display: grid;
  gap: 12px;
}

.dl-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--card);
  transition: border-color 0.2s;
}

.dl-row:hover {
  border-color: color-mix(in oklab, var(--accent) 40%, var(--border));
}

.dl-row img {
  width: 52px;
  height: 52px;
  border-radius: 13px;
}

.dl-row h3 {
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}

.dl-row p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.92rem;
}

.dl-file {
  display: inline-block;
  margin-top: 6px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.dl-actions {
  display: flex;
  gap: 8px;
}

@media (max-width: 680px) {
  .dl-row {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 14px;
    padding: 16px;
  }
  .dl-row img {
    width: 44px;
    height: 44px;
  }
  .dl-actions {
    grid-column: 1 / -1;
  }
  .dl-actions .btn {
    flex: 1;
  }
}

.req-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 12px;
}

.req {
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
}

.req .icon {
  width: 22px;
  height: 22px;
  color: var(--accent-ink);
}

.req b {
  display: block;
  margin-top: 12px;
  font-weight: 600;
}

.req p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.93rem;
}

.guide-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

@media (min-width: 940px) {
  .guide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.guide {
  padding: clamp(22px, 3vw, 32px);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
}

.guide h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.35rem;
}

.guide h3 img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.guide > p {
  margin-top: 10px;
  color: var(--muted);
}

.olist {
  display: grid;
  gap: 16px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: li;
}

.olist > li {
  counter-increment: li;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.olist > li::before {
  content: counter(li);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface2);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
}

.olist > li > div {
  padding-top: 2px;
  color: var(--muted);
}

.olist strong {
  color: var(--text);
}

.url-list {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.url-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 6px 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: color-mix(in oklab, var(--input) 70%, transparent);
  font-size: 0.88rem;
}

.url-list li span {
  color: var(--faint);
  font-size: 0.82rem;
}

.url-list code {
  padding: 0;
  border: 0;
  background: none;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  margin-left: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface2);
  color: var(--text);
  font: 500 0.8rem var(--font-body);
  cursor: pointer;
  flex: none;
}

.copy-btn:hover {
  border-color: color-mix(in oklab, var(--accent) 45%, var(--border));
}

.copy-btn .icon {
  width: 14px;
  height: 14px;
}

.copy-btn.done {
  color: var(--success);
}

.callout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  padding: clamp(22px, 4vw, 40px);
  border-radius: var(--radius);
  border: 1px solid color-mix(in oklab, var(--warning) 35%, var(--border));
  background: color-mix(in oklab, var(--warning) 5%, var(--surface));
}

@media (min-width: 900px) {
  .callout {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: center;
    gap: 48px;
  }
}

.callout .kicker {
  color: color-mix(in oklab, var(--warning) 80%, var(--text));
}

.callout h2 {
  margin-top: 12px;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.callout p {
  margin-top: 12px;
  color: var(--muted);
}

/* Schematic SmartScreen dialog */
.ss {
  overflow: hidden;
  border-radius: 12px;
  background: #1f3f7a;
  color: #fff;
  font-family: "Segoe UI", var(--font-body);
  box-shadow: var(--shadow-md);
  -webkit-user-select: none;
  user-select: none;
}

.ss-body {
  padding: 22px 22px 18px;
}

.ss-title {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.25;
}

.callout .ss-text {
  margin-top: 10px;
  color: rgb(255 255 255 / 0.9);
  font-size: 0.86rem;
}

.ss-more {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.86rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ss-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 14px;
  margin-top: 12px;
  font-size: 0.8rem;
  opacity: 0.9;
}

.ss-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  background: rgb(0 0 0 / 0.18);
}

.ss-btn {
  padding: 6px 16px;
  border: 1px solid rgb(255 255 255 / 0.55);
  font-size: 0.82rem;
}

.ss-hl {
  position: relative;
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.ss-hl::after {
  content: attr(data-step);
  position: absolute;
  top: -12px;
  right: -14px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-fg);
  font: 700 0.75rem var(--font-mono);
  text-decoration: none;
}

/* ---------- Prose (privacy) ---------- */
.prose {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.75;
}

.prose h2 {
  margin: 56px 0 14px;
  color: var(--text);
  font-size: clamp(1.4rem, 2.6vw, 1.8rem);
  letter-spacing: -0.03em;
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.prose h3 {
  margin: 28px 0 8px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 16px;
}

.prose ul,
.prose ol {
  padding-left: 1.3em;
}

.prose li {
  margin-bottom: 6px;
}

.prose strong {
  color: var(--text);
  font-weight: 600;
}

.prose table {
  width: 100%;
  margin: 0 0 20px;
  border-collapse: collapse;
  font-size: 0.93rem;
}

.prose th,
.prose td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

.prose th {
  color: var(--text);
  font-weight: 600;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 0 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
}

.table-wrap table {
  margin: 0;
  min-width: 520px;
}

.table-wrap tr:last-child td {
  border-bottom: 0;
}

.tldr {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tldr li {
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
}

@media (max-width: 540px) {
  .tldr {
    grid-template-columns: minmax(0, 1fr);
  }
}

.tldr .icon {
  width: 22px;
  height: 22px;
  color: var(--success);
}

.tldr b {
  display: block;
  margin-top: 10px;
  color: var(--text);
  font-weight: 600;
}

.tldr span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.policy-date {
  margin-top: 18px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.toc + .prose,
nav + .prose {
  margin-top: 8px;
}

.prose > h2:first-child {
  margin-top: 48px;
}

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.toc a {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
  text-decoration: none;
}

.toc a:hover {
  color: var(--text);
  border-color: color-mix(in oklab, var(--accent) 45%, var(--border));
}

/* ---------- 404 ---------- */
.nf {
  display: grid;
  justify-items: center;
  gap: 18px;
  min-height: calc(100vh - var(--header-h) - 260px);
  align-content: center;
  padding: 64px 0 24px;
  text-align: center;
}

.nf-hero {
  padding-top: 0;
}

.nf .h2 {
  margin-top: 0;
}

.foot-bottom.foot-bottom-only {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.nf-code {
  font-family: var(--font-display);
  font-size: clamp(6rem, 22vw, 13rem);
  font-weight: 800;
  line-height: 0.85;
  letter-spacing: -0.07em;
}

.nf-bar {
  width: min(100%, 520px);
  margin-top: 10px;
  text-align: left;
}

.nf-map {
  position: relative;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
  height: 22px;
  padding: 2px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--input);
}

.nf-map i {
  border-radius: 3px;
  background: color-mix(in oklab, var(--accent) 80%, var(--surface));
}

.nf-map i.part {
  background: linear-gradient(90deg, color-mix(in oklab, var(--accent) 80%, var(--surface)) 40%, transparent 40%);
}

.nf-map i.fail {
  background: repeating-linear-gradient(135deg, color-mix(in oklab, var(--danger) 70%, transparent) 0 4px, transparent 4px 8px);
  animation: blink 1.6s ease-in-out infinite;
}

.nf-map i.empty {
  background: transparent;
}

.nf-status {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.nf-status .err {
  color: var(--danger);
}

/* ---------- Scroll reveal (only when JS is running) ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

.js .reveal.d1 {
  transition-delay: 0.08s;
}
.js .reveal.d2 {
  transition-delay: 0.16s;
}
.js .reveal.d3 {
  transition-delay: 0.24s;
}

/* ---------- Theme switch: circular reveal via View Transitions ---------- */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-new(root) {
  z-index: 2;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
  }
  .hero-glow {
    animation: none;
  }
}

/* ---------- Print ---------- */
@media print {
  .site-header,
  .site-footer,
  .hero-glow,
  .stage {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
}
