@font-face {
  font-family: 'Newsreader';
  src: url('/vendor/newsreader.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('/vendor/plex-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('/vendor/plex-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

:root {
  --bg: #FFFFFF;
  --ink: #1B1B1A;
  --muted: #6A6A66;
  --mark: #F3E3A6;
  --chip: #EFEDE8;
  --rule: #C9C9C6;
  --accent: #E2A600;
  --alert: #C2410C;
  --error: #B3261E;
  --btn: #141414;
  --btn-ink: #FFFFFF;
  --field: #BDBDB8;
  --placeholder: #8A8A86;
  --serif: 'Newsreader', Georgia, serif;
  --sans: 'IBM Plex Sans', 'Helvetica Neue', Helvetica, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1E1F22; --ink: #ECEBE6; --muted: #A2A39F; --mark: #5A4B14; --chip: #2E2F33;
    --rule: #55565A; --error: #FF8A80; --btn: #ECEBE6; --btn-ink: #141414; --field: #55565A;
    --placeholder: #8E8F8B; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1E1F22; --ink: #ECEBE6; --muted: #A2A39F; --mark: #5A4B14; --chip: #2E2F33;
  --rule: #55565A; --error: #FF8A80; --btn: #ECEBE6; --btn-ink: #141414; --field: #55565A;
  --placeholder: #8E8F8B; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--serif); }
[hidden] { display: none !important; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
input::placeholder { color: var(--placeholder); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Landing ---------- */
.page { min-height: 100vh; display: flex; flex-direction: column; }
.wrap { max-width: 660px; padding: 72px 32px 96px; display: flex; flex-direction: column; gap: 34px; flex: 1; }
.logo { display: block; width: 44px; height: 30px; }
.logo .ring { stroke: var(--accent); }
.logo .dot { fill: var(--ink); }
h1.headline { margin: 12px 0 0; font-weight: 400; font-size: clamp(30px, 4vw, 38px); line-height: 1.15; letter-spacing: -0.01em; }
.lede { margin: 0; font-size: 22px; line-height: 1.5; }
.muted { color: var(--muted); }
.small { font-size: 16px; line-height: 1.5; margin: 0; }

.phrase {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit;
  display: inline; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; text-decoration-color: var(--rule);
}
.phrase:hover { text-decoration-color: var(--ink); }

.chip {
  position: fixed; left: 0; top: 0; width: 46px; height: 46px; border-radius: 50%; background: var(--chip);
  box-shadow: 0 3px 12px rgba(0,0,0,0.10); display: flex; align-items: center; justify-content: center;
  pointer-events: none; z-index: 10; opacity: 0; transition: opacity 120ms ease;
}
.chip.on { opacity: 1; }
.chip svg { width: 24px; height: 24px; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; fill: none; display: none; }
.chip svg.on { display: block; }
.chip .fill-ink { fill: var(--ink); stroke: none; }
.chip .slash { stroke: var(--alert); stroke-width: 1.8; }
.chip .badge { fill: var(--accent); stroke: var(--chip); stroke-width: 1.4; }
@media (prefers-reduced-motion: reduce) { .chip { transition: none; } }

.cta {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; padding: 0; border: 0; background: none; cursor: pointer;
  font-family: inherit; font-size: 24px; color: var(--ink); min-height: 44px;
}
.cta .hl { background: linear-gradient(transparent 58%, var(--mark) 58%); padding: 0 2px; }
.cta .arrow { font-size: 20px; }

.step { display: flex; flex-direction: column; gap: 14px; }
.step.done { gap: 26px; }
.line-field { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--ink); max-width: 460px; }
.line-field.short { max-width: 300px; }
.line-field input {
  flex: 1; min-width: 0; padding: 10px 0; border: 0; outline: none; background: transparent;
  font-family: inherit; font-size: 22px; color: var(--ink); border-radius: 0;
}
.line-field input.upper { text-transform: uppercase; }
.line-field button {
  padding: 8px 4px; min-width: 44px; min-height: 44px; border: 0; background: none; cursor: pointer;
  font-family: inherit; font-size: 22px; color: var(--ink);
}
.line-field:focus-within { border-bottom-width: 2px; margin-bottom: -1px; }
.error { color: var(--error); font-size: 16px; line-height: 1.5; margin: 0; }
.picks { display: flex; flex-direction: column; gap: 10px; }
.pick {
  align-self: flex-start; padding: 4px 0; border: 0; background: none; cursor: pointer; font-family: inherit; font-size: 22px;
  color: var(--ink); text-align: left; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; text-decoration-color: var(--rule);
}
.pick:hover { text-decoration-color: var(--ink); }
.pick .dist { color: var(--muted); text-decoration: none; display: inline-block; margin-left: 6px; font-size: 18px; }
.share { display: flex; flex-direction: column; gap: 8px; }
.busy { opacity: 0.5; pointer-events: none; }

.foot {
  max-width: 660px; padding: 0 32px 40px; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; color: var(--muted);
}
.foot a { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 600px) {
  .wrap { padding: 48px 24px 64px; gap: 26px; }
  h1.headline { font-size: 30px; }
  .lede, .line-field input, .line-field button, .pick { font-size: 19px; }
  .cta { font-size: 22px; }
  .foot { padding: 0 24px 32px; }
}

/* ---------- Invite (sans, app-like) ---------- */
.invite { font-family: var(--sans); min-height: 100vh; display: flex; flex-direction: column; align-items: center; }
.invite .card { width: 100%; max-width: 440px; flex: 1; padding: 40px 28px 32px; display: flex; flex-direction: column; }
.invite .screen { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 28px; }
.wordmark { display: flex; align-items: center; gap: 12px; justify-content: center; }
.wordmark svg { width: 54px; height: 36px; }
.wordmark span { font-family: var(--serif); font-size: 48px; letter-spacing: -0.01em; }
.invite .center { text-align: center; }
.invite .lead { margin: 0; font-size: 17px; color: var(--muted); }
.btn {
  width: 100%; height: 52px; border: 0; border-radius: 12px; background: var(--btn); color: var(--btn-ink);
  font-family: inherit; font-size: 16px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
.promises { display: flex; flex-direction: column; gap: 26px; }
.promise { display: flex; gap: 14px; }
.promise svg { flex: 0 0 20px; width: 20px; height: 20px; margin-top: 2px; stroke: var(--muted); stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.promise b { display: block; font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.promise span { font-size: 15px; line-height: 1.55; color: var(--muted); }
.invite h1 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 38px; line-height: 1.1; }
.invite p { margin: 0; }
.box-row { display: flex; gap: 10px; }
.box {
  flex: 1; min-width: 0; height: 52px; padding: 0 16px; border: 1px solid var(--field); border-radius: 10px;
  font-family: inherit; font-size: 16px; color: var(--ink); background: var(--bg); outline: none;
}
.box:focus { border-color: var(--ink); }
.box.upper { text-transform: uppercase; }
.btn-sm { height: 52px; padding: 0 18px; border: 0; border-radius: 10px; background: var(--btn); color: var(--btn-ink); font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.opt {
  height: 46px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--field); background: var(--bg); color: var(--ink);
  font-family: inherit; font-size: 15px; text-align: left; cursor: pointer; width: 100%;
}
.opt[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
.fine { font-size: 13px; line-height: 1.55; color: var(--muted); }
.invite .foot { justify-content: center; padding: 20px 0 0; font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack-lg { display: flex; flex-direction: column; gap: 22px; }

/* ---------- Legal pages ---------- */
.legal { max-width: 720px; padding: 56px 32px 80px; font-family: var(--sans); font-size: 16px; line-height: 1.65; }
.legal .back { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; margin-bottom: 32px; }
.legal .back svg { width: 36px; height: 24px; }
.legal h1 { font-family: var(--serif); font-weight: 400; font-size: 38px; line-height: 1.15; margin: 0 0 8px; }
.legal h2 { font-family: var(--serif); font-weight: 500; font-size: 24px; margin: 40px 0 8px; }
.legal p, .legal ul { margin: 0 0 14px; }
.legal ul { padding-left: 22px; }
.legal li { margin-bottom: 6px; }
.legal table { width: 100%; border-collapse: collapse; margin: 0 0 14px; font-size: 15px; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--rule); }
.legal .table-wrap { overflow-x: auto; }
.legal .note { padding: 12px 14px; border: 1px dashed var(--alert); border-radius: 8px; color: var(--ink); }
@media (max-width: 600px) { .legal { padding: 40px 20px 64px; } .legal h1 { font-size: 32px; } }

/* ---------- Notification-style celebration ---------- */
.buzz-notice {
  position: fixed; top: max(10px, env(safe-area-inset-top)); left: 50%; z-index: 60;
  width: min(92vw, 380px); display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px;
  border-radius: 22px; background: rgba(27, 27, 26, 0.94); color: #FFFFFF;
  -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(226, 166, 0, 0.55);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', var(--sans);
  transform: translate(-50%, calc(-100% - 24px)); opacity: 0; cursor: pointer;
  transition: transform 420ms cubic-bezier(.2, .9, .3, 1.15), opacity 220ms ease;
}
.buzz-notice.in { transform: translate(-50%, 0); opacity: 1; }
.buzz-notice-icon {
  flex: 0 0 38px; width: 38px; height: 38px; border-radius: 9px; background: #FFFFFF;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.12); display: flex; align-items: center; justify-content: center;
}
.buzz-notice-icon svg { width: 26px; height: 18px; }
.buzz-notice-body { flex: 1; min-width: 0; }
.buzz-notice-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; }
.buzz-notice-top b { font-weight: 600; letter-spacing: 0.02em; }
.buzz-notice-top span { color: #B8B8B3; font-size: 12px; }
.buzz-notice p { margin: 2px 0 0; font-size: 15px; line-height: 1.35; }
/* On a dark page, flip to a light banner so it still stands out. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .buzz-notice { background: rgba(250, 250, 248, 0.96); color: #1B1B1A; }
  :root:not([data-theme="light"]) .buzz-notice-top span { color: #6A6A66; }
}
@media (prefers-reduced-motion: reduce) { .buzz-notice { transition: opacity 200ms ease; } }
