:root {
  --vst-bg: #fff;
  --vst-text: #111;
  --vst-card-bg: #fff;
  --vst-card-border: #e9e9e9;
  --vst-shadow-sm: 0 2px 6px rgba(0,0,0,0.05);
  --vst-shadow-md: 0 8px 24px rgba(0,0,0,0.08);
  --vst-blue: #2067e7;
  --vst-blue-dark: #174bb3;
  --vst-light-blue: #eaf1ff;
  --vst-radius: 1rem;
  --focus: 3px solid #2067e7;
  --moon-gold: #f2c14e;
  --tide-blue: #7fd0ff;
  --ok-bg: #e4f2e0;
  --ok-ink: #2c5e22;
  --bad-bg: #fbe6e4;
  --bad-ink: #8f2a22;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--vst-bg);
  color: var(--vst-text);
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  line-height: 1.6;
}

/* HEADER */
header.site-header {
  text-align: center;
  padding: 2.4rem 1rem 2.1rem;
  background: radial-gradient(circle at top center, rgba(32,103,231,.22), transparent 34%),
              linear-gradient(135deg, #151515, #000);
  color: #fff;
}

header.site-header img.vst-logo {
  width: min(280px, 70vw);
  height: auto;
  margin: 0 auto .9rem;
  display: block;
}

header.site-header h1 {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  margin: 0 auto .4rem;
  line-height: 1.1;
  font-weight: 800;
  color: #fff;
}

header.site-header p {
  margin: 0 auto;
  max-width: 60ch;
  opacity: .92;
  font-size: clamp(.95rem, 2vw, 1.08rem);
  color: #fff;
}

.gradient-bar {
  height: 6px;
  background: linear-gradient(90deg, #174bb3 0%, #2067e7 25%, #3b82f6 50%, #2067e7 75%, #174bb3 100%);
  box-shadow: 0 1px 6px rgba(0,0,0,0.15), inset 0 -1px 0 rgba(255,255,255,0.25);
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.75rem 1rem 3rem;
}

/* SIM CARD */
.sim-card {
  background: linear-gradient(135deg, #151515, #000);
  border-radius: var(--vst-radius);
  padding: 1.1rem 1.1rem 1.3rem;
  box-shadow: var(--vst-shadow-md);
}

.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: .75rem;
  color: #cfd6e4;
  font-size: .9rem;
}

input[type="range"] {
  flex: 1;
  min-width: 140px;
  accent-color: var(--vst-blue);
}

.readout {
  font-weight: 700;
  color: #fff;
  min-width: 62px;
  text-align: right;
}

button {
  font-family: inherit;
  font-size: .88rem;
  font-weight: 700;
  padding: .55rem .9rem;
  border: none;
  border-radius: .55rem;
  background: var(--vst-blue);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(32,103,231,.25);
  transition: background .2s ease, transform .15s ease;
  line-height: 1.1;
}

button:hover { background: var(--vst-blue-dark); transform: translateY(-1px); }
button:focus-visible { outline: var(--focus); outline-offset: 2px; }
button:disabled { opacity: .55; cursor: default; transform: none; }

button.ghost {
  background: rgba(255,255,255,.12);
  box-shadow: none;
}
button.ghost:hover { background: rgba(255,255,255,.22); }
button.ghost.selected { background: var(--vst-blue); }

.sim-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 12px;
  align-items: center;
}

@media (max-width: 640px) {
  .sim-grid { grid-template-columns: 1fr; }
}

.sim-cell { text-align: center; }


.phase-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.phase-box {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  min-height: 300px;
  padding: 1rem .9rem;
  margin-top: .25rem;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(159,176,204,.28);
  border-radius: .9rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
}

.sim-label {
  font-size: .78rem;
  color: #9fb0cc;
  margin: 0 0 .3rem;
}

.phase-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--moon-gold);
  margin: .4rem 0 0;
}

.phase-sub { font-size: .82rem; color: #9fb0cc; margin: 0; }

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: .9rem;
  justify-content: center;
}

.presets button { font-size: .78rem; padding: .45rem .7rem; }

/* EXPANDABLE INFO CARDS */
.info-cards {
  display: grid;
  gap: 12px;
  margin-top: 1.4rem;
}

details.info {
  background: var(--vst-card-bg);
  border: 1px solid var(--vst-card-border);
  border-radius: var(--vst-radius);
  box-shadow: var(--vst-shadow-sm);
  overflow: hidden;
  transition: box-shadow .2s ease;
}

details.info[open] { box-shadow: var(--vst-shadow-md); }

details.info summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-weight: 700;
  color: var(--vst-blue-dark);
  font-size: 1.02rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

details.info summary::-webkit-details-marker { display: none; }

details.info summary::after {
  content: "+";
  font-size: 1.4rem;
  line-height: 1;
  color: var(--vst-blue);
  transition: transform .2s ease;
}

details.info[open] summary::after { content: "\2212"; }

details.info summary:focus-visible { outline: var(--focus); outline-offset: -3px; }

.info-body {
  padding: 0 1.15rem 1.1rem;
  font-size: .93rem;
  color: #333;
}

