/* Wrolp Terminal site — shared styles.
   Light-first indigo/violet theme, no build step, no external fonts. */

:root {
  color-scheme: light;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-mono: "Cascadia Code", "JetBrains Mono", "SF Mono", ui-monospace,
    Consolas, "Liberation Mono", Menlo, monospace;
  --mono: var(--font-mono);

  --bg: #fbfaff;
  --bg-alt: #f4f2fc;
  --surface: #ffffff;
  --panel: #ffffff;
  --panel-alt: #f7f5fd;
  --surface-2: #f7f5fd;
  --surface-3: #eef0fb;

  --text: #191a25;
  --heading: #14151f;
  --muted: #55597a;
  --text-dim: #656a86;
  --border: #e0ddf1;
  --border-soft: #ebe8f7;

  --brand-blue: #375ccb;
  --brand-mid: #6963e4;
  --brand-violet: #9165f3;
  --brand-gradient: linear-gradient(118deg, #375ccb 0%, #6963e4 52%, #9165f3 100%);

  --accent: #5747cf;
  --accent-hover: #4636b8;
  --accent-soft: rgba(87, 71, 207, 0.09);
  --accent-line: rgba(87, 71, 207, 0.26);
  --on-accent: #ffffff;

  --added: #1c7f45;
  --added-bg: rgba(28, 127, 69, 0.09);
  --warn: #9a6510;
  --warn-soft: rgba(154, 101, 16, 0.1);
  --warn-border: #d9a441;

  --code-bg: #f6f4fd;
  --nav-bg: rgba(251, 250, 255, 0.84);
  --glow: rgba(105, 99, 228, 0.16);

  --shadow-sm: 0 1px 2px rgba(28, 24, 66, 0.07);
  --shadow: 0 12px 28px -14px rgba(28, 24, 66, 0.22);
  --shadow-lg: 0 40px 70px -34px rgba(28, 24, 66, 0.35);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --main-width: 1120px;
  --max: 1120px;
  --gutter: 24px;
  --nav-offset: 84px;

  --step--1: 0.8125rem;
  --step-0: 0.9375rem;
  --step-1: 1.0625rem;
  --step-2: 1.375rem;
  --step-3: clamp(1.6rem, 1.2rem + 1.6vw, 2.1rem);
  --step-4: clamp(2.4rem, 1.6rem + 3.4vw, 3.6rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0d0e13;
    --bg-alt: #111219;
    --surface: #161821;
    --panel: #161821;
    --panel-alt: #1b1e29;
    --surface-2: #1b1e29;
    --surface-3: #222634;
    --text: #e7e8ef;
    --heading: #f4f5fa;
    --muted: #9ba0b5;
    --text-dim: #828aa8;
    --border: #272b3a;
    --border-soft: #1e2230;
    --accent: #8b7cf3;
    --accent-hover: #a495f7;
    --accent-soft: rgba(139, 124, 243, 0.13);
    --accent-line: rgba(139, 124, 243, 0.34);
    --on-accent: #0d0e13;
    --added: #4ac07a;
    --added-bg: rgba(74, 192, 122, 0.11);
    --code-bg: #12131b;
    --nav-bg: rgba(13, 14, 19, 0.84);
    --glow: rgba(105, 99, 228, 0.22);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 40px 80px -32px rgba(0, 0, 0, 0.85);
  }
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }
main, section { min-width: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

::selection { background: var(--accent-soft); color: var(--text); }

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

.wrap {
  width: 100%;
  max-width: var(--main-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink, #fff);
  font-weight: 600;
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; color: #fff; }

/* ---------- header ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-soft);
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
}

.nav-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  min-height: 60px;
  padding-block: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.brand span { color: var(--muted); font-weight: 450; }
.brand-mark { width: 30px; height: 30px; flex: none; border-radius: 7px; }
.brand:hover { color: var(--text); }

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  min-width: 0;
}
.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: var(--step-0);
  font-weight: 500;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a.current {
  color: var(--text);
  background: var(--accent-soft);
  font-weight: 600;
}
.nav-links a.lang {
  margin-left: 6px;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: var(--step--1);
  font-weight: 600;
}
.nav-links a.lang:hover { color: var(--text); border-color: var(--accent-line); background: var(--surface); }
.nav-links a.external::after { content: "↗"; margin-left: 4px; font-size: 11px; }

/* ---------- hero (home) ---------- */

.hero { position: relative; padding: 72px 0 40px; overflow: hidden; }
.hero::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto;
  height: 620px;
  background:
    radial-gradient(52% 62% at 50% 0%, var(--glow) 0%, transparent 72%),
    radial-gradient(34% 46% at 82% 12%, rgba(145, 101, 243, 0.13) 0%, transparent 74%);
  pointer-events: none;
}
.hero > .wrap { position: relative; }
.hero-inner { padding: 0; }

.hero-copy { max-width: 780px; margin: 0 auto; text-align: center; }

.release-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  padding: 5px 13px 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--text-muted, var(--muted));
  font-family: var(--font-mono);
  font-size: var(--step--1);
  line-height: 1.6;
  letter-spacing: 0.01em;
}
.release-badge strong { color: var(--text); font-weight: 650; }
.release-badge:hover { color: var(--text); border-color: var(--accent-line); }

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
}

