:root {
  color-scheme: dark;
  --c-bg: #130f03;
  --c-panel: #211b0e;
  --c-ink-panel: #141005;
  --c-ink-raise: #1b160b;
  --c-border: #403727;
  --c-accent: #ff9b73;
  --c-accent-dark: #f0a07a;
  --c-text: #f4ede0;
  --c-muted: #b9af9b;
  --c-success: #79c59b;
  --c-warn: #efb85d;
  --c-error: #ff8a85;
  --c-on-dark: #f4ede0;
  --c-on-dark-muted: #a69d8b;
  --c-line-dark: rgba(244, 237, 224, 0.11);
  --c-line-dark-soft: rgba(244, 237, 224, 0.06);
  --c-dark-fill: rgba(244, 237, 224, 0.07);
  --c-scene-a: #191407;
  --c-scene-b: #302211;
  --c-scene-c: #49301b;
  --c-light-spot: rgba(240, 160, 122, 0.08);
  --c-screen: #211b0e;
  --c-sand: #342614;
  --c-sand-deep: #49301b;
  --c-terra-soft: #f0a07a;
  --c-ring: rgba(168, 50, 15, 0.24);
  --c-frame: #1f1a11;
  --c-frame-edge: #4a4031;
  --c-island: #080602;
  --c-ground: rgba(70, 38, 14, 0.30);
  --c-hairline-ink: rgba(244, 237, 224, 0.06);
  --c-glow-sand: rgba(224, 176, 143, 0.04);
  --c-glow-white: rgba(255, 255, 255, 0.02);
  --c-accent-halo: rgba(228, 71, 28, 0.16);
  --c-success-halo: rgba(47, 138, 91, 0.24);
  --c-veil: rgba(20, 16, 5, 0.45);
  --c-clear: transparent;

  --f-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Songti SC", "STSong", "Noto Serif CJK SC", Georgia, serif;
  --f-body: "Inter", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --weight-display: 400;
  --weight-medium: 500;
  --weight-strong: 600;
  --tracking-display: -0.02em;
  --tracking-tight: -0.01em;
  --tracking-brand: -0.005em;
  --tracking-code: 0.02em;
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lead: 19px;
  --text-h1: clamp(34px, 2.2vw + 16px, 48px);
  --text-h2: clamp(26px, 2vw + 12px, 36px);
  --text-h3: 22px;
  --leading-body: 1.6;
  --leading-prose: 1.8;
  --leading-title: 1.15;

  --r-board: 32px;
  --r-card: 28px;
  --r-float: 20px;
  --r-tile: 10px;
  --r-mark: 8px;
  --r-phone: 46px;
  --r-screen: 37px;
  --r-key: 2px;
  --r-round: 50%;
  --r-pill: 999px;

  --sh-sm: 0 1px 2px rgba(28, 23, 12, 0.05), 0 2px 6px rgba(28, 23, 12, 0.04);
  --sh-card: 0 18px 40px -30px rgba(70, 38, 14, 0.25);
  --sh-cta: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 10px 22px -10px rgba(168, 50, 15, 0.55);
  --sh-board: inset 0 0 0 1px rgba(28, 23, 12, 0.04), 0 30px 60px -44px rgba(92, 56, 28, 0.40);
  --sh-phone: 0 40px 70px -30px rgba(70, 38, 14, 0.55), 0 14px 24px -12px rgba(70, 38, 14, 0.35);
  --sh-rule: 0 2px 4px rgba(70, 38, 14, 0.06), 0 14px 28px -14px rgba(70, 38, 14, 0.38);
  --sh-float: 0 6px 14px rgba(20, 16, 5, 0.18), 0 34px 64px -22px rgba(20, 16, 5, 0.58);
  --sh-dark: 0 30px 60px -30px rgba(0, 0, 0, 0.60);

  --nav-h: 72px;
  --wrap: 1280px;
  --header-wrap: 1280px;
  --reading: 780px;
  --gutter: 40px;
  --section-space: 140px;
  --gap: 24px;
  --stroke: 1px;
  --focus-width: 2px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --time-fast: 0.2s;
  --time-reveal: 0.65s;
  --time-float: 8s;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
}
html.nav-open { overflow: hidden; }
body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--f-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
[hidden] { display: none !important; }
img, svg { vertical-align: middle; }
img { max-width: 100%; }
svg { flex-shrink: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: 0.2em; }
button, a { -webkit-tap-highlight-color: var(--c-accent-halo); }
:focus-visible {
  outline: var(--focus-width) solid var(--c-accent-dark);
  outline-offset: 3px;
}
::selection { background: var(--c-accent-halo); color: var(--c-text); }
h1, h2, h3 {
  font-family: var(--f-display);
  font-weight: var(--weight-display);
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-title);
  text-wrap: balance;
  overflow-wrap: break-word;
}
h1 { margin: 0 0 20px; font-size: var(--text-h1); }
h2 { margin: 0 0 24px; font-size: var(--text-h2); }
h3 { margin: 0 0 16px; font-size: var(--text-h3); }
p { margin: 0 0 20px; }
strong { font-weight: var(--weight-strong); }
em.accent { font-style: normal; color: var(--c-accent-dark); }
.keep { white-space: nowrap; }
.muted { color: var(--c-muted); }
.mono, code, pre { font-family: var(--f-mono); }
.mono { font-size: 13px; letter-spacing: var(--tracking-code); }
code { overflow-wrap: anywhere; font-size: 0.875em; }
pre {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  padding: 20px;
  border: var(--stroke) solid var(--c-border);
  border-radius: var(--r-tile);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.7;
  -webkit-overflow-scrolling: touch;
}
pre code { overflow-wrap: normal; word-break: normal; white-space: pre; }
hr { border: 0; border-top: var(--stroke) solid var(--c-border); margin: 32px 0; }
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
  border-inline: var(--stroke) solid var(--c-border);
}
.wrap > *, .grid > *, .split > *, .footer__grid > * { min-width: 0; }
.reading { max-width: var(--reading); margin-inline: auto; }
.section { padding-top: var(--section-space); padding-bottom: var(--section-space); }
.section__intro { max-width: 44em; margin-bottom: 48px; }
.section__intro p { color: var(--c-muted); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; }
.stack > * + * { margin-top: 24px; }
.prose, .article-body { min-width: 0; line-height: var(--leading-prose); }
.prose h2, .article-body h2 { margin-top: 64px; }
.prose h3, .article-body h3 { margin-top: 36px; }
.prose a, .article-body a { color: var(--c-accent-dark); }
.prose li, .article-body li { margin-bottom: 10px; }
.prose :where(p, li, dd), .article-body :where(p, li, dd) { overflow-wrap: break-word; }
.prose :where(div, section), .article-body :where(div, section) { min-width: 0; max-width: 100%; }

