:root {
  --bg: #faf8fd;
  --surface: #ffffff;
  --surface-2: #f2eef9;
  --text: #1d1828;
  --muted: #5d5670;
  --border: #e2dcee;
  --accent: #6b3fd1;
  --accent-text: #ffffff;
  --gold: #a87a12;
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14111c;
    --surface: #1d1828;
    --surface-2: #251f33;
    --text: #ece8f4;
    --muted: #a9a1bb;
    --border: #342c45;
    --accent: #b48cff;
    --accent-text: #14111c;
    --gold: #e2b84b;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

/* Korean breaks between words; Chinese and Japanese must keep breaking between characters. */
:lang(ko) body, body:lang(ko) { word-break: keep-all; }
body:lang(ja) { font-family: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans JP", sans-serif; }
body:lang(zh-CN) { font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; }
body:lang(zh-TW) { font-family: system-ui, -apple-system, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif; }

a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 780px; }

/* Header */
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; }
.brand img { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; }
.site-nav { display: flex; gap: 4px 16px; flex-wrap: wrap; font-size: 15px; }
.site-nav { align-items: center; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
.lang-menu { position: relative; }
.lang-menu summary { cursor: pointer; color: var(--muted); list-style: none; padding: 2px 10px; border: 1px solid var(--border); border-radius: 8px; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary::after { content: " ▾"; }
.lang-menu[open] summary { color: var(--text); }
.lang-menu ul { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; margin: 0; padding: 6px 0; list-style: none; min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); }
.lang-menu li a { display: block; padding: 6px 14px; color: var(--text); }
.lang-menu li a:hover { background: var(--surface-2); }
.lang-menu li a[aria-current="true"] { color: var(--accent); font-weight: 600; }
.notice.translation { font-size: 14px; color: var(--muted); }

/* Home */
.hero { padding: 56px 0 40px; }
.hero-inner { display: flex; gap: 32px; align-items: center; flex-wrap: wrap; }
.hero-icon { width: 160px; height: 160px; border-radius: 32px; object-fit: cover; border: 1px solid var(--border); background: var(--surface); flex: none; }
.hero-text { flex: 1 1 320px; }
.hero h1 { font-size: clamp(30px, 6vw, 44px); line-height: 1.2; margin: 0 0 12px; }
.tagline { font-size: 18px; color: var(--muted); margin: 0 0 24px; }
.buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.button { display: inline-block; padding: 11px 20px; border-radius: 10px; font-weight: 600; text-decoration: none; border: 1px solid var(--accent); }
.button.primary { background: var(--accent); color: var(--accent-text); }
.button.secondary { color: var(--accent); }

.section { padding: 32px 0; border-top: 1px solid var(--border); }
.section h2 { font-size: 24px; margin: 0 0 16px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; padding: 0; margin: 0; list-style: none; }
.features li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.features h3 { font-size: 17px; margin: 0 0 6px; color: var(--gold); }
.features p { margin: 0; color: var(--muted); font-size: 15px; }
.info-card { background: var(--surface-2); border-radius: var(--radius); padding: 20px; }
.info-card p:first-child { margin-top: 0; }
.info-card p:last-child { margin-bottom: 0; }

/* Legal documents */
.doc { padding: 40px 0 56px; }
.doc h1 { font-size: clamp(26px, 5vw, 34px); line-height: 1.3; margin: 0 0 8px; }
.doc .meta { color: var(--muted); font-size: 15px; margin: 0 0 20px; }
.doc .notice { background: var(--surface-2); border-radius: var(--radius); padding: 14px 18px; margin: 0 0 24px; }
.doc h2 { font-size: 21px; margin: 40px 0 12px; padding-top: 8px; scroll-margin-top: 16px; }
.doc h3 { font-size: 17px; margin: 24px 0 8px; }
.doc ol, .doc ul { padding-left: 1.4em; }
.doc li { margin: 4px 0; }
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; }
.toc ol { margin: 0; columns: 2 240px; column-gap: 32px; }
.toc a { text-decoration: none; }
.table-scroll { overflow-x: auto; margin: 12px 0; border: 1px solid var(--border); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 15px; background: var(--surface); }
th, td { border-bottom: 1px solid var(--border); padding: 10px 12px; text-align: left; vertical-align: top; }
th { background: var(--surface-2); font-weight: 600; }
tr:last-child td { border-bottom: none; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 14px; padding: 24px 0 32px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 8px; padding: 0; list-style: none; }
.footer-links a { color: var(--muted); }
.site-footer p { margin: 4px 0; }