.eyebrow {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.28;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--heading);
}

h1 { font-size: clamp(2.1rem, 4vw, 3rem); letter-spacing: -0.03em; }

.home .hero h1 {
  font-size: var(--step-4);
  font-weight: 750;
  letter-spacing: -0.035em;
  background: linear-gradient(118deg, #2f4cb4 0%, #5a4fd0 52%, #7c4ce0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.home .hero h1 em { font-style: normal; color: inherit; }

@media (prefers-color-scheme: dark) {
  .home .hero h1 {
    background: linear-gradient(118deg, #7d95ff 0%, #a08cff 52%, #c6a2ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
  }
}

.tagline {
  max-width: 620px;
  margin: 18px auto 0;
  font-size: var(--step-1);
  line-height: 1.75;
  color: var(--muted);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: linear-gradient(118deg, #375ccb 0%, #5b52d6 52%, #7a4ce0 100%);
  color: #fff;
  font-size: var(--step-0);
  font-weight: 600;
  line-height: 1.4;
  box-shadow: 0 6px 20px -8px var(--glow);
  transition: transform 160ms ease, filter 160ms ease, border-color 160ms ease, background-color 160ms ease;
}
.btn:hover { color: #fff; filter: brightness(1.09); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn.ghost {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
}
.btn.ghost:hover { border-color: var(--accent-line); background: var(--surface-2); color: var(--text); }

.meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  margin: 18px 0 0;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--text-dim);
}
.meta span { display: inline-flex; align-items: center; gap: 8px; }
.meta span + span::before {
  content: "";
  width: 3px;
  height: 3px;
  flex: none;
  border-radius: 50%;
  background: var(--text-dim);
}

/* hero screenshot */

.hero-figure { max-width: 1000px; margin: 52px auto 0; }
.shot {
  display: block;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transition: border-color 200ms ease;
}
.shot:hover { border-color: var(--accent-line); }
.shot img { display: block; width: 100%; height: auto; }
.figure-caption {
  margin-top: 14px;
  font-size: var(--step--1);
  line-height: 1.6;
  color: var(--text-dim);
  text-align: center;
}

.stack-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 28px;
  margin-top: 40px;
  padding-block: 22px;
  border-top: 1px solid var(--border-soft);
  font-size: var(--step--1);
  color: var(--text-dim);
}
.stack-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.stack-strip strong { color: var(--muted); font-weight: 600; }

/* ---------- subhero (inner pages) ---------- */

.subhero {
  border-bottom: 1px solid var(--border-soft);
  background:
    radial-gradient(60% 90% at 18% 0%, var(--accent-soft) 0%, transparent 70%),
    var(--bg-alt);
}
.subhero .wrap { padding-block: 56px 44px; }
.subhero h1 { font-size: var(--step-3); letter-spacing: -0.025em; }
.subhero .lede {
  max-width: 46em;
  margin: 14px 0 0;
  font-size: var(--step-1);
  line-height: 1.7;
  color: var(--muted);
}

/* ---------- page body & typography ---------- */

.page-body { padding-block: 56px 88px; }

section, h2, h3, h4, #main { scroll-margin-top: var(--nav-offset); }

h2 {
  margin: 52px 0 18px;
  font-size: var(--step-3);
  letter-spacing: -0.025em;
}
h3 { margin: 30px 0 12px; font-size: var(--step-1); }
h4 { margin: 22px 0 10px; font-size: var(--step-0); }

p { margin: 0 0 18px; }
.page-body main > section > p,
.doc-main > p,
.doc-main > ul,
.doc-main > ol { max-width: 78ch; }

main ul { margin: 0 0 22px; padding: 0; list-style: none; }
main ul li {
  position: relative;
  margin: 0 0 10px;
  padding-left: 18px;
  color: var(--text);
}
main ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--brand-gradient);
}
main ol { margin: 0 0 22px; padding-left: 24px; }
main ol > li { margin-bottom: 10px; padding-left: 4px; }
main li > ul, main li > ol { margin-block: 10px 0; }
li strong, p strong { color: var(--heading); }

