@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces-450.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/fonts/atkinson-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/fonts/atkinson-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --paper: #FBF9F4;
  --paper-2: #F3EFE6;
  --card: #FFFFFF;
  --ink: #1C201D;
  --ink-2: #454B46;
  --ink-3: #5F655F;
  --line: #E2DBCD;
  --line-strong: #C9BFAC;
  --mark: #F6DB97;
  --accent: #8A5A00;
  --focus: #B47A12;
  --error: #A3321F;
  --error-soft: #FBEDE9;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Atkinson Hyperlegible", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --gutter: 20px;
  --page: 75rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 1.125rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; text-decoration-color: var(--line-strong); }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
strong { font-weight: 700; }

h1, h2, h3 { font-family: var(--serif); font-weight: 420; color: var(--ink); margin: 0; font-optical-sizing: auto; text-wrap: balance; }
h1 { font-size: clamp(2.35rem, 1.6rem + 3.6vw, 3.75rem); line-height: 1.06; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 1.3rem + 1.3vw, 2.1rem); line-height: 1.15; letter-spacing: -0.012em; }
h3 { font-size: 1.25rem; line-height: 1.3; font-weight: 500; }
p { margin: 0; text-wrap: pretty; }

.wrap { width: 100%; max-width: 42rem; margin: 0 auto; padding: 0 var(--gutter); }
.wrap-wide { width: 100%; max-width: 64rem; margin: 0 auto; padding: 0 var(--gutter); }

/* Header */
.top-in { max-width: var(--page); margin: 0 auto; padding: 16px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.mark { font-family: var(--serif); font-size: 1.15rem; font-weight: 500; letter-spacing: -0.01em; text-decoration: none; }
.lang { font-size: 1rem; padding: 10px 14px; margin-right: -14px; border-radius: 999px; text-decoration: underline; text-decoration-color: var(--line-strong); }
.lang:hover { background: var(--paper-2); }

/* Home: hero (photo, what it is, where it stands), then the form */
.home { padding-bottom: clamp(56px, 10vw, 112px); }
.hero, .join-in { width: 100%; max-width: 36rem; margin: 0 auto; padding: 4px var(--gutter) 0; }
.photo { display: block; margin: 0; border-radius: 12px; overflow: hidden; background: #2A2620; position: relative; }
.photo::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(28, 32, 29, 0.08); pointer-events: none; }
.photo img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.label { margin-top: 28px; font-size: 1rem; font-weight: 700; line-height: 1.4; color: var(--accent); display: flex; gap: 10px; align-items: baseline; }
.label::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #D9A23A; transform: translateY(-1px); }
.home h1 { margin-top: 12px; font-size: clamp(2.05rem, 1.5rem + 2.6vw, 3.5rem); line-height: 1.08; max-width: 15ch; }
.lede { margin-top: 18px; font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem); line-height: 1.6; color: var(--ink); max-width: 33rem; }
.status { margin-top: 14px; font-size: 1rem; line-height: 1.55; color: var(--ink-3); max-width: 33rem; }
.hero-cta { display: none; }
.join { margin-top: 40px; }
.join-in { padding-top: 36px; border-top: 1px solid var(--line); }
.join h2 { font-size: clamp(1.45rem, 1.3rem + 0.6vw, 1.75rem); }
.join-intro { margin-top: 8px; color: var(--ink-2); font-size: 1.0625rem; }
.join:has(.thanks:not([hidden])) .join-head, .home:has(.thanks:not([hidden])) .hero-cta { display: none; }

@media (min-width: 640px) {
  .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
}

