/* SignUpSmarty — "civic noticeboard" identity.
   Warm paper, petrol ink, teal = manage, marigold = join in.
   Signature: seat pips (capacity as dots that fill with marigold).
   Type: Bricolage Grotesque (display) / Hanken Grotesk (body) / Spline Sans Mono (data). */

:root {
  --paper: #f6f1e6;
  --paper-card: #fcfaf3;
  --ink: #14302f;
  --ink-soft: #2c4a48;
  --teal: #196463;
  --teal-deep: #0f4a49;
  --marigold: #eba12e;
  --marigold-deep: #d4862a;
  --marigold-soft: #f7e6c0;
  --clay: #b14a2f;
  --line: #e4dbc8;
  --line-strong: #d6cab1;
  --muted: #726c5d;

  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 880px;
  --shadow: 0 1px 0 rgba(20, 48, 47, 0.04), 0 8px 24px -16px rgba(20, 48, 47, 0.35);

  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  --font-mono: 'Spline Sans Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(20, 48, 47, 0.045) 1px, transparent 0);
  background-size: 22px 22px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.main { flex: 1 0 auto; padding-top: 36px; padding-bottom: 72px; }

/* ---------- Typography ---------- */
h1, h2, h3 { font-family: var(--font-display); line-height: 1.08; letter-spacing: -0.01em; margin: 0 0 0.4em; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.8rem); font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 700; margin-top: 1.4em; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--teal-deep); }

.lead { font-size: 1.2rem; color: var(--ink-soft); }
.muted { color: var(--muted); }
small, .small { font-size: 0.85rem; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal);
}

/* ---------- Header / footer ---------- */
.site-header {
  background: rgba(246, 241, 230, 0.85);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); }
.brand-mark { display: inline-flex; }
.brand-word { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; }

.site-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  padding: 22px 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.site-footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.site-footer a:hover { color: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--teal);
  color: #fbf7ee;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.08s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { background: var(--teal-deep); color: #fff; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

/* Marigold = "join in": the primary participant action. */
.btn-claim { background: var(--marigold); color: var(--ink); border-color: var(--marigold-deep); }
.btn-claim:hover { background: var(--marigold-deep); color: var(--ink); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: var(--paper-card); color: var(--ink); border-color: var(--ink-soft); }

/* ---------- Forms ---------- */
.stack { display: flex; flex-direction: column; gap: 16px; max-width: 380px; }
.stack-wide { max-width: 540px; }
.stack label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 0.92rem; }
.stack input,
.stack textarea,
.stack select {
  font: inherit;
  font-weight: 400;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper-card);
  color: var(--ink);
}
.stack textarea { resize: vertical; }
.stack select { cursor: pointer; }
.stack input:focus,
.stack textarea:focus,
.stack select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(25, 100, 99, 0.15); }
.row { display: flex; gap: 14px; }
.row label { flex: 1; }

/* Visible keyboard focus everywhere. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--marigold-deep);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Signature: seat pips, meter, count ---------- */
.pips { display: inline-flex; gap: 5px; align-items: center; }
.pip {
  width: 13px; height: 13px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: transparent;
  transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.pip-on { background: var(--marigold); border-color: var(--marigold-deep); }

.meter {
  width: 110px; height: 9px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.meter-fill { height: 100%; background: var(--marigold); border-radius: 999px; transition: width 0.4s ease; }

.count {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.count-full { color: var(--clay); }

/* ---------- Pills / status ---------- */
.pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 3px 11px;
  white-space: nowrap;
}
.pill-full { color: var(--clay); background: #f6e3dd; border-color: #e3b9ac; }

.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

/* ---------- Cards: sessions & slots ---------- */
.session {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.session-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(25, 100, 99, 0.06), transparent);
  border-bottom: 1px solid var(--line);
}
.session-head .loc { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.date-tab {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 3px;
}

.slot-list { list-style: none; padding: 0; margin: 0; }
.slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}
.slot:first-child { border-top: none; }
.slot-main { flex: 1; min-width: 0; }
.slot-name { font-weight: 600; }
.slot .reserved { color: var(--marigold-deep); font-weight: 500; }
.slot-action { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.slot-meta { display: flex; align-items: center; gap: 10px; }
.roster { margin-top: 5px; font-size: 0.9rem; color: var(--ink-soft); }
.roster .who { display: inline-block; }

/* ---------- Lists (dashboard) ---------- */
.event-list { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 10px; }
.event-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.08s ease, border-color 0.15s ease;
}
.event-list li:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.event-list a { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--ink); text-decoration: none; }
.event-meta { display: flex; align-items: center; gap: 12px; }
.by { font-family: var(--font-mono); font-size: 0.76rem; color: var(--muted); white-space: nowrap; }

/* Public landing directory of active sheets */
.sheet-links { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 10px; }
.sheet-links a {
  display: flex; flex-direction: column; gap: 3px;
  padding: 16px 18px;
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform 0.08s ease, border-color 0.15s ease;
}
.sheet-links a:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.sheet-title { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--ink); }
.sheet-sub { color: var(--muted); font-size: 0.92rem; }