code {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--code-bg);
  font-family: var(--font-mono);
  font-size: 0.88em;
  overflow-wrap: anywhere;
}

pre {
  min-width: 0;
  max-width: 100%;
  margin: 0 0 24px;
  padding: 20px 24px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--code-bg);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.75;
  tab-size: 2;
}
pre code { padding: 0; background: none; border-radius: 0; font-size: inherit; white-space: pre; overflow-wrap: normal; }
.tree code { font-size: 12.5px; }

/* ---------- figures ---------- */

.doc-figure { margin: 8px 0 30px; }
.doc-figure img {
  display: block;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.doc-figure figcaption {
  margin-top: 12px;
  font-size: var(--step--1);
  line-height: 1.6;
  color: var(--text-dim);
}

/* ---------- facts & cards ---------- */

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
  gap: 14px;
  margin: 0;
}
.fact {
  min-width: 0;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.fact.wide { grid-column: 1 / -1; }
.fact dt {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.fact dd { margin: 0; font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 16px;
  margin: 0;
}
.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}
.card:hover { border-color: var(--accent-line); transform: translateY(-2px); box-shadow: var(--shadow); }
.card h3, .card h4 { margin: 0 0 10px; font-size: var(--step-1); }
.card p { margin: 0 0 18px; font-size: var(--step-0); line-height: 1.72; color: var(--muted); }
.card > :last-child { margin-bottom: 0; }
.card .more { margin-top: auto; padding-top: 4px; font-size: var(--step--1); font-weight: 600; }
.card .more:hover { text-decoration: none; }
.card .chapter-no {
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}
.feature-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 18px;
  border: 1px solid var(--accent-line);
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}
.feature-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- home sections ---------- */

.home .page-body { padding-block: 64px 88px; }
.home main > section + section { margin-top: 64px; }
.home .page-body section > h2 { margin: 0 0 22px; font-size: var(--step-3); }

.home #what-it-is { display: block; }
.home #what-it-is > h2 { max-width: 22em; margin-bottom: 20px; }
.home #what-it-is > p { max-width: 74ch; font-size: var(--step-0); line-height: 1.78; color: var(--muted); }
.home #what-it-is > p + p { margin-top: 16px; }

.home #at-a-glance .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.home #at-a-glance .fact { padding: 22px; }
.home #at-a-glance .fact:last-child { grid-column: span 2; }

.home #capabilities {
  padding: 40px;
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  background: var(--bg-alt);
}
.home #capabilities .eyebrow { margin-bottom: 10px; }
.home #capabilities .grid,
.home #manual-entry .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.home #capabilities .card,
.home #manual-entry .card { grid-column: span 2; }
.home #capabilities .card:nth-child(n + 4),
.home #manual-entry .card:nth-child(n + 4) { grid-column: span 3; }

.home #start {
  padding: 32px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-alt);
}
.home #start pre { margin-block: 20px; }
.home #start > :last-child { margin-bottom: 0; }
.home #start > p:first-of-type { max-width: 66ch; }

.home #manual-entry > p { max-width: 64em; margin-bottom: 26px; font-size: var(--step-0); color: var(--muted); }

.home #limitations {
  padding-top: 28px;
  border-top: 1px solid var(--border-soft);
  color: var(--muted);
  font-size: var(--step--1);
}
.home #limitations > h2 { margin: 0 0 14px; font-size: 1rem; }
.home #limitations ul { margin-bottom: 0; }
.home #limitations li { font-size: var(--step--1); }

