:root {
  --color-wall: #F3E9D7;
  --color-paper: #FFF9EC;
  --color-paper-deep: #F7EBCF;
  --color-paper-note: #E8D9BC;
  --color-cork: #B77B4D;
  --color-cork-dark: #96613B;
  --color-cork-light: #C98E60;
  --color-wood: #8A684C;
  --color-wood-light: #B18A65;
  --color-blue: #2455A4;
  --color-blue-dark: #193B73;
  --color-blue-soft: #DCE5F3;
  --color-text: #211D18;
  --color-muted: #6D6256;
  --color-green: #43745A;
  --color-amber: #B87718;
  --color-red: #C63F2F;
  --color-red-dark: #8F291E;
  --color-brass: #C69A3A;
  --color-brass-dark: #84621E;
  --color-white: #FFFFFF;
  --color-black: #000000;
  --color-transparent: transparent;
  --color-shadow: rgba(66, 42, 25, 0.18);
  --color-shadow-deep: rgba(66, 42, 25, 0.28);
  --color-line-soft: rgba(33, 29, 24, 0.16);
  --color-line-strong: rgba(33, 29, 24, 0.34);
  --color-fleck: rgba(83, 49, 27, 0.22);
  --color-fleck-light: rgba(255, 249, 236, 0.2);
  --color-veil: rgba(33, 29, 24, 0.48);
  --color-focus: rgba(36, 85, 164, 0.28);

  --font-display: Inter, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: Inter, "Noto Sans SC", "Noto Sans JP", "Noto Sans KR", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  --radius-zero: 0;
  --radius-small: 3px;
  --radius-medium: 8px;
  --radius-large: 14px;
  --radius-pill: 999px;

  --shadow-header: 0 2px 0 var(--color-line-soft);
  --shadow-panel: 5px 7px 0 var(--color-shadow);
  --shadow-panel-heavy: 8px 11px 0 var(--color-shadow-deep);
  --shadow-button: 3px 4px 0 var(--color-blue-dark);
  --shadow-button-light: 3px 4px 0 var(--color-line-soft);
  --shadow-focus: 0 0 0 4px var(--color-focus);

  --header-height: 88px;
  --page-width: 1360px;
  --content-width: 1160px;
  --reading-width: 820px;
  --gutter: clamp(16px, 4vw, 32px);

  --text-xs: 0.6875rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-md: 1.0625rem;
  --text-lg: 1.375rem;
  --text-xl: 1.875rem;
  --text-2xl: clamp(2.1rem, 5vw, 3.5rem);
  --text-display: clamp(3.25rem, 7vw, 5.5rem);

  --weight-regular: 400;
  --weight-medium: 600;
  --weight-bold: 750;
  --weight-black: 900;

  --space-1: 0.375rem;
  --space-2: 0.625rem;
  --space-3: 0.875rem;
  --space-4: 1.125rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;

  --transition-fast: 160ms ease;
  --transition-base: 260ms ease;
  --transition-reveal: 620ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
  min-width: 0;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 18px);
}

html.nav-open {
  overflow: hidden;
}

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  color: var(--color-text);
  background-color: var(--color-wall);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.72;
  overflow-wrap: break-word;
}

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

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

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

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

button {
  cursor: pointer;
}

a {
  color: var(--color-blue-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--color-blue);
}

p,
ul,
ol,
blockquote,
pre,
table {
  margin-top: 0;
  margin-bottom: var(--space-5);
}

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

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

h1 {
  margin-bottom: var(--space-5);
  font-size: var(--text-display);
  font-weight: var(--weight-black);
  letter-spacing: -0.05em;
}

h2 {
  margin-bottom: var(--space-4);
  font-size: var(--text-2xl);
  font-weight: var(--weight-black);
  letter-spacing: -0.035em;
}

h3 {
  margin-bottom: var(--space-3);
  font-size: clamp(1.3rem, 2.6vw, 1.75rem);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
}

h4 {
  margin-bottom: var(--space-2);
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
}

strong {
  font-weight: var(--weight-bold);
}

small {
  font-size: var(--text-sm);
}

hr {
  height: 0;
  margin: var(--space-7) 0;
  border: 0;
  border-top: 1px dashed var(--color-wood);
}

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

code {
  padding: 0.12em 0.32em;
  color: var(--color-blue-dark);
  background: var(--color-blue-soft);
  border-radius: var(--radius-small);
  overflow-wrap: anywhere;
  word-break: break-word;
}

