:root {
  --ink: #f7f3ea;
  --muted: #b8c0d3;
  --night: #0a1022;
  --night-soft: #101b37;
  --panel: rgba(17, 29, 57, 0.82);
  --line: rgba(255, 255, 255, 0.13);
  --gold: #f2c777;
  --mint: #8cdec3;
  --purple: #a99be9;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
  --serif: Iowan Old Style, Baskerville, "Times New Roman", serif;
  --sans: Avenir Next, Avenir, Inter, ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 75% 25%, rgba(70, 80, 151, 0.28), transparent 32rem),
    radial-gradient(circle at 12% 76%, rgba(34, 104, 101, 0.16), transparent 28rem),
    var(--night);
  font-family: var(--sans);
  overflow-x: hidden;
}
button { color: inherit; font: inherit; }
button:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }

.sky { position: fixed; inset: 0; overflow: hidden; pointer-events: none; opacity: .8; }
.star { position: absolute; width: 3px; height: 3px; background: white; border-radius: 50%; box-shadow: 0 0 10px white; animation: twinkle 3s ease-in-out infinite; }
.star-1 { left: 8%; top: 18%; }
.star-2 { left: 29%; top: 9%; animation-delay: -1s; }
.star-3 { left: 58%; top: 16%; animation-delay: -.4s; }
.star-4 { right: 8%; top: 32%; animation-delay: -1.8s; }
.star-5 { left: 18%; bottom: 24%; animation-delay: -2.2s; }
.star-6 { right: 22%; bottom: 13%; animation-delay: -.7s; }
@keyframes twinkle { 50% { opacity: .25; transform: scale(.6); } }

