:root {
  --color-page: #F8F4EA;
  --color-panel: #0B4A47;
  --color-panel-soft: #EEE7D9;
  --color-border: #CFC5B3;
  --color-accent: #DF692F;
  --color-accent-dark: #A94720;
  --color-text: #172825;
  --color-text-muted: #64736D;
  --color-success: #2D7658;
  --color-warning: #C77A24;
  --color-error: #B63D38;
  --color-panel-text: #F8F4EA;
  --color-panel-muted: #B9C9C2;
  --color-panel-line: #4B7A74;
  --color-panel-grid: rgba(248, 244, 234, 0.075);
  --color-panel-dot: rgba(248, 244, 234, 0.12);
  --color-panel-wash: rgba(248, 244, 234, 0.06);
  --color-accent-soft: #F4C8B3;
  --color-white: #FFFFFF;
  --color-black: #172825;
  --color-flag-red: #C8423A;
  --color-flag-blue: #315A85;
  --color-flag-navy: #263E62;
  --color-flag-pale-blue: #698EB2;
  --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-panel: 32px;
  --radius-card: 22px;
  --radius-control: 999px;
  --radius-logo: 12px;
  --radius-small: 8px;
  --line-hair: 1px;
  --header-height: 72px;
  --content-width: 1240px;
  --reading-width: 768px;
  --gutter: clamp(16px, 3vw, 32px);
  --section-space: clamp(72px, 9vw, 128px);
  --toc-top: 12px;
  --toc-scroll-offset: 92px;
  --transition-fast: 160ms ease;
  --transition-slow: 520ms cubic-bezier(.2, .7, .2, 1);
}

*,
*::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:
    linear-gradient(to right, transparent calc(50% - .5px), var(--color-border) 50%, transparent calc(50% + .5px)),
    var(--color-page);
  font-size: 16px;
  line-height: 1.7;
}

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

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

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

button {
  color: inherit;
}

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

img {
  height: auto;
}

figure,
blockquote {
  margin: 0;
}

ul,
ol {
  overflow-wrap: anywhere;
}

code {
  font-family: var(--font-mono);
  overflow-wrap: anywhere;
}

pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 20px;
  border: var(--line-hair) solid var(--color-border);
  border-radius: var(--radius-small);
  background: var(--color-panel);
  color: var(--color-panel-text);
  -webkit-overflow-scrolling: touch;
}

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

table {
  border-collapse: collapse;
}

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

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

.wrap {
  max-width: calc(var(--content-width) + var(--gutter) * 2);
}

.reading-wrap {
  max-width: calc(var(--reading-width) + var(--gutter) * 2);
}

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

.section-tight {
  padding-top: calc(var(--section-space) * .6);
  padding-bottom: calc(var(--section-space) * .6);
}

.eyebrow,
.mono-label {
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
}

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: 24px;
  font-size: clamp(52px, 5vw, 68px);
  font-weight: 760;
  letter-spacing: -.02em;
}

h2 {
  margin-bottom: 20px;
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 740;
  letter-spacing: -.018em;
}

h3 {
  margin-bottom: 14px;
  font-size: clamp(21px, 2vw, 28px);
  font-weight: 710;
}

h4 {
  margin-bottom: 10px;
  font-size: 18px;
}

p {
  margin-top: 0;
  margin-bottom: 1.15em;
}

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

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

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

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

.button,
.primary-cta,
.secondary-cta {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  max-width: 100%;
  padding: 0 22px;
  border: var(--line-hair) solid transparent;
  border-radius: var(--radius-control);
  font-weight: 720;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition:
    color var(--transition-fast),
    background-color var(--transition-fast),
    border-color var(--transition-fast);
}

.button-primary,
.primary-cta {
  color: var(--color-white);
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.button-primary:hover,
.primary-cta:hover {
  background: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
}

.button-outline,
.secondary-cta {
  color: var(--color-text);
  background: transparent;
  border-color: var(--color-border);
}

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

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

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

.button[aria-disabled="true"],
.button:disabled {
  opacity: .52;
  pointer-events: none;
}

.site-header {
  position: relative;
  z-index: 50;
  min-height: var(--header-height);
  background: var(--color-page);
  border-bottom: var(--line-hair) solid var(--color-border);
}

.header-inner {
  width: 100%;
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 16px;
  padding-inline: 20px;
}

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

.brand-logo {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  object-fit: contain;
}

.brand-name {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  white-space: nowrap;
}

.brand-name-en {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 760;
  letter-spacing: -.02em;
}

.brand-name-local {
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 550;
}

.primary-nav {
  min-width: 0;
  margin-left: auto;
}

.nav-list {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border-radius: var(--radius-control);
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.nav-link svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

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

.nav-link[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--color-accent);
}

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

.login-button,
.language-toggle,
.menu-toggle {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-control);
}

