/* 1s.xuanhieu.org — Graphite Luxe (dark, default) / Light Authority. Values from 02_design-system/project/tokens.json 0.10.0. */

/* Self-hosted fonts. Generated by tools/build-fonts.mjs from the SIL OFL faces in 03_product-brand-kit/fonts/;
   the licence files ship next to the WOFF2 in src/assets/fonts/. No external font service is contacted.
   font-display: swap so text renders immediately in the fallback and never waits on a font. */
@font-face{font-family:"Be Vietnam Pro";font-style:normal;font-weight:400;font-display:swap;src:url("/assets/fonts/BeVietnamPro-400.woff2") format("woff2")}
@font-face{font-family:"Be Vietnam Pro";font-style:normal;font-weight:500;font-display:swap;src:url("/assets/fonts/BeVietnamPro-500.woff2") format("woff2")}
@font-face{font-family:"Be Vietnam Pro";font-style:normal;font-weight:600;font-display:swap;src:url("/assets/fonts/BeVietnamPro-600.woff2") format("woff2")}
@font-face{font-family:"Be Vietnam Pro";font-style:normal;font-weight:700;font-display:swap;src:url("/assets/fonts/BeVietnamPro-700.woff2") format("woff2")}
@font-face{font-family:"Be Vietnam Pro";font-style:normal;font-weight:800;font-display:swap;src:url("/assets/fonts/BeVietnamPro-800.woff2") format("woff2")}
@font-face{font-family:"JetBrains Mono";font-style:normal;font-weight:500;font-display:swap;src:url("/assets/fonts/JetBrainsMono-500.woff2") format("woff2")}
@font-face{font-family:"JetBrains Mono";font-style:normal;font-weight:700;font-display:swap;src:url("/assets/fonts/JetBrainsMono-700.woff2") format("woff2")}

:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --xh-bg: #07080A;
  --xh-surface: #111317;
  --xh-surface-raised: #16191E;
  --xh-glass-fill: rgba(255,255,255,0.045);
  --xh-glass-border: rgba(255,255,255,0.09);
  --xh-glass-highlight: rgba(255,255,255,0.16);
  --xh-ink: #F4F5F7;
  --xh-muted: #A7ADB7;
  --xh-deep-blue: #C6CED9;
  --xh-primary: #9DCDFF;
  --xh-primary-hover: #C4E2FF;
  --xh-warm: #C9A46A;
  --xh-warm-text: #E2C799;
  --xh-divider: #22262C;
  --xh-divider-strong: #626A76;
  --xh-control-border: #6B7380;
  --xh-focus: #9DCDFF;
  --xh-positive: #8AD9B6;
  --xh-btn-bg: #F4F5F7;
  --xh-btn-fg: #07080A;
  --xh-btn-hover: #DADDE2;
  --xh-secondary-hover: #1A1D22;
  --xh-shadow-card: 0 1px 0 rgba(255,255,255,.04), 0 20px 48px rgba(0,0,0,.55);
  --xh-shadow-hover: 0 1px 0 rgba(255,255,255,.06), 0 28px 64px rgba(0,0,0,.6);
  --xh-shadow-glass: 0 24px 60px rgba(0,0,0,.55);
  --mark-white: block;
  --mark-ink: none;
}
:root[data-theme="light"] {
  color-scheme: light;
  --xh-bg: #F8FAFD;
  --xh-surface: #FFFFFF;
  --xh-surface-raised: #FFFFFF;
  --xh-glass-fill: rgba(255,255,255,0.72);
  --xh-glass-border: rgba(16,35,58,0.10);
  --xh-glass-highlight: rgba(255,255,255,0.95);
  --xh-ink: #10233A;
  --xh-muted: #52647A;
  --xh-deep-blue: #123A63;
  --xh-primary: #1258A8;
  --xh-primary-hover: #0D467E;
  --xh-warm: #C59B62;
  --xh-warm-text: #73511C;
  --xh-divider: #CAD6E4;
  --xh-divider-strong: #6E7E94;
  --xh-control-border: #6E7E94;
  --xh-focus: #1258A8;
  --xh-positive: #1B6B49;
  --xh-btn-bg: #1258A8;
  --xh-btn-fg: #FFFFFF;
  --xh-btn-hover: #0D467E;
  --xh-secondary-hover: #DCEBFA;
  --xh-shadow-card: 0 8px 28px rgba(8,21,37,.07);
  --xh-shadow-hover: 0 12px 32px rgba(8,21,37,.10);
  --xh-shadow-glass: 0 12px 40px rgba(16,35,58,.10);
  --mark-white: none;
  --mark-ink: block;
}

