:root {
  --color-bg: #08251C;
  --color-panel: #103126;
  --color-panel-2: #173B2E;
  --color-border: #6E744E;
  --color-accent: #C58A46;
  --color-accent-dark: #8F5B2C;
  --color-text: #F3F0E4;
  --color-text-muted: #A9B7A9;
  --color-success: #79A66F;
  --color-warn: #E0A43E;
  --color-error: #D76049;
  --color-bg-alpha: rgba(8, 37, 28, 0.88);
  --color-bg-soft: rgba(8, 37, 28, 0.56);
  --color-panel-alpha: rgba(16, 49, 38, 0.92);
  --color-accent-soft: rgba(197, 138, 70, 0.16);
  --color-accent-faint: rgba(197, 138, 70, 0.08);
  --color-text-faint: rgba(243, 240, 228, 0.08);
  --color-text-line: rgba(243, 240, 228, 0.18);
  --color-veil: rgba(8, 37, 28, 0.78);
  --color-transparent: transparent;
  --font-display: Inter, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Noto Sans SC", Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --radius-none: 0;
  --nav-height: 76px;
  --page-width: 1344px;
  --content-width: 920px;
  --gutter: clamp(16px, 4vw, 32px);
  --line-thin: 1px;
  --line-medium: 2px;
  --line-heavy: 4px;
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 72px;
  --space-8: 104px;
  --transition-fast: 160ms ease;
  --transition-medium: 420ms ease;
  --tracking-display: -0.045em;
  --tracking-wide: 0.12em;
}

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

html {
  min-width: 0;
  scroll-behavior: smooth;
  background: var(--color-bg);
}

html.nav-open {
  overflow: hidden;
}

body {
  min-width: 0;
  min-height: 100%;
  margin: 0;
  overflow-x: clip;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main,
section,
article,
aside,
header,
footer,
nav,
div {
  min-width: 0;
}

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

img {
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: var(--color-transparent);
}

button {
  border-radius: var(--radius-none);
}

p,
ul,
ol,
dl,
blockquote,
pre,
table {
  margin-top: 0;
}

ul,
ol {
  padding-left: 1.25em;
}

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

:not(pre) > code {
  padding: 0.12em 0.35em;
  border: var(--line-thin) solid var(--color-border);
  background: var(--color-panel);
  color: var(--color-accent);
  overflow-wrap: anywhere;
  word-break: break-word;
}

pre {
  max-width: 100%;
  padding: var(--space-4);
  overflow-x: auto;
  border: var(--line-thin) solid var(--color-border);
  background: var(--color-panel);
  color: var(--color-text);
  font-family: var(--font-mono);
  line-height: 1.65;
  tab-size: 2;
  -webkit-overflow-scrolling: touch;
}

pre code {
  white-space: pre;
  overflow-wrap: normal;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-panel);
}

th,
td {
  padding: 13px 15px;
  border: var(--line-thin) solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--color-panel-2);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}

td {
  color: var(--color-text-muted);
}

hr {
  height: var(--line-thin);
  margin: var(--space-6) 0;
  border: 0;
  background: var(--color-border);
}

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

:focus-visible {
  outline: var(--line-medium) solid var(--color-warn);
  outline-offset: 3px;
}

