:root {
  --blue: #0055ff;
  --blue-dark: #0044cc;
  --ink: #1a1a1a;
  --bg: #ffffff;
  --muted: #f3f3f3;
  --muted-fg: #606060;
  --border: #d4d4d4;
  --diagram: #11151b;
  --error: #b42318;
  --ok: #067647;
  --sans: "Geist", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
.mono { font-family: var(--mono); }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 880px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* Header */
.top {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 880px; margin: 0 auto; padding: 20px 16px;
  border-bottom: 1px solid var(--border);
}
@media (min-width: 720px) { .top { padding: 24px 32px; } }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 20px; letter-spacing: -0.03em; }
.handle { font-size: 13px; color: var(--muted-fg); }

/* Hero */
.hero { padding: 56px 0 40px; }
@media (min-width: 720px) { .hero { padding: 88px 0 56px; } }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 20px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted-fg);
}
.eyebrow.light { color: #a8a8a8; }
.sq { width: 8px; height: 8px; background: var(--blue); display: inline-block; }
h1 {
  margin: 0; font-weight: 600; letter-spacing: -0.04em; line-height: 1.02;
  font-size: clamp(38px, 8vw, 68px); max-width: 15ch;
}
.accent { color: var(--blue); }
.lede { margin: 24px 0 0; font-size: 18px; color: var(--muted-fg); max-width: 52ch; }

/* Gate */
.gate {
  background: var(--ink); color: #fff;
  display: grid; gap: 28px;
  padding: 28px 20px; margin: 0 0 48px;
  scroll-margin-top: 16px;
}
@media (min-width: 720px) { .gate { grid-template-columns: 1fr 1.1fr; gap: 40px; padding: 40px; } }
.gate h2 { margin: 0; font-size: 28px; line-height: 1.1; letter-spacing: -0.03em; font-weight: 600; }
.gate-sub { margin: 14px 0 0; color: #bbbbbb; font-size: 15px; }
.gate-sub strong { color: #fff; font-weight: 500; }

.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: #a8a8a8; }
.form input[type="email"], .form select {
  width: 100%; height: 48px; padding: 0 14px;
  background: #252525; border: 1px solid #404040; border-radius: 0; color: #fff;
  font-size: 16px; outline: none; appearance: none; -webkit-appearance: none;
}
.form select {
  background-image: linear-gradient(45deg, transparent 50%, #bbb 50%), linear-gradient(135deg, #bbb 50%, transparent 50%);
  background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px;
  background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px;
}
.form select:invalid { color: #8a8a8a; }
.form option { color: var(--ink); background: #fff; }
.form input:focus, .form select:focus { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.form input::placeholder { color: #7a7a7a; }

.check { display: grid; grid-template-columns: 20px 1fr; gap: 12px; align-items: start; font-size: 13px; color: #bbbbbb; line-height: 1.5; cursor: pointer; }
.check input {
  appearance: none; -webkit-appearance: none; margin: 1px 0 0;
  width: 20px; height: 20px; border: 1px solid #5a5a5a; background: #252525; border-radius: 0; cursor: pointer;
  display: grid; place-content: center;
}
.check input:checked { background: var(--blue); border-color: var(--blue); }
.check input:checked::after { content: ""; width: 10px; height: 6px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
.check input:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.check a { color: #fff; text-underline-offset: 3px; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 52px; padding: 0 20px; border: 0; border-radius: 0;
  background: var(--blue); color: #fff; font-weight: 600; font-size: 16px; cursor: pointer;
  transition: background .15s ease;
}
.btn:hover { background: var(--blue-dark); }
.btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn svg { transition: transform .15s ease; }
.btn:hover svg { transform: translate(2px, -2px); }

.msg { margin: 0; min-height: 1.4em; font-size: 14px; }
.msg.err { color: #ff8a80; }

.unlocked { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted-fg); margin: 0 0 24px; text-transform: uppercase; letter-spacing: .08em; }
.dot { width: 8px; height: 8px; background: var(--ok); display: inline-block; }

/* List */
.list-head {
  display: flex; justify-content: space-between;
  font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted-fg);
  padding-bottom: 12px; border-bottom: 2px solid var(--ink);
}
.list { list-style: none; margin: 0; padding: 0; }
.item { border-bottom: 1px solid var(--border); scroll-margin-top: 16px; }
.item.flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 40% { background: #eaf1ff; } 100% { background: transparent; } }

.row {
  width: 100%; display: grid; grid-template-columns: 36px 1fr; gap: 12px 16px;
  padding: 22px 0; background: none; border: 0; text-align: left; cursor: pointer; color: inherit;
}
@media (min-width: 720px) { .row { grid-template-columns: 56px 1fr auto; align-items: start; padding: 28px 0; } }
.row:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.idx { font-family: var(--mono); font-size: 13px; color: var(--muted-fg); padding-top: 3px; }
.meta { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.tag { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 3px 7px; border: 1px solid var(--ink); }
.date { font-family: var(--mono); font-size: 11px; color: var(--muted-fg); }
.title { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
.desc { margin: 8px 0 0; color: var(--muted-fg); font-size: 15px; max-width: 60ch; }
.act {
  grid-column: 2; justify-self: start;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--blue);
}
@media (min-width: 720px) { .act { grid-column: 3; padding-top: 4px; } }
.act .lock { width: 12px; height: 12px; }
.row:hover .title { color: var(--blue); }

.body { padding: 0 0 28px 52px; }
@media (min-width: 720px) { .body { padding: 0 0 32px 72px; } }
@media (max-width: 719px) { .body { padding-left: 0; } }
.note { margin: 0 0 14px; font-size: 14px; color: var(--muted-fg); border-left: 2px solid var(--blue); padding-left: 12px; }
.code {
  position: relative; background: var(--diagram); color: #e8e8e8;
}
.code pre {
  margin: 0; padding: 20px; padding-top: 52px; overflow-x: auto; max-height: 420px;
  font-family: var(--mono); font-size: 13px; line-height: 1.6; white-space: pre-wrap; word-break: break-word;
}
.copy {
  position: absolute; top: 0; right: 0; height: 36px; padding: 0 14px;
  background: var(--blue); color: #fff; border: 0; border-radius: 0;
  font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; cursor: pointer;
}
.copy:hover { background: var(--blue-dark); }
.link-out {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 14px;
  height: 44px; padding: 0 16px; border: 1px solid var(--ink); text-decoration: none; font-weight: 500;
}
.link-out:hover { background: var(--ink); color: #fff; }

/* Footer */
.foot {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding-top: 64px; padding-bottom: 40px; font-size: 13px; color: var(--muted-fg);
}
.foot nav { display: flex; gap: 20px; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--blue); }

/* Legal page */
.legal { padding: 56px 0 24px; max-width: 68ch; }
.legal h1 { font-size: clamp(32px, 6vw, 48px); max-width: none; margin-bottom: 8px; }
.legal h2 { font-size: 18px; margin: 36px 0 8px; letter-spacing: -0.01em; }
.legal p, .legal li { color: #333; font-size: 15px; }
.legal ul { padding-left: 20px; }
.legal .upd { font-family: var(--mono); font-size: 12px; color: var(--muted-fg); margin: 0 0 32px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