:root {
  --font-sans: "Be Vietnam Pro", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.2,.8,.2,1);
  --header-h: 64px;
  --gap: 12px;
  --gutter: 16px;
  --radius-control: 12px;
  --radius-card: 16px;
  --radius-feature: 24px;
  --radius-bento: 28px;
}
@media (min-width: 768px) { :root { --header-h: 72px; --gap: 16px; --gutter: 24px; } }
@media (min-width: 1024px) { :root { --gutter: 40px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--xh-bg);
  color: var(--xh-ink);
  font: 400 16px/1.65 var(--font-sans);
  overflow-x: hidden;
  transition: background-color .24s var(--ease), color .24s var(--ease);
}
@media (min-width: 768px) { body { font-size: 17px; line-height: 1.72; } }
/* Soft light + grain behind the dark theme only. */
:root:not([data-theme="light"]) body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 45% at 78% -5%, rgba(157,205,255,.07), transparent 70%),
    radial-gradient(50% 40% at 0% 30%, rgba(255,255,255,.035), transparent 70%);
}
:root:not([data-theme="light"]) body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--xh-primary); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--xh-primary-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--xh-focus); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--xh-btn-bg); color: var(--xh-btn-fg); padding: 10px 16px; border-radius: var(--radius-control); }
.skip:focus { left: 8px; }
/* Announced by screen readers only (catalog result count). Clipped rather than moved off-screen so it can
   never create a horizontal scrollbar. */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Header: floating glass pill ---------- */
.site-header { position: sticky; top: 0; z-index: 50; height: var(--header-h); padding: 10px var(--gutter) 0; pointer-events: none; }
.pill {
  pointer-events: auto; max-width: 1200px; height: calc(var(--header-h) - 14px); margin: 0 auto; padding: 0 8px 0 14px;
  display: flex; align-items: center; gap: 12px; border-radius: 18px;
  background: color-mix(in srgb, var(--xh-surface) 72%, transparent);
  border: 1px solid var(--xh-glass-border); box-shadow: inset 0 1px 0 var(--xh-glass-highlight), var(--xh-shadow-card);
  -webkit-backdrop-filter: blur(24px) saturate(1.2); backdrop-filter: blur(24px) saturate(1.2);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--xh-ink); text-decoration: none; min-height: 44px; }