/* ---------- Notes / banners ---------- */
.status-note {
  padding: 16px 18px;
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  border-radius: var(--radius-sm);
  margin: 18px 0;
}
.banner {
  display: flex; align-items: center; gap: 10px;
  background: var(--marigold-soft);
  border: 1px solid #e7cd96;
  color: #6b5316;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-weight: 500;
}
.error { color: var(--clay); font-weight: 600; }
.description { white-space: pre-wrap; color: var(--ink-soft); }

/* ---------- Action links (edit/delete) ---------- */
.action-links { display: flex; align-items: center; gap: 14px; }
.action-links a { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.03em; }
.action-links form { margin: 0; }
.link-danger {
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.03em;
  color: var(--clay); text-decoration: underline; text-underline-offset: 2px;
}

/* ---------- Share + privacy controls ---------- */
.share-link-row { display: flex; gap: 8px; margin: 8px 0; }
.share-link-input {
  flex: 1;
  font-family: var(--font-mono); font-size: 0.85rem;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink-soft);
}
.share-actions { display: flex; gap: 10px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.share-actions form { margin: 0; }
.privacy-toggle { margin: 16px 0 26px; }
.privacy-toggle label { display: flex; align-items: center; gap: 9px; font-size: 0.95rem; cursor: pointer; }
.privacy-toggle input { width: 17px; height: 17px; accent-color: var(--teal); }

/* ---------- Roster table ---------- */
.roster-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.roster-table th, .roster-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 0.94rem;
  vertical-align: top;
}
.roster-table th {
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.roster-table tr:last-child td { border-bottom: none; }
.roster-table tbody tr:hover { background: rgba(25, 100, 99, 0.03); }

/* ---------- Home hero ---------- */
.hero { padding: 28px 0 8px; }
.hero h1 { max-width: 14ch; }
.hero .lead { max-width: 46ch; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }

.sheet-demo {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 6px 0;
  transform: rotate(-1.2deg);
}
.sheet-demo .demo-head {
  padding: 12px 18px 10px;
  border-bottom: 1px solid var(--line);
}
.sheet-demo .demo-title { font-family: var(--font-display); font-weight: 700; }
.demo-slot { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-top: 1px solid var(--line); }
.demo-slot:first-of-type { border-top: none; }

.how { margin-top: 56px; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 18px; }
.how-card { background: var(--paper-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.how-step { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.1em; color: var(--marigold-deep); }
.how-card h3 { margin: 8px 0 4px; }
.how-card p { margin: 0; font-size: 0.95rem; color: var(--ink-soft); }

/* ---------- Add-slot / add-session disclosure ---------- */
.add-form { border-top: 1px solid var(--line); padding: 14px 18px; }
.add-form > summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  color: var(--teal);
  font-weight: 500;
  list-style: none;
}
.add-form > summary::-webkit-details-marker { display: none; }
.add-form > summary:hover { color: var(--teal-deep); }
.add-form[open] > summary { margin-bottom: 14px; }
/* Top-level add-session card (not nested in a session) gets its own surface. */
.main > .add-form {
  background: var(--paper-card);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}
.empty-slots { padding: 14px 18px; margin: 0; }

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

/* ---------- Back link ---------- */
.backlink { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.03em; }

/* ---------- Motion: entrance for the public/event header ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.rise { animation: rise 0.5s ease both; }
.rise-2 { animation: rise 0.5s ease 0.08s both; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .sheet-demo { transform: none; }
  .how-grid { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
  .slot { flex-direction: column; align-items: stretch; }
  .slot-action { flex-direction: row; align-items: center; justify-content: space-between; }
  .row { flex-direction: column; }
  .roster-table { display: block; overflow-x: auto; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .sheet-demo { transform: none; }
}
