/* ============================================================
   15 — Private Membership · "The Long Table"
   Candlelit dining room. Deep green, gold rule, quiet serif.
   Shared by join.html (public) and index.html (gated).
   Font: Fraunces.
   ============================================================ */

@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/Fraunces-Variable.woff2") format("woff2");
  font-weight: 300 800; font-style: normal; font-display: swap;
}

:root {
  --bg: #12211C;
  --surface: #172A23;
  --surface-2: #1D342B;
  --hairline: rgba(211, 178, 106, 0.20);
  --ink: #EFE9DA;
  --muted: #9DAB9F;
  --gold: #D3B26A;
  --gold-dim: #8A7038;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

/* The UA's `[hidden] { display: none }` loses to any author `display` rule
   below, and every demo here toggles `element.hidden` to show and hide
   panels. Without this, hiding silently stops working. */
[hidden] { display: none !important; }

/* A long unbroken token -- a pasted URL, a 200-character "word" -- must wrap
   rather than push its container past its grid track and break the row.
   `anywhere` rather than `break-word` on purpose: only `anywhere` reduces the
   element's min-content width, and a grid or flex item defaults to
   `min-width: auto`, which refuses to shrink below its longest word. With
   `break-word` alone, demo-06 and demo-10 still blew 1.4k px past the viewport.
   The `min-width: 0` below is the other half of the same fix. */
h1, h2, h3, h4, p, li, a, span, strong, em, code, label, time,
button, input, textarea { overflow-wrap: anywhere; }
.card, .post, .listing, .idea, .topic, .question, .profile-card, .submission,
.lesson, .resource, .nominee, .archive-item, .member-card, .comment, .reply,
.answer, .idea-body-wrap { min-width: 0; }


body {
  margin: 0;
  padding-block-end: 96px;
  background: var(--bg);
  background-image: radial-gradient(52rem 34rem at 50% -12%, rgba(211,178,106,0.09), transparent 64%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.72;
  font-optical-sizing: auto;
}

.wrap { max-width: 720px; margin-inline: auto; padding: 0 20px; }

h1, h2 { margin: 0; font-weight: 500; letter-spacing: -0.02em; }
p { margin: 0 0 14px; }
p:last-child { margin-bottom: 0; }
a { color: var(--gold); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.84em; color: var(--gold); }
em { color: var(--ink); }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 5px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- join.html hero ---------- */

.hero {
  padding-block: clamp(64px, 13vw, 132px) 40px;
  text-align: center;
  max-width: 40rem; margin-inline: auto;
}
.hero h1 {
  font-size: clamp(44px, 8.6vw, 92px);
  line-height: 0.98;
  letter-spacing: -0.04em;
  font-weight: 400;
  margin-bottom: 22px;
}
/* A gold rule under the name, drawn in by motion.js. */
.hero h1::after {
  content: "";
  display: block;
  width: 7rem; height: 1px;
  margin: 26px auto 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.hero > p { color: var(--muted); font-size: 18px; margin-bottom: 30px; }
/* The CTA is inline-block, so nothing separated it from the notice that
   follows — measured 0px between them, which reads as a collision. */
.hero > .btn { margin-bottom: 34px; }

/* The wax seal. Drawn by motion.js when the anonymous probe is refused. */
.seal { display: block; margin: 30px auto 0; }
.seal circle, .seal path { fill: none; stroke: var(--gold); stroke-width: 1.4; }
.seal .seal-ring { stroke-dasharray: 1; stroke-dashoffset: 0; }
.seal-caption {
  font-family: var(--sans);
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gold); text-align: center;
  margin-top: 12px;
}

.notice {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 20px 22px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--muted);
  text-align: left;
  margin-bottom: 24px;
}
.notice strong { color: var(--gold); font-weight: 600; }

/* ---------- index.html chrome ---------- */

.topbar {
  padding-block: clamp(40px, 6vw, 72px) 24px;
  display: flex; flex-wrap: wrap; gap: 18px;
  justify-content: space-between; align-items: flex-end;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 26px;
}
.topbar h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 400; }
.topbar > div > p { color: var(--muted); max-width: 42ch; margin-top: 10px; font-size: 16px; }

.identity-picker {
  font-family: var(--sans);
  font-size: 11px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted);
}
.identity-picker select {
  font-family: var(--sans); font-size: 14px;
  letter-spacing: 0; text-transform: none;
  margin-left: 6px; min-height: 44px; padding: 9px 12px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--hairline); border-radius: 6px;
}

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.tab {
  font-family: var(--sans); font-size: 11.5px; font-weight: 700; cursor: pointer;
  letter-spacing: 0.16em; text-transform: uppercase;
  min-height: 44px; padding: 12px 20px;
  background: transparent; color: var(--muted);
  border: 1px solid var(--hairline); border-radius: 6px;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}
