:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #17191f;
  --muted: #5f6573;
  --line: #e1e4ea;
  --accent: #1f2a44;
  --accent-text: #ffffff;
  --focus: #3b6ef5;
  --error: #c0392b;
  --frame: #e9ebf0;
  --dot: #c9cdd6;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101216;
    --surface: #181b21;
    --text: #e9ebef;
    --muted: #9aa1ae;
    --line: #2a2f38;
    --accent: #e9ebef;
    --accent-text: #101216;
    --focus: #7c9cff;
    --error: #ff7a6b;
    --frame: #232730;
    --dot: #3a404b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101216; --surface: #181b21; --text: #e9ebef; --muted: #9aa1ae; --line: #2a2f38;
  --accent: #e9ebef; --accent-text: #101216; --focus: #7c9cff; --error: #ff7a6b;
  --frame: #232730; --dot: #3a404b; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---- buttons & fields */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 20px;
  border: 0; border-radius: 8px;
  background: var(--accent); color: var(--accent-text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
button:disabled { opacity: .6; cursor: progress; }
.field { display: grid; gap: 6px; margin: 0 0 16px; }
.field span { font-size: 14px; font-weight: 600; }
.field em { font-style: normal; font-weight: 400; color: var(--muted); }
.field input {
  width: 100%; min-height: 44px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--text); font: inherit;
}
.field input:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }

/* ---- home page */
.gate { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.card {
  width: 100%; max-width: 400px; padding: 32px 28px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card h1 { margin: 0 0 8px; font-size: 24px; line-height: 1.2; letter-spacing: -.01em; }
.card .hint { margin: 0 0 24px; color: var(--muted); font-size: 15px; }
.card button { width: 100%; }
.card .btn { width: 100%; }
.msg { min-height: 1.4em; margin: -4px 0 12px; color: var(--error); font-size: 14px; }
.msg:empty { margin-bottom: 4px; }

/* ---- project page */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; height: 52px; padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px); -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; text-decoration: none; letter-spacing: -.01em; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 40px 16px 80px; }
.head { max-width: 760px; margin-bottom: 28px; }
.kind { margin: 0 0 6px; color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.head h1 { margin: 0; font-size: clamp(28px, 5vw, 40px); line-height: 1.15; letter-spacing: -.02em; }
.lead { margin: 12px 0 0; color: var(--muted); font-size: 18px; }

.about { max-width: 760px; margin-bottom: 28px; }
.about p, .about ul { margin: 0 0 12px; }
.about ul { padding-left: 1.2em; }
.live a { font-weight: 600; }

.toc { margin: 0 0 40px; }
.toc ol { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.toc a {
  display: inline-block; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-size: 14px; text-decoration: none;
}
.toc a:hover { border-color: var(--muted); }

.screens { display: flex; flex-wrap: wrap; justify-content: center; gap: 56px 32px; }
.screen { width: 100%; margin: 0; scroll-margin-top: 72px; }
.screen--mobile { width: min(100%, 360px); }
.screen figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 12px; }
.screen .num { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; font-weight: 600; }
.screen .cap { font-size: 18px; font-weight: 650; }
.screen .note { flex-basis: 100%; color: var(--muted); font-size: 15px; }
.frame {
  overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.screen--mobile .frame { border-radius: 28px; padding: 10px; background: var(--frame); }
.screen--mobile .frame img { border-radius: 20px; }
.screen--mobile .bar { display: none; }
.bar { display: flex; gap: 6px; padding: 10px 14px; background: var(--frame); border-bottom: 1px solid var(--line); }
.bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--dot); }
.frame a { display: block; }
.frame img { width: 100%; background: var(--frame); }

/* ---- 404 / 403 */
.card--error { text-align: center; }
.card--error h1 { font-size: 48px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.card--error .hint:last-child { margin-bottom: 0; }
.unlocking #denied { display: none; }

@media (max-width: 600px) {
  .wrap { padding-top: 28px; }
  .lead { font-size: 16px; }
  .card { padding: 24px 20px; }
  .screens { gap: 40px; }
}