.brand:hover { color: var(--xh-ink); text-decoration: none; }
.brand img { width: 32px; height: 32px; }
.brand .m-white { display: var(--mark-white); }
.brand .m-ink { display: var(--mark-ink); }
.brand b { font-weight: 800; letter-spacing: -0.02em; font-size: 17px; }
.brand > span:not(.visually-hidden) { color: var(--xh-muted); font: 500 12px/1 var(--font-mono); letter-spacing: .08em; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a { white-space: nowrap; color: var(--xh-muted); text-decoration: none; font-size: 15px; font-weight: 500; padding: 10px 12px; border-radius: var(--radius-control); min-height: 44px; display: inline-flex; align-items: center; transition: color .16s var(--ease), background-color .16s var(--ease); }
.nav a:hover { color: var(--xh-ink); background: var(--xh-secondary-hover); }
.nav a[aria-current="page"] { color: var(--xh-ink); background: var(--xh-secondary-hover); }
@media (max-width: 559px) { .nav a.opt { display: none; } .brand > span:not(.visually-hidden) { display: none; } }

.theme {
  display: inline-flex; flex: none; border: 1px solid var(--xh-control-border); border-radius: var(--radius-control); padding: 2px; margin-left: 4px;
}
.theme button {
  appearance: none; border: 0; background: transparent; color: var(--xh-muted); font: 600 12px/1 var(--font-sans);
  /* 44x44 is the token's `xh-touch-target` minimum; these were 40px. The `max-width: 420px` override below
     trims them to 40px only on the narrowest phones, where the header has to fit. */
  width: 44px; height: 44px; padding: 0; border-radius: 9px; cursor: pointer; display: inline-grid; place-items: center;
  transition: background-color .16s var(--ease), color .16s var(--ease);
}
.theme button svg { width: 18px; height: 18px; }
.theme button:hover { color: var(--xh-ink); }
.theme button[aria-pressed="true"] { background: var(--xh-btn-bg); color: var(--xh-btn-fg); }
@media (max-width: 420px) { .theme button { width: 38px; } .brand b { display: none; } .pill { gap: 6px; padding-left: 10px; } .nav a { padding: 10px 8px; } }

/* ---------- Type ---------- */
.eyebrow { font: 700 12px/1.4 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--xh-deep-blue); margin: 0 0 14px; }
h1, h2, h3 { font-weight: 800; letter-spacing: -0.035em; line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(36px, 6vw, 64px); max-width: 18ch; }
.lead { font-size: clamp(18px, 2vw, 20px); color: var(--xh-muted); max-width: 60ch; margin: 20px 0 0; line-height: 1.6; }
.goldline { width: 56px; height: 2px; background: var(--xh-warm); border: 0; margin: 24px 0 0; }

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px;
  border-radius: var(--radius-control); font: 600 15px/1.2 var(--font-sans); text-decoration: none; text-align: center;
  transition: background-color .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease), transform .16s var(--ease);
}
.btn-primary { background: var(--xh-btn-bg); color: var(--xh-btn-fg); }
.btn-primary:hover { background: var(--xh-btn-hover); color: var(--xh-btn-fg); text-decoration: none; }
.btn-secondary { border: 1px solid var(--xh-control-border); color: var(--xh-ink); }
.btn-secondary:hover { background: var(--xh-secondary-hover); color: var(--xh-ink); text-decoration: underline; text-decoration-thickness: 1px; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(40px, 9vw, 112px); padding-bottom: clamp(32px, 6vw, 72px); }
.hero-product { display: grid; gap: 24px; align-items: center; }
@media (min-width: 900px) { .hero-product { grid-template-columns: minmax(0, 1fr) 280px; gap: 64px; } }
.hero-tile { width: 88px; border-radius: 22%; box-shadow: var(--xh-shadow-glass); order: -1; }
@media (min-width: 900px) { .hero-tile { width: 100%; max-width: 280px; justify-self: end; order: 0; } }
.facts { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 28px 0 0; padding: 0; list-style: none; color: var(--xh-muted); font: 500 13px/1.5 var(--font-mono); letter-spacing: .02em; }
.facts li { display: inline-flex; align-items: center; gap: 8px; }
.facts li::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--xh-divider-strong); }

/* ---------- Sections ---------- */
.section { padding-top: clamp(40px, 7vw, 88px); padding-bottom: clamp(40px, 7vw, 88px); }
.section.tight { padding-top: clamp(16px, 3vw, 32px); padding-bottom: clamp(24px, 4vw, 48px); }
.section-head { margin-bottom: 28px; }
.section-head h2 { font-size: clamp(28px, 3.6vw, 40px); }
.section-head p { color: var(--xh-muted); margin: 12px 0 0; max-width: 62ch; }
.section-head.center { text-align: center; }
.section-head.center h2, .section-head.center p { margin-left: auto; margin-right: auto; }
.pill-eyebrow { display: inline-block; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--xh-glass-border); background: var(--xh-glass-fill); }
.status { flex: none; align-self: flex-start; font: 600 11px/1 var(--font-mono); letter-spacing: .06em; padding: 7px 9px; border-radius: 999px; border: 1px solid var(--xh-control-border); color: var(--xh-ink); white-space: nowrap; }
.status.s-live { color: var(--xh-positive); border-color: currentColor; }

