/* CitizenOz home page: the hero's night sky and phone, the test paper that marks itself, the scroll
   story, the sky map, the read-aloud and try-it demos, the screens marquee and the closing mark.
   Loaded on the home page only. Everything is readable and still without JavaScript or with reduced
   motion: hidden-until-revealed states only apply once landing.js adds `.motion` to <html>. */

@property --angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

/* ---------- Hero ---------- */
.hero { margin-top: -64px; padding: 116px 0 0; min-height: min(100svh, 980px); display: flex; flex-direction: column; }
.hero .sky { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; }
.hero.live::before { opacity: 0; }
.hero-inner { text-align: center; display: flex; flex-direction: column; align-items: center; position: relative; }
.hero .eyebrow { justify-content: center; }
.hero-title { font-size: clamp(46px, 7.6vw, 96px); line-height: 0.98; letter-spacing: -0.04em; margin: 22px 0 24px; }
.hero-title .line { display: block; }
.hero-title .w { display: inline-block; will-change: transform; }
.hero .lede { max-width: 36em; margin: 0 auto 30px; color: var(--night-muted); font-size: clamp(17px, 1.5vw, 20px); }
.hero .cta { justify-content: center; margin-bottom: 14px; }
.hero .fine { color: var(--night-muted); font-size: 14px; }

.stage { position: relative; width: min(1120px, 100%); margin: 52px auto 0; height: clamp(400px, 46vw, 600px); flex: 1 0 auto; perspective: 1400px; }
.hero-phone { position: absolute; left: 50%; bottom: 0; width: clamp(250px, 25vw, 320px); padding: 11px 11px 0; border-radius: 48px 48px 0 0;
  transform: translateX(-50%) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transform-origin: 50% 100%; transition: transform 0.7s var(--ease-out);
  box-shadow: 0 -10px 80px -10px rgba(106, 142, 255, 0.45), 0 40px 80px rgba(2, 8, 36, 0.6); }
.hero-phone img { border-radius: 38px 38px 0 0; width: 100%; aspect-ratio: 390 / 760; object-fit: cover; object-position: top; }

.burst i { width: 17px; height: 17px; background: var(--night-gold); clip-path: polygon(50% 0, 61.8% 35.3%, 98.5% 35.3%, 68.8% 57.1%, 79.4% 92.7%, 50% 71%, 20.6% 92.7%, 31.2% 57.1%, 1.5% 35.3%, 38.2% 35.3%); }

