/* LANDWAR: Ink Atlas — legal pages */

:root {
  --accent: #19c3b5;
  --accent-strong: #0e8f85;
  --accent-soft: rgba(25, 195, 181, 0.12);
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --text: #1a2133;
  --text-muted: #5a647a;
  --border: #dde2ec;
  --topbar-bg: #0b1020;
  --topbar-text: #f2f5fb;
  --shadow: 0 1px 2px rgba(11, 16, 32, 0.06), 0 4px 16px rgba(11, 16, 32, 0.05);
  --radius: 12px;
  --gutter: 16px;
  --col: 760px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Noto Sans", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR",
    "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", "Noto Sans JP",
    "PingFang SC", "Microsoft YaHei", "Noto Sans SC",
    "PingFang TC", "Microsoft JhengHei", "Noto Sans TC",
    "Thonburi", "Leelawadee UI", "Noto Sans Thai",
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #19c3b5;
    --accent-strong: #4fe0d3;
    --accent-soft: rgba(25, 195, 181, 0.16);
    --bg: #0b1020;
    --surface: #121a30;
    --surface-2: #18223c;
    --text: #e6eaf3;
    --text-muted: #9aa5bd;
    --border: #26314d;
    --topbar-bg: #070b17;
    --topbar-text: #f2f5fb;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.25);
  }
}

/* Per-script font priorities */
:lang(ko) { --font-lang: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR"; word-break: keep-all; }
:lang(ja) { --font-lang: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", "Noto Sans JP"; line-break: strict; }
:lang(zh-CN) { --font-lang: "PingFang SC", "Microsoft YaHei", "Noto Sans SC"; }
:lang(zh-TW) { --font-lang: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC"; }
:lang(th) { --font-lang: "Thonburi", "Leelawadee UI", "Noto Sans Thai"; }

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-lang, system-ui), var(--font);
  font-size: 16px;
  line-height: 1.7;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

:lang(th) body, body:lang(th) { line-height: 1.85; }

a { color: var(--accent-strong); text-underline-offset: 2px; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 10;
  padding: 8px 14px;
  background: var(--accent);
  color: #0b1020;
  border-radius: 8px;
  font-weight: 600;
}
.skip-link:focus { left: 8px; }

/* Top bar */
.topbar {
  background: var(--topbar-bg);
  color: var(--topbar-text);
  border-bottom: 3px solid var(--accent);
}
.topbar-inner,
.lang-row-inner,
.footer-inner {
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--topbar-text);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-decoration: none;
  font-size: 1.05rem;
}
.brand:hover { color: #fff; }
.brand-mark {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(25, 195, 181, 0.25);
  transform: rotate(45deg);
}
.brand-sub {
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--accent);
  margin-left: 2px;
}
.back-link {
  color: var(--topbar-text);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  white-space: nowrap;
}
.back-link:hover { color: #0b1020; background: var(--accent); border-color: var(--accent); }

/* Language selector row */
.lang-row {
  background: rgba(255, 255, 255, 0.04);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.lang-row-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  padding-top: 8px;
  padding-bottom: 10px;
}
.lang-row a {
  color: #c9d2e6;
  text-decoration: none;
  font-size: 0.82rem;
  line-height: 1.4;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.lang-row a:hover { color: #fff; border-color: rgba(255, 255, 255, 0.25); }
.lang-row a[aria-current="page"] {
  color: #0b1020;
  background: var(--accent);
  font-weight: 600;
}

/* Document */
.doc {
  max-width: var(--col);
  margin: 0 auto;
  padding: 36px var(--gutter) 48px;
}
.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
h1 {
  margin: 0 0 8px;
  font-size: clamp(1.75rem, 5vw, 2.4rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.meta { margin: 0 0 16px; color: var(--text-muted); font-size: 0.95rem; }
.doc-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.pill {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent-strong);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}
.pill:hover { background: var(--accent); color: #0b1020; }
.pill-ghost { background: transparent; border-color: var(--border); color: var(--text-muted); font-weight: 500; }

.intro p, .intro-lead { font-size: 1.05rem; }

/* Table of contents */
.toc {
  margin: 28px 0 36px;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.toc h2 {
  margin: 0 0 8px;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 0;
  padding: 0;
}
.toc ol { margin: 0; padding-left: 1.6em; columns: 2 260px; column-gap: 28px; }
.toc li { margin: 3px 0; break-inside: avoid; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--accent-strong); text-decoration: underline; }

/* Sections */
section { margin: 0 0 8px; }
h2 {
  margin: 40px 0 12px;
  padding-top: 8px;
  font-size: 1.35rem;
  line-height: 1.35;
  border-top: 1px solid var(--border);
}
h2 .num { color: var(--accent-strong); margin-right: 4px; }
section:first-of-type h2 { border-top: 0; margin-top: 8px; }
h3 { margin: 22px 0 8px; font-size: 1.05rem; line-height: 1.4; }
p { margin: 0 0 14px; }
ul { margin: 0 0 16px; padding-left: 1.4em; }
li { margin: 5px 0; }
li::marker { color: var(--accent-strong); }
strong { font-weight: 650; }

.note {
  padding: 12px 16px;
  background: var(--accent-soft);
  border-radius: 10px;
}

.table-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--border); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
th, td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
th { background: var(--surface-2); font-weight: 650; }
tr:last-child td { border-bottom: 0; }

.contact-box {
  margin: 40px 0 0;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Index chooser */
.chooser { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
.chooser-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.chooser-lang { font-weight: 700; }
.chooser-links { display: flex; flex-wrap: wrap; gap: 8px; }
.chooser-links a {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  text-decoration: none;
  font-size: 0.9rem;
}
.chooser-links a:hover { border-color: var(--accent); background: var(--accent-soft); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.88rem;
}
.footer-inner { padding-top: 20px; padding-bottom: 28px; }
.footer-inner p { margin: 0 0 6px; }
.biz-info { font-size: 0.82rem; line-height: 1.6; overflow-wrap: anywhere; }
.biz-info a { color: var(--text-muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--accent-strong); }

@media (max-width: 560px) {
  body { font-size: 15.5px; }
  .doc { padding-top: 24px; }
  .brand-sub { display: none; }
  .toc { padding: 14px 16px; }
  h2 { font-size: 1.2rem; margin-top: 32px; }
}

@media print {
  .topbar, .lang-row, .site-footer, .doc-links, .skip-link { display: none; }
  body { background: #fff; color: #000; }
  .toc { box-shadow: none; }
  a { color: #000; }
}