/* ---------- Catalog (filter chips + preview cards) ---------- */
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 0 28px; }
.fchip {
  appearance: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  /* `xh-control-border` (not `xh-divider`): this is a control, and its boundary is the only thing showing the
     hit area, so it has to clear 3:1 in both themes. The divider sits at ~1.3:1 and is for decoration only.
     `min-height: 44px` is the token's touch-target minimum (it was 40px). */
  border-radius: 999px; border: 1px solid var(--xh-control-border); background: transparent; color: var(--xh-muted);
  font: 600 14px/1 var(--font-sans); transition: background-color .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.fchip span { font: 500 11px/1 var(--font-mono); opacity: .8; }
.fchip:hover { color: var(--xh-ink); border-color: var(--xh-control-border); }
.fchip[aria-pressed="true"] { background: var(--xh-btn-bg); color: var(--xh-btn-fg); border-color: var(--xh-btn-bg); }
.catalog { display: grid; gap: 20px var(--gap); grid-template-columns: 1fr; }
@media (min-width: 700px) { .catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .catalog { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pcard { display: flex; flex-direction: column; gap: 12px; color: inherit; text-decoration: none; min-width: 0; }
.pcard:hover { color: inherit; text-decoration: none; }
.pcard[hidden] { display: none; }
.pcard-preview {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--radius-feature);
  background: var(--xh-surface); border: 1px solid var(--xh-divider);
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s var(--ease);
}
.pcard-preview > img { width: 100%; height: 100%; object-fit: cover; }
.pcard:hover .pcard-preview, .pcard:focus-visible .pcard-preview { transform: translateY(-4px); box-shadow: var(--xh-shadow-hover); border-color: var(--xh-control-border); }
.mini { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 22px;
  background: radial-gradient(80% 70% at 85% 0%, color-mix(in srgb, var(--xh-primary) 9%, transparent), transparent 70%); }
.mini .tile { width: 56px; height: 56px; border-radius: 22%; transition: transform .28s var(--ease); }
.pcard:hover .mini .tile { transform: scale(1.05); }
.mini .flow li { font-size: 12px; }
.pcard-meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 0 4px; }
.pcard-meta h3 { font-size: 19px; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.pcard-meta p { margin: 2px 0 0; color: var(--xh-muted); font-size: 14px; }
.pcard-tag { margin: 0; padding: 0 4px; color: var(--xh-muted); font-size: 15px; line-height: 1.55; }
/* "Mới" / "New": only on a card whose product was released inside the build's freshness window.
   It reuses the ice-blue signal colour rather than introducing a second accent, and the gold stays reserved
   for the one decor point per screen. Sits on the preview, so it cannot shift the card's text layout. */
.ribbon {
  position: absolute; top: 12px; left: 12px; z-index: 2; display: inline-flex; align-items: center;
  padding: 6px 10px; border-radius: 999px; font: 700 11px/1 var(--font-mono); letter-spacing: .08em;
  text-transform: uppercase; color: var(--xh-bg); background: var(--xh-primary);
  box-shadow: var(--xh-shadow-card);
}
.pcard:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }

.pcard.next .pcard-preview { background: transparent; border-style: dashed; border-color: var(--xh-control-border); }
.pcard.next .mini { background: none; justify-content: center; align-items: center; text-align: center; gap: 14px; }
.pcard.next .plus { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; border: 1.75px solid var(--xh-divider-strong); font: 400 28px/1 var(--font-sans); color: var(--xh-muted); transition: transform .28s var(--ease), border-color .28s var(--ease); }
.pcard.next:hover .plus { transform: rotate(90deg); border-color: var(--xh-ink); color: var(--xh-ink); }
.pcard.next .mini p { margin: 0; max-width: 30ch; color: var(--xh-muted); font-size: 14px; }

/* ---------- Numbered steps (noti-style pipeline) ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--gap); grid-template-columns: 1fr; counter-reset: s; }
@media (min-width: 700px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } .steps.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.steps li { position: relative; padding: 24px; border-radius: var(--radius-card); background: var(--xh-surface); border: 1px solid var(--xh-divider); }
.steps .num { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; margin-bottom: 18px; font: 700 12px/1 var(--font-mono); color: var(--xh-ink); border: 1.75px solid var(--xh-divider-strong); }
.steps li:last-child .num { background: var(--xh-ink); color: var(--xh-bg); border-color: var(--xh-ink); }
.steps li:nth-child(2) .num { border-color: var(--xh-warm); }
.steps b { display: block; font-size: 18px; letter-spacing: -0.015em; line-height: 1.35; }
.steps p { margin: 8px 0 0; color: var(--xh-muted); font-size: 15px; line-height: 1.55; }
@media (min-width: 1100px) {
  .steps li:not(:last-child)::after { content: ""; position: absolute; top: 40px; right: calc(var(--gap) * -1); width: var(--gap); height: 1.75px; background: var(--xh-divider-strong); }
}
.section .chips { justify-content: center; margin-top: 20px; }

/* ---------- Product highlights ---------- */
.shot { margin: 0; border-radius: var(--radius-bento); overflow: hidden; border: 1px solid var(--xh-glass-border); box-shadow: var(--xh-shadow-glass); }
.shot img { width: 100%; height: auto; }

.highlights { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
@media (min-width: 700px) { .highlights { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .highlights { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.hl { padding: 24px; border-radius: var(--radius-bento); background: var(--xh-glass-fill); border: 1px solid var(--xh-glass-border); box-shadow: inset 0 1px 0 var(--xh-glass-highlight); }
.hl b { display: block; font-size: 18px; letter-spacing: -0.015em; line-height: 1.35; }
.hl p { margin: 8px 0 0; color: var(--xh-muted); font-size: 15px; line-height: 1.55; }

/* ---------- Closing CTA band ---------- */
.cta-band {
  text-align: center; padding: clamp(36px, 6vw, 72px) clamp(20px, 5vw, 64px); border-radius: var(--radius-bento);
  background: var(--xh-glass-fill); border: 1px solid var(--xh-glass-border);
  box-shadow: inset 0 1px 0 var(--xh-glass-highlight), var(--xh-shadow-glass);
}
.cta-band h2 { font-size: clamp(26px, 3.4vw, 40px); max-width: 22ch; margin: 0 auto; }
.cta-band p { color: var(--xh-muted); max-width: 56ch; margin: 14px auto 28px; }

/* ---------- Reading layout + SmartTOC ---------- */
.doc { display: grid; gap: 0; padding-bottom: 96px; }
@media (min-width: 1024px) { .doc { grid-template-columns: minmax(0, 1fr) 260px; gap: 64px; } .doc.no-toc { grid-template-columns: minmax(0, 1fr); } }
.prose { max-width: 70ch; min-width: 0; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: clamp(26px, 3.2vw, 36px); margin-top: 2.4em; padding-top: 4px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: clamp(20px, 2.2vw, 24px); margin-top: 1.8em; letter-spacing: -0.02em; }
.prose p, .prose li { color: var(--xh-ink); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .45em; }
.prose li::marker { color: var(--xh-divider-strong); }
.prose strong { font-weight: 700; }
.prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 2px solid var(--xh-warm); color: var(--xh-ink); font-size: 1.12em; line-height: 1.6; }
.prose blockquote p { margin: 0; }
.prose hr { border: 0; height: 1px; background: var(--xh-divider); margin: 2.4em 0; }
.prose code { font: 500 .88em/1.4 var(--font-mono); background: var(--xh-surface-raised); border: 1px solid var(--xh-divider); padding: 1px 6px; border-radius: 6px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--xh-divider); vertical-align: top; }
.prose th { font-weight: 600; color: var(--xh-muted); font-size: 13px; }
.prose .note { padding: 18px 20px; border-radius: var(--radius-card); background: var(--xh-surface); border: 1px solid var(--xh-divider); color: var(--xh-muted); font-size: 15px; }
.prose [lang="en"] { font-feature-settings: normal; }

.toc { display: none; }
.toc-ready .toc { display: block; }
.toc-title { font: 700 12px/1.4 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--xh-muted); margin: 0 0 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--xh-divider); }
.toc li a {
  display: block; padding: 7px 0 7px 16px; margin-left: -1px; border-left: 2px solid transparent;
  color: var(--xh-muted); text-decoration: none; font-size: 14px; line-height: 1.45;
  transition: color .16s var(--ease), border-color .16s var(--ease);
}
.toc li.sub a { padding-left: 30px; font-size: 13px; }
.toc li a:hover { color: var(--xh-ink); }
.toc li a[aria-current="true"] { color: var(--xh-ink); border-left-color: var(--xh-ink); font-weight: 600; }
.toc-progress { height: 2px; background: var(--xh-divider); border-radius: 2px; margin: 0 0 16px; overflow: hidden; }
.toc-progress i { display: block; height: 100%; width: 100%; background: var(--xh-primary); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }

/* Desktop: sticky aside */
@media (min-width: 1024px) {
  .toc { position: sticky; top: calc(var(--header-h) + 32px); align-self: start; max-height: calc(100vh - var(--header-h) - 64px); overflow: auto; order: 2; }
  .toc-toggle { display: none; }
}
/* Mobile/tablet: sticky collapsible bar under header */
@media (max-width: 1023px) {
  .toc {
    position: sticky; top: var(--header-h); z-index: 40; margin: 0 calc(var(--gutter) * -1) 24px; padding: 0 var(--gutter);
    background: color-mix(in srgb, var(--xh-bg) 88%, transparent);
    -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--xh-divider);
  }
  .toc-toggle {
    appearance: none; width: 100%; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0;
    border: 0; background: transparent; color: var(--xh-ink); font: 600 14px/1.3 var(--font-sans); text-align: left; cursor: pointer;
  }
  .toc-toggle .lbl { font: 700 11px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--xh-muted); flex: none; }
  .toc-toggle .cur { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .toc-toggle svg { width: 18px; height: 18px; flex: none; transition: transform .2s var(--ease); }
  .toc[data-open="true"] .toc-toggle svg { transform: rotate(180deg); }
  .toc-title { display: none; }
  .toc-progress { position: absolute; left: 0; right: 0; bottom: -1px; margin: 0; height: 2px; border-radius: 0; background: transparent; }
  html { scroll-padding-top: calc(var(--header-h) + 64px); }
  .toc-panel {
    position: absolute; left: 0; right: 0; top: 100%; padding: 0 var(--gutter);
    background: var(--xh-surface); border-bottom: 1px solid var(--xh-divider); box-shadow: var(--xh-shadow-card);
    display: grid; grid-template-rows: 0fr; visibility: hidden;
    transition: grid-template-rows .24s var(--ease), visibility 0s linear .24s;
  }
  .toc[data-open="true"] .toc-panel { visibility: visible; transition: grid-template-rows .24s var(--ease); }
  .toc-panel ol { padding-top: 8px; }
  .toc[data-open="true"] .toc-panel { grid-template-rows: 1fr; }
  .toc-panel > div { overflow: hidden; }
  .toc-panel ol { margin: 0 0 14px; max-height: 55vh; overflow: auto; }
}