.site-header, footer {
  position: relative;
  z-index: 10;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-header { height: 82px; }
.wordmark, .nav-link { border: 0; background: none; cursor: pointer; }
.wordmark { padding: 8px 0; font-family: var(--serif); font-size: 1.22rem; font-weight: 600; letter-spacing: .01em; }
.mark { color: var(--gold); margin-right: 7px; }
.nav-link { padding: 10px 0 10px 18px; color: var(--muted); }
.nav-link:hover { color: var(--ink); }

main { position: relative; z-index: 2; }
.screen { width: min(1180px, calc(100% - 40px)); min-height: calc(100vh - 154px); margin: 0 auto; animation: screenIn .55s ease both; }
.screen[hidden] { display: none; }
@keyframes screenIn { from { opacity: 0; transform: translateY(10px); } }

.home-screen { display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 6vw; padding: 42px 0 80px; }
.eyebrow { margin: 0 0 20px; color: var(--gold); font-size: .75rem; font-weight: 600; letter-spacing: .19em; text-transform: uppercase; }
h1 { margin: 0; font-family: var(--serif); font-size: clamp(3.2rem, 6.5vw, 6.25rem); line-height: .98; letter-spacing: -.045em; }
h1 em { color: var(--gold); font-style: italic; font-weight: 500; }
.hero-subtitle { margin: 30px 0; color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.17rem); line-height: 1.75; }
.primary-button, .secondary-button {
  min-height: 54px;
  border-radius: 999px;
  padding: 0 25px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.primary-button { color: #152033; background: var(--gold); box-shadow: 0 10px 35px rgba(242, 199, 119, .18); }
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 14px 38px rgba(242, 199, 119, .3); }
.primary-button span { margin-left: 12px; }
.secondary-button { border-color: var(--line); background: rgba(255,255,255,.05); }
.secondary-button:hover { background: rgba(255,255,255,.1); }
.time-note { margin: 19px 0 0; color: #7f899f; font-size: .82rem; }

.animal-orbit { position: relative; width: min(38vw, 455px); aspect-ratio: 1; justify-self: center; }
.moon-glow { position: absolute; inset: 20%; border-radius: 50%; background: radial-gradient(circle at 38% 34%, #fff5cd, #e8c178 32%, #825c79 70%, transparent 71%); filter: drop-shadow(0 0 45px rgba(242,199,119,.25)); opacity: .9; }
.orbit-ring { position: absolute; border: 1px solid rgba(242,199,119,.21); border-radius: 50%; }
.ring-one { inset: 7%; }
.ring-two { inset: -5%; transform: rotate(52deg); border-style: dashed; opacity: .5; }
.orbit-animal { position: absolute; display: grid; width: 58px; height: 58px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: rgba(10,16,34,.86); box-shadow: 0 8px 30px rgba(0,0,0,.25); font-size: 1.75rem; animation: hover 5s ease-in-out infinite; }
.animal-wolf { left: 5%; top: 18%; }
.animal-dolphin { right: 4%; top: 20%; animation-delay: -1s; }
.animal-owl { right: -3%; bottom: 24%; animation-delay: -2s; }
.animal-octopus { right: 36%; bottom: -3%; animation-delay: -3s; }
.animal-goat { left: -2%; bottom: 24%; animation-delay: -4s; }
.animal-kea { left: 43%; top: -5%; animation-delay: -2.5s; }
.center-spark { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); color: #fff4c6; font-size: 3rem; text-shadow: 0 0 30px white; }
@keyframes hover { 50% { transform: translateY(-8px) rotate(3deg); } }

.quiz-screen { display: grid; place-items: center; padding: 30px 0 80px; }
.quiz-shell { width: min(760px, 100%); }
.progress-heading { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .82rem; letter-spacing: .04em; }
.quiet-button, .back-button, .text-button { border: 0; background: none; cursor: pointer; color: var(--muted); }
.quiet-button:hover, .back-button:hover, .text-button:hover { color: var(--ink); }
.progress-track { height: 4px; overflow: hidden; margin: 12px 0 55px; border-radius: 99px; background: rgba(255,255,255,.1); }
.progress-track span { display: block; width: 10%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--mint)); transition: width .4s ease; }
.question-panel { animation: questionIn .38s ease both; }
.question-panel.leaving { animation: questionOut .18s ease both; }
@keyframes questionIn { from { opacity: 0; transform: translateX(16px); } }
@keyframes questionOut { to { opacity: 0; transform: translateX(-12px); } }
.question-prompt { color: var(--gold); font-size: .75rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.question-panel h2 { max-width: 720px; margin: 10px 0 30px; font-family: var(--serif); font-size: clamp(2rem, 4.5vw, 3.25rem); font-weight: 500; line-height: 1.12; }
.answer-list { display: grid; gap: 11px; }
.answer-button { display: flex; align-items: center; width: 100%; min-height: 66px; padding: 13px 18px; color: var(--ink); text-align: left; border: 1px solid var(--line); border-radius: 15px; background: rgba(21,32,61,.64); cursor: pointer; transition: border-color .2s, transform .2s, background .2s; }
.answer-button:hover { transform: translateX(5px); border-color: rgba(242,199,119,.55); background: rgba(31,45,79,.86); }
.answer-letter { flex: 0 0 36px; display: grid; width: 36px; height: 36px; margin-right: 14px; place-items: center; color: var(--gold); border: 1px solid rgba(242,199,119,.25); border-radius: 50%; font-size: .78rem; }
.back-button { margin-top: 25px; padding: 8px 0; }
.back-button:disabled { opacity: 0; pointer-events: none; }

.reveal-screen { display: grid; place-items: center; text-align: center; }
.reveal-sigil { display: block; color: var(--gold); font-size: 4rem; animation: revealPulse 1.4s ease-in-out infinite; }
.reveal-loading p { color: var(--muted); font-family: var(--serif); font-size: 1.4rem; }
@keyframes revealPulse { 50% { transform: scale(1.35) rotate(45deg); text-shadow: 0 0 45px var(--gold); } }

.result-screen { max-width: 900px; padding: 54px 0 90px; text-align: center; }
.result-intro h1 { max-width: 780px; margin: 0 auto 38px; font-size: clamp(2.5rem, 6vw, 4.8rem); }
.result-card { position: relative; overflow: hidden; max-width: 690px; margin: 0 auto; padding: 24px 48px 30px; text-align: left; border: 1px solid rgba(255,255,255,.17); border-radius: 28px; background: linear-gradient(145deg, rgba(27,42,76,.97), rgba(13,24,49,.98)); box-shadow: var(--shadow); }
.result-card::before { content: ""; position: absolute; inset: -40% 30% 60% -30%; border-radius: 50%; background: var(--result-color, #b0a1ec); filter: blur(80px); opacity: .18; }
.card-topline, .card-footer { position: relative; display: flex; justify-content: space-between; color: #8490aa; font-size: .62rem; font-weight: 600; letter-spacing: .15em; }
.result-aura { position: relative; display: grid; width: 132px; height: 132px; margin: 28px auto 17px; place-items: center; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--result-color) 30%, transparent), transparent 68%); box-shadow: 0 0 45px color-mix(in srgb, var(--result-color) 22%, transparent); }
.result-aura::before, .result-aura::after { content: "✦"; position: absolute; color: var(--result-color); }
.result-aura::before { left: -18px; top: 28px; }
.result-aura::after { right: -24px; bottom: 20px; font-size: .7rem; }
.result-emoji { font-size: 4.8rem; filter: drop-shadow(0 10px 14px rgba(0,0,0,.28)); }
.result-animal { margin: 0; color: var(--result-color); text-align: center; font-size: .72rem; font-weight: 600; letter-spacing: .17em; text-transform: uppercase; }
.result-card h2 { max-width: 540px; margin: 8px auto 12px; text-align: center; font-family: var(--serif); font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 500; line-height: 1.05; }
.result-personality { margin: 0 0 30px; color: var(--muted); text-align: center; }
.result-details { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.result-details h3 { margin: 0 0 12px; color: var(--result-color); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; }
.result-details ul { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; list-style: none; }
.result-details li { padding: 6px 9px; border: 1px solid var(--line); border-radius: 99px; color: #dce1ec; font-size: .75rem; }
.result-details p { margin: 0; color: #d1d6e2; font-size: .86rem; line-height: 1.55; }
blockquote { margin: 27px 0; color: var(--ink); text-align: center; font-family: var(--serif); font-size: 1.32rem; font-style: italic; line-height: 1.5; }
.card-footer { padding-top: 4px; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; max-width: 690px; margin: 28px auto 0; }
.text-button { flex-basis: 100%; margin-top: 6px; padding: 8px; }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -10%; width: 7px; height: 12px; border-radius: 2px; animation: fall 3.5s ease-in forwards; }
@keyframes fall { to { transform: translate3d(var(--drift), 115vh, 0) rotate(760deg); opacity: 0; } }

.about-screen { display: grid; place-items: center; padding: 60px 0 100px; }
.about-card { max-width: 930px; padding: clamp(30px, 7vw, 72px); border: 1px solid var(--line); border-radius: 30px; background: var(--panel); box-shadow: var(--shadow); }
.about-card h1 { max-width: 780px; font-size: clamp(2.8rem, 6vw, 5rem); }
.about-lead { max-width: 730px; margin: 28px 0 42px; color: var(--muted); font-size: 1.15rem; line-height: 1.75; }
.about-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 15px; margin-bottom: 38px; }
.about-grid div { padding: 22px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.025); }
.about-grid span { color: var(--gold); }
.about-grid h2 { margin: 14px 0 8px; font-family: var(--serif); font-size: 1.3rem; }
.about-grid p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.6; }

footer { min-height: 72px; color: #677189; border-top: 1px solid rgba(255,255,255,.06); font-size: .75rem; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 28px; transform: translate(-50%, 20px); padding: 11px 18px; color: var(--night); border-radius: 99px; background: var(--mint); font-size: .82rem; font-weight: 600; opacity: 0; pointer-events: none; transition: .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%,0); }

@media (max-width: 800px) {
  .home-screen { grid-template-columns: 1fr; padding-top: 28px; text-align: center; }
  .hero-copy { position: relative; z-index: 2; }
  .animal-orbit { order: -1; width: min(75vw, 330px); margin-bottom: 12px; }
  .orbit-animal { width: 46px; height: 46px; font-size: 1.35rem; }
  .hero-subtitle br { display: none; }
  .about-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .site-header, footer, .screen { width: min(100% - 28px, 1180px); }
  .site-header { height: 68px; }
  .screen { min-height: calc(100vh - 130px); }
  h1 { font-size: clamp(2.85rem, 14vw, 4rem); }
  .home-screen { gap: 18px; padding: 12px 0 55px; }
  .animal-orbit { width: 68vw; }
  .quiz-screen { padding-top: 14px; }
  .progress-track { margin-bottom: 38px; }
  .question-panel h2 { font-size: 2.05rem; }
  .answer-button { min-height: 62px; padding: 11px 13px; font-size: .92rem; }
  .result-screen { padding-top: 34px; }
  .result-card { padding: 20px 21px 25px; border-radius: 21px; }
  .result-details { grid-template-columns: 1fr; gap: 22px; }
  .result-aura { width: 108px; height: 108px; }
  .result-emoji { font-size: 4rem; }
  footer { align-items: flex-start; padding: 22px 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
