/* AI Check — a bright, future-forward quiz. Mobile first. */

:root {
  color-scheme: dark;
  --bg: #070b14;
  --bg-raise: #10192c;
  --card: rgba(16, 28, 52, 0.78);
  --text: #f6f3ea;
  --muted: #d5deec;
  --gold: #ffc857;
  --gold-deep: #1a1204;
  --teal: #3ee0c7;
  --line: rgba(213, 222, 236, 0.28);
  --sans: Inter, "Avenir Next", "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  --mono: "Cascadia Mono", "Segoe UI Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  --wrap: 1080px;
}

*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

body::before {
  background:
    radial-gradient(ellipse 90% 55% at 50% 118%, rgba(255, 186, 72, 0.42), rgba(62, 224, 199, 0.08) 42%, transparent 70%),
    radial-gradient(circle at 12% 8%, rgba(255, 210, 130, 0.16), transparent 26%),
    radial-gradient(circle at 92% 0%, rgba(62, 224, 199, 0.14), transparent 28%),
    linear-gradient(180deg, #10192c 0%, #070b14 46%);
}

body::after {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    radial-gradient(1px 1px at 8% 18%, #fff 50%, transparent 60%),
    radial-gradient(1.4px 1.4px at 22% 72%, rgba(255, 255, 255, 0.85) 50%, transparent 60%),
    radial-gradient(1px 1px at 74% 22%, #fff 50%, transparent 60%),
    radial-gradient(1.2px 1.2px at 88% 64%, rgba(255, 255, 255, 0.75) 50%, transparent 60%),
    radial-gradient(1px 1px at 48% 12%, rgba(255, 255, 255, 0.8) 50%, transparent 60%),
    radial-gradient(1px 1px at 63% 48%, rgba(255, 255, 255, 0.55) 50%, transparent 60%);
  background-size: 72px 72px, 72px 72px, auto, auto, auto, auto, auto, auto;
  mask-image: radial-gradient(ellipse at 50% 20%, #000 20%, transparent 78%);
  opacity: 0.55;
}

::selection { background: var(--gold); color: var(--gold-deep); }

:focus { outline: none; }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 5;
  background: var(--gold);
  color: var(--gold-deep);
  padding: 0.6rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}

.skip:focus { top: 12px; }

.wrap {
  width: min(var(--wrap), calc(100% - 32px));
  margin-inline: auto;
}

.top {
  position: sticky;
  top: 0;
  z-index: 3;
  backdrop-filter: blur(14px);
  background: rgba(7, 11, 20, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
}

.logo,
.top-link {
  color: var(--text);
  text-decoration: none;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  margin-left: -6px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  letter-spacing: -0.03em;
  cursor: pointer;
}

.logo-mark {
  width: 28px;
  height: 28px;
  display: block;
}

.top-link {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.top-link:hover { color: var(--gold); }

main { padding: 28px 0 64px; }

.kicker {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
}

.hero {
  display: grid;
  gap: 8px;
  grid-template-areas:
    "art"
    "copy"
    "measures";
}

.hero-copy { grid-area: copy; }
.hero-art { grid-area: art; }
.measures { grid-area: measures; }

.hero-art {
  width: min(112px, 32vw);
  margin: 0 auto;
}

.orbit {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.orbit-spin {
  transform-box: view-box;
  transform-origin: center;
  animation: spin 28s linear infinite;
}

.moon-spin {
  transform-box: view-box;
  transform-origin: center;
  animation: spin 46s linear infinite reverse;
}

@keyframes spin { to { transform: rotate(360deg); } }

h1, h2, h3, p { overflow-wrap: anywhere; }

.poster {
  margin: 0;
  font-size: clamp(2.65rem, 10.5vw, 6.4rem);
  line-height: 0.9;
  letter-spacing: -0.045em;
  font-weight: 800;
}

.gold { color: var(--gold); }

.lede {
  max-width: 40rem;
  margin-top: 14px;
  color: var(--text);
  font-size: 1.12rem;
}

.answer-first {
  max-width: 42rem;
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
}

.chips li {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  background: rgba(7, 11, 20, 0.45);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 8px 0 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 52px;
  padding: 0.8rem 1.3rem;
  border-radius: 999px;
  border: 2px solid transparent;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(180deg, #ffd978, #ffc857 55%, #f0b429);
  color: var(--gold-deep);
  box-shadow: 0 10px 30px rgba(255, 200, 87, 0.22);
}

.btn-primary:hover { background: #ffe7a3; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: rgba(213, 222, 236, 0.45);
}

.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.talk {
  color: var(--muted);
  margin-top: 0;
}

.talk a { color: var(--gold); font-weight: 700; white-space: nowrap; }

.section-label {
  margin: 28px 0 12px;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--mono);
  font-weight: 600;
  color: var(--muted);
}

.measures {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.measures li,
.note,
.hope,
.cta,
.sub,
.tips li,
.choice {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.measures li {
  border-radius: 18px;
  padding: 16px 16px 14px;
}

.measures h3,
.sub h3,
.tips h3,
.cta h2,
.hope p {
  margin: 0;
}

.measures h3 {
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.measures p,
.note p,
.sub p,
.tips p,
.cta p,
.hope p,
.formula-note,
.disclaimer,
.quiz-note {
  color: var(--muted);
}

.measures p { margin: 6px 0 0; }

.note,
.hope,
.cta {
  border-radius: 22px;
  padding: 18px 18px 16px;
  margin-top: 22px;
}

.note h2,
.hope h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.note p:last-child,
.hope p:last-child,
.cta p:last-child { margin-bottom: 0; }

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 28px 0 40px;
  color: var(--muted);
}

.site-footer p { margin: 0 0 6px; }

.site-footer a { color: var(--gold); }

.site-footer strong { color: var(--text); }

.disclaimer { font-size: 0.92rem; margin-top: 12px; }

body[data-screen="quiz"] .site-footer { display: none; }

.quiz-head { margin-bottom: 18px; }

.bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--teal));
}

.q-title {
  margin: 22px 0 16px;
  font-size: clamp(1.45rem, 4.6vw, 2.2rem);
  line-height: 1.18;
  letter-spacing: -0.03em;
}

.choice {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  margin: 0 0 10px;
  padding: 14px 14px;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: none;
}

.choice input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.choice:focus-within {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.key {
  flex: 0 0 auto;
  width: 1.8rem;
  height: 1.8rem;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
}

.choice-label { padding-top: 2px; }

.mark {
  margin-left: auto;
  color: var(--gold);
  font-weight: 800;
  opacity: 0;
}

.choice.is-selected {
  border-color: var(--gold);
  background: linear-gradient(90deg, rgba(255, 200, 87, 0.24), rgba(62, 224, 199, 0.1));
}

.choice.is-selected .key {
  background: var(--gold);
  color: var(--gold-deep);
}

.choice.is-selected .mark { opacity: 1; }

.quiz-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 10px;
  padding: 18px 0 calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(7, 11, 20, 0.94) 28%);
}

.quiz-actions .btn-primary { flex: 1; }

.quiz-note {
  margin: 4px 0 0;
  font-size: 0.92rem;
}

.score-layout {
  display: grid;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.score-orb {
  position: relative;
  width: min(220px, 70vw);
  margin: 0 auto;
}

.score-orb svg { width: 100%; height: auto; display: block; }

.ring-track,
.ring-value {
  fill: none;
  stroke-width: 8;
}

.ring-track { stroke: rgba(255, 255, 255, 0.12); }

.ring-value {
  stroke: url(#ringGrad);
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 60px 60px;
}

.score-figure {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  margin: 0;
  text-align: center;
}

.score-num {
  font-size: clamp(3.2rem, 10vw, 4.4rem);
  line-height: 0.9;
  letter-spacing: -0.05em;
  font-weight: 800;
}

.score-denom {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#tier-name {
  margin: 8px 0 8px;
  font-size: clamp(2.1rem, 6vw, 3.4rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  text-align: center;
}

#tier-summary {
  margin: 0 auto 8px;
  max-width: 40rem;
  text-align: center;
  color: var(--muted);
  font-size: 1.12rem;
}

.subs {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.sub {
  border-radius: 18px;
  padding: 14px 14px 12px;
  box-shadow: none;
}

.sub-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.sub h3 { font-size: 1.02rem; letter-spacing: -0.02em; }

.sub-score {
  margin: 0;
  color: var(--gold);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
}

.meter {
  height: 10px;
  margin: 10px 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--teal));
  transition: width 0.7s ease;
}

.formula-note {
  margin: 14px 0 0;
  font-size: 0.98rem;
}

.tips {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
  counter-reset: tip;
}

.tips li {
  border-radius: 18px;
  padding: 14px 14px 12px 16px;
  box-shadow: none;
  border-left: 4px solid var(--gold);
}

.tips li::before {
  counter-increment: tip;
  content: counter(tip, decimal-leading-zero);
  display: block;
  margin-bottom: 4px;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--teal);
}

.tips h3 {
  font-size: 1.12rem;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.tips p { margin: 0; }

.hope {
  background:
    linear-gradient(180deg, rgba(255, 200, 87, 0.16), rgba(62, 224, 199, 0.08)),
    rgba(16, 28, 52, 0.9);
  border-color: rgba(255, 200, 87, 0.45);
}

.hope-kicker {
  margin: 0 0 8px;
  font-family: var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--gold);
}

.hope-line {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  line-height: 1.35;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.cta h2 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 8px;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 10px;
}

.end-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  align-items: center;
}

#share-status {
  flex-basis: 100%;
  min-height: 1.4em;
  margin: 0;
  color: var(--teal);
  font-weight: 700;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.error-view h1 { letter-spacing: -0.04em; }

@media (min-width: 800px) {
  main { padding-top: 42px; }

  .hero {
    grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr);
    grid-template-areas:
      "copy art"
      "measures measures";
    column-gap: 36px;
    align-items: center;
  }

  .hero-art {
    width: min(420px, 100%);
    margin: 0 0 0 auto;
  }

  .measures { grid-template-columns: repeat(3, 1fr); }

  .poster { font-size: clamp(4.2rem, 6.4vw, 6.5rem); }

  .score-layout {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 18px 28px;
    margin-top: 10px;
  }

  .score-orb { margin: 0; }

  #tier-name,
  #tier-summary { text-align: left; }

  #tier-name { margin-top: 18px; }

  .subs { grid-template-columns: repeat(3, 1fr); }

  .quiz-panel { max-width: 760px; margin-inline: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .orbit-spin,
  .moon-spin { animation: none; }
  .meter-fill,
  .ring-value,
  .bar-fill { transition: none; }
}

@media (forced-colors: active) {
  .btn,
  .choice,
  .measures li,
  .note,
  .hope,
  .cta,
  .tips li,
  .sub { border: 1px solid CanvasText; }
  .btn-primary { background: ButtonFace; color: ButtonText; }
}

@media print {
  body { background: #fff; color: #111; }
  body::before,
  body::after,
  .top,
  .skip,
  .end-actions,
  .quiz-actions { display: none !important; }
  .measures li,
  .note,
  .hope,
  .cta,
  .sub,
  .tips li { box-shadow: none; background: #fff; color: #111; }
  a { color: #111; }
}
