/* TorchTap — "Torchlight" tokens (see docs/superpowers/specs/2026-11-27-torchtap-design.md) */
:root {
  --bg: #14110f;
  --surface: #1f1a16;
  --raised: #2a231e;
  --border: #2e2621;
  --border-strong: #4a4038;
  --text: #f2e8dc;
  --text-2: #d8ccbd;
  --muted: #b3a594;
  --ember: #f08a3c;
  --on-ember: #1a0f05;
  --ember-soft: #2a1e15;
  --ember-line: #7a4a26;
  --peach: #ffd9b8;
  --danger: #ff8f80;
  --display: 'Fraunces', Georgia, serif;
  --body: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--body); }
a { color: var(--ember); }
a:hover { color: #ffb37a; }
h1, h2, h3 { margin: 0; font-family: var(--display); line-height: 1.1; }
h1 { font-size: 34px; font-weight: 800; }
h2 { font-size: 21px; font-weight: 600; }
p { margin: 0; }

.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ember); font: 800 18px var(--display); text-decoration: none; }
.wrap { display: flex; flex-direction: column; gap: 24px; width: 100%; margin: 0 auto; padding: 28px 20px 64px; }
.player .wrap { max-width: 560px; }
.admin .wrap { max-width: 1040px; }
.admin .topbar { padding: 16px 32px; }