@media (prefers-reduced-motion: no-preference) {
  .hero-title .w { animation: word-up 0.95s var(--ease-out) both; animation-delay: calc(140ms + var(--i) * 85ms); }
  .rise { animation: fade-up 0.9s var(--ease-out) both; animation-delay: calc(140ms + var(--d) * 85ms); }
  .hero-phone { animation: phone-rise 1.3s 0.55s var(--ease-out) both; }
}
@keyframes word-up { from { opacity: 0; transform: translateY(0.55em) rotate(5deg); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes phone-rise { from { opacity: 0; translate: 0 120px; } to { opacity: 1; translate: 0 0; } }

@media (max-width: 860px) {
  .stage { height: 440px; margin-top: 40px; }
}

/* ---------- Rhythm: sections sit closer together than on the guides ---------- */
.home .section { padding: 64px 0; }
.home .section-head { margin-bottom: 32px; }

/* ---------- The test paper ---------- */
.section.test { padding-top: 88px; }
.test-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.test-copy h2 { font-size: clamp(32px, 4vw, 48px); margin: 0 0 16px; }
.sub { color: var(--text-2); font-size: 18px; margin-bottom: 26px; }
.test-copy .keys { grid-template-columns: 1fr; }
.key { position: relative; align-items: center; transition: border-color 0.35s, background-color 0.35s; }
.key .turn { margin-left: auto; flex: none; width: 32px; height: 32px; border-radius: 16px; border: 2px solid var(--stroke-strong); display: grid; place-items: center; transition: background-color 0.35s, border-color 0.35s, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
.key .turn::after { content: ''; width: 12px; height: 7px; border: solid #fff; border-width: 0 0 3px 3px; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.key.pass { border-color: var(--success); }
.key.pass .turn { background: var(--success); border-color: var(--success); transform: rotate(360deg); }
.key.pass .turn::after { opacity: 1; }
.key.fail { border-color: #c8283a; }
.key.fail .turn { background: #c8283a; border-color: #c8283a; transform: rotate(-90deg); }
.key.fail .turn::after { opacity: 1; width: 12px; height: 12px; border-width: 0; transform: none; background: linear-gradient(45deg, transparent 43%, #fff 43%, #fff 57%, transparent 57%), linear-gradient(-45deg, transparent 43%, #fff 43%, #fff 57%, transparent 57%); }

.paper { background: var(--surface); border-radius: 30px; padding: 26px; box-shadow: 0 40px 80px -32px rgba(10, 42, 143, 0.45), var(--shadow); }
.paper-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.paper-title { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 600; }
.paper-score { font: 800 24px/1 var(--display); font-variant-numeric: tabular-nums; }
.tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.qt { position: relative; aspect-ratio: 1; border-radius: 16px; background: var(--accent-soft); display: grid; place-items: center;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s, opacity 0.3s; }
.qt b { font: 700 17px/1 var(--display); color: var(--accent-text); }
.qt.v { background: var(--gold); }
.qt.v b { color: #2a1e00; }
.qt i { position: absolute; right: -6px; bottom: -6px; width: 26px; height: 26px; border-radius: 13px; border: 3px solid var(--surface); transform: scale(0); transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
.qt i::after { content: ''; position: absolute; inset: 0; margin: auto; }
.qt.ok i { background: var(--success); transform: scale(1); }
.qt.ok i::after { width: 9px; height: 5px; border: solid #fff; border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg) translate(1px, -1px); }
.qt.no i { background: #c8283a; transform: scale(1); }
.qt.no i::after { width: 10px; height: 10px; background: linear-gradient(45deg, transparent 40%, #fff 40%, #fff 60%, transparent 60%), linear-gradient(-45deg, transparent 40%, #fff 40%, #fff 60%, transparent 60%); }
.qt.no { animation: nudge 0.35s; }
.motion .qt.off { opacity: 0; transform: scale(0.5); }
.verdict { margin-top: 20px; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 12px 16px; border-radius: 16px; background: var(--surface-muted); font-weight: 600; transition: background-color 0.35s, color 0.35s; }
.verdict-dot { flex: none; width: 10px; height: 10px; border-radius: 5px; background: var(--text-3); transition: background-color 0.35s; }
.verdict.pass { background: rgba(11, 122, 75, 0.12); color: var(--success); }
.verdict.pass .verdict-dot { background: var(--success); }
.verdict.fail { background: rgba(200, 40, 58, 0.1); color: #c8283a; }
.verdict.fail .verdict-dot { background: #c8283a; }
.legend { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 16px; color: var(--text-3); font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; }
.legend .lv { background: var(--gold); } .legend .lok { background: var(--success); border-radius: 6px; } .legend .lno { background: #c8283a; border-radius: 6px; }
@keyframes nudge { 30% { transform: translateX(-4px); } 60% { transform: translateX(4px); } }
@media (max-width: 900px) { .test-grid { grid-template-columns: 1fr; gap: 36px; } }

/* ---------- The scroll story ---------- */
.story { background: linear-gradient(180deg, var(--bg) 0%, var(--surface-muted) 14%, var(--surface-muted) 86%, var(--bg) 100%); }
.story-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 64px; align-items: center; min-height: 100svh; padding-block: 32px; }
.story-steps h2 { font-size: clamp(32px, 4vw, 48px); margin: 0 0 8px; }
.story-list { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.step { display: flex; align-items: flex-start; gap: 18px; padding: 20px 22px; border-radius: 22px; transition: background-color 0.45s, box-shadow 0.45s, opacity 0.45s; }
.motion .step { opacity: 0.45; }
.motion .step.is-active { opacity: 1; background: var(--surface); box-shadow: var(--shadow); }
.step .num { flex: none; width: 42px; height: 42px; border-radius: 21px; display: grid; place-items: center; background: var(--surface-muted); font: 800 18px/1 var(--display); transition: background-color 0.45s, color 0.45s; }
.step.is-active .num { background: var(--night); color: #fff; }
.step h3 { font-size: 22px; margin: 0 0 6px; }
.step p { color: var(--text-2); }
.step-shot { display: none; }
.story-stage { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.story-phone { width: min(330px, calc((100svh - 190px) * 390 / 844)); }
.story-phone .screens { position: relative; aspect-ratio: 390 / 844; overflow: hidden; border-radius: 38px; }
.story-phone .screens picture { position: absolute; inset: 0; will-change: transform; }
.story-phone .screens img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.rail { display: flex; gap: 8px; }
.rail b { position: relative; width: 44px; height: 5px; border-radius: 3px; background: var(--stroke-strong); overflow: hidden; }
.rail b::after { content: ''; position: absolute; inset: 0; background: var(--accent); transform: scaleX(var(--p, 0)); transform-origin: left; }
@media (max-width: 900px) {
  .story { padding: 48px 0; }
  .story-grid { grid-template-columns: 1fr; min-height: 0; padding-block: 0; }
  .story-stage { display: none; }
  .motion .step { opacity: 1; background: var(--surface); box-shadow: var(--shadow); }
  .step { flex-wrap: wrap; }
  .step-shot { display: block; width: 100%; max-width: 260px; height: auto; margin: 16px auto 0; border-radius: 26px; border: 8px solid #0b1230; aspect-ratio: 390 / 640; object-fit: cover; object-position: top; }
}

/* ---------- The sky map ---------- */
.skymap { padding: 88px 0 80px; text-align: center; }
.skymap .section-head { margin-inline: auto; }
.skymap .section-head p { color: var(--night-muted); }
.constellations { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; margin: 24px 0 34px; }
.con { margin: 0; }
.con svg { width: 100%; max-width: 230px; margin: 0 auto 14px; overflow: visible; }
.con line { stroke: #fff; stroke-opacity: 0.16; stroke-width: 1.2; transition: stroke 0.6s, stroke-opacity 0.6s; }
.con line.on { stroke: var(--night-gold); stroke-opacity: 0.7; }
.con .halo { display: none; }
.con .dot { fill: #fff; opacity: 0.45; transition: opacity 0.4s; }
.con .lit { fill: var(--night-gold); transform-box: fill-box; transform-origin: center; transform: scale(0) rotate(-72deg); transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); filter: drop-shadow(0 0 3px rgba(255, 198, 41, 0.75)); }
.con .st.on .dot { opacity: 0; }
.con .st.on .lit { transform: scale(1) rotate(0deg); }
.con figcaption { color: var(--night-muted); font-size: 15px; display: grid; gap: 4px; }
.con figcaption span { color: var(--night-gold); font-weight: 600; font-size: 12px; }
.sky-count { font-size: 18px; color: var(--night-muted); }
.sky-count b { font: 800 48px/1 var(--display); color: #fff; font-variant-numeric: tabular-nums; margin-right: 8px; vertical-align: -6px; }
@media (max-width: 760px) { .constellations { grid-template-columns: 1fr 1fr; gap: 20px; } }

/* ---------- Read aloud and try one ---------- */
.try-section { padding-top: 88px; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: stretch; }
.panel { position: relative; display: flex; flex-direction: column; background: var(--surface); border-radius: 30px; padding: 30px; box-shadow: var(--shadow); }
.listen .listen-row { margin-top: auto; }
.panel h3 { font-size: clamp(24px, 2.4vw, 30px); margin: 0 0 10px; }
.listen-text { font-size: 20px; line-height: 1.7; margin: 22px 0 24px; }
.listen-text .wd { border-radius: 6px; transition: background-color 0.12s, color 0.12s, box-shadow 0.12s; }
.listen-text .wd.now { background: var(--gold-soft); box-shadow: 0 0 0 3px var(--gold-soft); color: var(--text); }
.listen-text .wd.done { color: var(--text-3); }
.listen-row { display: flex; align-items: center; gap: 18px; }
.wave { display: flex; align-items: center; gap: 4px; height: 34px; }
.wave i { width: 4px; height: 6px; border-radius: 2px; background: var(--accent); opacity: 0.35; transition: height 0.25s, opacity 0.25s; }
.listening .wave i { opacity: 1; animation: wave 0.9s ease-in-out infinite; }
.wave i:nth-child(2n) { animation-delay: 0.12s; } .wave i:nth-child(3n) { animation-delay: 0.27s; } .wave i:nth-child(5n) { animation-delay: 0.4s; }
@keyframes wave { 0%, 100% { height: 6px; } 50% { height: 30px; } }

.try-stem { font: 600 21px/1.35 var(--sans); letter-spacing: 0; margin: 20px 0 14px; }
.try-choices { display: grid; gap: 10px; }
.try-choice { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px 16px; border-radius: 16px; border: 1.5px solid var(--stroke); background: var(--surface); color: var(--text); font: 500 16px/1.4 var(--sans); cursor: pointer; transition: border-color 0.2s, background-color 0.2s, transform 0.12s var(--ease-out), opacity 0.3s; }
.try-choice:hover:not(:disabled) { border-color: var(--accent); }
.try-choice:active:not(:disabled) { transform: scale(0.985); }
.try-choice:disabled { cursor: default; }
.try-choice .k { flex: none; width: 30px; height: 30px; border-radius: 15px; display: grid; place-items: center; background: var(--surface-muted); color: var(--text-2); font-weight: 600; font-size: 14px; transition: background-color 0.25s, color 0.25s; }
.try-choice.right { border-color: var(--success); background: rgba(11, 122, 75, 0.1); }
.try-choice.right .k { background: var(--success); color: #fff; }
.try-choice.wrong { border-color: #c8283a; background: rgba(200, 40, 58, 0.08); animation: shake 0.4s; }
.try-choice.wrong .k { background: #c8283a; color: #fff; }
.try-choice.dim { opacity: 0.45; }
.try-answer { margin-top: 16px; padding: 18px; border-radius: 18px; background: var(--surface-muted); display: grid; gap: 8px; animation: fade-up 0.5s var(--ease-out) both; }
.try-answer[hidden] { display: none; }
.verdict-line { font-weight: 700; font-size: 17px; }
.verdict-line.ok { color: var(--success); } .verdict-line.no { color: #c8283a; }
.burst { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; z-index: 3; }
.burst i { position: absolute; left: -8px; top: -8px; animation: burst 0.95s var(--ease-out) forwards; }
@keyframes burst { from { opacity: 1; transform: translate(0, 0) rotate(0) scale(0.4); } to { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--r)) scale(1); } }
@keyframes shake { 20% { transform: translateX(-6px); } 45% { transform: translateX(6px); } 70% { transform: translateX(-3px); } }
@media (max-width: 900px) { .duo { grid-template-columns: 1fr; } }

/* ---------- Features ---------- */

/* ---------- Screens marquee ---------- */
.marquee { overflow: hidden; padding: 8px 0 24px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
.marquee-track { display: flex; gap: 28px; padding-right: 28px; width: max-content; }
.phone.small { flex: none; width: 230px; padding: 8px; border-radius: 36px; }
.phone.small img { border-radius: 29px; aspect-ratio: 390 / 844; object-fit: cover; }
@media (prefers-reduced-motion: no-preference) {
  .marquee.running .marquee-track { animation: marquee 60s linear infinite; }
  .marquee:hover .marquee-track { animation-play-state: paused; }
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Pricing: the lifetime plan's border catches the light ---------- */
.plan { transition: transform 0.35s var(--ease-out), box-shadow 0.35s; }
.plan:hover { transform: translateY(-6px); }
.plan.best { border: 2px solid transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, conic-gradient(from var(--angle), var(--gold), rgba(245, 184, 0, 0.15) 25%, var(--gold) 50%, rgba(245, 184, 0, 0.15) 75%, var(--gold)) border-box; }
@media (prefers-reduced-motion: no-preference) { .plan.best { animation: spin-angle 6s linear infinite; } }
@keyframes spin-angle { to { --angle: 360deg; } }

/* ---------- FAQ: heading on the left, questions on the right ---------- */
.faq-layout { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 56px; align-items: start; }
.faq-layout .section-head { position: sticky; top: 96px; margin-bottom: 0; }
.faq-layout .faq { max-width: none; }
.faq details > div { animation: fade-up 0.35s var(--ease-out); }
@media (max-width: 900px) { .faq-layout { grid-template-columns: 1fr; gap: 0; } .faq-layout .section-head { position: static; margin-bottom: 28px; } }

/* ---------- Closing band ---------- */
.band { padding: 88px 0; }
.band-inner { display: flex; flex-direction: column; align-items: center; }
.pass-mark { width: 132px; height: 132px; margin-bottom: 22px; filter: drop-shadow(0 18px 30px rgba(2, 8, 36, 0.45)); }
.motion .pass-mark .fill { clip-path: inset(0 100% 0 0 round 28px); }
.motion .pass-mark .knob { transform: translateX(-514px); }
.band.in .pass-mark .fill { animation: fill-bar 1.1s 0.25s cubic-bezier(0.77, 0, 0.175, 1) forwards; }
.band.in .pass-mark .knob { animation: knob-run 1.35s 0.25s cubic-bezier(0.77, 0, 0.175, 1) forwards; }
@keyframes fill-bar { to { clip-path: inset(0 0 0 0 round 28px); } }
@keyframes knob-run { 0% { transform: translateX(-514px); } 78% { transform: translateX(0); } 89% { transform: translateX(0) scale(1.08); } 100% { transform: translateX(0); } }
.band::after, .band .wrap::before { content: ''; position: absolute; width: 140px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, #fff); opacity: 0; pointer-events: none; }
.band::after { top: 22%; left: 8%; transform: rotate(-16deg); }
.band .wrap { position: relative; }
.band .wrap::before { top: 8%; right: 12%; transform: rotate(-24deg); }
@media (prefers-reduced-motion: no-preference) {
  .band::after { animation: shoot 7s 1s linear infinite; }
  .band .wrap::before { animation: shoot 9s 4s linear infinite; }
}
@keyframes shoot { 0% { opacity: 0; translate: 0 0; } 3% { opacity: 1; } 10% { opacity: 0; translate: 260px 90px; } 100% { opacity: 0; translate: 260px 90px; } }

/* ---------- Scroll reveals (set up by landing.js) ---------- */
.motion .reveal { opacity: 0; transform: translateY(34px); }
