/* ============================================================
   Monterey Space Program
   Palette: lunar regolith greys + Apollo-era amber instrument
   light. Green and red are reserved strictly for GO / NO-GO
   status, never for decoration.
   ============================================================ */

:root {
  --void:        #06070B;
  --void-2:      #0C0E15;
  --panel:       #191C25;
  --panel-lit:   #232734;
  --edge:        #333949;
  --regolith:    #CBC7BE;
  --regolith-dim:#8B8880;
  --amber:       #F2A93B;
  --amber-deep:  #B8761C;
  --go:          #6DC64C;
  --nogo:        #D9483B;

  --slot: 0.75rem;
  --measure: 62ch;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--regolith);
  background-color: var(--void);
  background-image:
    radial-gradient(1px 1px at 12% 18%,  #fff, transparent),
    radial-gradient(1px 1px at 74% 9%,   #d8dae6, transparent),
    radial-gradient(1px 1px at 33% 62%,  #fff, transparent),
    radial-gradient(1px 1px at 88% 44%,  #b9bccb, transparent),
    radial-gradient(1px 1px at 57% 82%,  #fff, transparent),
    radial-gradient(1px 1px at 21% 91%,  #9ea2b3, transparent),
    radial-gradient(1px 1px at 95% 74%,  #fff, transparent),
    radial-gradient(1px 1px at 45% 31%,  #c4c7d4, transparent),
    radial-gradient(1400px 700px at 50% -12%, #12172a 0%, transparent 70%);
  background-attachment: fixed;
}

/* ---------- Minecraft-inventory bevels ------------------- */

.raised {
  background: var(--panel);
  box-shadow:
    inset 2px 2px 0 rgba(255,255,255,.07),
    inset -2px -2px 0 rgba(0,0,0,.6);
}

.sunken {
  background: var(--void-2);
  box-shadow:
    inset 2px 2px 0 rgba(0,0,0,.7),
    inset -2px -2px 0 rgba(255,255,255,.06);
}

/* ---------- Type ----------------------------------------- */

.pixel {
  font-family: "Silkscreen", "Courier New", monospace;
  font-weight: 400;
  letter-spacing: .02em;
  line-height: 1.35;
}

h1, h2, h3 { margin: 0; font-weight: 600; }

a { color: var(--amber); text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* ---------- Layout --------------------------------------- */

.shell {
  width: min(74rem, 100% - 2.5rem);
  margin-inline: auto;
  padding-block: 1rem 4rem;
}

.quiz-shell {
  width: min(46rem, 100% - 2.5rem);
  margin-inline: auto;
  padding-block: 1rem 4rem;
}

.masthead-bar {
  border-bottom: 1px solid var(--edge);
  background: rgba(6, 7, 11, .72);
  backdrop-filter: blur(6px);
}

.masthead {
  width: min(74rem, 100% - 2.5rem);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: .85rem;
  padding-block: 1rem;
}

.badge {
  width: 2.5rem;
  text-decoration: none;
  height: 2.5rem;
  flex: none;
  background: var(--panel-lit);
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.09), inset -2px -2px 0 rgba(0,0,0,.6);
  display: grid;
  place-items: center;
}

.masthead-name {
  font-family: "Silkscreen", monospace;
  font-size: .95rem;
  color: var(--regolith);
}

.masthead-sub {
  font-size: .78rem;
  color: var(--regolith-dim);
  line-height: 1.3;
}

/* ---------- Hero ----------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 3.5rem;
  align-items: start;
}

@media (max-width: 60rem) {
  .hero { grid-template-columns: 1fr; gap: 2.5rem; }
}

.hero-title {
  font-family: "Silkscreen", monospace;
  font-size: clamp(1.75rem, 5.5vw, 3.1rem);
  line-height: 1.15;
  color: #fff;
  margin-bottom: 1.25rem;
}

.hero-lede {
  max-width: var(--measure);
  color: var(--regolith);
  margin: 0 0 1rem;
}

.hero-note {
  max-width: var(--measure);
  color: var(--regolith-dim);
  font-size: .92rem;
  margin: 0;
}

.horizon {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 2.5rem;
}

@media (max-width: 60rem) { .horizon { display: none; } }

/* ---------- Arming checklist (the hero interaction) ------ */

.checklist {
  padding: 1.5rem;
  background: var(--panel);
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.07), inset -2px -2px 0 rgba(0,0,0,.6);
}

.checklist-head {
  font-family: "Silkscreen", monospace;
  font-size: .82rem;
  color: var(--amber);
  margin-bottom: .35rem;
}

.checklist-hint {
  font-size: .85rem;
  color: var(--regolith-dim);
  margin: 0 0 1.35rem;
}

.item {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: .7rem;
  margin-bottom: .6rem;
  border: 0;
  text-align: left;
  color: var(--regolith-dim);
  font: inherit;
  font-size: .95rem;
  background: var(--void-2);
  box-shadow: inset 2px 2px 0 rgba(0,0,0,.7), inset -2px -2px 0 rgba(255,255,255,.06);
  cursor: pointer;
  transition: color .12s linear, background-color .12s linear;
}

.item:hover { background: #101320; }

.item:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.item[aria-pressed="true"] {
  color: var(--regolith);
  background: #0F1A12;
}

.item-slot {
  width: 2.75rem;
  height: 2.75rem;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--panel-lit);
  box-shadow: inset 2px 2px 0 rgba(0,0,0,.55), inset -2px -2px 0 rgba(255,255,255,.09);
}

.item-slot svg { display: block; }

.item-text { flex: 1; }

.item-name {
  font-family: "Silkscreen", monospace;
  font-size: .8rem;
  color: inherit;
  display: block;
  margin-bottom: .15rem;
}

.item-meta { font-size: .8rem; color: var(--regolith-dim); }

.item-tick {
  width: 1.15rem;
  height: 1.15rem;
  flex: none;
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--edge);
}

.item[aria-pressed="true"] .item-tick {
  background: var(--go);
  box-shadow: inset 0 0 0 2px var(--go);
}

/* ---------- Buttons -------------------------------------- */

.btn {
  display: inline-block;
  padding: .95rem 1.6rem;
  border: 0;
  font-family: "Silkscreen", monospace;
  font-size: .85rem;
  color: var(--void);
  background: var(--amber);
  box-shadow: inset -3px -3px 0 var(--amber-deep), inset 3px 3px 0 rgba(255,255,255,.35);
  cursor: pointer;
  text-decoration: none;
  transition: background-color .12s linear;
}

.btn:hover { background: #FFBB55; }
.btn:active { box-shadow: inset 3px 3px 0 var(--amber-deep); }
.btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.btn[aria-disabled="true"],
.btn:disabled {
  color: var(--regolith-dim);
  background: var(--panel-lit);
  box-shadow: inset -3px -3px 0 #12151d, inset 3px 3px 0 rgba(255,255,255,.05);
  cursor: not-allowed;
  pointer-events: none;
}

.btn-quiet {
  background: transparent;
  color: var(--regolith);
  box-shadow: inset 0 0 0 2px var(--edge);
  padding: .8rem 1.35rem;
}

.btn-quiet:hover { background: var(--panel-lit); }

.launch-row {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.launch-status {
  font-family: "Silkscreen", monospace;
  font-size: .72rem;
  color: var(--regolith-dim);
}

/* ---------- Protocol reference --------------------------- */

.protocol { margin-top: 5rem; }

.protocol-head {
  font-family: "Silkscreen", monospace;
  font-size: 1.05rem;
  color: #fff;
  margin-bottom: .4rem;
}

.protocol-intro {
  color: var(--regolith-dim);
  max-width: var(--measure);
  margin: 0 0 2rem;
}

.stages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--edge);
  box-shadow: 0 0 0 1px var(--edge);
}

.stage {
  background: var(--panel);
  padding: 1.4rem;
}

@media (max-width: 62rem) { .stages { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 38rem) { .stages { grid-template-columns: 1fr; } }

.stage-step {
  font-family: "Silkscreen", monospace;
  font-size: .72rem;
  color: var(--amber);
  margin-bottom: .5rem;
}

.stage-title {
  font-family: "Silkscreen", monospace;
  font-size: .82rem;
  color: #fff;
  margin-bottom: .6rem;
}

.stage p { margin: 0; font-size: .9rem; color: var(--regolith-dim); }

.fees {
  margin-top: 2.5rem;
  padding: 1.5rem;
  background: var(--panel);
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.07), inset -2px -2px 0 rgba(0,0,0,.6);
}

.fees h3 {
  font-family: "Silkscreen", monospace;
  font-size: .82rem;
  color: var(--nogo);
  margin-bottom: 1rem;
}

.fee-list { margin: 0; padding: 0; list-style: none; }

.fee-list li {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: .65rem 0;
  border-bottom: 1px solid var(--edge);
  font-size: .9rem;
}

.fee-list li:last-child { border-bottom: 0; }

@media (max-width: 44rem) {
  .fee-list li { flex-direction: column; gap: .3rem; }
  .fee-list span:last-child { white-space: normal; }
  .masthead-sub { display: none; }
}
.fee-list span:last-child { font-family: "Silkscreen", monospace; font-size: .78rem; color: var(--amber); white-space: nowrap; }

/* ---------- Quiz ----------------------------------------- */

.gauge {
  display: flex;
  gap: 3px;
  margin-bottom: .75rem;
}

.gauge-cell {
  height: .6rem;
  flex: 1;
  background: #262B38;
  box-shadow: inset 1px 1px 0 rgba(0,0,0,.55), inset -1px -1px 0 rgba(255,255,255,.05);
}

.gauge-cell.done { background: var(--amber); box-shadow: inset -1px -1px 0 var(--amber-deep); }

.gauge-label {
  display: flex;
  justify-content: space-between;
  font-family: "Silkscreen", monospace;
  font-size: .72rem;
  color: var(--regolith-dim);
  margin-bottom: 2.5rem;
}

.card { display: none; }
.card.active { display: block; }

.card-section {
  font-family: "Silkscreen", monospace;
  font-size: .72rem;
  color: var(--amber);
  margin-bottom: .85rem;
}

.card-q {
  font-size: clamp(1.15rem, 3vw, 1.5rem);
  line-height: 1.4;
  color: #fff;
  font-weight: 500;
  margin: 0 0 1.75rem;
  max-width: var(--measure);
}

.opts { display: grid; gap: .5rem; margin-bottom: 2rem; }

.opt {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .9rem 1rem;
  border: 0;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: .97rem;
  color: var(--regolith);
  background: var(--panel);
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.06), inset -2px -2px 0 rgba(0,0,0,.6);
  cursor: pointer;
  transition: background-color .12s linear;
}

.opt:hover { background: var(--panel-lit); }
.opt:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.opt-key {
  width: 1.6rem;
  height: 1.6rem;
  flex: none;
  display: grid;
  place-items: center;
  font-family: "Silkscreen", monospace;
  font-size: .7rem;
  color: var(--regolith-dim);
  background: var(--void-2);
  box-shadow: inset 1px 1px 0 rgba(0,0,0,.7);
}

.opt[aria-pressed="true"] {
  background: #2A2415;
  box-shadow: inset 0 0 0 2px var(--amber);
}

.opt[aria-pressed="true"] .opt-key { color: var(--void); background: var(--amber); }

.nav-row { display: flex; gap: .75rem; align-items: center; }
.nav-note { font-size: .85rem; color: var(--regolith-dim); }

/* ---------- Results -------------------------------------- */

.verdict {
  padding: 2rem;
  margin-bottom: 2.5rem;
  background: var(--panel);
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.07), inset -2px -2px 0 rgba(0,0,0,.6);
}

.verdict-flag {
  font-family: "Silkscreen", monospace;
  font-size: 1.5rem;
  margin-bottom: .75rem;
}

.verdict.pass .verdict-flag { color: var(--go); }
.verdict.fail .verdict-flag { color: var(--nogo); }

.verdict p { margin: 0; max-width: var(--measure); color: var(--regolith); }

.score-line {
  font-family: "Silkscreen", monospace;
  font-size: 2.75rem;
  color: #fff;
  margin: 1.5rem 0 .35rem;
}

.score-of { font-size: 1.15rem; color: var(--regolith-dim); }

.passport {
  padding: 1.75rem;
  margin-bottom: 2.5rem;
  background: linear-gradient(180deg, #1E2230, #14171F);
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.09), inset -2px -2px 0 rgba(0,0,0,.65);
  animation: stamp .45s cubic-bezier(.2,.9,.3,1.3) both;
}

@keyframes stamp {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: scale(1); }
}

.passport-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--edge);
}

.passport-title { font-family: "Silkscreen", monospace; font-size: .9rem; color: var(--amber); }
.passport-serial { font-family: "Silkscreen", monospace; font-size: .78rem; color: var(--regolith-dim); }
.passport p { margin: 0; font-size: .92rem; color: var(--regolith-dim); max-width: var(--measure); }

.debrief h3 {
  font-family: "Silkscreen", monospace;
  font-size: .85rem;
  color: #fff;
  margin-bottom: 1rem;
}

.miss {
  padding: 1.1rem 1.25rem;
  margin-bottom: .6rem;
  background: var(--panel);
  border-left: 4px solid var(--nogo);
}

.miss-q { color: #fff; font-size: .95rem; margin: 0 0 .5rem; }
.miss-right {
  font-size: .9rem;
  margin: 0 0 .35rem;
  color: var(--go);
  display: flex;
  gap: .5rem;
}

.miss-right::before {
  content: "";
  flex: none;
  width: .7rem;
  height: .7rem;
  margin-top: .42rem;
  background: var(--go);
}
.miss-why { font-size: .88rem; margin: 0; color: var(--regolith-dim); }

.reminders {
  margin: 2.5rem 0 0;
  padding: 1.5rem;
  background: var(--void-2);
  box-shadow: inset 2px 2px 0 rgba(0,0,0,.7), inset -2px -2px 0 rgba(255,255,255,.06);
}

.reminders h3 { font-family: "Silkscreen", monospace; font-size: .8rem; color: var(--amber); margin-bottom: .9rem; }
.reminders ul { margin: 0; padding-left: 1.15rem; }
.reminders li { font-size: .9rem; color: var(--regolith-dim); margin-bottom: .45rem; }

.motto {
  width: min(74rem, 100% - 2.5rem);
  margin: 0 auto;
  padding-block: 2rem 3rem;
  border-top: 1px solid var(--edge);
  font-family: "Silkscreen", monospace;
  font-size: .78rem;
  color: var(--regolith-dim);
  text-align: center;
}

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