/* Love or Fear. One night at the door of the mind: fear's cold left, love's warm right. */
:root {
  --night: #050908;
  --pearl: #f4eee2;
  --mist: #a9b3ad;
  --gold: #f0c86e;
  --gold-deep: #b8862e;
  --rose: #ffa8a0;
  --ember: #e86054;
  --ash: #96aac4;
  --line: rgba(244, 238, 226, 0.14);
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Roboto Condensed", "Avenir Next Condensed", "Arial Narrow", sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--night); color: var(--pearl); }
body { font-family: var(--sans); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
button { font: inherit; color: inherit; cursor: pointer; }

/* Thought labels ride their bubbles. */
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 2; }
.label {
  position: absolute; left: 0; top: 0; width: 13em; margin-left: -6.5em; text-align: center;
  font-family: var(--serif); font-style: italic; font-weight: 500; line-height: 1.08;
  color: var(--pearl); text-shadow: 0 1px 14px rgba(0, 0, 0, 0.9), 0 0 2px rgba(0, 0, 0, 0.8);
  pointer-events: auto; cursor: pointer; user-select: none; will-change: transform, opacity;
  transform-origin: 50% 50%; transition: color 0.4s ease;
}
.label.guest { pointer-events: none; font-weight: 600; }
.label.love { color: #fff4d6; text-shadow: 0 0 18px rgba(240, 200, 110, 0.9), 0 1px 10px rgba(0, 0, 0, 0.9); }
.label.fear { color: #d9e4f2; }

/* The brand mark. */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 5; display: flex; justify-content: center; padding: 18px 16px 0; pointer-events: none; }
.mark { pointer-events: auto; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--pearl); }
.mark svg { width: 26px; height: 26px; }
.mark .m-fear, .mark .m-love { fill: none; stroke-width: 4.5; }
.mark .m-fear { stroke: var(--ash); }
.mark .m-love { stroke: var(--gold); }
.mark .m-star { fill: var(--gold); }
.mark span { font-weight: 600; font-size: 13px; letter-spacing: 0.32em; text-transform: uppercase; opacity: 0.86; }

.tally { position: fixed; top: 64px; z-index: 4; display: flex; align-items: baseline; gap: 8px; font-size: 12px; letter-spacing: 0.24em; text-transform: uppercase; pointer-events: none; }
.tally b { font-size: 28px; font-weight: 300; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.tally i { font-style: normal; opacity: 0.7; }
.fear-tally { left: 22px; color: var(--ash); }
.love-tally { right: 22px; color: var(--gold); }
.tally b.bump { animation: bump 0.6s ease; }
@keyframes bump { 30% { transform: scale(1.45); } }

/* The question at the door. */
.ask { position: fixed; left: 0; right: 0; top: 17vh; z-index: 4; text-align: center; pointer-events: none; opacity: 0; transform: translateY(8px); transition: opacity 0.5s ease, transform 0.6s ease; }
.ask.on { opacity: 1; transform: none; }
.ask-line { margin: 0 auto; max-width: 18ch; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: clamp(30px, 5.4vw, 64px); line-height: 1.02; text-shadow: 0 2px 30px rgba(0, 0, 0, 0.9); }
.w-love { color: var(--gold); font-style: italic; }
.w-fear { color: var(--ash); font-style: italic; }

/* The reading. */
.verdict { position: fixed; left: 50%; bottom: calc(108px + var(--safe-b)); z-index: 6; width: min(760px, calc(100vw - 28px)); transform: translateX(-50%); text-align: center; }
.verdict[hidden], .verdict [hidden], [hidden] { display: none !important; }
.whisper { margin: 0 0 12px; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: clamp(26px, 3.6vw, 40px); line-height: 1.05; text-shadow: 0 2px 24px rgba(0, 0, 0, 0.95); }
.verdict.v-love .whisper { color: #ffe7b0; }
.verdict.v-fear .whisper { color: #ffd1c9; }
.verdict.v-care .whisper { color: var(--rose); }
.voices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 10px; }
.says { margin: 0; padding: 10px 14px; border-radius: 14px; font-size: 15px; line-height: 1.3; background: rgba(6, 10, 9, 0.62); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line); }
.fear-says { color: #cfdbea; border-color: rgba(150, 170, 196, 0.32); text-align: left; }
.love-says { color: #ffe9bd; border-color: rgba(240, 200, 110, 0.36); text-align: right; }
.verdict.v-love .fear-says, .verdict.v-fear .love-says { opacity: 0.5; }
.verdict.v-care .voices { display: none; }
.choose { display: flex; justify-content: center; gap: 12px; margin: 4px 0 10px; }
.pick { min-width: 150px; padding: 14px 22px; border-radius: 999px; border: 1px solid var(--line); background: rgba(6, 10, 9, 0.7); font-size: 15px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: transform 0.2s ease, background 0.2s ease; }
.pick:hover, .pick:focus-visible { transform: translateY(-2px); }
.pick-fear { color: var(--ash); border-color: rgba(150, 170, 196, 0.5); }
.pick-love { color: var(--gold); border-color: rgba(240, 200, 110, 0.6); }
.pick-love:hover { background: rgba(240, 200, 110, 0.14); }
.pick-fear:hover { background: rgba(150, 170, 196, 0.12); }
.reframe { margin: 2px auto 8px; padding: 14px 18px 16px; max-width: 560px; border-radius: 18px; background: radial-gradient(120% 140% at 50% 0%, rgba(240, 200, 110, 0.2), rgba(6, 10, 9, 0.72) 70%); border: 1px solid rgba(240, 200, 110, 0.45); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.reframe-line { margin: 0 0 12px; font-family: var(--serif); font-style: italic; font-size: clamp(21px, 2.8vw, 28px); line-height: 1.15; color: #fff2d2; }
.cancel { padding: 11px 22px; border: 0; border-radius: 999px; background: linear-gradient(180deg, #ffd98a, var(--gold-deep)); color: #1b1305; font-weight: 800; font-size: 13px; letter-spacing: 0.24em; text-transform: uppercase; box-shadow: 0 0 28px rgba(240, 200, 110, 0.45); }
.cancel:active { transform: scale(0.97); }
.care { margin: 0 auto 8px; max-width: 560px; padding: 14px 18px; border-radius: 18px; background: rgba(40, 18, 24, 0.7); border: 1px solid rgba(255, 168, 160, 0.4); text-align: left; font-size: 16px; line-height: 1.4; }
.care p { margin: 0 0 8px; }
.care ul { margin: 0; padding-left: 18px; }
.care a { color: var(--rose); }
.after { display: flex; justify-content: center; gap: 10px; }
.share { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: rgba(6, 10, 9, 0.55); color: var(--mist); font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; }
.share:hover { color: var(--pearl); }

.hint { position: fixed; left: 0; right: 0; bottom: calc(96px + var(--safe-b)); z-index: 3; margin: 0; text-align: center; font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--mist); opacity: 0.72; transition: opacity 0.6s ease; pointer-events: none; }
.hint.gone { opacity: 0; }

/* The dock: voice first. */
.dock { position: fixed; left: 50%; bottom: calc(22px + var(--safe-b)); z-index: 7; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; width: min(640px, calc(100vw - 24px)); padding: 7px; border-radius: 999px; background: rgba(8, 12, 11, 0.72); border: 1px solid var(--line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); }
.mic { flex: none; width: 54px; height: 54px; border-radius: 50%; border: 0; display: grid; place-items: center; background: radial-gradient(circle at 50% 35%, #ffe2a0, var(--gold) 45%, var(--gold-deep)); box-shadow: 0 0 0 0 rgba(240, 200, 110, 0.6), 0 0 26px rgba(240, 200, 110, 0.4); transition: transform 0.2s ease; }
.mic svg { width: 24px; height: 24px; fill: none; stroke: #1b1305; stroke-width: 2; stroke-linecap: round; }
.mic svg rect { fill: #1b1305; stroke: none; }
.mic.listening { animation: listen 1.2s ease-in-out infinite; }
.mic[hidden] { display: none; }
@keyframes listen { 50% { box-shadow: 0 0 0 14px rgba(240, 200, 110, 0), 0 0 40px rgba(240, 200, 110, 0.8); transform: scale(1.06); } }
.field { flex: 1; min-width: 0; }
.field input { width: 100%; height: 48px; padding: 0 8px 0 4px; border: 0; outline: 0; background: transparent; color: var(--pearl); font-family: var(--serif); font-style: italic; font-size: 21px; }
.field input::placeholder { color: rgba(244, 238, 226, 0.48); }
.go { flex: none; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: transparent; font-size: 22px; color: var(--gold); }
.go:hover { background: rgba(240, 200, 110, 0.12); }

.foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; pointer-events: none; }
.foot > * { pointer-events: auto; }
.practice-link, .sound { position: fixed; bottom: calc(30px + var(--safe-b)); width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: rgba(8, 12, 11, 0.5); color: var(--mist); text-decoration: none; font-family: var(--serif); font-style: italic; font-size: 20px; }
.practice-link { left: 18px; }
.sound { right: 18px; padding: 0; }
.sound svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.sound svg path:first-child { fill: currentColor; }
.sound .wave { opacity: 0.25; }
.sound[aria-pressed="true"] { color: var(--gold); }
.sound[aria-pressed="true"] .wave { opacity: 1; }
.stamp { position: fixed; right: 64px; bottom: calc(10px + var(--safe-b)); font-size: 10px; letter-spacing: 0.08em; color: rgba(169, 179, 173, 0.4); text-decoration: none; }
.noscript { position: fixed; inset: 40% 20px auto; text-align: center; font-family: var(--serif); font-size: 26px; }

@media (max-width: 760px) {
  .practice-link, .sound { bottom: auto; top: 14px; width: 34px; height: 34px; }
  .practice-link { left: 12px; }
  .sound { right: 12px; }
  .stamp { right: 12px; bottom: 2px; }
  .tally { top: 58px; }
  .fear-tally { left: 14px; }
  .love-tally { right: 14px; }
  .tally b { font-size: 22px; }
  .mark span { font-size: 11px; letter-spacing: 0.26em; }
  .ask { top: 13vh; }
  .verdict { bottom: calc(88px + var(--safe-b)); }
  .voices { gap: 6px; }
  .says { font-size: 13px; padding: 8px 10px; }
  .pick { min-width: 0; flex: 1; padding: 13px 10px; letter-spacing: 0.16em; }
  .dock { bottom: calc(12px + var(--safe-b)); }
  .mic { width: 50px; height: 50px; }
  .field input { font-size: 19px; }
  .hint { bottom: calc(80px + var(--safe-b)); font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .mic.listening { animation: none; }
  .ask, .hint { transition: none; }
}