/* ---------- Author / footer ---------- */
.author { display: grid; gap: 20px; align-items: start; }
@media (min-width: 768px) { .author { grid-template-columns: 96px minmax(0, 1fr); gap: 28px; } }
.author .mono { width: 96px; height: 96px; border-radius: 24px; display: grid; place-items: center; background: var(--xh-surface-raised); border: 1px solid var(--xh-divider); }
.author .mono img { width: 56px; height: 56px; }
.author .mono .m-white { display: var(--mark-white); }
.author .mono .m-ink { display: var(--mark-ink); }
.site-footer { border-top: 1px solid var(--xh-divider); padding: 48px 0 56px; color: var(--xh-muted); font-size: 14px; }
.site-footer .wrap { display: grid; gap: 28px; grid-template-columns: 1fr; }
/* Brand column + one column per product type + the legal column. */
@media (min-width: 768px) { .site-footer .wrap { grid-template-columns: 2fr repeat(4, 1fr); } }
@media (max-width: 1023px) { .site-footer .wrap { grid-template-columns: 1fr 1fr; } }
.site-footer p { margin: 0 0 6px; }
.site-footer b { color: var(--xh-ink); }
.site-footer nav { display: flex; flex-direction: column; gap: 8px; }
.site-footer nav .eyebrow { margin: 0 0 4px; }
.site-footer a { color: var(--xh-muted); }
.site-footer a:hover { color: var(--xh-ink); }

