:root {
  --color-page: #FFFFFF;
  --color-panel: #102A56;
  --color-panel-raised: #173563;
  --color-panel-soft: #F3F5F7;
  --color-border: #D5DAE1;
  --color-border-dark: #40577A;
  --color-accent: #E4A72A;
  --color-accent-dark: #B97808;
  --color-text: #25282D;
  --color-text-muted: #69717C;
  --color-success: #C88B16;
  --color-warn: #D99A1D;
  --color-error: #B8463F;
  --color-white: #FFFFFF;
  --color-white-muted: #DDE5F0;
  --color-white-soft: #AEBED3;
  --color-panel-line: rgba(255, 255, 255, 0.18);
  --color-panel-line-strong: rgba(255, 255, 255, 0.34);
  --color-panel-fill: rgba(255, 255, 255, 0.05);
  --color-panel-fill-strong: rgba(255, 255, 255, 0.09);
  --color-focus: rgba(228, 167, 42, 0.35);
  --color-overlay: rgba(16, 42, 86, 0.52);
  --color-flag-red: #C94747;
  --color-flag-blue: #315A9A;
  --color-flag-deep-blue: #213F78;
  --color-flag-white: #FFFFFF;
  --color-flag-black: #25282D;

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

  --radius-logo: 12px;
  --radius-card: 28px;
  --radius-board: 18px;
  --radius-control: 999px;
  --radius-small: 8px;
  --radius-flag: 5px;

  --page-width: 1190px;
  --reading-width: 48rem;
  --header-height: 88px;
  --hero-height: 680px;
  --hero-gap: 58px;
  --gutter: 24px;
  --space-section: 96px;
  --toc-offset: 84px;
  --focus-width: 3px;
  --border-thin: 1px;
  --border-medium: 2px;
  --transition-fast: 180ms;
  --transition-normal: 260ms;
}

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

html {
  min-width: 320px;
  scroll-behavior: smooth;
  background: var(--color-page);
  color: var(--color-text);
  font-family: var(--font-body);
}

html.nav-open {
  overflow: hidden;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: clip;
  background: var(--color-page);
  color: var(--color-text);
  font-size: 16px;
  line-height: 1.7;
}

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

img {
  height: auto;
}

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

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

button {
  cursor: pointer;
}

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

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

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

h1 {
  font-size: clamp(52px, 5.4vw, 72px);
  font-weight: 800;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 780;
  letter-spacing: -0.015em;
}

h3 {
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 750;
}

strong {
  font-weight: 750;
}

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

code {
  overflow-wrap: anywhere;
}

pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 20px;
  border: var(--border-thin) solid var(--color-border-dark);
  border-radius: var(--radius-small);
  background: var(--color-panel);
  color: var(--color-white-muted);
  line-height: 1.65;
  -webkit-overflow-scrolling: touch;
}

pre code {
  overflow-wrap: normal;
}

hr {
  border: 0;
  border-top: var(--border-thin) solid var(--color-border);
}

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

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

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

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

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

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

.section-kicker,
.eyebrow {
  margin-bottom: 10px;
  color: var(--color-accent-dark);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-intro {
  color: var(--color-text-muted);
  font-size: 18px;
  line-height: 1.75;
}

.nowrap-term {
  white-space: nowrap;
}

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

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  padding: 0;
  border: 0;
  margin: -1px;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.button,
.button-primary,
.button-secondary,
.button-ghost {
  min-height: 48px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: var(--border-thin) solid var(--color-panel);
  border-radius: var(--radius-control);
  font-size: 14px;
  font-weight: 760;
  line-height: 1.2;
  text-align: center;
  transition:
    color var(--transition-fast) ease,
    background-color var(--transition-fast) ease,
    border-color var(--transition-fast) ease,
    transform var(--transition-fast) ease;
}

.button-primary {
  background: var(--color-panel);
  color: var(--color-white);
}

.button-secondary {
  background: var(--color-page);
  color: var(--color-panel);
}

.button-ghost {
  border-color: var(--color-border);
  background: var(--color-panel-soft);
  color: var(--color-text);
}

.button:hover,
.button-primary:hover,
.button-secondary:hover,
.button-ghost:hover {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-panel);
  transform: translateY(-2px);
}

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