.login-button {
  padding: 0 17px;
  color: var(--color-panel-text);
  background: var(--color-panel);
  border: var(--line-hair) solid var(--color-panel);
  font-size: 13px;
  font-weight: 700;
}

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

.language-menu {
  position: relative;
}

.language-toggle {
  gap: 6px;
  padding: 0 12px;
  color: var(--color-text-muted);
  background: transparent;
  border: var(--line-hair) solid var(--color-border);
  cursor: pointer;
}

.language-toggle svg {
  width: 15px;
  height: 15px;
}

.language-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 176px;
  margin: 0;
  padding: 7px;
  list-style: none;
  border: var(--line-hair) solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-page);
}

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

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

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

.menu-toggle {
  display: none;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: var(--line-hair) solid var(--color-border);
  background: transparent;
  cursor: pointer;
}

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

.mobile-drawer,
.mobile-veil {
  display: none;
}

.panel,
.card {
  border: var(--line-hair) solid var(--color-border);
  background: var(--color-page);
}

.panel {
  border-radius: var(--radius-panel);
}

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

.paper-grid {
  background:
    linear-gradient(var(--color-border) var(--line-hair), transparent var(--line-hair)) 0 0 / 80px 80px,
    linear-gradient(90deg, var(--color-border) var(--line-hair), transparent var(--line-hair)) 0 0 / 80px 80px,
    var(--color-page);
}

.badge,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 30px;
  padding: 0 12px;
  overflow: hidden;
  border: var(--line-hair) solid var(--color-border);
  border-radius: var(--radius-control);
  color: var(--color-text-muted);
  background: var(--color-panel-soft);
  font-size: 12px;
  line-height: 1.3;
}

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

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

.reveal {
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

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

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

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

.footer-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1.2fr .8fr;
  gap: 42px;
  padding-top: 64px;
  padding-bottom: 54px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 16px;
  color: var(--color-panel-text);
}

.footer-brand img {
  width: 42px;
  height: 42px;
}

.footer-brand strong {
  font-size: 20px;
}

.footer-copy {
  max-width: 330px;
  font-size: 14px;
}

.footer-heading {
  margin: 0 0 14px;
  color: var(--color-panel-text);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.footer-links,
.footer-keywords,
.footer-languages {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links {
  columns: 2;
}

.footer-links li,
.footer-keywords li,
.footer-languages li {
  break-inside: avoid;
  margin-bottom: 8px;
}

.footer-links a,
.footer-keywords a,
.footer-languages a {
  display: inline-block;
  font-size: 13px;
}

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

.footer-bottom {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: var(--line-hair) solid var(--color-panel-line);
  font-family: var(--font-mono);
  font-size: 11px;
}

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

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

.tilt,
.tilt-card {
  transform: rotate(.35deg);
}

@media (max-width: 1180px) {
  .primary-nav .nav-link {
    padding-inline: 6px;
    font-size: 11px;
  }

  .primary-nav .nav-link svg {
    display: none;
  }

  .brand-name-local {
    display: none;
  }
}

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

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

  .language-menu {
    display: none;
  }

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

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

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

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

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

  .mobile-drawer ul {
    margin: 0;
    padding: 0;
    list-style: none;
  }

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

  .mobile-drawer a svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
  }

  .mobile-language-links {
    margin-top: 14px !important;
    border-top: var(--line-hair) solid var(--color-border);
  }

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

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

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

  .section {
    padding-top: 72px;
    padding-bottom: 72px;
  }

  .absolute-decoration,
  .decorative-caption {
    display: none !important;
  }
}

@media (max-width: 640px) {
  :root {
    --gutter: 16px;
    --radius-panel: 24px;
    --radius-card: 18px;
  }

  body {
    font-size: 15px;
  }

  .header-inner {
    gap: 8px;
    padding-inline: 12px;
  }

  .brand-logo {
    width: 35px;
    height: 35px;
  }

  .brand-name-en {
    font-size: 17px;
  }

  .login-button {
    min-height: 38px;
    padding-inline: 14px;
  }

  .button,
  .primary-cta,
  .secondary-cta {
    min-height: 48px;
    padding-inline: 17px;
  }

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

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 22px;
    padding-bottom: 22px;
  }

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

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

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

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