.wrap {
  width: min(100%, calc(var(--page-width) + (var(--gutter) * 2)));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.content-wrap {
  width: min(100%, calc(var(--content-width) + (var(--gutter) * 2)));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  overflow-x: clip;
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}

.section-compact {
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
}

.section-lined {
  border-top: var(--line-thin) solid var(--color-border);
}

.eyebrow,
.board-kicker,
.ref-label {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.eyebrow::before,
.board-kicker::before {
  width: 34px;
  height: var(--line-medium);
  flex-shrink: 0;
  content: "";
  background: var(--color-accent);
}

.eyebrow::after,
.board-kicker::after {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  content: "";
  border: var(--line-thin) solid var(--color-warn);
  background: var(--color-warn);
}

h1,
h2,
h3,
h4 {
  margin-top: 0;
  color: var(--color-text);
  font-family: var(--font-display);
  text-wrap: balance;
}

h1,
.hero-title {
  margin-bottom: var(--space-4);
  font-size: clamp(42px, 5.2vw, 72px);
  font-weight: 780;
  line-height: 1.08;
  letter-spacing: var(--tracking-display);
}

h2 {
  margin-bottom: var(--space-4);
  font-size: clamp(30px, 3.2vw, 46px);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

h3 {
  margin-bottom: var(--space-3);
  font-size: clamp(21px, 2vw, 28px);
  line-height: 1.3;
  letter-spacing: -0.02em;
}

h4 {
  margin-bottom: var(--space-2);
  font-size: 18px;
  line-height: 1.4;
}

.lead {
  max-width: 760px;
  color: var(--color-text-muted);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.85;
}

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

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

.accent-text,
.title-keyword {
  color: var(--color-accent);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: var(--space-5);
}

.button {
  min-height: 50px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: var(--line-medium) solid var(--color-accent);
  border-radius: var(--radius-none);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast),
    background-color var(--transition-fast),
    transform var(--transition-fast);
}

.button svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 1.8;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  color: var(--color-bg);
  background: var(--color-accent);
}

.button-primary:hover {
  border-color: var(--color-text);
  background: var(--color-text);
}

.button-secondary {
  color: var(--color-text);
  background: var(--color-bg-soft);
}

.button-secondary:hover {
  border-color: var(--color-text);
  background: var(--color-text);
  color: var(--color-bg);
}

.button-quiet {
  border-color: var(--color-border);
  background: var(--color-panel);
  color: var(--color-text-muted);
}

.button-quiet:hover {
  border-color: var(--color-accent);
  color: var(--color-text);
}

.button[disabled],
.button.is-disabled {
  border-color: var(--color-border);
  background: var(--color-panel);
  color: var(--color-text-muted);
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.icon-box {
  width: 38px;
  height: 38px;
  display: grid;
  flex-shrink: 0;
  place-items: center;
  border: var(--line-medium) solid var(--color-accent);
  color: var(--color-accent);
}

.icon-box svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 1.6;
}

.panel,
.card {
  position: relative;
  min-width: 0;
  border: var(--line-thin) solid var(--color-border);
  background: var(--color-panel);
}

.panel {
  padding: clamp(20px, 3vw, 34px);
}

.card {
  padding: var(--space-4);
}

.card::before,
.panel-marked::before {
  position: absolute;
  top: -1px;
  left: -1px;
  width: 34px;
  height: var(--line-heavy);
  content: "";
  background: var(--color-accent);
}

.card:hover {
  border-color: var(--color-accent);
}

.panel-strong {
  background: var(--color-panel-2);
}

.rule-heading {
  position: relative;
  padding-left: 18px;
  border-left: var(--line-heavy) solid var(--color-accent-dark);
}

.fact-row,
.badge-row {
  margin: var(--space-4) 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

.fact-row li,
.badge,
.tag {
  min-height: 30px;
  max-width: 100%;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  border: var(--line-thin) solid var(--color-border);
  background: var(--color-panel);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.fact-row li::before,
.status-dot {
  width: 5px;
  height: 5px;
  flex-shrink: 0;
  content: "";
  background: var(--color-success);
}

.badge-accent {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.badge-success {
  border-color: var(--color-success);
  color: var(--color-success);
}

.badge-warn {
  border-color: var(--color-warn);
  color: var(--color-warn);
}

.badge-error {
  border-color: var(--color-error);
  color: var(--color-error);
}

.grid-2,
.grid-3,
.grid-4,
.auto-grid {
  display: grid;
  gap: var(--space-4);
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.grid-2 > *,
.grid-3 > *,
.grid-4 > *,
.auto-grid > * {
  min-width: 0;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: var(--line-thin) solid var(--color-border);
  -webkit-overflow-scrolling: touch;
}

.table-wrap table {
  min-width: 680px;
  border: 0;
}

.data-table {
  min-width: 680px;
}

.site-header {
  position: relative;
  z-index: 100;
  height: var(--nav-height);
  border-bottom: var(--line-thin) solid var(--color-border);
  background: var(--color-bg-alpha);
}

.header-shell {
  width: min(100%, calc(var(--page-width) + (var(--gutter) * 2)));
  height: 100%;
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: stretch;
}

.site-brand {
  display: flex;
  align-items: center;
  flex: 0 0 238px;
  gap: 12px;
  border-right: var(--line-thin) solid var(--color-border);
  font-family: var(--font-display);
  font-weight: 750;
  letter-spacing: -0.02em;
}

.site-brand img {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: 16px;
  line-height: 1;
}

.brand-copy small {
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
}

.desktop-nav {
  display: flex;
  align-items: stretch;
  min-width: 0;
  flex: 1;
}

.desktop-nav a {
  position: relative;
  min-width: 78px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-right: var(--line-thin) solid var(--color-text-faint);
  color: var(--color-text-muted);
  font-size: 13px;
  white-space: nowrap;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.desktop-nav a::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  content: "";
  background: var(--color-transparent);
}

.desktop-nav a:hover,
.desktop-nav a[aria-current="page"] {
  background: var(--color-accent-faint);
  color: var(--color-text);
}

.desktop-nav a[aria-current="page"]::after {
  background: var(--color-accent);
}

.desktop-nav svg,
.mobile-drawer svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 1.5;
}

.header-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.language-switch {
  position: relative;
}

.language-button {
  min-height: 44px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: var(--color-transparent);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
}

.language-button svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 1.4;
}

.language-menu {
  position: absolute;
  top: calc(100% + 1px);
  right: 0;
  z-index: 120;
  width: 180px;
  display: none;
  border: var(--line-thin) solid var(--color-border);
  background: var(--color-panel);
}

.language-menu.is-open {
  display: block;
}

.language-menu a {
  min-height: 44px;
  padding: 9px 13px;
  display: flex;
  align-items: center;
  border-bottom: var(--line-thin) solid var(--color-text-faint);
  color: var(--color-text-muted);
  font-size: 13px;
}

.language-menu a:last-child {
  border-bottom: 0;
}

.language-menu a:hover,
.language-menu a[aria-current="true"] {
  background: var(--color-panel-2);
  color: var(--color-text);
}

.menu-toggle {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  display: none;
  place-items: center;
  border: var(--line-thin) solid var(--color-border);
  background: var(--color-panel);
  color: var(--color-text);
  cursor: pointer;
}

.menu-toggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.mobile-drawer {
  position: fixed;
  top: var(--nav-height);
  right: 0;
  left: 0;
  z-index: 110;
  max-height: calc(100dvh - var(--nav-height));
  display: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-bottom: var(--line-medium) solid var(--color-accent);
  background: var(--color-bg);
}

.mobile-drawer.is-open {
  display: block;
}

.mobile-drawer a {
  width: 100%;
  min-height: 48px;
  padding: 12px var(--gutter);
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: var(--line-thin) solid var(--color-border);
  color: var(--color-text-muted);
}

.mobile-drawer a[aria-current="page"],
.mobile-drawer a:hover {
  background: var(--color-panel);
  color: var(--color-text);
}

.mobile-language-title {
  padding: 13px var(--gutter);
  border-bottom: var(--line-thin) solid var(--color-border);
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: var(--tracking-wide);
}

.mobile-language-links a {
  padding-left: calc(var(--gutter) + 27px);
}

.nav-veil {
  position: fixed;
  inset: var(--nav-height) 0 0;
  z-index: 90;
  display: none;
  border: 0;
  background: var(--color-veil);
}

.nav-veil.is-open {
  display: block;
}

.site-footer {
  position: relative;
  overflow-x: clip;
  border-top: var(--line-medium) solid var(--color-border);
  background: var(--color-panel);
}

.footer-grid {
  padding-top: var(--space-7);
  padding-bottom: var(--space-6);
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr 0.8fr;
  gap: var(--space-6);
}

.footer-brand {
  max-width: 360px;
}

.footer-brand-head {
  display: flex;
  align-items: center;
  gap: 13px;
}

.footer-brand-head img {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
}

.footer-brand strong {
  font-family: var(--font-display);
  font-size: 18px;
}

.footer-brand p {
  margin: var(--space-3) 0 0;
  color: var(--color-text-muted);
}

.footer-title {
  margin-bottom: var(--space-3);
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: var(--tracking-wide);
}

.footer-links {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  list-style: none;
}

.footer-links a {
  display: inline-block;
  color: var(--color-text-muted);
  font-size: 14px;
}

.footer-links a:hover {
  color: var(--color-text);
}

.footer-bottom {
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  border-top: var(--line-thin) solid var(--color-border);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--transition-medium), transform var(--transition-medium);
}

.reveal.shown {
  opacity: 1;
  transform: none;
}

.tilt,
.tilt-panel {
  transform: rotate(-0.35deg);
}

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

.prose > * {
  max-width: 100%;
}

.prose h2,
.prose h3,
.prose h4,
.prose strong {
  color: var(--color-text);
}

.prose h2 {
  margin-top: var(--space-7);
  padding-top: var(--space-3);
  border-top: var(--line-thin) solid var(--color-border);
}

.prose h3 {
  margin-top: var(--space-5);
}

.prose p,
.prose li {
  overflow-wrap: break-word;
}

.prose a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (max-width: 1180px) {
  .site-brand {
    flex-basis: 205px;
  }

  .desktop-nav a {
    min-width: 62px;
    padding-inline: 8px;
    font-size: 12px;
  }

  .desktop-nav svg {
    display: none;
  }

  .language-button span {
    display: none;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  :root {
    --nav-height: 66px;
  }

  .desktop-nav,
  .language-switch {
    display: none;
  }

  .site-brand {
    flex: 0 1 auto;
    border-right: 0;
  }

  .header-tools {
    margin-left: auto;
  }

  .menu-toggle {
    display: grid;
  }

  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid {
    gap: var(--space-5);
  }
}

@media (max-width: 640px) {
  :root {
    --gutter: 16px;
  }

  body {
    font-size: 15px;
  }

  .wrap,
  .content-wrap {
    width: 100%;
    padding-inline: var(--gutter);
  }

  .section {
    padding-top: var(--space-7);
    padding-bottom: var(--space-7);
  }

  h1,
  .hero-title {
    font-size: clamp(38px, 12vw, 54px);
  }

  h2 {
    font-size: clamp(28px, 9vw, 38px);
  }

  .brand-copy strong {
    font-size: 14px;
  }

  .brand-copy small {
    display: none;
  }

  .site-brand img {
    width: 36px;
    height: 36px;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
  }

  .tilt,
  .tilt-panel {
    transform: none;
  }

  th,
  td {
    padding: 11px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto;
    transition-duration: 0.01ms;
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
  }

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