.badge,
.tag {
  max-width: 100%;
  min-height: 30px;
  padding: 5px 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  border: var(--border-thin) solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-page);
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.badge-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: var(--radius-control);
  background: var(--color-accent);
}

.panel,
.card {
  min-width: 0;
  border: var(--border-thin) solid var(--color-border);
  border-radius: var(--radius-board);
  background: var(--color-page);
}

.panel-soft {
  min-width: 0;
  border-radius: var(--radius-board);
  background: var(--color-panel-soft);
}

.panel-dark {
  min-width: 0;
  border: var(--border-thin) solid var(--color-border-dark);
  border-radius: var(--radius-card);
  background: var(--color-panel);
  color: var(--color-white);
}

.site-header {
  position: relative;
  z-index: 100;
  min-height: var(--header-height);
  background: var(--color-page);
}

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

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
}

.brand-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: var(--radius-logo);
}

.brand-copy {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.brand-latin {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-local {
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 500;
}

.desktop-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
}

.nav-link,
.more-menu summary {
  min-height: 42px;
  padding-inline: 13px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-control);
  color: var(--color-text);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.nav-link:hover,
.nav-link[aria-current="page"],
.more-menu summary:hover,
.more-menu[open] summary {
  background: var(--color-panel-soft);
  color: var(--color-panel);
}

.more-menu {
  position: relative;
}

.more-menu summary {
  gap: 6px;
}

.more-menu summary::-webkit-details-marker {
  display: none;
}

.more-chevron {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-fast) ease;
}

.more-menu[open] .more-chevron {
  transform: rotate(180deg);
}

.more-popover {
  position: absolute;
  z-index: 5;
  top: calc(100% + 8px);
  right: 0;
  width: 190px;
  padding: 8px;
  border: var(--border-thin) solid var(--color-border);
  border-radius: var(--radius-board);
  background: var(--color-page);
}

.more-popover a {
  width: 100%;
  min-height: 44px;
  padding-inline: 12px;
  display: flex;
  align-items: center;
  border-radius: var(--radius-small);
  font-size: 14px;
  font-weight: 650;
}

.more-popover a:hover,
.more-popover a[aria-current="page"] {
  background: var(--color-panel-soft);
  color: var(--color-panel);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 9px;
}

.language-menu {
  position: relative;
}

.language-button {
  min-height: 42px;
  padding-inline: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: var(--border-thin) solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-page);
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 650;
}

.language-popover {
  position: absolute;
  z-index: 6;
  top: calc(100% + 8px);
  right: 0;
  width: 168px;
  padding: 8px;
  border: var(--border-thin) solid var(--color-border);
  border-radius: var(--radius-board);
  background: var(--color-page);
}

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

.language-popover a {
  width: 100%;
  min-height: 42px;
  padding-inline: 11px;
  display: flex;
  align-items: center;
  border-radius: var(--radius-small);
  font-size: 13px;
}

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

.login-button {
  min-height: 42px;
  padding-inline: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: var(--border-thin) solid var(--color-panel);
  border-radius: var(--radius-control);
  background: var(--color-panel);
  color: var(--color-white);
  font-size: 14px;
  font-weight: 750;
}

.login-button:hover {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-panel);
}

.menu-toggle {
  min-width: 44px;
  min-height: 44px;
  padding: 9px;
  display: none;
  align-items: center;
  justify-content: center;
  border: var(--border-thin) solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-page);
  color: var(--color-panel);
}

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

.mobile-veil {
  position: fixed;
  z-index: 98;
  inset: var(--header-height) 0 0;
  background: var(--color-overlay);
}

