:root {
  --bg: #0d0b14;
  --bg-2: #15111f;
  --ink: #ece6f5;
  --muted: #8d84a3;
  --line: rgba(236, 230, 245, 0.14);
  --gold: #d9b26f;
  --gold-soft: rgba(217, 178, 111, 0.16);
  --violet: #6b4fa3;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,.55), transparent 60%),
    radial-gradient(1px 1px at 78% 12%, rgba(255,255,255,.45), transparent 60%),
    radial-gradient(1.5px 1.5px at 40% 70%, rgba(255,255,255,.35), transparent 60%),
    radial-gradient(1px 1px at 88% 64%, rgba(255,255,255,.5), transparent 60%),
    radial-gradient(1px 1px at 22% 86%, rgba(255,255,255,.4), transparent 60%),
    radial-gradient(1px 1px at 60% 34%, rgba(255,255,255,.3), transparent 60%),
    radial-gradient(ellipse 80% 55% at 50% 0%, rgba(107, 79, 163, 0.28), transparent 70%),
    var(--bg);
}

body { display: flex; flex-direction: column; min-height: 100svh; }

#app {
  flex: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  animation: rise 0.45s ease both;
}
.screen.leaving { animation: fall 0.2s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes fall { to { opacity: 0; transform: translateY(-6px); } }

.sigil {
  width: 44px;
  height: 44px;
  margin: 0 auto;
  color: var(--gold);
  animation: breathe 4s ease-in-out infinite;
}
.sigil.big { width: 84px; height: 84px; }
.sigil.seeking { animation: seek 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.55; transform: scale(0.96); } }
@keyframes seek { 50% { opacity: 0.35; transform: scale(1.12) rotate(8deg); } }

h1, .prompt, .oracle {
  font-family: var(--serif);
  font-weight: 500;
  text-align: center;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(34px, 8vw, 46px); line-height: 1.12; }
.prompt { font-size: clamp(27px, 6.6vw, 34px); line-height: 1.2; }
.oracle { font-size: 24px; font-style: italic; color: var(--muted); }

.lead {
  text-align: center;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0;
}

.hint { text-align: center; color: var(--muted); font-size: 15px; margin: -8px 0 0; text-wrap: balance; }

.options { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.options.grid { display: grid; grid-template-columns: 1fr 1fr; }

button { font: inherit; color: inherit; cursor: pointer; }

.opt {
  width: 100%;
  min-height: 52px;
  padding: 13px 18px;
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  display: flex;
  align-items: center;
  gap: 12px;
}
.opt:hover { border-color: rgba(217, 178, 111, 0.5); }
.opt:active { transform: scale(0.99); }
.opt[aria-pressed='true'] { border-color: var(--gold); background: var(--gold-soft); }
.opt .badge {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 13px;
  color: var(--gold);
}
.opt[aria-pressed='true'] .badge { border-color: var(--gold); }
.options.grid .opt { justify-content: center; text-align: center; min-height: 64px; }

.primary {
  align-self: center;
  min-width: 200px;
  min-height: 52px;
  padding: 14px 32px;
  border: 0;
  border-radius: 999px;
  background: var(--gold);
  color: #14101f;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: opacity 0.15s, transform 0.1s;
}
.primary:disabled { opacity: 0.35; cursor: default; }
.primary:not(:disabled):active { transform: scale(0.98); }

.ghost {
  align-self: center;
  background: none;
  border: 0;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: 8px;
}

.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.row .primary, .row .secondary { min-width: 0; flex: 1 1 140px; }
.secondary {
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  font-weight: 500;
}

input[type='email'], textarea {
  width: 100%;
  padding: 15px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  font: inherit;
  font-size: 17px;
}
input:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
textarea { min-height: 140px; resize: vertical; line-height: 1.5; }

.disclaimer { text-align: center; font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.note { text-align: center; font-size: 14px; color: var(--muted); margin: 0; }
.error { text-align: center; font-size: 14px; color: #f0a7a7; margin: 0; min-height: 1.2em; }
.turnstile { display: flex; justify-content: center; min-height: 65px; }

.card-wrap { display: flex; justify-content: center; }
.card-wrap canvas {
  width: min(100%, 400px);
  aspect-ratio: 4 / 5;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--line);
}
.reading {
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.5;
  margin: 0;
}

.notice {
  border: 1px solid var(--gold);
  background: var(--gold-soft);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
}
.notice p { margin: 0 0 14px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  animation: rise 0.3s ease both;
}

.ghost.small { font-size: 14px; padding: 4px; }
.ghost:disabled { opacity: 0.4; cursor: default; }

.check {
  align-self: center;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
}
.check input { width: 22px; height: 22px; accent-color: var(--gold); margin: 0; }

.rating { display: flex; flex-direction: column; gap: 10px; padding: 8px 0; }
.dots { display: flex; justify-content: center; gap: 10px; }
.dot {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
}
.dot[aria-pressed='true'] { border-color: var(--gold); background: var(--gold); color: #14101f; font-weight: 600; }
.ends { display: flex; justify-content: space-between; max-width: 290px; width: 100%; margin: 0 auto; font-size: 13px; color: var(--muted); }

.site-footer {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 16px 16px max(20px, env(safe-area-inset-bottom));
  font-size: 13px;
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover, .site-footer a[aria-current='page'] { color: var(--gold); }

/* Legal pages */
.doc { max-width: 680px; margin: 0 auto; padding: 32px 16px 48px; width: 100%; flex: 1; }
.doc .home { display: inline-flex; color: var(--gold); margin-bottom: 24px; }
.doc .home svg { width: 40px; height: 40px; }
.doc h1 { text-align: left; font-size: clamp(32px, 7vw, 42px); margin-bottom: 6px; }
.doc .updated { color: var(--muted); font-size: 14px; margin: 0 0 28px; }
.doc h2 { font-family: var(--serif); font-weight: 600; font-size: 25px; margin: 32px 0 8px; }
.doc p, .doc li { color: #d8d1e6; font-size: 16px; line-height: 1.65; }
.doc ul { padding-left: 20px; }
.doc li { margin-bottom: 6px; }
.doc a { color: var(--gold); }
.doc .callout { border: 1px solid var(--gold); background: var(--gold-soft); border-radius: 14px; padding: 16px 18px; margin: 20px 0; }
.doc .callout p { margin: 0; color: var(--ink); }

.noscript { text-align: center; padding: 40px 16px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