pre {
  max-width: 100%;
  padding: var(--space-5);
  color: var(--color-paper);
  background: var(--color-blue-dark);
  border: 2px solid var(--color-text);
  border-radius: var(--radius-small);
  box-shadow: var(--shadow-panel);
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

pre code {
  display: block;
  min-width: max-content;
  padding: 0;
  color: inherit;
  background: var(--color-transparent);
  border-radius: var(--radius-zero);
  overflow-wrap: normal;
  word-break: normal;
}

::selection {
  color: var(--color-white);
  background: var(--color-blue);
}

:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 300;
  padding: var(--space-2) var(--space-4);
  color: var(--color-white);
  background: var(--color-blue-dark);
  border: 2px solid var(--color-paper);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

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

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

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

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

.section-paper {
  background: var(--color-paper);
  border-top: 2px solid var(--color-wood);
  border-bottom: 2px solid var(--color-wood);
}

.section-heading {
  max-width: 760px;
  margin-bottom: var(--space-7);
}

.eyebrow {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  color: var(--color-blue-dark);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow-dot,
.status-dot,
.icon-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  background: var(--color-red);
  border: 2px solid var(--color-red-dark);
  border-radius: var(--radius-pill);
}

.lead {
  max-width: 720px;
  color: var(--color-muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
}

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

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

.title-accent {
  color: var(--color-blue);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.button {
  display: inline-flex;
  min-height: 44px;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  color: var(--color-blue-dark);
  background: var(--color-paper);
  border: 2px solid var(--color-blue-dark);
  border-radius: var(--radius-small);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  box-shadow: var(--shadow-button-light);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

.button:hover {
  color: var(--color-blue-dark);
  background: var(--color-paper-deep);
  transform: translate(-1px, -1px);
}

.button:active {
  box-shadow: 1px 1px 0 var(--color-line-soft);
  transform: translate(2px, 2px);
}

.button:focus-visible {
  box-shadow: var(--shadow-button-light), var(--shadow-focus);
}

.button-primary {
  color: var(--color-white);
  background: var(--color-blue);
  box-shadow: var(--shadow-button);
}

.button-primary:hover {
  color: var(--color-white);
  background: var(--color-blue-dark);
}

.button-danger {
  color: var(--color-white);
  background: var(--color-red);
  border-color: var(--color-red-dark);
  box-shadow: 3px 4px 0 var(--color-red-dark);
}

.button[disabled],
.button.is-disabled {
  cursor: not-allowed;
  color: var(--color-muted);
  background: var(--color-paper-note);
  border-color: var(--color-wood);
  box-shadow: none;
  opacity: 0.72;
  transform: none;
}

.button-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.paper-panel,
.card {
  position: relative;
  min-width: 0;
  padding: clamp(20px, 4vw, 32px);
  background: var(--color-paper);
  border: 1px solid var(--color-wood);
  border-radius: var(--radius-small);
  box-shadow: var(--shadow-panel);
}

.paper-panel::before,
.card::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 24px;
  width: 72px;
  height: 17px;
  background: var(--color-paper-note);
  border: 1px solid var(--color-line-soft);
  transform: rotate(-2deg);
  opacity: 0.82;
  pointer-events: none;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
}

.card-grid > * {
  min-width: 0;
}

.tilt-left {
  transform: rotate(-0.7deg);
}

.tilt-right {
  transform: rotate(0.7deg);
}

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

.badge,
.chip,
.tag {
  display: inline-flex;
  min-height: 27px;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  color: var(--color-blue-dark);
  background: var(--color-blue-soft);
  border: 1px solid var(--color-blue);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  line-height: 1.35;
  overflow: hidden;
}

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

.badge-warning {
  color: var(--color-text);
  background: var(--color-paper-deep);
  border-color: var(--color-amber);
}

.badge-error {
  color: var(--color-white);
  background: var(--color-red);
  border-color: var(--color-red-dark);
}

.table-wrap {
  max-width: 100%;
  margin-bottom: var(--space-5);
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--color-wood);
  box-shadow: var(--shadow-panel);
}

.data-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  background: var(--color-paper);
}

.data-table th,
.data-table td {
  padding: 13px 15px;
  border-right: 1px solid var(--color-line-soft);
  border-bottom: 1px solid var(--color-line-soft);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--color-paper);
  background: var(--color-blue-dark);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table th:last-child,
.data-table td:last-child {
  border-right: 0;
}

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

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

.site-header {
  position: relative;
  z-index: 120;
  height: var(--header-height);
  background: var(--color-wall);
  box-shadow: var(--shadow-header);
}

.nav-shell {
  width: min(var(--page-width), calc(100% - 64px));
  height: 100%;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 30px;
}

.site-brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 11px;
  color: var(--color-text);
  font-family: var(--font-display);
  font-weight: var(--weight-black);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.site-brand:hover {
  color: var(--color-text);
}

.site-brand-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  transform: rotate(-3deg);
  filter: drop-shadow(3px 3px 0 var(--color-blue-dark));
}

.site-brand-name {
  font-size: var(--text-md);
  white-space: nowrap;
}

.desktop-nav {
  height: 100%;
  margin-left: auto;
  display: flex;
  align-items: stretch;
  gap: 19px;
}

.desktop-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 3px 1px 0;
  color: var(--color-muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  text-decoration: none;
}

.desktop-nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 18px;
  left: 0;
  height: 3px;
  background: var(--color-blue);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--transition-fast);
}

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

.desktop-nav a:hover::after,
.desktop-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.desktop-nav a[aria-current="page"] {
  font-weight: var(--weight-bold);
}

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

