/* Roll Call — landing. Warm "paper & ink", mobile-first. */

:root {
  --paper: #f4eee2;
  --paper-lift: #fbf7ee;
  --ink: #221e19;
  --ink-soft: #6a6157;
  --ink-faint: #9a9183;
  --accent: #d9542b;
  --accent-deep: #b23e1b;
  --line: rgba(34, 30, 25, 0.12);
  --line-soft: rgba(34, 30, 25, 0.07);

  --shadow-card: 0 1px 1px rgba(34, 30, 25, 0.04), 0 10px 24px -16px rgba(34, 30, 25, 0.4);
  --shadow-cta: 0 1px 0 var(--accent-deep), 0 10px 22px -8px rgba(217, 84, 43, 0.55);

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Hanken Grotesk', system-ui, sans-serif;

  --pad: clamp(1.25rem, 5.5vw, 2.25rem);
  --maxw: 33rem;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* warm radial glow behind everything */
  background-image: radial-gradient(120% 60% at 50% -10%, #fbf6ea 0%, var(--paper) 55%);
  padding:
    env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom)
    env(safe-area-inset-left);
}

/* subtle film grain over the whole page */
.grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

main,
.site-head,
.site-foot {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

a {
  color: inherit;
}

/* ---------- header ---------- */
.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: clamp(1.1rem, 4vw, 1.75rem);
  padding-bottom: 0.5rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}
.wordmark__mark {
  display: inline-flex;
  filter: drop-shadow(0 4px 8px rgba(217, 84, 43, 0.28));
}
.wordmark__text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  font-optical-sizing: auto;
  letter-spacing: -0.01em;
}

.tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: var(--ink-soft);
  background: var(--paper-lift);
  border: 1px solid var(--line);
  padding: 0.32rem 0.66rem;
  border-radius: 999px;
}

/* ---------- hero ---------- */
.hero {
  padding-top: clamp(2.25rem, 9vw, 4rem);
  padding-bottom: clamp(2.5rem, 9vw, 4rem);
}

.eyebrow {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(2.5rem, 11.5vw, 4.05rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
}
.hero h1 em {
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
}

.lede {
  margin: 1.15rem 0 0;
  max-width: 30ch;
  font-size: 1.12rem;
  color: var(--ink-soft);
}

/* ---------- buttons ---------- */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.85rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3.35rem;
  padding: 0 1.5rem;
  border: 0;
  border-radius: 0.95rem;
  font-family: var(--font-body);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.14s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.2s ease,
    background 0.2s ease;
}
.btn--primary {
  flex: 1 1 auto;
  background: var(--accent);
  color: var(--paper-lift);
  box-shadow: var(--shadow-cta);
}
.btn--primary:hover {
  background: #e15d33;
}
.btn--primary:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--accent-deep), 0 5px 12px -8px rgba(217, 84, 43, 0.5);
}
.btn__arrow {
  transition: transform 0.18s ease;
}
.btn--primary:hover .btn__arrow {
  transform: translateX(3px);
}
.btn--ghost {
  flex: 0 0 auto;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn--ghost:hover {
  background: var(--paper-lift);
  border-color: var(--ink-faint);
}
.btn:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 3px;
}

/* "coming soon" reveal — stays hidden (UA [hidden] rule) until JS removes the
   attribute; display:flex is scoped so it can't override `hidden`. */
.soon:not([hidden]) {
  display: flex;
}
.soon {
  align-items: center;
  gap: 0.55rem;
  margin: 1.1rem 0 0;
  padding: 0.7rem 0.9rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
  background: var(--paper-lift);
  border: 1px dashed var(--line);
  border-radius: 0.8rem;
  animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}
.soon__dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(217, 84, 43, 0.5);
  animation: pulse 1.8s ease-out infinite;
}

/* ---------- roster preview ---------- */
.roster {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 2.4rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line-soft);
}
.roster__avatars {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}
.roster__avatars li {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  margin-left: -0.7rem;
  border-radius: 50%;
  background: var(--c, var(--ink-faint));
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 2.5px solid var(--paper);
  box-shadow: 0 4px 10px -6px rgba(34, 30, 25, 0.5);
}
.roster__avatars li:first-child {
  margin-left: 0;
}
.roster__avatars li:nth-child(1) {
  --c: #e0a33b;
}
.roster__avatars li:nth-child(2) {
  --c: #6f8c5a;
}
.roster__avatars li:nth-child(3) {
  --c: #c96a8b;
}
.roster__avatars li:nth-child(4) {
  --c: #4e8c8a;
}
.roster__more {
  background: var(--ink) !important;
  font-size: 0.74rem !important;
}
.roster__label {
  font-size: 0.92rem;
  color: var(--ink-soft);
}

