@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/space-grotesk-v22-latin-500.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/space-grotesk-v22-latin-600.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/space-grotesk-v22-latin-700.woff2") format("woff2");
}

/* E0-02/E0-03 — design tokens: the only place colors/sizes may be defined. */
:root {
  color-scheme: light;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-ink: #ffffff;
  --accent-soft: #eff6ff;
  --paper: #fafaf8;
  --card: #ffffff;
  --ink: #1c1917;
  --muted: #57534e;
  --line: #e7e5e4;
  --notice-bg: #eff6ff;
  --notice-line: #bfdbfe;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --glow: rgba(37, 99, 235, 0.07);
  --shadow: 0 1px 2px rgba(28, 25, 23, 0.05), 0 8px 24px rgba(28, 25, 23, 0.06);
  --shadow-lift: 0 2px 4px rgba(28, 25, 23, 0.06), 0 16px 32px rgba(28, 25, 23, 0.1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    --accent-ink: #0b0d10;
    --accent-soft: #0f172a;
    --paper: #0b0d10;
    --card: #14171b;
    --ink: #f5f4f2;
    --muted: #a8a29e;
    --line: #262b33;
    --notice-bg: #0f172a;
    --notice-line: #1e3a5f;
    --danger: #f87171;
    --danger-soft: #2a1215;
    --glow: rgba(96, 165, 250, 0.09);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.45), 0 16px 32px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --accent-ink: #0b0d10;
  --accent-soft: #0f172a;
  --paper: #0b0d10;
  --card: #14171b;
  --ink: #f5f4f2;
  --muted: #a8a29e;
  --line: #262b33;
  --notice-bg: #0f172a;
  --notice-line: #1e3a5f;
  --danger: #f87171;
  --danger-soft: #2a1215;
  --glow: rgba(96, 165, 250, 0.09);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.45), 0 16px 32px rgba(0, 0, 0, 0.5);
}
:root {
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-hero: clamp(2.4rem, 6vw, 3.8rem);
  --fs-h1: clamp(1.9rem, 4vw, 2.6rem);
  --fs-h2: 1.35rem;
  --s1: 0.25rem; --s2: 0.5rem; --s3: 0.75rem; --s4: 1rem;
  --s5: 1.5rem; --s6: 2rem; --s7: 3rem; --s8: 4rem;
  --r-s: 12px; --r-m: 16px; --r-l: 20px; --r-pill: 999px;
  --dur: 180ms;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  --ring: 0 0 0 3px var(--accent-soft), 0 0 0 5px var(--accent);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: radial-gradient(1200px 480px at 70% -10%, var(--glow), transparent 70%), var(--paper);
  background-attachment: fixed;
  margin: 0 auto;
  max-width: 1100px;
  padding: var(--s4);
  line-height: 1.6;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
h1, h2, h3, .brand {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  line-height: 1.12;
}
h1 { font-size: var(--fs-h1); font-weight: 700; margin: var(--s5) 0 var(--s4); }
h2 { font-size: var(--fs-h2); font-weight: 600; margin: var(--s6) 0 var(--s3); }
a { color: var(--accent); text-underline-offset: 3px; transition: color var(--dur) var(--ease); }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-s); }