/* ---------- Home hero: copy + system window ---------- */
@media (min-width: 1024px) { .hero-home { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 56px; align-items: center; } }
.nav a.lang { font: 700 12px/1 var(--font-mono); letter-spacing: .08em; border: 1px solid var(--xh-divider); margin-left: 4px; }

.sysw {
  position: relative; margin-top: 48px; padding: 18px 18px 22px; border-radius: var(--radius-bento);
  background: var(--xh-glass-fill); border: 1px solid var(--xh-glass-border);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  box-shadow: inset 0 1px 0 var(--xh-glass-highlight), var(--xh-shadow-glass);
}
@media (min-width: 1024px) { .sysw { margin-top: 0; } }
.sysw-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; color: var(--xh-muted); font: 500 11px/1 var(--font-mono); letter-spacing: .04em; }
.sysw-bar i { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--xh-divider-strong); }
.sysw-bar span { margin-left: 8px; }
.sysw-row { padding: 16px; border-radius: var(--radius-card); background: var(--xh-surface); border: 1px solid var(--xh-divider); }
.sysw-row + .sysw-row { margin-top: 12px; }
.sysw-name { display: flex; justify-content: space-between; align-items: center; margin: 0 0 14px; font-weight: 700; font-size: 15px; }
.sysw-name em { font: 600 11px/1 var(--font-mono); font-style: normal; letter-spacing: .06em; text-transform: uppercase; color: var(--xh-positive); padding: 6px 8px; border-radius: 999px; border: 1px solid currentColor; }
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.flow li { position: relative; padding-top: 22px; font-size: 12.5px; line-height: 1.35; color: var(--xh-muted); }
.flow li::before { content: ""; position: absolute; top: 0; left: 0; width: 12px; height: 12px; border-radius: 4px; border: 1.75px solid var(--xh-divider-strong); background: var(--xh-surface); z-index: 1; }
.flow li::after { content: ""; position: absolute; top: 6px; left: 12px; right: 0; height: 1.75px; background: var(--xh-divider-strong); transform-origin: 0 50%; }
.flow li:last-child::after { display: none; }
.flow li:last-child { color: var(--xh-ink); font-weight: 600; }
.flow li:last-child::before { background: var(--xh-ink); border-color: var(--xh-ink); }
.float {
  position: absolute; z-index: 2; padding: 7px 11px; border-radius: 999px; white-space: nowrap;
  font: 600 11px/1 var(--font-mono); letter-spacing: .02em; color: var(--xh-ink);
  background: var(--xh-surface-raised); border: 1px solid var(--xh-glass-border); box-shadow: var(--xh-shadow-card);
}
.float.f0 { top: -14px; left: 28px; } .float.f1 { top: calc(50% + 4px); right: -12px; }
.float.f2 { bottom: -14px; right: 18%; } .float.f3 { top: calc(50% + 4px); left: -14px; }
@media (max-width: 600px) { .float.f1, .float.f3 { display: none; } }