/* ---------- steps ---------- */
.section-title {
  margin: 0 0 1.4rem;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(1.6rem, 6.5vw, 2.05rem);
  letter-spacing: -0.02em;
}

.steps {
  padding-top: clamp(1rem, 4vw, 2rem);
  padding-bottom: clamp(2rem, 7vw, 3rem);
}
.steps__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.85rem;
}
.step {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 1.3rem;
  background: var(--paper-lift);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  box-shadow: var(--shadow-card);
}
.step__num {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.7rem;
  background: var(--accent);
  color: var(--paper-lift);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
}
.step h3 {
  margin: 0.15rem 0 0.25rem;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}
.step p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

/* ---------- privacy ---------- */
.privacy {
  padding-bottom: clamp(2.5rem, 8vw, 3.5rem);
}
.privacy__card {
  padding: 1.6rem 1.5rem;
  border-radius: 1.2rem;
  color: var(--paper-lift);
  background:
    radial-gradient(130% 100% at 100% 0%, #2c2620 0%, #1d1915 70%);
  box-shadow: var(--shadow-card);
}
.privacy__card h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-style: italic;
  font-size: 1.45rem;
  letter-spacing: -0.01em;
  color: #f0c9a0;
}
.privacy__points {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.8rem;
}
.privacy__points li {
  position: relative;
  padding-left: 1.6rem;
  font-size: 0.98rem;
  color: #d9d0c2;
}
.privacy__points strong {
  color: var(--paper-lift);
  font-weight: 600;
}
.privacy__points li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- footer ---------- */
.site-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-top: 1.5rem;
  padding-bottom: max(1.75rem, env(safe-area-inset-bottom));
  margin-top: 0.5rem;
  border-top: 1px solid var(--line-soft);
}
.site-foot__mark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
}
.site-foot__meta {
  font-size: 0.82rem;
  color: var(--ink-faint);
}

/* ---------- entrance animation ---------- */
[data-reveal] {
  animation: rise 0.72s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
  animation-delay: var(--d, 0s);
}
/* staggered reveal delays (kept in CSS so no inline styles → tighter CSP) */
.r1 {
  --d: 0.02s;
}
.r2 {
  --d: 0.08s;
}
.r3 {
  --d: 0.16s;
}
.r4 {
  --d: 0.24s;
}
.r5 {
  --d: 0.34s;
}
.s1 {
  --d: 0.04s;
}
.s2 {
  --d: 0.1s;
}
.s3 {
  --d: 0.16s;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(217, 84, 43, 0.45);
  }
  70% {
    box-shadow: 0 0 0 0.5rem rgba(217, 84, 43, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(217, 84, 43, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  [data-reveal] {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- a little room on wider screens ---------- */
@media (min-width: 600px) {
  :root {
    --maxw: 36rem;
  }
  .btn--primary {
    flex: 0 0 auto;
  }
}

/* ============================================================================
   App pages (create / join / admin) — shared components, same paper & ink tokens
   ============================================================================ */

.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 33rem;
  margin-inline: auto;
  padding-inline: var(--pad);
  padding-bottom: max(2.5rem, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: clamp(1.1rem, 4vw, 1.6rem);
  padding-bottom: 0.5rem;
}
.topbar .wordmark__text {
  font-size: 1.1rem;
}
.back {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
}
.back:hover {
  color: var(--accent-deep);
}

.card {
  background: var(--paper-lift);
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  box-shadow: var(--shadow-card);
  padding: clamp(1.25rem, 5vw, 1.75rem);
  margin-top: 1.1rem;
}
.card + .card {
  margin-top: 0.9rem;
}

.page-title {
  margin: 0.4rem 0 0.2rem;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(1.9rem, 8vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
}
.page-sub {
  margin: 0 0 1.1rem;
  color: var(--ink-soft);
}

/* forms */
.field {
  display: block;
  margin: 0 0 1rem;
}
.field > .label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.field .opt {
  color: var(--ink-faint);
  font-weight: 500;
}
.input,
textarea.input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1.05rem; /* >=16px so iOS doesn't zoom on focus */
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 0.8rem;
  padding: 0.85rem 0.95rem;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus,
textarea.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(217, 84, 43, 0.16);
}
textarea.input {
  min-height: 4.5rem;
  resize: vertical;
}
.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}
.hint {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--ink-faint);
}

/* button variants (extends .btn from the landing) */
.btn--full {
  width: 100%;
  flex: 1 1 100%;
}
.btn--sm {
  min-height: 2.5rem;
  padding: 0 0.85rem;
  font-size: 0.9rem;
  border-radius: 0.7rem;
}
.btn--danger {
  background: transparent;
  color: #b5341a;
  border: 1.5px solid rgba(181, 52, 26, 0.35);
}
.btn--danger:hover {
  background: rgba(181, 52, 26, 0.07);
  border-color: rgba(181, 52, 26, 0.6);
}
.btn[disabled] {
  opacity: 0.55;
  pointer-events: none;
}

/* disclosure for optional fields */
.disclosure > summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--accent-deep);
  padding: 0.3rem 0;
  user-select: none;
}
.disclosure > summary::-webkit-details-marker {
  display: none;
}
.disclosure > summary::before {
  content: '+ ';
}
.disclosure[open] > summary::before {
  content: '– ';
}
.disclosure[open] > summary {
  margin-bottom: 0.6rem;
}