header {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s4);
  border-bottom: 1px solid var(--line); padding: var(--s3) 0;
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
}
header nav { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; }
header nav a { color: var(--ink); text-decoration: none; }
header nav a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.site-nav a[aria-current="page"] { color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.empty-state { text-align: center; color: var(--muted); margin: var(--s5) 0; }
.empty-state strong { color: var(--ink); }
.brand { font-weight: 700; font-size: 1.15rem; text-decoration: none; color: var(--ink); }
footer { border-top: 1px solid var(--line); margin-top: var(--s7); padding-top: var(--s4); font-size: 0.9rem; color: var(--muted); }
main { animation: rise var(--dur) var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.flash, .notice {
  background: var(--notice-bg); border: 1px solid var(--notice-line);
  padding: var(--s3) var(--s4); border-radius: var(--r-m);
}
.placeholder {
  border: 1px dashed var(--muted); background: var(--card);
  padding: var(--s4); border-radius: var(--r-m); margin-top: var(--s4);
}

/* E0-05 — button system. Default <button> is secondary; .button/.primary is accent. */
button, .button {
  font: inherit; font-weight: 600; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  padding: var(--s2) var(--s5); border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  cursor: pointer; text-decoration: none;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
button:hover, .button:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--muted); }
button:active, .button:active { transform: scale(0.98); }
button:disabled, .button[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.button, button.primary {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
}
.button:hover, button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
button.danger {
  background: var(--danger-soft); border-color: var(--danger); color: var(--danger);
}
button.danger:hover { border-color: var(--danger); }
button.small { min-height: 36px; padding: var(--s1) var(--s4); font-size: 0.9rem; }
button:focus-visible, .button:focus-visible { box-shadow: var(--ring); }
.theme-toggle { min-height: 44px; min-width: 44px; padding: var(--s2); border-radius: var(--r-pill); }
/* PWA controls: opt-in, never shown until JS decides it is useful. */
.pwa-controls { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
[hidden] { display: none !important; }
.pwa-toast {
  position: fixed; left: 50%; bottom: var(--s5); transform: translateX(-50%); z-index: 40;
  background: var(--ink); color: var(--paper); padding: var(--s2) var(--s4);
  border-radius: var(--r-pill); box-shadow: var(--shadow-lift); font-size: 0.9rem;
}

label { display: block; margin: var(--s3) 0; font-weight: 500; }
input, textarea, select {
  font: inherit; color: var(--ink); background: var(--card);
  display: block; width: 100%; margin-top: var(--s1);
  padding: var(--s3); min-height: 44px;
  border: 1px solid var(--line); border-radius: var(--r-s);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input[type="checkbox"], input[type="radio"] { display: inline; width: auto; min-height: 0; }
label.check input { display: inline; width: auto; }
fieldset { border: 1px solid var(--line); border-radius: var(--r-m); margin: var(--s4) 0; padding: var(--s4); background: var(--card); }
.phase { color: var(--muted); font-size: 0.85rem; }
form.inline { display: inline; }

.member-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m);
  box-shadow: var(--shadow); padding: var(--s4); margin: var(--s4) 0;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.member-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.member-card h2 { margin: 0 0 var(--s1); font-size: 1.1rem; }
.tags span {
  background: var(--accent-soft); color: var(--accent);
  border-radius: var(--r-pill); padding: var(--s1) var(--s3);
  margin-right: var(--s2); font-size: 0.85rem; font-weight: 500;
}
dl { display: grid; grid-template-columns: auto 1fr; gap: var(--s1) var(--s4); }
dt { font-weight: 600; color: var(--muted); }
dd { margin: 0; }
article.placeholder form { margin-top: var(--s3); }

/* E1 — shell, wordmark, hero, steps, trust, accordion, sticky CTA. */
.brand { display: inline-flex; align-items: center; gap: var(--s3); }
.mark { position: relative; width: 26px; height: 26px; flex: none; }
.mark span { position: absolute; width: 16px; height: 16px; border-radius: 5px; background: var(--accent); }
.mark span:last-child { right: 0; bottom: 0; background: var(--ink); opacity: 0.85; }
.button.secondary { background: transparent; color: var(--accent); border-color: var(--accent); }
.button.secondary:hover { background: var(--accent-soft); color: var(--accent-hover); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l);
  box-shadow: var(--shadow); padding: var(--s5);
}
.prose { max-width: 46rem; }
.hero { max-width: 52rem; margin: var(--s7) auto var(--s6); text-align: center; }
.hero h1 { font-size: var(--fs-hero); margin-bottom: var(--s4); }
.hero .sub { font-size: 1.15rem; color: var(--muted); }
.hero .actions { display: flex; gap: var(--s3); justify-content: center; flex-wrap: wrap; margin-top: var(--s5); }
.steps { list-style: none; counter-reset: step; padding: 0; margin: var(--s6) auto; max-width: 62rem;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); }
.steps li {
  counter-increment: step; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-m); box-shadow: var(--shadow); padding: var(--s5); text-align: left;
}
.steps li::before {
  content: counter(step); display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--r-pill); margin-bottom: var(--s3);
  background: var(--accent); color: var(--accent-ink); font-family: var(--font-display); font-weight: 700;
}
.steps strong { display: block; font-family: var(--font-display); margin-bottom: var(--s1); }
.steps p { margin: 0; color: var(--muted); }
.trust { list-style: none; padding: 0; margin: var(--s6) auto; max-width: 62rem;
  display: flex; gap: var(--s4); justify-content: center; flex-wrap: wrap; }