/* ---------- Proof strip ---------- */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); padding-bottom: 8px; }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { padding: 22px 20px; border-radius: var(--radius-card); border: 1px solid var(--xh-divider); background: var(--xh-surface); }
.stat b { display: block; font-size: clamp(30px, 4vw, 44px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 8px; color: var(--xh-muted); font-size: 14px; line-height: 1.45; }

/* ---------- Cards: badge + chips ---------- */
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; padding: 0; }
.chips li { font: 500 12px/1 var(--font-mono); padding: 7px 9px; border-radius: 8px; color: var(--xh-muted); background: var(--xh-surface-raised); border: 1px solid var(--xh-divider); }

/* ---------- Pure-CSS entrance (no JS needed, never hides the LCP text) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .words span { display: inline-block; animation: word-in .7s var(--ease) both; animation-delay: calc(var(--w) * 70ms + 80ms); }
  @keyframes word-in { from { color: var(--xh-divider-strong); transform: translateY(6px); } to { color: var(--xh-ink); transform: none; } }
  .goldline { animation: line-in .6s var(--ease) .5s both; transform-origin: 0 50%; }
  @keyframes line-in { from { transform: scaleX(0); } to { transform: none; } }
  .sysw { animation: rise .6s var(--ease) .25s both; }
  .sysw-row { animation: rise .5s var(--ease) both; animation-delay: calc(.45s + var(--r) * .15s); }
  .flow li::before { animation: node-in .35s var(--ease) both; animation-delay: calc(.7s + var(--s) * .28s); }
  .flow li::after { animation: draw .45s var(--ease) both; animation-delay: calc(.85s + var(--s) * .28s); }
  .float { animation: rise .5s var(--ease) both, bob 7s ease-in-out 1.6s infinite; }
  .float.f0 { animation-delay: 1.1s, 1.6s; } .float.f1 { animation-delay: 1.25s, 2.4s; }
  .float.f2 { animation-delay: 1.4s, 3.1s; } .float.f3 { animation-delay: 1.55s, 3.8s; }
  .motion .pcard.pop { opacity: 1; transform: none; animation: rise .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
  @keyframes node-in { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes draw { from { transform: scaleX(0); } to { transform: none; } }
  @keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }
  :root:not([data-theme="light"]) body::before { animation: drift 24s ease-in-out infinite alternate; }
  @keyframes drift { to { transform: translate3d(-4%, 3%, 0); } }
}

/* ---------- Motion (only with JS + no reduced-motion preference) ---------- */
.motion [data-reveal] {
  opacity: 0; transform: translateY(10px);
  transition: opacity .32s var(--ease), transform .32s var(--ease);
  transition-delay: calc(var(--i, 0) * 60ms);
}
.motion [data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
  .motion [data-reveal] { opacity: 1; transform: none; }
}
@media print { .site-header, .toc, .theme { display: none !important; } }