/* result links (create page) */
.linkbox {
  margin-top: 0.9rem;
}
.linkbox .label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.4rem;
}
.linkrow {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}
.linkrow code {
  flex: 1 1 auto;
  min-width: 0;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.82rem;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 0.7rem;
  padding: 0.7rem 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.5;
}

.qr {
  display: grid;
  place-items: center;
  width: min(60vw, 13rem);
  margin: 0.4rem auto 0.2rem;
  padding: 0.8rem;
  background: #fff;
  border-radius: 1rem;
  box-shadow: var(--shadow-card);
}
.qr svg {
  width: 100%;
  height: auto;
  display: block;
}

.callout {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  font-size: 0.92rem;
  border-radius: 0.8rem;
  background: rgba(217, 84, 43, 0.08);
  border: 1px solid rgba(217, 84, 43, 0.2);
  color: var(--accent-deep);
}
.callout strong {
  color: #8f3216;
}

.note-hint {
  margin-top: 1rem;
  padding: 0.7rem 0.85rem;
  font-size: 0.86rem;
  border-radius: 0.7rem;
  background: var(--paper);
  border: 1px dashed var(--line);
  color: var(--ink-soft);
}

/* member list (admin + roster count) */
.metarow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}
.count-pill {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-deep);
  background: rgba(217, 84, 43, 0.1);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
}
.mlist {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.mlist li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.75rem 0.9rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
}
.mlist .m-name {
  font-weight: 600;
}
.mlist .m-phone {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.status-ok {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: #2f6b3d;
}
.status-ok::before {
  content: '✓';
  display: grid;
  place-items: center;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background: #2f6b3d;
  color: #fff;
  font-size: 0.8rem;
}

.divider {
  height: 1px;
  background: var(--line-soft);
  border: 0;
  margin: 1.1rem 0;
}

.muted {
  color: var(--ink-soft);
}
.center {
  text-align: center;
}
.stack > * + * {
  margin-top: 0.7rem;
}
.spinner {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
  border: 2.5px solid rgba(34, 30, 25, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -0.2em;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* toast */
.toast-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
  padding: 0 1rem;
}
.toast {
  max-width: 30rem;
  width: max-content;
  padding: 0.75rem 1.05rem;
  border-radius: 0.8rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--paper-lift);
  background: #2b2620;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.toast--err {
  background: #8f2d16;
}
.toast--ok {
  background: #2f6b3d;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

.cf-turnstile {
  margin: 0.2rem 0 1rem;
  min-height: 65px;
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 1.4s;
  }
  .toast {
    animation: none;
  }
}

/* numbered how-to list (iOS import steps) */
.howto {
  margin: 0.2rem 0 0.4rem;
  padding-left: 1.4rem;
  display: grid;
  gap: 0.55rem;
}
.howto li {
  padding-left: 0.3rem;
  line-height: 1.45;
}
.howto li::marker {
  color: var(--accent);
  font-weight: 700;
}

.card-h {
  margin: 0;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}