.trust li { display: flex; align-items: center; gap: var(--s2); color: var(--muted); font-size: 0.95rem; }
.trust svg { color: var(--accent); flex: none; }
details.faq {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m);
  box-shadow: var(--shadow); margin: var(--s3) 0; padding: 0 var(--s5);
}
details.faq summary {
  cursor: pointer; font-family: var(--font-display); font-weight: 600; font-size: 1.1rem;
  padding: var(--s4) 0; min-height: 44px; list-style-position: outside;
}
details.faq p { color: var(--muted); padding-bottom: var(--s4); margin: 0; }
.nav-checkbox { position: absolute; opacity: 0; pointer-events: none; }
.nav-burger { display: none; }
.sticky-cta { display: none; }
footer nav { display: flex; gap: var(--s5); flex-wrap: wrap; }
footer nav a { min-height: 44px; display: inline-flex; align-items: center; }
.footer-brand { font-family: var(--font-display); color: var(--ink); }

/* E2 — apply form: cards, grid, chips, counters, drop zone, submit. */
.form-shell { max-width: 52rem; margin: 0 auto; }
.form-card { margin: var(--s5) 0; }
.form-card h2 { margin-top: 0; }
.hint { color: var(--muted); margin-top: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s4); }
.counter { float: right; font-size: 0.8rem; font-weight: 500; color: var(--muted); }
.counter.over { color: var(--danger); }
.chip-field { border: none; padding: 0; background: none; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2); }
.chip { position: relative; display: inline-block; margin: 0; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: var(--s2) var(--s4); border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--card); font-weight: 500;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.chip:hover span { border-color: var(--muted); }
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip input:focus-visible + span { box-shadow: var(--ring); }
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: var(--s2); text-align: center;
  border: 2px dashed var(--line); border-radius: var(--r-m); background: var(--accent-soft);
  padding: var(--s6) var(--s4); cursor: pointer; margin: var(--s4) 0;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); }
.dropzone input[type="file"] { max-width: 22rem; }
.dropzone .filename { font-weight: 600; color: var(--accent); }
.dropzone .filename:empty { display: none; }
.turnstile-wrap { display: flex; justify-content: center; margin: var(--s3) 0; }
.submit-card {
  position: sticky; bottom: var(--s4); z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap;
}
.submit-card .hint { margin: 0; flex: 1; min-width: 16rem; }

/* E3 — auth: centered card, shared notice-card pattern, envelope art. */
.auth-shell { max-width: 28rem; margin: var(--s7) auto; }
.auth-card { padding: var(--s6); }
.auth-card h1 { margin-top: 0; }
.btn-block { width: 100%; }
.notice-card { max-width: 34rem; margin: var(--s7) auto; text-align: center; padding: var(--s6); }
.notice-card .actions { margin-top: var(--s5); }
.envelope-art { color: var(--muted); margin-bottom: var(--s3); }
.envelope-art .envelope-dot { fill: var(--accent); stroke: none; }

