:root {
  --bg: #0f1411;
  --surface: #171f1a;
  --raised: #202a24;
  --line: #2c3830;
  --text: #f1f4ef;
  --muted: #a7b4aa;
  --green: #5fd068;
  --green-ink: #0b1a0d;
  --amber: #f2a649;
  --red: #ff7a6b;
  --radius: 14px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; word-break: keep-all; }
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2 { margin: 0; letter-spacing: -0.02em; line-height: 1.25; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
.skip-link { position: absolute; left: 16px; top: -48px; z-index: 50; padding: 8px 14px; background: var(--green); color: var(--green-ink); border-radius: 8px; font-weight: 700; }
.skip-link:focus { top: 12px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: rgb(15 20 17 / 0.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.2rem; text-decoration: none; }
.version { padding: 2px 10px; border-radius: 999px; background: var(--amber); color: #2a1a05; font-size: 0.8rem; font-weight: 800; }
.world-status { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; color: var(--muted); font-size: 0.875rem; font-weight: 600; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
[data-state="online"] .status-dot { background: var(--green); box-shadow: 0 0 0 4px rgb(95 208 104 / 0.2); }
[data-state="degraded"] .status-dot { background: var(--amber); }
[data-state="offline"] .status-dot { background: var(--red); }
.header-link { padding: 8px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 0.95rem; text-decoration: none; }
.header-link:hover { color: var(--text); background: var(--raised); }

/* Buttons */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px; border-radius: 10px; border: 2px solid transparent; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; transition: transform .15s, background .15s; }
.button:hover { transform: translateY(-2px); }
.button.primary { background: var(--green); color: var(--green-ink); box-shadow: 0 4px 0 #2f8a3a; }
.button.primary:hover { background: #74db7c; }
.button.ghost { background: rgb(255 255 255 / 0.08); border-color: rgb(255 255 255 / 0.35); color: var(--text); }
.button.ghost:hover { background: rgb(255 255 255 / 0.16); }
.button.big { min-height: 56px; padding: 0 32px; font-size: 1.1rem; }

/* Hero */
.hero { position: relative; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgb(10 14 12 / 0.94) 0%, rgb(10 14 12 / 0.65) 50%, rgb(10 14 12 / 0.2) 85%), linear-gradient(0deg, var(--bg), transparent 30%); }
.hero-inner { position: relative; padding: 96px 0 72px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.6rem); font-weight: 900; max-width: 12em; text-shadow: 0 2px 24px rgb(0 0 0 / 0.5); }
.lead { margin-top: 16px; max-width: 32em; font-size: 1.1rem; color: #dfe6e0; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.residents { margin-top: 48px; max-width: 640px; }
.residents-title { color: var(--muted); font-size: 0.875rem; font-weight: 700; margin-bottom: 10px; }
.resident-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.resident { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 10px; background: rgb(23 31 26 / 0.85); border: 1px solid var(--line); }
.resident::before { content: ""; width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--muted); }
.resident[data-state="online"]::before { background: var(--green); }
.resident[data-state="busy"]::before,
.resident[data-state="working"]::before { background: var(--amber); }
.resident[data-state="offline"]::before { background: var(--red); }
.resident strong { min-width: 5.5em; }
.resident span { color: var(--muted); font-size: 0.9rem; overflow-wrap: anywhere; }

/* Boards */
.boards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 48px 0; }
.board { padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.board h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: 12px; }
.board-list { list-style: none; padding: 0; margin: 0; }
.row { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.row time { color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.row-title { font-weight: 600; font-size: 0.95rem; }
.tag { padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; white-space: nowrap; background: var(--raised); color: var(--muted); }
.tag[data-tone="accent"] { background: rgb(95 208 104 / 0.18); color: var(--green); }
.tag[data-tone="warn"] { background: rgb(242 166 73 / 0.18); color: var(--amber); }

/* Waitlist */
.waitlist { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; padding: 56px 0 88px; border-top: 1px solid var(--line); }
.waitlist h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; margin-bottom: 12px; }
.waitlist p { color: var(--muted); }
.waitlist p a { color: var(--green); font-weight: 600; }
.waitlist-form[hidden], [data-form-fallback="waitlist"][hidden] { display: none; }
.form-note { color: var(--muted); font-size: 0.8rem; }
.waitlist > .button { justify-self: start; }
.waitlist-form { display: grid; gap: 8px; padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.waitlist-form label { font-weight: 700; font-size: 0.9rem; margin-top: 6px; }
.optional { color: var(--muted); font-weight: 400; }
.waitlist-form input, .waitlist-form textarea { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
.waitlist-form input::placeholder, .waitlist-form textarea::placeholder { color: #7f8c83; }
.waitlist-form .button { margin-top: 12px; }
.form-result { min-height: 1.5em; font-size: 0.9rem; font-weight: 600; }
.form-result[data-state="ok"] { color: var(--green); }
.form-result[data-state="error"] { color: var(--red); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0; color: var(--muted); font-size: 0.85rem; }
.site-footer p + p { margin-top: 6px; }

@media (max-width: 960px) {
  .boards { grid-template-columns: 1fr; }
  .waitlist { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; gap: 8px 12px; padding: 10px 0; }
  .world-status { order: 3; width: 100%; margin: 0; }
  .header-link { margin-left: auto; }
  .hero-inner { padding: 64px 0 48px; }
  .hero-shade { background: linear-gradient(0deg, var(--bg) 15%, rgb(10 14 12 / 0.75) 60%, rgb(10 14 12 / 0.4)); }
  .actions .button { flex: 1 1 100%; }
  .row { grid-template-columns: 1fr auto; }
  .row time { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* youth protection policy (verbatim terms) */
.policy { padding: 24px 0 40px; }
.policy details { border: 1px solid var(--line); border-radius: 14px; padding: 4px 20px; }
.policy summary { cursor: pointer; list-style: none; padding: 14px 0; }
.policy summary::-webkit-details-marker { display: none; }
.policy summary h2 { display: inline; font-size: 1.05rem; }
.policy summary::after { content: " ▾"; color: var(--muted); }
.policy details[open] summary::after { content: " ▴"; }
.policy-body { padding: 4px 0 18px; font-size: 0.92rem; line-height: 1.75; }
.policy-body p + p { margin-top: 8px; }
.policy-body hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
