:root {
  --color-paper: #FAF3E9;
  --color-surface: #FFFCF7;
  --color-surface-warm: #F4E6D6;
  --color-line: #E6D9C6;
  --color-accent: #CC2E3F;
  --color-accent-deep: #9E1F2E;
  --color-ink: #26211B;
  --color-muted: #6E6357;
  --color-success: #2F8F5B;
  --color-warning: #D08A1F;
  --color-warning-ink: #8A5A12;
  --color-error: #B3261E;
  --color-indigo: #4F5BD5;
  --color-sand: #E6D5BD;
  --color-white: #FFFFFF;
  --color-black: #000000;
  --color-highlight: rgba(255, 255, 255, .8);
  --color-accent-05: rgba(204, 46, 63, .05);
  --color-accent-08: rgba(204, 46, 63, .08);
  --color-accent-10: rgba(204, 46, 63, .10);
  --color-accent-12: rgba(204, 46, 63, .12);
  --color-accent-16: rgba(204, 46, 63, .16);
  --color-accent-30: rgba(204, 46, 63, .30);
  --color-accent-45: rgba(204, 46, 63, .45);
  --color-success-12: rgba(47, 143, 91, .12);
  --color-success-30: rgba(47, 143, 91, .30);
  --color-indigo-12: rgba(79, 91, 213, .12);
  --color-warning-14: rgba(208, 138, 31, .14);
  --color-ink-04: rgba(38, 33, 27, .04);
  --color-ink-06: rgba(38, 33, 27, .06);
  --color-ink-10: rgba(38, 33, 27, .10);
  --color-ink-16: rgba(38, 33, 27, .16);
  --flag-red: #D9312B;
  --flag-blue: #2E4A9E;
  --flag-gold: #F0C21B;
  --flag-black: #26211B;
  --flag-white: #FFFFFF;
  --font-display: 'Inter', 'Noto Sans SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
  --font-body: 'Inter', 'Noto Sans SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --radius-pill: 999px;
  --radius-large: 28px;
  --radius-window: 20px;
  --radius-card: 16px;
  --radius-medium: 12px;
  --radius-small: 8px;
  --shadow-window: 0 28px 48px -16px var(--color-accent-10), 0 1px 2px var(--color-ink-06);
  --shadow-float: 0 18px 40px -14px var(--color-accent-12), 0 1px 2px var(--color-ink-06);
  --shadow-card: 0 20px 42px -24px var(--color-accent-30), 0 1px 2px var(--color-ink-06);
  --content-width: 1200px;
  --reading-width: 780px;
  --gutter: 24px;
  --header-height: 64px;
  --section-space: 96px;
  --focus-width: 2px;
  --table-min-width: 720px;
  --motion-fast: 180ms;
  --motion-base: 420ms;
}

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

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

html.nav-open {
  overflow: hidden;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: clip;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

body:has(.float-cta)::after {
  display: block;
  height: calc(88px + env(safe-area-inset-bottom, 0px));
  content: "";
}

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

img {
  height: auto;
}

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

button,
summary {
  cursor: pointer;
}

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

p,
h1,
h2,
h3,
h4,
ul,
ol,
dl,
dd,
figure,
blockquote {
  margin: 0;
}

ul,
ol {
  padding: 0;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
}

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

h1 {
  font-size: clamp(52px, 6vw, 68px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.02em;
}

h2 {
  font-size: clamp(34px, 4vw, 50px);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -.02em;
}

h3 {
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -.015em;
}

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

code {
  overflow-wrap: anywhere;
}

pre {
  max-width: 100%;
  margin: 24px 0;
  overflow-x: auto;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-medium);
  background: var(--color-surface);
  padding: 18px;
  -webkit-overflow-scrolling: touch;
}

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

table {
  border-collapse: collapse;
}

:where(a, button, input, select, textarea, summary, [role="tab"]):focus-visible {
  outline: var(--focus-width) solid var(--color-accent);
  outline-offset: 3px;
}

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

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

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

.section {
  position: relative;
  max-width: 100%;
  overflow-x: clip;
  padding-top: var(--section-space);
  padding-bottom: var(--section-space);
}

.section--compact {
  padding-top: 64px;
  padding-bottom: 64px;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 42px;
}

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

.eyebrow {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  padding: 3px 12px;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .02em;
}

.eyebrow::before {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-12);
  content: "";
}