/* ---------- callouts ---------- */

.note, .callout {
  margin: 0 0 24px;
  padding: 18px 22px;
  border: 1px solid var(--accent-line);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--accent-soft);
  font-size: var(--step-0);
  color: var(--text);
}
.note strong, .callout strong { color: var(--heading); }
.note p:last-child, .callout p:last-child { margin-bottom: 0; }
.callout ul { margin-bottom: 0; }
.callout li { font-size: var(--step-0); }

/* ---------- tables ---------- */

.table-wrap {
  min-width: 0;
  max-width: 100%;
  margin: 0 0 24px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  line-height: 1.7;
}
th, td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border-soft);
}
tr:last-child td { border-bottom: 0; }
th {
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 650;
  color: var(--heading);
  white-space: nowrap;
}
td code { white-space: nowrap; }

/* ---------- documentation layout ---------- */

.doc-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 48px;
  padding-block: 44px 88px;
}

.doc-nav {
  position: sticky;
  top: var(--nav-offset);
  align-self: start;
  min-width: 0;
  max-height: calc(100vh - var(--nav-offset) - 24px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  font-size: var(--step--1);
}
.doc-nav-title {
  margin: 0 0 14px;
  padding-inline: 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.doc-nav ol { list-style: none; counter-reset: chapter; margin: 0; padding: 0; }
.doc-nav li { min-width: 0; counter-increment: chapter; margin: 0 0 2px; padding: 0; }
.doc-nav a {
  display: flex;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  line-height: 1.5;
}
.doc-nav a::before {
  content: counter(chapter, decimal-leading-zero);
  flex: none;
  min-width: 1.6em;
  padding-top: 1px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  text-align: right;
}
.doc-nav a:hover { color: var(--text); background: var(--surface-2); }
.doc-nav a.current { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.doc-nav a.current::before { color: var(--accent); }

.doc-main { min-width: 0; }
.doc-main h2 { margin-top: 46px; font-size: 1.45rem; }
.doc-main > h2:first-of-type { margin-top: 8px; }

.breadcrumb { margin: 0 0 14px; font-size: var(--step--1); color: var(--text-dim); }
.breadcrumb a { color: var(--text-dim); }
.breadcrumb .sep { margin: 0 8px; }

.pager {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border-soft);
  font-size: var(--step-0);
}
.pager a { min-width: 0; max-width: 46%; }
.pager .dir {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.pager .next { margin-left: auto; text-align: right; }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border-soft);
  background: var(--bg-alt);
}
.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 40px;
  padding-block: 48px 36px;
  font-size: var(--step--1);
  color: var(--text-dim);
}
.footer-brand .brand { font-size: 15px; }
.footer-tagline { max-width: 34ch; margin: 12px 0 0; color: var(--muted); line-height: 1.65; }
.footer-copy { margin: 10px 0 0; font-family: var(--font-mono); font-size: 11.5px; color: var(--text-dim); }
.footer-cols { display: grid; grid-template-columns: repeat(3, minmax(120px, auto)); gap: 36px; }
.footer-heading {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.footer-col a { display: block; margin-bottom: 8px; color: var(--muted); }
.footer-col a:last-child { margin-bottom: 0; }
.footer-col a:hover { color: var(--accent); }

/* ---------- Chinese edition ---------- */

html[lang="zh-CN"] body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
    "Source Han Sans SC", ui-sans-serif, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.8;
  line-break: strict;
}
html[lang="zh-CN"] h1,
html[lang="zh-CN"] h2,
html[lang="zh-CN"] h3,
html[lang="zh-CN"] h4 { letter-spacing: 0; line-height: 1.4; }
html[lang="zh-CN"] .home .hero h1 { font-size: clamp(2.3rem, 4vw, 3.3rem); line-height: 1.24; letter-spacing: -0.02em; }
html[lang="zh-CN"] .eyebrow { letter-spacing: 0.1em; }
html[lang="zh-CN"] .tagline,
html[lang="zh-CN"] .card p,
html[lang="zh-CN"] .home #what-it-is > p { line-height: 1.9; }
html[lang="zh-CN"] code,
html[lang="zh-CN"] pre,
html[lang="zh-CN"] .tree { font-family: var(--font-mono); line-break: auto; }