.language-switch {
  min-height: 38px;
  padding: 8px 12px;
  color: var(--color-text);
  background: var(--color-paper);
  border: 1px solid var(--color-wood);
  border-radius: var(--radius-small);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  box-shadow: 2px 2px 0 var(--color-line-soft);
}

.language-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 52px;
  z-index: 150;
  width: 180px;
  padding: 7px;
  background: var(--color-paper);
  border: 2px solid var(--color-wood);
  box-shadow: var(--shadow-panel);
}

.language-menu[hidden] {
  display: none;
}

.language-menu a {
  display: flex;
  min-height: 42px;
  width: 100%;
  align-items: center;
  padding: 8px 10px;
  color: var(--color-text);
  text-decoration: none;
}

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

.menu-toggle {
  display: none;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--color-text);
  background: var(--color-paper);
  border: 1px solid var(--color-wood);
  border-radius: var(--radius-small);
  box-shadow: 2px 2px 0 var(--color-line-soft);
}

.menu-toggle-lines,
.menu-toggle-lines::before,
.menu-toggle-lines::after {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text);
}

.menu-toggle-lines {
  position: relative;
}

.menu-toggle-lines::before,
.menu-toggle-lines::after {
  content: "";
  position: absolute;
  left: 0;
}

.menu-toggle-lines::before {
  top: -6px;
}

.menu-toggle-lines::after {
  top: 6px;
}

.mobile-drawer {
  display: none;
}

.nav-veil {
  display: none;
}

.site-footer {
  position: relative;
  padding-top: var(--space-8);
  color: var(--color-paper);
  background: var(--color-blue-dark);
  border-top: 8px solid var(--color-wood);
  overflow-x: clip;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) repeat(3, minmax(150px, 1fr));
  gap: var(--space-7);
}

.footer-brand .site-brand {
  color: var(--color-paper);
  margin-bottom: var(--space-4);
}

.footer-brand p {
  max-width: 340px;
  color: var(--color-paper-note);
}

.footer-heading {
  margin-bottom: var(--space-4);
  color: var(--color-paper);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.footer-links a {
  display: inline-flex;
  color: var(--color-paper-note);
  text-decoration: none;
}

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

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  padding-bottom: var(--space-5);
  border-top: 1px dashed var(--color-paper-note);
  color: var(--color-paper-note);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer-legal a {
  color: var(--color-paper-note);
}

@media (max-width: 1180px) {
  .nav-shell {
    gap: 18px;
  }

  .desktop-nav {
    gap: 12px;
  }

  .site-brand-name {
    font-size: var(--text-base);
  }
}

@media (max-width: 980px) {
  .site-header {
    height: 72px;
  }

  .nav-shell {
    width: 100%;
    padding-inline: var(--gutter);
  }

  .desktop-nav {
    display: none;
  }

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

  .header-tools > .language-switch,
  .header-tools > .language-menu {
    display: none;
  }

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

  .mobile-drawer {
    position: fixed;
    top: 72px;
    right: 0;
    left: 0;
    z-index: 140;
    max-height: calc(100dvh - 72px);
    padding: 10px var(--gutter) 24px;
    background: var(--color-paper);
    border-top: 2px solid var(--color-wood);
    border-bottom: 5px solid var(--color-blue);
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: var(--shadow-panel-heavy);
  }

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

  .mobile-drawer a {
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    padding: 10px 12px;
    color: var(--color-text);
    border-bottom: 1px dashed var(--color-wood);
    text-decoration: none;
  }

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

  .mobile-drawer-label {
    display: block;
    margin: 18px 12px 5px;
    color: var(--color-muted);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: 0.08em;
  }

  .nav-veil {
    position: fixed;
    inset: 72px 0 0;
    z-index: 110;
    background: var(--color-veil);
  }

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

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

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

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

  html {
    scroll-padding-top: 86px;
  }

  body {
    font-size: 0.9375rem;
  }

  h1 {
    font-size: clamp(2.65rem, 13vw, 3.5rem);
  }

  h2 {
    font-size: clamp(1.8rem, 9vw, 2.5rem);
  }

  .site-brand-logo {
    width: 38px;
    height: 38px;
  }

  .site-brand-name {
    max-width: 150px;
    white-space: normal;
    line-height: 1.12;
  }

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

  .button-row {
    align-items: stretch;
  }

  .button-row .button {
    flex: 1 1 100%;
  }

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

  .paper-panel::before,
  .card::before {
    transform: none;
  }

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

  .footer-legal {
    flex-direction: column;
    gap: 8px;
  }

  .table-wrap {
    width: 100%;
  }

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

  .decorative-field,
  .hero,
  .hero-visual,
  [data-hero-visual] {
    overflow-x: clip;
  }
}

@media (max-width: 380px) {
  .site-brand-name {
    max-width: 116px;
    font-size: var(--text-sm);
  }

  .nav-shell {
    gap: 8px;
  }

  .header-tools {
    gap: 4px;
  }
}

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

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

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