.lead {
  margin-top: 18px;
  color: var(--color-muted);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.65;
}

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

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

.no-break {
  white-space: nowrap;
}

.panel,
.card {
  min-width: 0;
  border: 1px solid var(--color-line);
  background: var(--color-surface);
  box-shadow: inset 0 1px 0 var(--color-highlight), var(--shadow-card);
}

.panel {
  border-radius: var(--radius-window);
  padding: 28px;
}

.card {
  border-radius: var(--radius-card);
  padding: 24px;
}

.card--warm {
  background: var(--color-surface-warm);
}

.stack {
  display: grid;
  gap: 20px;
}

.cluster {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: 22px;
}

.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));
}

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

.btn {
  display: inline-flex;
  min-width: 24px;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0 26px;
  font-size: 15px;
  font-weight: 650;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  transition: transform var(--motion-fast) ease, background-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: linear-gradient(180deg, var(--color-accent), var(--color-accent-deep));
  box-shadow: 0 10px 22px -10px var(--color-accent-45), inset 0 1px 0 var(--color-highlight);
  color: var(--color-white);
}

.btn--primary:hover {
  box-shadow: 0 14px 26px -11px var(--color-accent-45), inset 0 1px 0 var(--color-highlight);
}

.btn--secondary {
  border: 1px solid var(--color-ink);
  background: transparent;
  color: var(--color-ink);
}

.btn--secondary:hover {
  background: var(--color-surface);
}

.btn--soft {
  border: 1px solid var(--color-line);
  background: var(--color-surface-warm);
  color: var(--color-ink);
}

.btn--small {
  min-height: 36px;
  padding-inline: 18px;
  font-size: 14px;
}

.btn[aria-disabled="true"],
.btn:disabled {
  cursor: not-allowed;
  opacity: .55;
  transform: none;
}

.badge {
  display: inline-flex;
  min-height: 26px;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.badge svg,
.btn svg,
.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

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

.badge--indigo {
  background: var(--color-indigo-12);
  color: var(--color-indigo);
}

.badge--warning {
  background: var(--color-warning-14);
  color: var(--color-warning-ink);
}

.badge--neutral {
  background: var(--color-surface-warm);
  color: var(--color-ink);
}

.reveal {
  transition: opacity var(--motion-base) ease, transform var(--motion-base) ease;
}

.reveal.pending {
  opacity: 0;
  transform: translateY(16px);
}

.reveal.shown {
  opacity: 1;
  transform: translateY(0);
}

.site-header {
  position: relative;
  z-index: 60;
  min-height: var(--header-height);
}

.site-header__bar {
  display: flex;
  min-height: var(--header-height);
  align-items: center;
  gap: 18px;
}

.site-brand {
  display: inline-flex;
  min-width: max-content;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
}

.site-brand img {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 9px;
}

.site-brand__word {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.site-brand__local {
  color: var(--color-muted);
  font-size: 14px;
  font-weight: 550;
}

.desktop-nav {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 2px;
}

.desktop-nav a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  padding-inline: 11px;
  color: var(--color-muted);
  font-size: 13.5px;
  font-weight: 550;
  white-space: nowrap;
}

.desktop-nav a:hover {
  background: var(--color-ink-06);
  color: var(--color-ink);
}

.desktop-nav a.is-current {
  border: 1px solid var(--color-line);
  background: var(--color-surface-warm);
  color: var(--color-ink);
  font-weight: 650;
}

.header-tools {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
}

.login-link {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-ink);
  border-radius: var(--radius-pill);
  padding-inline: 18px;
  background: var(--color-ink);
  color: var(--color-white);
  font-size: 14px;
  font-weight: 650;
}

.language-picker {
  position: relative;
}

.language-button,
.menu-button {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-muted);
}

.language-button:hover,
.menu-button:hover {
  background: var(--color-ink-06);
  color: var(--color-ink);
}

.language-menu {
  position: absolute;
  z-index: 75;
  top: calc(100% + 8px);
  right: 0;
  display: none;
  min-width: 170px;
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-medium);
  background: var(--color-surface);
  box-shadow: var(--shadow-float);
  padding: 6px;
}