.info-body p { margin: 0 0 .6rem; }
.info-body p:last-child { margin-bottom: 0; }

.info-body .mini-sim {
  background: linear-gradient(135deg, #151515, #000);
  border-radius: .75rem;
  padding: .85rem;
  margin-top: .6rem;
}

.mini-sim .controls { margin-bottom: .5rem; }
.mini-sim .sim-label { text-align: center; margin-top: .4rem; }

.callout {
  background: var(--vst-light-blue);
  border: 1px solid #dbe6ff;
  border-radius: .75rem;
  padding: .7rem .9rem;
  font-size: .9rem;
}

/* QUIZ */
.quiz-section { margin-top: 2rem; }

.quiz-section h2 {
  text-align: center;
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  margin: 0 0 .35rem;
  position: relative;
  padding-top: 16px;
}

.quiz-section h2::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 72px;
  height: 3px;
  background: var(--vst-blue);
  border-radius: 3px;
}

.quiz-lead {
  text-align: center;
  color: #444;
  font-size: .9rem;
  margin: 0 0 1rem;
}

.score-line {
  text-align: right;
  font-size: .88rem;
  font-weight: 700;
  color: var(--vst-blue-dark);
  margin: 0 0 .6rem;
}

.quiz-q {
  background: var(--vst-card-bg);
  border: 1px solid var(--vst-card-border);
  border-radius: var(--vst-radius);
  padding: 1rem 1.15rem;
  margin-bottom: 12px;
  box-shadow: var(--vst-shadow-sm);
}

.quiz-q h3 { margin: 0 0 .6rem; font-size: .98rem; }

.quiz-opts { display: flex; flex-direction: column; gap: 7px; }

.quiz-opts button {
  text-align: left;
  width: 100%;
  background: var(--vst-light-blue);
  color: #1a2b4a;
  box-shadow: none;
  font-weight: 600;
  font-size: .88rem;
  border: 1px solid #dbe6ff;
}

.quiz-opts button:hover { background: #dde9ff; transform: none; }
.quiz-opts button.correct { background: var(--ok-bg); color: var(--ok-ink); border-color: #9cc38f; }
.quiz-opts button.wrong { background: var(--bad-bg); color: var(--bad-ink); border-color: #dfa19a; }

.explain {
  font-size: .82rem;
  color: #555;
  margin: .6rem 0 0;
  padding-top: .55rem;
  border-top: 1px dashed var(--vst-card-border);
}

.submit-row { text-align: center; margin-top: .5rem; }

.result {
  border-radius: var(--vst-radius);
  padding: 1rem 1.15rem;
  margin-top: .9rem;
  display: none;
  text-align: center;
  font-size: .95rem;
}

.result.pass { display: block; background: var(--ok-bg); color: var(--ok-ink); }
.result.fail { display: block; background: var(--bad-bg); color: var(--bad-ink); }
.result strong { font-size: 1.1rem; }

footer.site-footer {
  text-align: center;
  font-size: .78rem;
  color: #666;
  padding: 1.4rem 1rem 2rem;
  border-top: 1px solid var(--vst-card-border);
}

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

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

/* PHASE CHIPS */
.chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 8px;
  margin-top: 1rem;
}

button.chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,.07);
  border: 1.5px solid rgba(255,255,255,.14);
  border-radius: .75rem;
  padding: .6rem .35rem .5rem;
  box-shadow: none;
  color: #cfd6e4;
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.15;
}

button.chip:hover {
  background: rgba(32,103,231,.25);
  border-color: rgba(110,163,255,.55);
  transform: translateY(-1px);
}

button.chip.active {
  background: rgba(32,103,231,.35);
  border-color: var(--vst-blue);
  color: #fff;
  box-shadow: 0 0 0 2px rgba(32,103,231,.35), 0 6px 16px rgba(32,103,231,.3);
}

button.chip svg { display: block; }

/* LEARN MORE PANEL */
details.learn-more {
  margin-top: 1.2rem;
}

details.learn-more summary {
  list-style: none;
  cursor: pointer;
  display: block;
  text-align: center;
  background: var(--vst-blue);
  color: #fff;
  font-weight: 700;
  font-size: .98rem;
  padding: .85rem 1.2rem;
  border-radius: .65rem;
  box-shadow: 0 8px 22px rgba(32,103,231,.3);
  transition: background .2s ease, transform .15s ease;
}

details.learn-more summary::-webkit-details-marker { display: none; }
details.learn-more summary:hover { background: var(--vst-blue-dark); transform: translateY(-1px); }
details.learn-more summary:focus-visible { outline: var(--focus); outline-offset: 3px; }
details.learn-more[open] summary { border-radius: .65rem .65rem 0 0; transform: none; }

.learn-body {
  background: var(--vst-card-bg);
  border: 1px solid var(--vst-card-border);
  border-top: none;
  border-radius: 0 0 var(--vst-radius) var(--vst-radius);
  box-shadow: var(--vst-shadow-md);
  padding: 1.1rem 1.25rem 1.25rem;
  display: grid;
  gap: 1rem;
}