.mobile-veil[hidden] {
  display: none;
}

.mobile-drawer {
  position: fixed;
  z-index: 101;
  top: var(--header-height);
  right: 0;
  left: 0;
  max-height: calc(100dvh - var(--header-height));
  overflow-y: auto;
  padding: 12px var(--gutter) 22px;
  border-top: var(--border-thin) solid var(--color-border);
  border-bottom: var(--border-thin) solid var(--color-border);
  background: var(--color-page);
  overscroll-behavior: contain;
}

.mobile-drawer[hidden] {
  display: none;
}

.mobile-drawer a {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  border-radius: var(--radius-small);
  font-weight: 680;
}

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

.mobile-language-title {
  margin: 14px 13px 4px;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.site-footer {
  margin-top: var(--space-section);
  background: var(--color-panel);
  color: var(--color-white-muted);
}

.footer-grid {
  padding-top: 66px;
  padding-bottom: 48px;
  display: grid;
  grid-template-columns: 1.35fr 1fr 1.3fr 1fr;
  gap: 44px;
}

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

.footer-brandline {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--color-white);
  font-size: 20px;
  font-weight: 800;
}

.footer-brandline img {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-logo);
}

.footer-brand p {
  margin-top: 18px;
  color: var(--color-white-soft);
  font-size: 14px;
}

.footer-column h2 {
  margin-bottom: 14px;
  color: var(--color-white);
  font-size: 14px;
  letter-spacing: 0.03em;
}

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

.footer-links a {
  display: inline-flex;
  padding-block: 4px;
  color: var(--color-white-soft);
  font-size: 13px;
}

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

.footer-bottom {
  min-height: 72px;
  padding-block: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: var(--border-thin) solid var(--color-panel-line);
  color: var(--color-white-soft);
  font-size: 12px;
}

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

.reveal {
  transition:
    opacity 620ms ease,
    transform 620ms ease;
}

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

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

body:has(.toc-tabs) section[id] {
  scroll-margin-top: calc(var(--toc-offset) + 28px);
}

.prose {
  min-width: 0;
}

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

.prose h2 {
  margin-top: 2.5em;
}

.prose h3 {
  margin-top: 2em;
}

.prose img,
.prose table {
  max-width: 100%;
}

.icon-stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-fill {
  fill: currentColor;
}

.flag-white {
  fill: var(--color-flag-white);
}

.flag-red {
  fill: var(--color-flag-red);
}

.flag-blue {
  fill: var(--color-flag-blue);
}

.flag-deep-blue {
  fill: var(--color-flag-deep-blue);
}

.flag-black {
  fill: var(--color-flag-black);
}

.flag-none {
  fill: none;
}

@media (max-width: 1080px) {
  .desktop-nav .nav-link {
    padding-inline: 9px;
  }

  .language-menu {
    display: none;
  }

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

@media (max-width: 900px) {
  :root {
    --header-height: 76px;
    --space-section: 74px;
  }

  .desktop-nav {
    display: none;
  }

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

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

  .brand-local {
    display: none;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: clamp(28px, 9.6vw, 40px);
    line-height: 1.12;
  }

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

  .footer-grid {
    gap: 34px 24px;
  }

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

  .decorative-label,
  .hero-coordinate {
    display: none;
  }
}

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

  .wrap,
  .reading-wrap,
  .nav-shell {
    padding-inline: var(--gutter);
  }

  .login-button {
    min-width: 64px;
    padding-inline: 13px;
  }

  .brand-copy {
    display: none;
  }

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

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

  .absolute-decoration,
  [class*="watermark"],
  [class*="glow-disc"] {
    max-width: 100%;
  }

  .button,
  .button-primary,
  .button-secondary,
  .button-ghost {
    max-width: 100%;
  }
}

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

  .header-tools {
    gap: 6px;
  }

  .login-button {
    min-width: 58px;
    padding-inline: 10px;
  }
}

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

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

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