.language-picker.is-open .language-menu {
  display: grid;
}

.language-menu a {
  display: flex;
  min-height: 40px;
  align-items: center;
  border-radius: var(--radius-small);
  padding-inline: 12px;
  font-size: 14px;
}

.language-menu a:hover,
.language-menu a.is-current {
  background: var(--color-surface-warm);
}

.menu-button {
  display: none;
}

.menu-button svg {
  width: 22px;
  height: 22px;
}

.mobile-nav {
  position: absolute;
  z-index: 70;
  top: var(--header-height);
  right: var(--gutter);
  left: var(--gutter);
  display: none;
  max-height: calc(100dvh - var(--header-height) - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-float);
  padding: 10px;
}

.site-header.is-menu-open .mobile-nav {
  display: block;
}

.mobile-nav a {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  border-radius: var(--radius-small);
  padding: 10px 13px;
  color: var(--color-ink);
  font-weight: 600;
}

.mobile-nav a:hover,
.mobile-nav a.is-current {
  background: var(--color-surface-warm);
}

.mobile-nav__languages {
  display: grid;
  margin-top: 8px;
  border-top: 1px solid var(--color-line);
  padding-top: 8px;
}

.mobile-nav__languages strong {
  padding: 8px 13px 4px;
  color: var(--color-muted);
  font-size: 12px;
}

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

.site-header.is-menu-open + .nav-veil,
.nav-veil.is-visible {
  display: block;
}

.site-footer {
  position: relative;
  max-width: 100%;
  overflow-x: clip;
  border-top: 1px solid var(--color-line);
  background: var(--color-surface-warm);
  padding-top: 64px;
  padding-bottom: 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 44px;
}

.footer-brand p {
  max-width: 410px;
  margin-top: 16px;
  color: var(--color-muted);
}

.footer-title {
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: .06em;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
}

.footer-links a,
.footer-languages a {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  color: var(--color-muted);
  font-size: 14px;
}

.footer-links a:hover,
.footer-languages a:hover {
  color: var(--color-accent);
}

.footer-languages {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 42px;
  border-top: 1px solid var(--color-line);
  padding-top: 22px;
  color: var(--color-muted);
  font-size: 13px;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

#server-status {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  margin-bottom: 32px;
  overflow: hidden;
}

#server-status > * {
  min-width: 0;
}

.prose {
  color: var(--color-ink);
}

.prose > * + * {
  margin-top: 20px;
}

.prose h2 {
  margin-top: 56px;
}

.prose h3 {
  margin-top: 36px;
}

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

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

.prose li + li {
  margin-top: 8px;
}

.prose img {
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
}

@media (max-width: 1100px) {
  .desktop-nav a {
    padding-inline: 8px;
    font-size: 12.5px;
  }

  .site-header__bar {
    gap: 12px;
  }
}

@media (max-width: 960px) {
  .desktop-nav {
    display: none;
  }

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

  .menu-button {
    display: inline-flex;
  }

  .language-picker {
    display: none;
  }

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

  .footer-brand {
    grid-column: 1 / -1;
  }

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

@media (max-width: 768px) {
  :root {
    --section-space: 72px;
  }

  h1 {
    font-size: clamp(28px, 9vw, 40px);
    line-height: 1.12;
    letter-spacing: -.02em;
  }

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

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

  .section-heading {
    margin-bottom: 30px;
  }
}

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

  .no-break {
    white-space: normal;
  }

  .tilt,
  [class*="tilt-"] {
    transform: none;
  }

  .absolute-decor,
  [data-parallax-decor] {
    max-width: 100%;
  }

  .btn {
    max-width: 100%;
  }

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

  .footer-brand {
    grid-column: auto;
  }

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

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-brand__local {
    display: none;
  }

  .login-link {
    min-height: 40px;
    padding-inline: 14px;
  }

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

  .panel,
  .card {
    padding: 20px;
  }
}

@media (max-width: 380px) {
  .site-brand__word {
    font-size: 17px;
  }

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

  .header-tools {
    gap: 3px;
  }

  .login-link {
    padding-inline: 12px;
  }
}

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

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

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