.learn-block h3 {
  margin: 0 0 .3rem;
  font-size: .98rem;
  color: var(--vst-blue-dark);
}

.learn-block p {
  margin: 0;
  font-size: .9rem;
  color: #333;
}

.learn-block .mini-sim { margin-top: .6rem; }

/* CHIPS: single row */
.chips {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

button.chip {
  font-size: .7rem;
  padding: .5rem .2rem .45rem;
  gap: 4px;
  border-radius: .6rem;
}

@media (max-width: 700px) {
  .chips {
    display: flex;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }
  button.chip { flex: 0 0 108px; }
}

/* QUIZ: one at a time */
.progress {
  text-align: center;
  font-size: .85rem;
  font-weight: 700;
  color: var(--vst-blue-dark);
  margin: 0 0 .7rem;
}

.feedback {
  border-radius: .65rem;
  padding: .65rem .85rem;
  font-size: .85rem;
  font-weight: 600;
  margin-top: .7rem;
}

.feedback.good { background: var(--ok-bg); color: var(--ok-ink); }
.feedback.hint { background: #fdf3dc; color: #7a5a10; }

.feedback .explain-inline {
  display: block;
  font-weight: 400;
  font-size: .82rem;
  margin-top: .3rem;
}

.next-row { text-align: center; margin-top: .8rem; }

/* RESULTS CARD (screenshot friendly) */
.result-card {
  background: var(--vst-card-bg);
  border: 2px solid var(--vst-blue);
  border-radius: var(--vst-radius);
  box-shadow: var(--vst-shadow-md);
  padding: 1.5rem 1.4rem;
  text-align: center;
}

.result-card h3 {
  margin: 0 0 .2rem;
  font-size: 1.25rem;
  color: var(--vst-blue-dark);
}

.result-score {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--vst-blue);
  margin: .2rem 0 0;
  line-height: 1.1;
}

.result-sub {
  font-size: .85rem;
  color: #555;
  margin: .15rem 0 1rem;
}

.attempt-list {
  list-style: none;
  margin: 0 auto 1rem;
  padding: 0;
  max-width: 340px;
  text-align: left;
  font-size: .86rem;
  display: grid;
  gap: 5px;
}

.attempt-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  background: var(--vst-light-blue);
  border: 1px solid #dbe6ff;
  border-radius: .55rem;
  padding: .4rem .7rem;
}

.attempt-list li .mark { font-weight: 700; }
.attempt-list li .mark.first { color: var(--ok-ink); }
.attempt-list li .mark.retry { color: #7a5a10; }

.name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: .5rem;
  flex-wrap: wrap;
}

.name-row label { font-size: .88rem; font-weight: 600; color: #333; }

.name-row input {
  font-family: inherit;
  font-size: .95rem;
  padding: .5rem .75rem;
  border: 1.5px solid var(--vst-card-border);
  border-radius: .55rem;
  min-width: 200px;
}

.name-row input:focus-visible { outline: var(--focus); outline-offset: 1px; border-color: var(--vst-blue); }

.result-date { font-size: .8rem; color: #666; margin: 0 0 1rem; }

.screenshot-note {
  background: var(--vst-light-blue);
  border: 1px solid #dbe6ff;
  border-radius: .65rem;
  padding: .6rem .9rem;
  font-size: .85rem;
  color: #1a2b4a;
  margin: 0 0 1rem;
}

.restart { background: none; border: none; box-shadow: none; color: #666; font-size: .82rem; font-weight: 600; text-decoration: underline; padding: .5rem .6rem; }
.restart:hover { background: none; color: var(--vst-blue-dark); transform: none; }

/* Selected (not yet graded) answer */
.quiz-opts button.selected {
  background: #dbe8ff;
  border-color: var(--vst-blue);
  color: var(--vst-blue-dark);
  box-shadow: 0 0 0 2px rgba(32,103,231,.25);
}

/* WCAG refinements */
.name-row input::placeholder { color: #767676; }

.quiz-opts button.selected::before {
  content: "\25CF\00a0";
  color: var(--vst-blue-dark);
}

.quiz-q h3:focus, .result-card:focus { outline: none; }

/* Near/far side photo comparison */
.photo-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: .8rem auto 0;
  max-width: 340px;
}
.photo-pair figure { margin: 0; }
.photo-pair img {
  width: 100%;
  display: block;
  border-radius: 10px;
  border: 1px solid var(--vst-card-border);
}
.photo-pair figcaption {
  margin-top: .4rem;
  text-align: center;
  font-size: .85rem;
  font-weight: 600;
}
.photo-pair .cap-near { color: #d64545; }
.photo-pair .cap-far { color: var(--vst-blue); }
.photo-credit {
  margin: .3rem 0 0 !important;
  font-size: .72rem !important;
  color: #8a8f9e !important;
  text-align: center;
}


/* Keep learn-section diagrams compact */
.learn-block .mini-sim {
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

.photo-pair .cap-note {
  display: block;
  margin-top: 2px;
  font-size: .73rem;
  font-weight: 400;
  color: #555;
  line-height: 1.35;
}