/* ---------- Hero proof: running products + trust line ---------- */
.trust { margin: 22px 0 0; font-size: 14px; line-height: 1.6; color: var(--xh-muted); max-width: 62ch; }
.trust a { color: var(--xh-muted); }
.trust a:hover { color: var(--xh-ink); }
.running {
  margin-top: 40px; padding: 18px; border-radius: var(--radius-bento);
  background: var(--xh-glass-fill); border: 1px solid var(--xh-glass-border);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  box-shadow: inset 0 1px 0 var(--xh-glass-highlight), var(--xh-shadow-glass);
}
@media (min-width: 1024px) { .running { margin-top: 0; } }
.running ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.running li a {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px;
  border-radius: var(--radius-card); background: var(--xh-surface); border: 1px solid var(--xh-divider);
  color: var(--xh-ink); text-decoration: none; transition: transform .2s var(--ease), border-color .2s var(--ease);
}
.running li a:hover { transform: translateX(4px); border-color: var(--xh-control-border); }
.running img { width: 44px; height: 44px; border-radius: 22%; }
.run-txt { display: grid; gap: 2px; min-width: 0; }
.run-txt b { font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.run-txt small { color: var(--xh-muted); font-size: 13px; line-height: 1.4; }
.run-note { margin: 12px 4px 0; font-size: 13px; color: var(--xh-muted); display: flex; align-items: center; gap: 6px; }
.run-note svg { width: 14px; height: 14px; }
@media (prefers-reduced-motion: no-preference) {
  .running { animation: rise .6s var(--ease) .25s both; }
  .running li { animation: rise .5s var(--ease) both; animation-delay: calc(.45s + var(--r) * .12s); }
}
@media (max-width: 560px) { .running li a { grid-template-columns: 40px minmax(0, 1fr); } .running li .status { grid-column: 2; justify-self: start; } }