.skip {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: var(--c-text);
  color: var(--c-bg);
  font-size: var(--text-sm);
  text-decoration: none;
}
.skip:focus { top: 12px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  max-width: 100%;
  padding: 12px 24px;
  border: var(--stroke) solid var(--c-clear);
  border-radius: var(--r-pill);
  background: var(--c-panel);
  color: var(--c-text);
  font: inherit;
  font-weight: var(--weight-strong);
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  transition: transform var(--time-fast) var(--ease), background-color var(--time-fast) var(--ease);
}
.btn svg { width: 18px; height: 18px; }
.btn--primary {
  background: var(--c-accent);
  color: var(--c-panel);
  box-shadow: var(--sh-cta);
}
.btn--primary:hover, .btn--primary.is-hover { background: var(--c-accent-dark); color: var(--c-panel); transform: translateY(-1px); }
.btn--ghost { background: var(--c-clear); color: var(--c-text); border-color: var(--c-text); }
.btn--ghost:hover { background: var(--c-panel); color: var(--c-text); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.btn.is-focus { outline: var(--focus-width) solid var(--c-accent-dark); outline-offset: 3px; }
.action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

#site-header, .topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--c-bg);
  color: var(--c-text);
  border-bottom: var(--stroke) solid var(--c-border);
}
.header-shell {
  position: relative;
  width: 100%;
  max-width: min(100%, calc(var(--header-wrap) + var(--gutter) * 2));
  min-height: var(--nav-h);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; flex-shrink: 0; text-decoration: none; }
.brand__mark {
  display: block;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border: var(--stroke) solid var(--c-border);
  border-radius: var(--r-mark);
  background: var(--c-panel);
  color: var(--c-text);
  box-shadow: var(--sh-sm);
}
.brand__name { font-size: 15px; font-weight: var(--weight-strong); letter-spacing: var(--tracking-brand); white-space: nowrap; }
.mainnav { min-width: 0; margin-left: auto; }
.mainnav__list {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.mainnav__link {
  display: block;
  padding: 8px 15px;
  border-radius: var(--r-pill);
  color: var(--c-muted);
  font-size: 14.5px;
  font-weight: var(--weight-medium);
  text-decoration: none;
  white-space: nowrap;
}
.mainnav__link:hover { color: var(--c-text); }
.mainnav__link[aria-current="page"] {
  background: var(--c-panel);
  color: var(--c-text);
  box-shadow: 0 0 0 var(--stroke) var(--c-border), var(--sh-sm);
}
.header-tools { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.language { position: relative; }
.lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  border: var(--stroke) solid var(--c-border);
  border-radius: var(--r-pill);
  background: var(--c-clear);
  color: var(--c-text);
  font-size: var(--text-sm);
  white-space: nowrap;
}
.lang:hover { background: var(--c-panel); color: var(--c-text); }
.lang svg { width: 15px; height: 15px; color: var(--c-muted); }
.lang__short { display: none; }
.lang__caret { font-size: 11px; color: var(--c-muted); }
.language__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  min-width: 180px;
  margin: 0;
  padding: 8px;
  list-style: none;
  border: var(--stroke) solid var(--c-border);
  border-radius: var(--r-float);
  background: var(--c-panel);
  color: var(--c-text);
  box-shadow: var(--sh-card);
}
.language__menu a { display: block; min-height: 44px; padding: 10px 14px; border-radius: var(--r-tile); text-decoration: none; }
.language__menu a:hover, .language__menu a[aria-current="true"] { background: var(--c-bg); color: var(--c-accent-dark); }
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 10px;
  border: var(--stroke) solid var(--c-border);
  border-radius: var(--r-pill);
  background: var(--c-panel);
  color: var(--c-text);
}
.menu-toggle svg { width: 20px; height: 20px; }
.mobile-nav, .nav-veil { display: none; }
.nav-veil {
  position: fixed;
  inset: var(--nav-h) 0 0;
  z-index: 0;
  border: 0;
  background: var(--c-veil);
  color: var(--c-on-dark);
}
.mobile-nav {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  z-index: 2;
  max-height: calc(100dvh - var(--nav-h));
  padding: 16px var(--gutter) 28px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-bottom: var(--stroke) solid var(--c-border);
  background: var(--c-bg);
  color: var(--c-text);
  box-shadow: var(--sh-card);
}
.mobile-nav ul { margin: 0; padding: 0; list-style: none; }
.mobile-nav a { display: flex; align-items: center; width: 100%; min-height: 48px; padding: 12px 16px; border-radius: var(--r-tile); text-decoration: none; }
.mobile-nav a:hover, .mobile-nav a[aria-current] { background: var(--c-panel); color: var(--c-accent-dark); }
.mobile-nav__label { margin: 20px 16px 8px; font-size: var(--text-xs); color: var(--c-muted); }
.header-shell > .brand, .header-shell > .header-tools, .header-shell > .mainnav { position: relative; z-index: 3; }