.tab:hover { color: var(--ink); }
.tab.is-active { background: var(--gold); color: #16241D; border-color: var(--gold); }
.tab-panel[hidden] { display: none; }

/* ---------- Forms ---------- */

.new-form {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 22px 24px;
  margin-bottom: 26px;
}
.new-form h2 {
  font-family: var(--sans); font-size: 11px; font-weight: 700;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 18px;
}

.field { display: block; margin-bottom: 14px; }
.field label {
  font-family: var(--sans); display: block;
  font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 6px;
}
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--hairline);
  border-radius: 5px; padding: 11px 13px; min-height: 44px;
}
.field textarea { resize: vertical; min-height: 5rem; }
.field input:focus, .field textarea:focus { border-color: var(--gold); }

.btn {
  display: inline-block;
  font-family: var(--sans); font-size: 12px; font-weight: 700; cursor: pointer;
  letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none;
  min-height: 44px; padding: 14px 26px;
  background: var(--gold); color: #16241D;
  border: 0; border-radius: 5px;
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -16px var(--gold); }

.btn-ghost {
  font-family: var(--sans); font-size: 12px; cursor: pointer;
  letter-spacing: 0.08em;
  min-height: 44px; padding: 11px 18px;
  background: transparent; color: var(--muted);
  border: 1px solid var(--hairline); border-radius: 5px;
  transition: color 150ms ease, border-color 150ms ease;
}
.btn-ghost:hover { color: var(--gold); border-color: var(--gold); }

/* ---------- Topics + resources ---------- */

.topic-list, .resource-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }

.topic, .resource {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 22px 24px;
}
.topic-title, .resource-title { font-size: 20px; line-height: 1.32; margin-bottom: 8px; font-weight: 500; }
.resource-title a { text-decoration: none; }
.resource-title a:hover { text-decoration: underline; }

.topic-meta, .resource-meta {
  font-family: var(--sans); font-size: 10.5px;
  letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--muted); margin-top: 14px;
}
.topic-meta strong, .resource-meta strong { color: var(--ink); font-weight: 700; }

.topic > .btn-ghost { margin-top: 14px; }

.replies { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; }
.replies:empty { margin: 0; }
.reply {
  border-left: 1px solid var(--hairline);
  padding-left: 16px;
  font-size: 16px;
}
.reply-meta {
  font-family: var(--sans); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 5px;
}
.reply-meta strong { color: var(--ink); font-weight: 700; }
.reply-body { margin: 0; }

.new-comment {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 40;
  background: var(--surface-2);
  border-top: 1px solid var(--hairline);
  padding: 16px 20px;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
}
.reply-panel-body { flex: 1 1 18rem; }
.new-comment textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--hairline);
  border-radius: 5px; padding: 10px 12px; min-height: 44px; resize: vertical;
}

/* ---------- Toasts ---------- */

.toast-stack { position: fixed; right: 16px; bottom: 108px; display: grid; gap: 8px; z-index: 50; }
.toast {
  font-family: var(--sans); font-size: 13px;
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--hairline);
  border-radius: 5px; padding: 12px 16px;
  box-shadow: 0 18px 40px -22px rgba(0,0,0,0.9);
}
.toast.error { border-color: #9C4A3E; color: #F2B6AA; }

/* ---------- Motion ---------- */

.motion .hero > *, .motion .topic, .motion .resource { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .motion .hero > *, .motion .topic, .motion .resource { opacity: 1 !important; transform: none !important; }
  .btn, .btn-ghost, .tab { transition: none !important; }
}


/* ---------- Candlelight ---------- */
/* Already elegant; one more degree of atmosphere. Light falls off toward the
   edges the way a single candle on a long table would. */

body::after {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(72% 55% at 50% 20%, transparent 38%, rgba(6,14,11,0.60) 100%);
}
.wrap { position: relative; z-index: 1; }


/* ---------- Compose affordance ---------- */
.compose-jump { margin: 0 0 22px; }
.btn-jump {
  font: inherit; font-size: 14px; cursor: pointer;
  min-height: 44px; padding: 12px 22px;
  background: transparent; color: var(--gold);
  border: 1px solid var(--hairline); border-radius: 4px;
  letter-spacing: 0.02em;
}
.btn-jump:hover { border-color: var(--gold); }
.new-topic { margin-top: 36px; }