.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-tight { display: flex; flex-direction: column; gap: 4px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.lede { color: var(--text-2); font-size: 16px; }
.eyebrow { color: var(--ember); font-size: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.notice { padding: 14px 16px; border: 1px solid var(--ember-line); border-radius: 14px; background: var(--ember-soft); color: var(--peach); }
.notice-error { border-color: #7a3a2f; background: #2a1714; color: var(--danger); }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.cols { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.col-main { flex: 999 1 520px; min-width: 0; }
.col-side { flex: 1 1 320px; min-width: 0; }

.card { padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.card-title { font: 600 18px var(--display); }
.row-link { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; color: var(--text); text-decoration: none; }
.row-link:hover { border-color: var(--border-strong); color: var(--text); }
.list { padding: 0; }
.list-row { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
.list-row.stack { align-items: stretch; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 1px solid var(--border-strong); border-radius: 999px; background: transparent; color: var(--text); font: 600 15px var(--body); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--ember-line); color: var(--text); }
.btn-primary { background: var(--ember); border-color: var(--ember); color: var(--on-ember); }
.btn-primary:hover { background: #ff9d55; color: var(--on-ember); }
.btn-small { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn-danger { color: var(--danger); }
.btn-block { width: 100%; min-height: 52px; font-size: 17px; }
.btn[disabled] { opacity: 0.6; cursor: default; }
.label { font-size: 14px; font-weight: 600; color: var(--text-2); }
.field { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--raised); color: var(--text); font: 16px var(--body); }
.field:focus, .btn:focus-visible, .opt input:focus-visible + span { outline: 2px solid var(--ember); outline-offset: 2px; }

.pill { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill-open { background: var(--ember); color: var(--on-ember); }
.pill-draft { background: #3a332d; color: var(--text-2); }
.pill-decided { background: var(--ember-soft); color: var(--peach); border: 1px solid var(--ember-line); }

details.menu { position: relative; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-body { position: absolute; right: 0; z-index: 5; width: min(300px, 80vw); margin-top: 6px; padding: 14px; background: var(--raised); border: 1px solid var(--border-strong); border-radius: 14px; }

/* Answer rows: radio pills (work without JS) */
.date-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.date-card legend { display: contents; }
.date-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; width: 100%; }
.date-title { font: 600 20px var(--display); }
.opts { display: flex; gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }
.opt { flex: 1; position: relative; }
.opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opt span { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 6px; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--text-2); font-weight: 600; font-size: 15px; text-align: center; }
.opt input:checked + .o-yes { background: var(--ember); border-color: var(--ember); color: var(--on-ember); }
.opt input:checked + .o-maybe { background: #4a3a2a; border-color: var(--ember); color: var(--peach); }
.opt input:checked + .o-no { background: #3a332d; border-color: #3a332d; color: var(--text-2); }
.opt input:disabled { cursor: default; }

.tz-bar { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border-radius: 12px; }
.tz-bar .field { flex: 1; }

/* Crew grid */
.grid-scroll { overflow-x: auto; }
.grid { display: flex; flex-direction: column; gap: 8px; min-width: min-content; }
.grid-row { display: grid; grid-template-columns: 112px repeat(var(--cols), minmax(36px, 1fr)) var(--action, 0); align-items: center; gap: 4px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.grid-row.has-action { --action: 140px; }
.grid-head { padding: 0 12px; border: 0; background: none; font-size: 13px; font-weight: 600; color: var(--muted); }
.grid-head span { text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid-row.leading { background: var(--ember-soft); border-color: var(--ember-line); }
.grid-row.chosen { background: var(--ember-soft); border-color: var(--ember); }
.grid-date { display: flex; flex-direction: column; gap: 2px; }
.grid-date strong { font: 600 16px var(--display); }
.cell { display: flex; justify-content: center; }
.mark { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; border-radius: 999px; }
.m-yes { background: var(--ember); color: var(--on-ember); }
.m-maybe { border: 2px solid var(--ember); color: #ffb37a; }
.m-no { background: var(--raised); color: #8a7d70; }
.m-wait { color: #8a7d70; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; padding: 0 12px; font-size: 13px; color: var(--muted); }

/* Who are you */
.who { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 60px; padding: 0 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); font: 600 18px var(--display); cursor: pointer; text-align: left; }
.who:hover { border-color: var(--ember-line); }

/* Decided */
.chosen-card { display: flex; flex-direction: column; gap: 10px; padding: 24px 20px; background: var(--ember-soft); border: 1px solid var(--ember-line); border-radius: 18px; }
.chosen-card h1 { font-size: 36px; }

/* Admin calendar picker */
.months { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.month { padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.month h3 { margin-bottom: 10px; font-size: 18px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; text-align: center; }
.cal .dow { font-size: 12px; font-weight: 600; color: var(--muted); }
.day { position: relative; }
.day input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.day span { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 10px; background: var(--raised); font-weight: 500; }
.day input:checked + span { background: var(--ember); color: var(--on-ember); font-weight: 700; }
.day input:focus-visible + span { outline: 2px solid var(--ember); outline-offset: 2px; }
.day input:disabled + span { opacity: 0.35; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; padding-top: 20px; border-top: 1px solid var(--border); }
.st-yes { color: var(--ember); }
.st-maybe { color: var(--peach); }
.st-no { color: var(--muted); }

/* On phones the per-row action drops under the marks instead of hiding off the right edge. */
@media (max-width: 640px) {
  .grid-row.has-action { grid-template-columns: 112px repeat(var(--cols), minmax(36px, 1fr)); }
  .grid-row.has-action > :last-child { grid-column: 1 / -1; }
  .grid-head.has-action > :last-child { display: none; }
}

/* ---- Home page (torchtap.com/) ---- */
.home .wrap { max-width: 1120px; padding-top: 0; overflow-x: clip; }
.welcome .ember { display: none; }
.hero { position: relative; display: flex; flex-direction: column; align-items: center; gap: 20px; max-width: 880px; margin: 0 auto; padding: 48px 0 56px; text-align: center; }
.hero-glow { position: absolute; top: -40px; left: 50%; width: min(720px, 160vw); height: 560px; transform: translateX(-50%); background: radial-gradient(closest-side, rgba(240,138,60,.30), rgba(240,138,60,.08) 55%, rgba(20,17,15,0) 100%); pointer-events: none; animation: breathe 3.4s ease-in-out infinite; }
.hero-glow-sm { top: -60px; left: 0; width: 320px; height: 280px; transform: none; }
.hero > *:not(.hero-glow), .welcome > *:not(.hero-glow) { position: relative; }
.hero-torch { position: relative; flex: none; }
.hero-torch svg { display: block; overflow: visible; }
.flame { transform-origin: 50% 92%; transform-box: fill-box; animation: flicker 2.6s ease-in-out infinite; }
.ember { position: absolute; width: 5px; height: 5px; border-radius: 999px; background: #ffb37a; box-shadow: 0 0 8px 2px rgba(240,138,60,.7); opacity: 0; animation: rise 4.5s ease-out infinite; }
.ember-sm { width: 3px; height: 3px; }
@keyframes flicker { 0%,100% { transform: scaleY(1) skewX(0deg); } 25% { transform: scaleY(1.05) skewX(-2deg); } 50% { transform: scaleY(.97) skewX(1.5deg); } 75% { transform: scaleY(1.03) skewX(-1deg); } }
@keyframes rise { 0% { transform: translateY(0) scale(1); opacity: 0; } 15% { opacity: .9; } 100% { transform: translateY(-220px) scale(.4); opacity: 0; } }
@keyframes breathe { 0%,100% { opacity: .85; } 50% { opacity: 1; } }
.wordmark { font-size: clamp(60px, 13vw, 104px); line-height: .95; letter-spacing: -0.02em; }
.tagline { font: italic 500 clamp(22px, 4vw, 30px)/1.25 var(--display); color: var(--peach); }
.tagline-sm { font-size: 17px; }
.hero-copy { max-width: 600px; font-size: 18px; line-height: 1.6; color: var(--text-2); }
.invite-card { display: flex; align-items: center; gap: 16px; margin-top: 8px; padding: 18px 22px; background: rgba(42,30,21,.85); border: 1px solid var(--ember-line); border-radius: 18px; text-align: left; }
.invite-card strong { font: 600 17px var(--display); }
.invite-card span span { color: var(--text-2); font-size: 15px; }
.invite-icon { display: flex; flex: none; width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: 12px; background: var(--ember); color: var(--on-ember); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; padding-bottom: 32px; }
.step { display: flex; flex-direction: column; gap: 12px; padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; }
.step h2 { font-size: 22px; line-height: 1.2; }
.step-num { font: italic 500 17px var(--display); color: var(--ember); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; border-radius: 999px; background: var(--ember-soft); border: 1px solid var(--ember-line); color: var(--peach); font-size: 13px; font-weight: 600; }
.chip-yes { background: var(--ember); border-color: var(--ember); color: var(--on-ember); }
.chip-maybe { background: #4a3a2a; border-color: var(--ember); }
.chip-no { background: #3a332d; border-color: #3a332d; color: var(--text-2); }
.mini-date { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--ember-soft); border: 1px solid var(--ember-line); border-radius: 12px; }
.mini-date strong { font: 800 18px var(--display); }
.mini-date span { font-size: 14px; color: var(--peach); }
.home-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 24px 0 8px; border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.home-footer a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.welcome { position: relative; display: flex; align-items: center; gap: 16px; padding: 28px 0 8px; }
.welcome h1 { font-size: 40px; line-height: 1; }
.sessions { display: flex; flex-direction: column; gap: 14px; max-width: 560px; padding-bottom: 24px; }
.session-card { display: flex; flex-direction: column; gap: 12px; padding: 20px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 18px; color: var(--text); text-decoration: none; }
a.session-card:hover { border-color: var(--ember-line); color: var(--text); }
.session-decided { background: var(--ember-soft); border-color: var(--ember-line); }
.session-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.session-head .card-title { font-size: 22px; }
.session-date { font: 800 20px var(--display); }
@media (prefers-reduced-motion: reduce) {
  .flame, .hero-glow, .ember { animation: none; }
  .ember { display: none; }
}