/* ---------- responsive ---------- */

@media (max-width: 1000px) {
  .nav-links { gap: 0; }
  .doc-layout { gap: 32px; }
  .card { padding: 22px; }
}

@media (max-width: 820px) {
  :root { --gutter: 20px; --nav-offset: 130px; }
  .nav-inner { gap: 6px; padding-block: 9px; }
  .nav-links { flex-basis: 100%; gap: 0 4px; }
  .nav-links a { min-height: 32px; padding: 6px 9px; font-size: var(--step--1); }
  .nav-links a.lang { margin-left: 0; }

  .hero { padding-block: 48px 32px; }
  .hero-copy { max-width: 640px; }
  .tagline { max-width: 40em; }
  .hero-figure { margin-top: 38px; }
  .stack-strip { gap: 8px 20px; margin-top: 32px; }

  .home .hero h1 { font-size: clamp(2.1rem, 7vw, 2.9rem); }
  .subhero .wrap { padding-block: 40px 34px; }

  .home #what-it-is > h2 { max-width: none; }
  .home #at-a-glance .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home #capabilities { padding: 26px 20px; border-radius: 16px; }
  .home #capabilities .grid,
  .home #manual-entry .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .home #capabilities .card,
  .home #manual-entry .card { grid-column: auto; }
  .home #capabilities .card:last-child,
  .home #manual-entry .card:last-child { grid-column: 1 / -1; }
  .home #start { padding: 26px; }

  .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-block: 30px 64px; }
  .doc-nav {
    position: static;
    max-height: none;
    overflow: visible;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-soft);
  }
  .doc-nav ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 10px; }
  .doc-nav li { margin: 0; }
  h2 { margin-top: 42px; }
  .footer-inner { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-block: 36px; }
  .footer-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
}

@media (max-width: 480px) {
  .release-badge { font-size: 10px; }
  .cta-row { gap: 10px; }
  .btn { padding-inline: 16px; }
  .meta { gap: 6px 12px; }
  .home #at-a-glance .facts,
  .home #capabilities .grid,
  .home #manual-entry .grid,
  .facts { grid-template-columns: minmax(0, 1fr); }
  .home #capabilities .card,
  .home #manual-entry .card { grid-column: 1 / -1; }
  .home #at-a-glance .fact:last-child { grid-column: auto; }
  .home #start { padding: 22px 18px; }
  .home #start pre { padding: 16px; font-size: 12px; }
  .home .page-body section > h2 { font-size: 1.35rem; }
  .doc-nav ol { grid-template-columns: minmax(0, 1fr); }
  .note, .callout { padding: 16px 18px; }
  pre { padding: 16px; font-size: 12px; }
  th, td { padding: 10px 12px; }
  .pager { flex-direction: column; gap: 22px; }
  .pager a, .pager .next { max-width: 100%; margin-left: 0; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .card:hover, .btn:hover { transform: none; }
}

@media print {
  :root {
    color-scheme: light;
    --bg: #ffffff;
    --bg-alt: #ffffff;
    --surface: #ffffff;
    --panel: #ffffff;
    --panel-alt: #f7f5fd;
    --text: #191a25;
    --heading: #14151f;
    --muted: #4a4e6b;
    --text-dim: #55597a;
    --border: #d5d2e8;
    --border-soft: #e6e3f4;
    --accent: #4a3ab8;
    --accent-soft: #f2f0fb;
    --code-bg: #f6f4fd;
    --shadow: none;
    --shadow-lg: none;
    --gutter: 0px;
  }
  body { font-size: 11pt; }
  .site-nav, .doc-nav, .pager, .skip-link, .cta-row { display: none; }
  .hero::before, .subhero { background: none; }
  .hero, .hero-inner, .subhero .wrap { padding-block: 24px; }
  .home .hero-figure, .doc-layout { display: block; }
  .home .page-body, .page-body, .doc-layout { padding-block: 24px; }
  .home main > section + section { margin-top: 32px; }
  .hero-figure { margin-top: 24px; }
  .shot, .doc-figure img { box-shadow: none; }
  a { color: inherit; }
}