@media (min-width: 960px) {
  .home { padding-bottom: 0; }
  .hero {
    max-width: var(--page); padding: clamp(8px, 2vh, 32px) var(--gutter) clamp(56px, 9vh, 104px);
    display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(48px, 6vw, 96px); align-items: center;
  }
  .hero-photo { grid-column: 2; grid-row: 1; }
  .hero-text { grid-column: 1; grid-row: 1; }
  .photo { border-radius: 16px; }
  .photo img { aspect-ratio: 1 / 1; max-height: calc(100svh - 150px); min-height: 420px; }
  .label { margin-top: 0; }
  .home h1 { margin-top: 16px; }
  .lede { margin-top: 22px; }
  .status { margin-top: 16px; }
  .hero-cta { display: block; margin-top: 32px; }

  .join { margin-top: 0; background: var(--paper-2); border-top: 1px solid var(--line); }
  .join-in {
    max-width: var(--page); border-top: 0; padding: clamp(64px, 9vh, 104px) var(--gutter);
    display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(40px, 6vw, 96px); align-items: start;
  }
  .join-head { position: sticky; top: 40px; }
  .join h2 { font-size: clamp(1.9rem, 1.4rem + 1vw, 2.4rem); }
  .join-intro { margin-top: 14px; max-width: 22rem; }
  .join-body { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: clamp(28px, 3vw, 44px); box-shadow: 0 1px 2px rgba(28, 32, 29, 0.04), 0 12px 32px -16px rgba(28, 32, 29, 0.12); }
  .join-body .signup { margin-top: 0; }
  .join:has(.thanks:not([hidden])) .join-in { grid-template-columns: minmax(0, 1fr); max-width: 44rem; }
}
@media (min-width: 1600px) {
  :root { --page: 82rem; }
  .home h1 { font-size: 3.9rem; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px;
  padding: 12px 26px; border: 0; border-radius: 999px; background: var(--ink); color: var(--paper);
  font: 700 1.0625rem/1.2 var(--sans); text-decoration: none; cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.btn:hover { background: #343a35; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn-quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); min-height: 46px; padding: 10px 20px; font-size: 1rem; }
.btn-quiet:hover { background: var(--paper-2); }

/* Join form */
.signup { margin-top: 22px; }
.field { margin: 0 0 20px; padding: 0; border: 0; min-width: 0; }
.field > label, legend { display: block; font-weight: 700; margin-bottom: 8px; padding: 0; font-size: 1.0625rem; }
input[type="text"], input[type="email"] {
  width: 100%; min-height: 52px; padding: 12px 14px; font: 400 1.0625rem/1.3 var(--sans); color: var(--ink);
  background: var(--card); border: 1.5px solid var(--line-strong); border-radius: 8px; appearance: none; -webkit-appearance: none;
}
input:hover { border-color: var(--ink-3); }
input:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--ink); }
input[aria-invalid="true"] { border-color: var(--error); }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 12px; border: 1.5px solid var(--line-strong); border-radius: 8px; cursor: pointer; line-height: 1.3; }
.choice:hover { border-color: var(--ink-3); }
.choice:has(input:checked) { border-color: var(--ink); background: #FBF7EC; box-shadow: inset 0 0 0 1px var(--ink); }
.choice:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice input:focus-visible { outline: none; }
input[type="radio"], input[type="checkbox"] { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--ink); cursor: pointer; }

.checks { display: grid; gap: 14px; }
.checks > .check { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; line-height: 1.45; font-weight: 400; margin: 0; font-size: 1.0625rem; }
.check input { margin-top: 2px; }

.fine { color: var(--ink-3); font-size: 0.95rem; margin-top: 16px; }
.signup .btn { width: 100%; }
@media (min-width: 520px) { .signup .btn { width: auto; min-width: 240px; } }

.err { color: var(--error); font-size: 1rem; margin-top: 8px; }
.err-summary { background: var(--error-soft); border-radius: 8px; padding: 12px 16px; margin: 0 0 24px; }
.err[hidden] { display: none; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Thank-you state */
.thanks[hidden] { display: none; }
.thanks:focus { outline: none; }
.thanks h2 { font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.1rem); margin-bottom: 12px; }
.thanks p { color: var(--ink-2); }
.thanks .back { margin-top: 24px; }
.page-thanks { padding-top: clamp(40px, 10vw, 112px); padding-bottom: clamp(80px, 14vw, 160px); }
.page-thanks h1 { font-size: clamp(2.05rem, 1.5rem + 2.6vw, 3rem); margin-bottom: 16px; }

/* Footer */
.foot { border-top: 1px solid var(--line); }
.foot-in { max-width: var(--page); margin: 0 auto; padding: 28px var(--gutter) calc(36px + env(safe-area-inset-bottom)); color: var(--ink-3); font-size: 0.95rem; display: grid; gap: 8px; }
.foot a { color: var(--ink-2); overflow-wrap: anywhere; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.foot-links span { color: var(--line-strong); }
.credit, .credit a { color: var(--ink-3); font-size: 0.85rem; }

/* Privacy and terms pages */
.doc { padding-top: clamp(32px, 6vw, 72px); padding-bottom: clamp(64px, 10vw, 112px); }
.doc h1 { font-size: clamp(2.1rem, 1.6rem + 2.4vw, 3rem); }
.updated { color: var(--ink-3); font-size: 1rem; margin-top: 12px; }
.doc-intro { margin-top: 28px; color: var(--ink-2); font-size: 1.2rem; }
.doc section { margin-top: 44px; }
.doc section h2 { font-size: 1.5rem; margin-bottom: 12px; }
.doc section p { color: var(--ink-2); }
.doc section p + p { margin-top: 14px; }
.doc a { overflow-wrap: anywhere; }
.terms { margin: 36px 0 0; padding: 0; list-style: none; }
.terms li { padding: 18px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.terms li strong { color: var(--ink); }

/* Admin */
.admin .stats { display: grid; gap: 4px; margin: 24px 0; font-size: 1.2rem; }
.admin h2 { font-size: 1.4rem; margin: 40px 0 12px; }
.admin table { border-collapse: collapse; width: 100%; }
.admin td { padding: 10px 0; border-bottom: 1px solid var(--line); }
.admin td:last-child { text-align: right; font-weight: 700; }
.admin .muted { color: var(--ink-3); }
.admin .del { display: grid; gap: 14px; margin-top: 12px; }
.admin .del label:first-child { display: grid; gap: 6px; font-weight: 700; }

@media (max-width: 420px) {
  :root { --gutter: 16px; }
  body { font-size: 1.0625rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
