:root {
  --bg: #F5ECDD;
  --panel: #FCF7EE;
  --panel-2: #ECE1D0;
  --border: #CEC2B3;
  --accent: #373039;
  --accent-dark: #272229;
  --text: #2C241F;
  --muted: #6E6259;
  --link: #62618C;
  --highlight: #DFDAE6;
  --on-accent: #FCF7EE;
  --success: #586F60;
  --warn: #876A3C;
  --error: #975952;
  --clear: transparent;
  --flag-white: #FFFFFF;
  --flag-red: #D52B3C;
  --flag-blue: #2D3961;
  --metal-light: #E6DDD3;
  --metal-mid: #B3AAA6;
  --metal-dark: #797077;
  --rim: #746B77;
  --wave-ink: rgba(98, 97, 140, .09);
  --wave-fade: rgba(98, 97, 140, 0);
  --line-soft: rgba(110, 98, 89, .16);
  --paper-glass: rgba(252, 247, 238, .93);
  --shine: rgba(252, 247, 238, .72);
  --veil: rgba(39, 34, 41, .3);
  --display: 'Inter', 'Noto Sans SC', 'Noto Sans JP', 'Noto Sans KR', system-ui, sans-serif;
  --body: 'Inter', 'Noto Sans SC', 'Noto Sans JP', 'Noto Sans KR', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
  --fs-display: 64px;
  --fs-display-small: 56px;
  --fs-mobile: 36px;
  --fs-body: 18px;
  --fs-logo: 25px;
  --fs-section: 24px;
  --fs-heading: 32px;
  --fs-md: 16px;
  --fs-small: 14px;
  --fs-ui: 13px;
  --fs-fine: 11px;
  --fs-micro: 10px;
  --fs-stat: 32px;
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-heavy: 900;
  --tracking-display: -.02em;
  --tracking-label: .13em;
  --tracking-ui: .06em;
  --leading-body: 1.85;
  --leading-heading: 1.25;
  --r-panel: 8px;
  --r-button: 999px;
  --r-mark: 12px;
  --r-screen: 5px;
  --r-flag: 3px;
  --r-device: 14px;
  --r-mobile: 30px;
  --r-mobile-inner: 24px;
  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 32px;
  --s5: 40px;
  --s6: 48px;
  --s8: 64px;
  --s10: 80px;
  --s12: 96px;
  --gutter: 72px;
  --page-max: 1440px;
  --prose-max: 800px;
  --header-height: 96px;
  --anchor-offset: 112px;
  --toc-top: 16px;
  --toc-offset: 112px;
  --focus-width: 2px;
  --focus-offset: 4px;
  --duration-fast: .18s;
  --duration-reveal: .6s;
  --ease-out: cubic-bezier(.2, .7, .25, 1);
  --shadow-device: 0 28px 56px rgba(98, 97, 140, .14), 0 8px 16px rgba(55, 48, 57, .12);
  --shadow-mobile: 0 24px 40px rgba(98, 97, 140, .19), 0 5px 10px rgba(55, 48, 57, .19);
  --shadow-slip: 0 12px 28px rgba(98, 97, 140, .11), 0 2px 4px rgba(55, 48, 57, .04);
  --shadow-button: 0 4px 8px rgba(55, 48, 57, .12);
  --shadow-inset: inset 0 0 0 1px rgba(252, 247, 238, .45);
  --shadow-base: 0 10px 14px var(--wave-ink);
  --shadow-notch: inset 0 1px 3px var(--metal-dark);
  --shadow-flag: 0 0 0 1px var(--line-soft);
  --shadow-selected: inset 0 3px 0 var(--link), var(--shadow-slip);
  --paper-gradient: linear-gradient(180deg, var(--panel), var(--bg));
  --shell-gradient: linear-gradient(145deg, var(--rim), var(--accent) 18%, var(--accent-dark) 80%);
  --metal-gradient: linear-gradient(180deg, var(--metal-light), var(--metal-mid) 55%, var(--metal-dark));
  --underline-gradient: linear-gradient(var(--clear) 76%, var(--highlight) 76%, var(--highlight) 94%, var(--clear) 94%);
}
* { box-sizing: border-box; }
html {
  color-scheme: light;
  scroll-behavior: smooth;
  scroll-padding-top: var(--anchor-offset);
}
html.nav-open { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: var(--fs-md);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  transition: color var(--duration-fast), background-color var(--duration-fast);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: var(--focus-width) solid var(--link);
  outline-offset: var(--focus-offset);
}
svg { display: block; flex-shrink: 0; }
img { display: block; max-width: 100%; height: auto; }
p, h1, h2, h3, h4, figure, blockquote { margin: 0; }
h1, h2, h3, h4 {
  font-family: var(--display);
  line-height: var(--leading-heading);
  overflow-wrap: break-word;
  text-wrap: balance;
}
h1 {
  font-size: var(--fs-display);
  font-weight: var(--weight-heavy);
  letter-spacing: var(--tracking-display);
  line-height: 1.2;
}
h2 { font-size: var(--fs-heading); font-weight: var(--weight-bold); }
h3 { font-size: var(--fs-section); font-weight: var(--weight-bold); }
ul, ol { margin-block: 0; padding-inline-start: var(--s3); }
code {
  font-family: var(--mono);
  font-size: .9em;
  overflow-wrap: anywhere;
}
pre {
  max-width: 100%;
  overflow-x: auto;
  padding: var(--s3);
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  background: var(--panel-2);
  -webkit-overflow-scrolling: touch;
}
pre code { white-space: pre; overflow-wrap: normal; }
:where(main, article, section, aside, nav, div, li) { min-width: 0; }
.no-break { white-space: nowrap; }
.frame, .wrap {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section {
  padding-top: var(--s10);
  padding-bottom: var(--s10);
}
.section-heading { margin-bottom: var(--s4); }
.section-heading p { margin-top: var(--s2); color: var(--muted); max-width: 720px; }
.stack > * + * { margin-top: var(--s3); }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.prose {
  max-width: var(--prose-max);
  font-size: var(--fs-body);
  overflow-wrap: break-word;
}
.prose > * + * { margin-top: var(--s3); }
.prose h2 { margin-top: var(--s8); }
.prose h3 { margin-top: var(--s5); }
.prose li + li { margin-top: var(--s1); }
.prose section + section { margin-top: var(--s8); }
.prose section > * + * { margin-top: var(--s3); }
.panel {
  padding: var(--s4);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  box-shadow: var(--shadow-inset);
}
.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.symbol-bank { position: absolute; width: 0; height: 0; overflow: hidden; }
.button, .login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  border: 1px solid var(--accent);
  border-radius: var(--r-button);
  font-weight: var(--weight-bold);
  transition: background-color var(--duration-fast), color var(--duration-fast), transform var(--duration-fast);
}
.button {
  gap: var(--s3);
  min-height: 56px;
  padding: var(--s1) var(--s4);
  font-size: var(--fs-md);
}
.button-primary, .btn-primary {
  color: var(--on-accent);
  background: var(--accent);
  box-shadow: var(--shadow-button);
  border-radius: var(--r-button);
}
.button-primary:hover, .login:hover, .button-primary.is-hover { background: var(--accent-dark); }
.button-secondary { background: var(--panel); color: var(--accent); }
.button-secondary:hover { background: var(--panel-2); }
.button:active, .button.is-pressed { transform: translateY(1px); }
.button.is-focus { outline: var(--focus-width) solid var(--link); outline-offset: var(--focus-offset); }
.button:disabled, .button[aria-disabled="true"] {
  color: var(--muted);
  background: var(--panel-2);
  border-color: var(--border);
  box-shadow: none;
}
.button-small { min-height: 44px; padding: var(--s1) var(--s3); font-size: var(--fs-small); }
.text-link { display: inline-flex; align-items: center; gap: var(--s1); min-height: 24px; }
#site-header { position: relative; z-index: 60; }
.masthead {
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: var(--s4);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  color: var(--text);
  text-decoration: none;
  font-size: var(--fs-logo);
  font-weight: var(--weight-heavy);
  letter-spacing: var(--tracking-display);
  line-height: 1.2;
}
.brand-symbol { width: 40px; height: 40px; border-radius: var(--r-mark); flex-shrink: 0; }
.brand-secondary { font-weight: var(--weight-medium); color: var(--muted); }
.navigation { display: flex; align-items: center; justify-content: center; gap: 22px; margin-left: auto; }
.navigation a {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  font-size: var(--fs-ui);
  font-weight: var(--weight-medium);
}
.navigation a:hover, .navigation a[aria-current="page"] { color: var(--link); }
.navigation .icon { width: 15px; height: 15px; }
.header-actions { display: flex; align-items: center; gap: var(--s3); flex-shrink: 0; }
.login {
  gap: var(--s1);
  min-width: 88px;
  min-height: 42px;
  padding: var(--s1) var(--s2);
  background: var(--accent);
  color: var(--on-accent);
  font-size: var(--fs-small);
  font-weight: var(--weight-semibold);
}
.language-picker { position: relative; }
.language-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: var(--clear);
  color: var(--muted);
  font-size: var(--fs-ui);
  white-space: nowrap;
}
.language-label .icon { width: 14px; height: 14px; }
.language-options {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 90;
  min-width: 168px;
  padding: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  background: var(--panel);
  box-shadow: var(--shadow-slip);
}
.language-options a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: var(--s1) var(--s2);
  color: var(--text);
  text-decoration: none;
  border-radius: var(--r-screen);
}
.language-options a:hover, .language-options a[aria-current="true"] { background: var(--highlight); }
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  background: var(--panel);
  color: var(--accent);
}
.nav-drawer {
  position: fixed;
  top: var(--header-height);
  inset-inline: var(--s2);
  z-index: 80;
  max-height: calc(100dvh - var(--header-height) - var(--s2));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--s2);
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  background: var(--panel);
  box-shadow: var(--shadow-device);
}
.nav-drawer a {
  display: flex;
  width: 100%;
  align-items: center;
  gap: var(--s2);
  min-height: 44px;
  padding: 12px var(--s2);
  color: var(--text);
  text-decoration: none;
  border-radius: var(--r-screen);
}
.nav-drawer a:hover, .nav-drawer a[aria-current] { background: var(--highlight); }
.drawer-languages { margin-top: var(--s2); padding-top: var(--s2); border-top: 1px solid var(--border); }
.nav-veil { position: fixed; inset: 0; z-index: 50; border: 0; background: var(--veil); cursor: default; }
.skip-link {
  position: absolute;
  top: var(--s1);
  left: var(--s2);
  z-index: 100;
  padding: var(--s1) var(--s2);
  background: var(--panel);
  color: var(--accent);
  border-radius: var(--r-panel);
  transform: translateY(-200%);
}
.skip-link:focus { transform: translateY(0); }
.site-footer {
  margin-top: var(--s6);
  padding-top: var(--s8);
  padding-bottom: var(--s4);
  border-top: 1px solid var(--border);
  background: var(--paper-gradient);
}
.footer-grid { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: var(--s8); }
.footer-brand p { margin-top: var(--s3); color: var(--muted); max-width: 380px; font-size: var(--fs-small); }
.footer-heading { margin-bottom: var(--s2); font-size: var(--fs-md); font-weight: var(--weight-bold); }
.footer-links { display: grid; gap: var(--s1); list-style: none; padding: 0; }
.footer-links a { display: inline-flex; align-items: center; min-height: 24px; text-decoration: none; font-size: var(--fs-small); color: var(--muted); }
.footer-links a:hover { color: var(--link); text-decoration: underline; }
.footer-languages, .footer-legal { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); }
.footer-languages { margin-top: var(--s5); }
.footer-languages a, .footer-legal a { min-height: 24px; font-size: var(--fs-small); }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-top: var(--s4);
  padding-top: var(--s3);
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: var(--fs-small);
}
.reveal { transition: opacity var(--duration-reveal), transform var(--duration-reveal) var(--ease-out); }
.reveal.pending { opacity: 0; transform: translateY(16px); }
.reveal.shown { opacity: 1; transform: none; }
#server-status {
  position: relative;
  display: block;
  min-width: 0;
  max-width: 100%;
  min-height: var(--s8);
  overflow: hidden;
  margin-top: var(--s3);
  margin-bottom: var(--s4);
}
#server-status > * { min-width: 0; max-width: 100%; }
#server-status + * { margin-top: var(--s4); }
@media (max-width: 1279px) {
  :root { --gutter: 40px; }
  .masthead { gap: var(--s3); }
  .navigation { gap: 12px; }
  .navigation a { gap: 4px; font-size: var(--fs-fine); }
  .header-actions { gap: var(--s2); }
  .language-label { font-size: var(--fs-fine); }
  h1 { font-size: var(--fs-display-small); }
}
@media (max-width: 1050px) {
  :root { --gutter: 24px; --header-height: 88px; }
  .masthead { justify-content: space-between; gap: 12px; }
  .masthead > .navigation { display: none; }
  .header-actions { margin-left: auto; }
  .menu-toggle { display: inline-flex; }
  .footer-grid { gap: var(--s4); }
}
@media (max-width: 768px) {
  h1 { font-size: var(--fs-mobile); line-height: var(--leading-heading); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  :root { --gutter: 20px; --header-height: 76px; }
  .no-break { white-space: normal; }
  .section { padding-top: var(--s6); padding-bottom: var(--s6); }
  .brand { font-size: var(--fs-section); gap: var(--s1); }
  .brand-symbol { width: 34px; height: 34px; }
  .masthead { gap: var(--s1); }
  .header-actions { gap: var(--s1); margin-left: auto; }
  .language-label { font-size: var(--fs-fine); }
  .login { min-width: 62px; min-height: 36px; padding: 6px 12px; font-size: var(--fs-ui); }
  .login .icon { display: none; }
  .button { min-height: 48px; padding: var(--s1) 23px; font-size: var(--fs-small); gap: var(--s2); }
  .panel { padding: var(--s3); }
  .prose { font-size: var(--fs-md); }
  h2 { font-size: var(--fs-section); }
  h3 { font-size: var(--fs-body); }
  .tilt, .paper-slip { transform: none; }
  .canvas, [data-hero-visual], .atmosphere { max-width: 100%; }
  .footer-grid { gap: var(--s4); }
}
@media (max-width: 359px) {
  .brand { font-size: var(--fs-body); }
  .brand-symbol { width: 30px; height: 30px; }
  .header-actions { gap: 4px; }
  .language-label { max-width: 44px; white-space: normal; line-height: 1.3; }
  .language-label .icon { display: none; }
  .login { min-width: 52px; padding-inline: var(--s1); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; }
  .reveal, .reveal.pending, .reveal.shown { opacity: 1; transform: none; }
}