.card, .panel {
  min-width: 0;
  padding: 32px;
  border: var(--stroke) solid var(--c-border);
  border-radius: var(--r-card);
  background: var(--c-panel);
  color: var(--c-text);
  box-shadow: var(--sh-card);
}
.card p:last-child, .panel p:last-child { margin-bottom: 0; }
.card__meta { color: var(--c-muted); font-size: var(--text-sm); }
.reveal { opacity: 1; transform: none; }
html.reveal-ready .reveal:not(.shown) { opacity: 0; transform: translateY(18px); }
html.reveal-ready .reveal { transition: opacity var(--time-reveal) var(--ease), transform var(--time-reveal) var(--ease); }

.site-footer { border-top: var(--stroke) solid var(--c-border); background: var(--c-bg); color: var(--c-text); }
.footer__inner { padding-top: 80px; padding-bottom: 32px; }
.footer__grid { display: grid; grid-template-columns: 1.35fr 0.7fr 1fr 0.65fr; gap: 40px; }
.footer__brand .brand__name { white-space: normal; }
.footer__description { margin-top: 20px; max-width: 27em; color: var(--c-muted); font-size: var(--text-sm); }
.footer__title { margin-bottom: 18px; font-family: var(--f-body); font-size: var(--text-sm); font-weight: var(--weight-strong); letter-spacing: normal; }
.footer__links { margin: 0; padding: 0; list-style: none; }
.footer__links li + li { margin-top: 8px; }
.footer__links a { display: inline-block; padding-block: 4px; color: var(--c-muted); text-decoration: none; font-size: var(--text-sm); overflow-wrap: anywhere; }
.footer__links a:hover { color: var(--c-accent-dark); text-decoration: underline; }
.footer__bottom { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 64px; padding-top: 24px; border-top: var(--stroke) solid var(--c-border); color: var(--c-muted); font-size: var(--text-xs); }
.footer__bottom p { margin: 0; }
.footer__bottom a { color: var(--c-text); }

@media (max-width: 1200px) {
  .mainnav { display: none; }
  .header-tools { margin-left: auto; }
  .menu-toggle { display: inline-flex; }
  .mobile-nav:not([hidden]), .nav-veil:not([hidden]) { display: block; }
}
@media (max-width: 960px) {
  .grid, .split { grid-template-columns: minmax(0, 1fr); }
  .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  :root { --text-h1: clamp(24px, 4vw, 30px); }
}
@media (max-width: 640px) {
  :root { --gutter: 20px; --gap: 20px; }
  .wrap { border-inline: 0; padding-inline: var(--gutter); }
  .header-shell { gap: 10px; }
  .brand { gap: 8px; }
  .brand__name { font-size: 12px; white-space: normal; max-width: 145px; line-height: 1.35; }
  .brand__mark { width: 30px; height: 30px; }
  .header-tools { margin-left: auto; gap: 6px; }
  .lang { padding-inline: 10px; min-height: 44px; }
  .lang__full, .lang > svg { display: none; }
  .lang__short { display: inline; }
  .card, .panel { padding: 24px; }
  .btn { min-height: 48px; padding: 11px 20px; font-size: 15px; }
  .footer__grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .footer__bottom { margin-top: 40px; }
  .tilt, [data-tilt] { transform: none !important; }
}
@media (max-width: 359px) {
  :root { --gutter: 16px; }
  .brand__name { max-width: 123px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html.reveal-ready .reveal:not(.shown) { opacity: 1; transform: none; }
}