/* funnel-theme.css — dark/light tone system + funnel-specific layouts */

/* ─── DARK SCREENS (home / intro / quiz / moment) ───────────────────── */
html:has(body[data-tone="dark"]) { background: #1e1529 }

body { background: var(--cream); transition: background-color .5s ease, color .4s ease }

body[data-tone="dark"] {
  --ink:   #f5ede8;
  --muted: #c8b8d4;
  --dim:   #a494b0;
  color: #f5ede8;
  background: #1e1529;
  color-scheme: dark;
}

body[data-tone="light"] { color-scheme: light }

/* Dark atmosphere — subtle gold glow at top */
body[data-tone="dark"] .atmosphere {
  background: radial-gradient(ellipse at 50% 0%, #b08a5a0c, transparent 50%);
}
body[data-tone="dark"] .haze-a {
  background: radial-gradient(ellipse, #b08a5a12, transparent 65%);
  opacity: .4; bottom: -28vh;
}
body[data-tone="dark"] .haze-b {
  background: radial-gradient(ellipse, #7a6e9622, transparent 65%);
  opacity: .3;
}
body[data-tone="dark"] .stardust { opacity: .6 }

body[data-tone="dark"] .presence::before {
  background: radial-gradient(circle, #b08a5a1a, transparent 70%);
  box-shadow: 0 0 50px 8px #b08a5a08;
}
body[data-tone="dark"] .presence .ring { border-color: #b08a5a18; opacity: .6 }
body[data-tone="dark"] .presence .ring.second { border-color: #b08a5a10 }
body[data-tone="dark"] .presence > .brand-pause { width: 48px; height: 48px; color: var(--gold); filter: none }
body[data-tone="dark"] .presence.small > .brand-pause { width: 27px; height: 27px }

body[data-tone="dark"] .library-button,
body[data-tone="dark"] .quiet-footer { color: #c8b8d4 }
body[data-tone="dark"] .library-count { background: #4a3755; color: #f5ede8 }

body[data-tone="dark"] .whisper { font-style: italic; color: #d8c8e0 }
body[data-tone="dark"] h1 em { color: #f5ede8 }
body[data-tone="dark"] .topic-marker { color: #cca67a }

body[data-tone="dark"] .back,
body[data-tone="dark"] .intro-copy,
body[data-tone="dark"] .micro,
body[data-tone="dark"] .entry-note,
body[data-tone="dark"] .age-check,
body[data-tone="dark"] .question-counter { color: #c8b8d4 }

/* Dark button: cream on dark */
body[data-tone="dark"] .btn {
  background: #f5ede8; color: #1e1529;
  border-color: #f5ede8; border-radius: 32px;
}
body[data-tone="dark"] .btn:hover:not(:disabled) {
  background: #ede0d6;
  box-shadow: 0 8px 26px #0e0a1422;
}
body[data-tone="dark"] button:focus-visible,
body[data-tone="dark"] a:focus-visible,
body[data-tone="dark"] input:focus-visible { outline-color: #d4b080 }

/* Dark choice cards */
body[data-tone="dark"] .choice {
  background: #ffffff09;
  border-color: #ffffff22;
  color: #f5ede8;
}
body[data-tone="dark"] .choice::after { color: #c8a070 }
body[data-tone="dark"] .choice:hover {
  background: #b08a5a14;
  border-color: #b08a5a88;
}
body[data-tone="dark"] .choice.selected {
  background: #b08a5a1e;
  border-color: #c8a070;
}
body[data-tone="dark"] .choice.selected::after { color: #d4b080 }
body[data-tone="dark"] .age-check input { accent-color: #c8a070 }

/* Dark progress */
body[data-tone="dark"] .progress i { color: #7a6a86 }
body[data-tone="dark"] .progress i.done { color: #c8a070 }
body[data-tone="dark"] .progress i.current { color: #f5ede8; outline-color: #c8a07088 }

/* Return states */
body[data-tone="dark"] .return-context,
body[data-tone="dark"] .return-invitation { color: #c8b8d4 }
body[data-tone="dark"] .return-context .quiet-action,
body[data-tone="dark"] .return-invitation button { color: #d4a86c }

/* ─── WELCOME SCREEN ────────────────────────────────────────────────── */
.welcome .presence { margin-bottom: 24px }
.welcome .whisper { font-size: 22px; margin-bottom: 14px }
.welcome h1 { font-size: clamp(44px, 4.8vw, 60px); margin-bottom: 30px }

/* Portal list — the core interaction on home */
.portals {
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
  margin-bottom: 24px;
}
.portal {
  display: flex; align-items: center; gap: 18px;
  padding: 16px 20px; text-align: left;
  border: 1px solid #ffffff1e;
  border-radius: 14px;
  background: #ffffff06;
  min-height: 72px;
  transition: background .2s, border-color .2s, transform .2s;
}
.portal + .portal::before { display: none }
.portal:hover {
  background: #b08a5a12;
  border-color: #b08a5a66;
  transform: translateY(-2px);
}
.portal-icon {
  font-size: 28px; width: 30px; height: auto;
  flex-shrink: 0; text-align: center; color: #c8a070;
  transition: transform .3s;
}
.portal:hover .portal-icon { transform: scale(1.1) }
.portal-text { flex: 1; display: block }
.portal-label {
  font: 300 italic 22px var(--serif);
  line-height: 1.2; margin: 0 0 3px; color: #f5ede8;
}
.portal-description {
  display: block; font-size: 11px;
  line-height: 1.5; color: #c8b8d4;
}
.portal-arrow { font-size: 16px; color: #c8a070 }
.entry-note { font-size: 10px; line-height: 1.8 }
.return-invitation { margin-top: 12px }

/* ─── MOMENT FORM ───────────────────────────────────────────────────── */
.moment form { max-width: 460px; margin: 28px auto 0 }
#current-moment {
  display: block; width: 100%;
  border: 1px solid #ffffff44;
  border-radius: 12px;
  background: #ffffff08;
  padding: 18px; color: #f5ede8;
  font-family: var(--serif); font-weight: 300; font-size: 15px;
  min-height: 60px;
  transition: border-color .2s, background .2s;
}
#current-moment:focus { border-color: #b08a5a88; background: #ffffff0d; outline: none }
#current-moment::placeholder { color: #a494b0; opacity: .9 }
.moment-counter {
  text-align: right; font-size: 10px;
  color: #a494b0; margin: 6px 2px 26px;
}
.moment-skip { display: block; margin: 14px auto 0; color: #a494b0 }
.scene.moment h1 { font-size: clamp(30px, 3.8vw, 44px) }

.moment-preview {
  border-left: 1px solid #b08a5a55;
  padding: 0 0 0 14px; margin-top: 18px; text-align: left;
}
.moment-preview > span {
  font-size: 9px; letter-spacing: .06em; color: var(--muted);
}

/* ─── MOOD / SITUATION GRID ─────────────────────────────────────────── */
.scene.mood-select { max-width: 480px }
.scene.mood-select h1 { font-size: clamp(32px, 4vw, 46px); margin-bottom: 28px }
.scene.mood-select .presence { margin-bottom: 18px }

.moods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
}

.mood-card {
  display: flex !important; flex-direction: column !important;
  align-items: flex-start !important; justify-content: center !important;
  gap: 5px;
  padding: 16px 18px;
  border: 1px solid #ffffff1e;
  border-radius: 14px;
  background: #ffffff06;
  text-align: left;
  min-height: 76px;
  transition: background .18s, border-color .18s, transform .18s;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
}
.mood-card:hover {
  background: #b08a5a12;
  border-color: #b08a5a66;
  transform: translateY(-2px);
}
.mood-card.selected,
.mood-card[aria-pressed="true"] {
  background: #b08a5a1e;
  border-color: #c8a070;
}

.mood-name {
  font: 300 italic 18px/1.2 var(--serif);
  color: #f5ede8;
  letter-spacing: -.01em;
}
.mood-hint {
  font-size: 10px;
  line-height: 1.5;
  color: #a494b0;
}

body[data-tone="dark"] .mood-card { background: #ffffff06; border-color: #ffffff1e }
body[data-tone="dark"] .mood-card:hover { background: #b08a5a12; border-color: #b08a5a66 }
body[data-tone="dark"] .mood-card.selected { background: #b08a5a1e; border-color: #c8a070 }
body[data-tone="dark"] .mood-name { color: #f5ede8 }
body[data-tone="dark"] .mood-hint { color: #a494b0 }

/* ─── PREVIEW / CHECKOUT SCENE (light) ─────────────────────────────── */
body[data-route="preview"] main { justify-content: stretch }

.scene.preview {
  display: flex; flex-direction: column; flex: 1;
  max-width: 540px; margin: 0 auto;
  padding: 14px 0 10px;
}
.scene.preview .back { margin-bottom: 22px }

.preview-topline {
  display: flex; justify-content: space-between;
  align-items: center; gap: 20px; margin-bottom: 16px;
}
.preview-topline > span:first-child {
  font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
}
.preview-topline .topic-marker { margin: 0; font-size: 13px }

.reading-preview {
  background: none; border: 0; border-radius: 0;
  box-shadow: none; padding: 0; margin: 0; max-width: none;
  overflow: visible; flex: 1; display: flex; flex-direction: column;
}
.reading-preview h1 {
  font: 300 italic 40px/1.12 var(--serif);
  text-align: left; margin: 0 0 18px;
  letter-spacing: -.035em;
}
.reading-preview .preview-copy {
  font: 15px/1.85 var(--sans); color: #514453;
  text-align: left; letter-spacing: 0;
}
.reading-preview .perspective-count {
  font: 11px/1.7 var(--sans); font-style: italic;
  color: var(--muted); margin-top: 16px; text-align: left;
}

.veiled-reading {
  flex: 1; min-height: 170px; height: auto; max-height: 360px;
  margin: 18px 0 0; padding-top: 18px;
  border-top: 1px solid #ded3ce;
  text-align: left;
}
.veiled-reading::after {
  background: linear-gradient(#faf5ed00, #faf5ed22 20%, #faf5ed 100%);
}

.unlock {
  position: sticky; bottom: 0; z-index: 2;
  margin-top: 0; padding: 16px 0 8px;
  background: linear-gradient(#faf5ed00, #faf5ed 10%);
}
.unlock-label {
  font: 300 11px/1.7 var(--sans); color: var(--muted); margin-bottom: 3px;
}
.price-line { font-size: 12px; color: #514453; margin-bottom: 15px }
.price-line strong { font-weight: 600; color: var(--ink) }
.unlock .btn { min-height: 52px }
.scene.preview > .micro { font-size: 9px; margin-top: 8px }
.reading-preview .repeat-note {
  font-size: 11px !important; text-align: center;
  margin: 6px 0 14px !important;
}
.report-body p { font: 15px/1.9 var(--sans); color: #514453; letter-spacing: 0 }
.report h1 { font-size: clamp(32px, 3.6vw, 44px) }

/* ─── RESPONSIVE OVERRIDES ──────────────────────────────────────────── */
@media (max-width: 680px) {
  .welcome .presence { width: 76px; height: 76px; margin-bottom: 16px }
  .welcome .whisper { font-size: 19px; margin-bottom: 10px }
  .welcome h1 { font-size: 38px; margin-bottom: 22px }

  .portal { min-height: 64px; padding: 12px 16px }
  .portal-icon { font-size: 24px }
  .portal-label { font-size: 20px; margin-bottom: 2px }
  .portal-description { font-size: 10px }
  .portals { max-width: 310px; margin-bottom: 18px; gap: 9px }
  .entry-note { font-size: 9px }
  .quiet-footer { font-size: 9px }
  .quiet-footer button { font-size: 9px }
  .welcome:has(.return-invitation) .presence { margin-bottom: 12px }
  .welcome:has(.return-invitation) h1 { margin-bottom: 20px }

  .scene.preview { width: calc(100% - 44px); padding-top: 8px }
  .scene.preview .back { margin-bottom: 16px }
  .preview-topline { margin-bottom: 12px }
  .preview-topline > span:first-child { font-size: 9px }
  .preview-topline .topic-marker { font-size: 12px }
  .reading-preview h1 { font-size: 30px; margin-bottom: 14px }
  .reading-preview .preview-copy { font-size: 14px; line-height: 1.8 }
  .reading-preview .perspective-count { font-size: 10px; margin-top: 12px }
  .veiled-reading { min-height: 150px; max-height: 310px; margin-top: 14px; padding-top: 16px }
  .veiled-section { margin-bottom: 18px }
  .veiled-section .veiled-heading { font-size: 15px }
  .unlock { padding-top: 12px }
  .price-line { font-size: 11px; margin-bottom: 12px }
  .unlock-label { font-size: 11px }
  .scene.preview > .micro { font-size: 8px }
  .report-body p { font-size: 14px; line-height: 1.85 }
  .report h1 { font-size: 31px }

  /* Mood grid — full width on mobile */
  .moods { grid-template-columns: 1fr 1fr; gap: 8px }
  .mood-card { min-height: 68px; padding: 13px 14px }
  .mood-name { font-size: 16px }
  .mood-hint { font-size: 9px }
}

@media (max-width: 360px) {
  .moods { grid-template-columns: 1fr }
  .mood-card { min-height: 60px }
}

@media (max-height: 740px) and (min-width: 681px) {
  .welcome .presence { width: 68px; height: 68px; margin-bottom: 14px }
  .welcome .whisper { font-size: 18px }
  .welcome h1 { font-size: 44px; margin-bottom: 20px }
  .portal { min-height: 62px; padding-block: 10px }
  .portals { gap: 8px; margin-bottom: 16px }
  .entry-note { font-size: 9px }
}

@media (prefers-reduced-motion: reduce) { body { transition: none } }

/* ─── GATE SCREEN (name + age) ──────────────────────────────────────── */
.scene.gate { max-width: 420px }
.scene.gate h1 { font-size: clamp(32px, 4vw, 46px) }

.gate-fields {
  max-width: 380px; margin: 32px auto 28px;
  display: flex; flex-direction: column; gap: 20px;
}
#gate-name {
  display: block; width: 100%;
  border: 1px solid #ffffff33;
  border-radius: 12px;
  background: #ffffff08;
  padding: 16px 20px;
  color: #f5ede8;
  font-family: var(--serif); font-weight: 300; font-size: 18px;
  transition: border-color .2s, background .2s;
}
#gate-name:focus {
  outline: none;
  border-color: #b08a5a88;
  background: #ffffff0d;
}
#gate-name::placeholder { color: #a494b0; opacity: .9 }

.scene.gate .age-check {
  justify-content: flex-start;
  font-size: 13px; color: #c8b8d4;
  margin: 0;
}
.scene.gate .btn { max-width: 380px; width: 100% }

/* ─── LIBRARY — CLEAR HISTORY ───────────────────────────────────────── */
.library-clear {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #ded3ce;
  text-align: center;
}
.danger-action {
  color: #a06060 !important;
  font-size: 12px;
}
.danger-action:hover { color: #c05050 !important; }

/* ─── GUIDE — QUESTION ECHO ─────────────────────────────────────────── */
.guide-question-echo {
  font: 300 italic 17px/1.6 var(--serif);
  color: #9b8da3;
  max-width: 380px;
  margin: 0 auto 28px;
  padding: 14px 18px;
  border-left: 2px solid #b08a5a44;
  text-align: left;
}

/* ─── CHOICES — 2-COLUMN GRID FOR NON-SIGN OPTIONS ─────────────────── */
.choices.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
}
.choices.two-col .choice {
  min-height: 72px;
  font-size: 13px;
  line-height: 1.4;
  padding: 12px 14px;
  text-align: left;
  align-items: flex-start;
}

/* ─── GUIDE — WHAT YOU GET LIST ─────────────────────────────────────── */
.guide-what-you-get {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 420px;
  margin: 24px auto;
}
.guide-what-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.guide-what-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}
.guide-what-item div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.guide-what-item strong {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink, #2a1f2e);
}
.guide-what-item span {
  font-size: 12px;
  color: #9b8da3;
  line-height: 1.4;
}

/* ─── GUIDE — CHECKOUT BOX ──────────────────────────────────────────── */
.guide-checkout-box {
  text-align: left;
  max-width: 420px;
  margin: 20px auto 24px;
  border-top: 1px solid #cdbdcc80;
}

/* ─── GUIDE — DETAILS (old layout kept for compatibility) ───────────── */
.guide-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 420px;
  margin: 20px auto;
  padding: 18px 20px;
  border-radius: 12px;
  background: #ffffff06;
  border: 1px solid #ffffff1e;
}
.guide-details > div {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}
.guide-details span { color: #9b8da3; }
.guide-details strong { font-weight: 500; color: var(--ink, #2a1f2e); }