/* E4 — member product: monograms, grids, filter bar, badges, thread. */
.monogram {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 44px; height: 44px; border-radius: var(--r-pill);
  color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
}
.monogram.large { width: 64px; height: 64px; font-size: 1.6rem; }
.card-head { display: flex; align-items: center; gap: var(--s3); }
.card-head h2 { flex: 1; }
.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s4); margin: var(--s4) 0; }
.card-grid .member-card { margin: 0; }
.filter-bar {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m);
  box-shadow: var(--shadow); padding: 0 var(--s4); margin: var(--s4) 0;
}
.filter-bar summary { cursor: pointer; font-weight: 600; padding: var(--s3) 0; min-height: 44px; }
.filter-bar form { padding-bottom: var(--s4); }
.profile-hero { display: flex; gap: var(--s5); align-items: flex-start; margin: var(--s5) 0; }
.profile-hero h1 { margin-top: 0; }
.contact-block { text-align: center; }
.contact-block form { display: inline-block; }
.badge {
  display: inline-flex; align-items: center; min-height: 28px;
  padding: 0 var(--s3); border-radius: var(--r-pill);
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase;
  background: var(--accent-soft); color: var(--accent);
}
.badge.offer { background: var(--notice-bg); color: var(--muted); }
.expiry.urgent { color: var(--danger); font-weight: 700; }
.response {
  border-left: 3px solid var(--line); padding: var(--s2) 0 var(--s2) var(--s4); margin: var(--s4) 0;
}
.response-head { font-weight: 600; margin: 0 0 var(--s1); }
.response p { margin: 0; }
.danger-card { border-color: var(--danger); max-width: 36rem; margin: var(--s6) auto; }
.danger-card h1 { color: var(--danger); }

/* E5 — admin console shell, queue/moderation cards, stats. */
.admin-shell { display: grid; grid-template-columns: 220px 1fr; gap: var(--s6); align-items: start; margin-top: var(--s5); }
.admin-side { position: sticky; top: 96px; }
.admin-side nav { display: flex; flex-direction: column; gap: var(--s1); margin-top: var(--s3); }
.admin-side nav a, .admin-side nav .disabled {
  display: flex; align-items: center; min-height: 44px; padding: var(--s2) var(--s3);
  border-radius: var(--r-s); color: var(--ink); text-decoration: none; font-weight: 500;
}
.admin-side nav a:hover { background: var(--accent-soft); text-decoration: none; }
.admin-side nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.admin-side nav .disabled { color: var(--muted); cursor: not-allowed; opacity: 0.7; }
.admin-card form { margin-top: var(--s3); }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); margin: var(--s5) 0; }
.stat { text-decoration: none; color: var(--ink); text-align: center; }
.stat strong { display: block; font-family: var(--font-display); font-size: 2.2rem; color: var(--accent); }
.stat span { color: var(--muted); }

@media (max-width: 720px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; }
  .admin-side nav { flex-direction: row; overflow-x: auto; }
  .stats-row { grid-template-columns: 1fr; }
  .grid-2, .card-grid { grid-template-columns: 1fr; }
  .profile-hero { flex-direction: column; }
  .steps { grid-template-columns: 1fr; }
  header { flex-wrap: wrap; }
  .nav-burger {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    min-width: 44px; min-height: 44px; margin: 0; cursor: pointer; align-items: center;
  }
  .nav-burger span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; }
  .site-nav { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: var(--s2); padding-bottom: var(--s3); }
  .site-nav a, .site-nav button { min-height: 44px; display: inline-flex; align-items: center; }
  .nav-checkbox:checked ~ .site-nav { display: flex; }
  .nav-checkbox:focus-visible ~ .nav-burger { box-shadow: var(--ring); border-radius: var(--r-s); }
  .sticky-cta {
    display: flex; gap: var(--s3); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom));
    background: var(--card); border-top: 1px solid var(--line); box-shadow: var(--shadow-lift);
  }
  .sticky-cta .button { flex: 1; }
  body { padding-bottom: 92px; }
  h1 { line-height: 1.08; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .member-card:hover, button:hover, .button:hover { transform: none; }
}
