:root {
  --navy: #0b1020;
  --navy-2: #151c33;
  --panel: rgba(12, 18, 36, 0.86);
  --gold: #e0c56a;
  --gold-2: #f3e2a4;
  --cyan: #7fd7ff;
  --ink: #e8edf7;
  --muted: #9aa6c0;
  --good: #8fe0b5;
  --good-bg: rgba(30, 107, 69, 0.28);
  --bad: #ffb3b3;
  --bad-bg: rgba(120, 32, 32, 0.35);
  --line: rgba(224, 197, 106, 0.35);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; background: var(--navy); color: var(--ink); }
body {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.12rem;
  line-height: 1.7;
}
a { color: var(--gold-2); }
a:hover { color: #fff; }
img { max-width: 100%; height: auto; display: block; }
#stars {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  background: radial-gradient(1200px 700px at 70% 10%, rgba(80, 90, 160, 0.18), transparent 55%),
              radial-gradient(900px 600px at 10% 80%, rgba(180, 120, 40, 0.08), transparent 50%),
              #070b16;
}
.phoenix-station {
  position: relative; z-index: 1;
  max-width: 980px; margin: 1.3rem auto;
  animation: bob 7s ease-in-out infinite;
  filter: drop-shadow(0 0 22px rgba(224, 197, 106, 0.28));
}
@keyframes bob {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -14px, 0); }
}
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 30; background: #fff; color: #111; padding: .4rem .7rem; }
.topbar {
  position: sticky; top: 0; z-index: 8;
  display: flex; justify-content: space-between; align-items: center;
  gap: .7rem; flex-wrap: wrap;
  padding: .55rem 1.1rem;
  background: rgba(8, 12, 24, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  font-family: "Source Sans 3", sans-serif;
}
.topbar nav { display: flex; gap: .85rem; flex-wrap: wrap; }
.topbar a { color: #f3ead0; text-decoration: none; font-size: .86rem; letter-spacing: .06em; text-transform: uppercase; }
.topbar a[aria-current="page"] { color: var(--gold); }
.preview-flag {
  font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold); border: 1px solid var(--line); border-radius: 999px; padding: .15rem .55rem;
}
.hero {
  position: relative; z-index: 1;
  min-height: 78vh;
  display: grid; align-items: end;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  width: 100%; height: 120%;
  object-fit: cover; object-position: center 40%;
  transform: translateY(var(--par-y, 0));
  will-change: transform;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7,11,22,.15) 20%, rgba(7,11,22,.88) 100%);
}
.hero-copy {
  position: relative; z-index: 1;
  max-width: 1100px; width: 100%;
  margin: 0 auto; padding: 3rem 1.2rem 2.2rem;
}
.eyebrow {
  font-family: "Source Sans 3", sans-serif;
  letter-spacing: .18em; text-transform: uppercase; font-size: .72rem;
  color: var(--gold); margin: 0 0 .45rem;
}
h1, h2, h3 { font-family: Cinzel, serif; font-weight: 700; line-height: 1.2; margin: 0 0 .45rem; color: #fff8e6; }
h1 { font-size: clamp(1.8rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.25rem, 3vw, 1.7rem); }
.dek { font-size: 1.15rem; color: var(--gold-2); margin: 0 0 1rem; }
.esther {
  display: inline-block;
  font-family: "Source Sans 3", sans-serif; font-size: .95rem;
  border-left: 3px solid var(--gold); padding: .25rem .7rem;
  background: rgba(20, 28, 54, 0.6);
}
.wrap { position: relative; z-index: 1; max-width: 980px; margin: 0 auto; padding: 1.2rem 1.1rem 3.5rem; }
.brief, .welcome, .complete {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.3rem 1.25rem 1.4rem;
  margin: 1.25rem 0;
  box-shadow: 0 0 0 1px rgba(127, 215, 255, 0.04), 0 20px 40px rgba(0,0,0,.25);
  opacity: 0; transform: translateY(22px);
  animation: rise .8s ease forwards;
}
.brief:nth-of-type(2) { animation-delay: .05s; }
@keyframes rise { to { opacity: 1; transform: none; } }
.js .brief, .js .welcome, .js .complete { animation: none; opacity: 0; transform: translateY(22px); }
.js .inview { opacity: 1; transform: none; transition: opacity .7s ease, transform .7s ease; }
.art {
  margin: 1rem 0 1.15rem; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 0 28px rgba(127, 215, 255, 0.08);
}
.art figcaption { font-family: "Source Sans 3", sans-serif; font-size: .82rem; color: var(--muted); padding: .5rem .15rem 0; }
.hud-verse {
  position: relative;
  margin: 1.1rem 0;
  padding: 1rem 1.05rem .95rem 1.15rem;
  background: linear-gradient(180deg, rgba(20, 40, 70, 0.55), rgba(10, 16, 32, 0.8));
  border: 1px solid rgba(127, 215, 255, 0.35);
  box-shadow: inset 0 0 0 1px rgba(224, 197, 106, 0.15), 0 0 24px rgba(127, 215, 255, 0.12);
  border-radius: 4px 14px 4px 14px;
  color: #eef6ff;
}
.hud-verse::before {
  content: "SCRIPTURE UPLINK";
  display: block;
  font-family: "Share Tech Mono", "Source Sans 3", monospace;
  font-size: .68rem; letter-spacing: .16em; color: var(--cyan);
  margin-bottom: .45rem;
}
.hud-verse .ref {
  display: block; margin-top: .6rem;
  font-family: Cinzel, serif; font-size: .72rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--gold);
}
.scan {
  pointer-events: none; position: absolute; left: 0; right: 0; height: 18%;
  top: -20%;
  background: linear-gradient(180deg, transparent, rgba(127,215,255,.12), transparent);
  animation: scan 5.5s linear infinite;
}
@keyframes scan { 0% { top: -20%; } 100% { top: 110%; } }
p { margin: 0 0 .9rem; }
.btn, button.btn {
  font-family: "Source Sans 3", sans-serif;
  background: linear-gradient(180deg, #c9a64a, #8a6a1c);
  color: #16120a; border: 0; border-radius: 999px;
  padding: .55rem 1.05rem; cursor: pointer; text-decoration: none;
  display: inline-block; font-weight: 700; font-size: .95rem;
}
.btn.ghost, button.btn.ghost {
  background: transparent; color: var(--gold-2); border: 1px solid var(--line);
}
.actions { display: flex; gap: .55rem; flex-wrap: wrap; margin-top: .9rem; }
.quiz {
  margin-top: 1rem; padding: 1rem;
  border: 1px solid rgba(127,215,255,.25);
  border-radius: 12px; background: rgba(8,12,24,.55);
}
.quiz h3 { font-family: "Source Sans 3", sans-serif; font-size: 1.02rem; color: var(--gold-2); }
.choices { display: flex; flex-direction: column; gap: .4rem; }
.choices label {
  display: block; cursor: pointer;
  font-family: "Source Sans 3", sans-serif; font-size: .98rem;
  border: 1px solid rgba(255,255,255,.1); border-radius: 8px; padding: .45rem .65rem;
}
.choices label:hover { border-color: var(--gold); }
.feedback { display: none; margin-top: .7rem; padding: .65rem .75rem; border-radius: 8px; font-family: "Source Sans 3", sans-serif; }
.feedback.show { display: block; }
.feedback.ok { background: var(--good-bg); color: var(--good); }
.feedback.no { background: var(--bad-bg); color: var(--bad); }
.hud { font-family: "Share Tech Mono", "Source Sans 3", monospace; color: var(--cyan); font-size: .85rem; }
footer.site { position: relative; z-index: 1; text-align: center; color: var(--muted); font-size: .9rem; padding: 1rem 1rem 2rem; }
footer.site p { margin: .4rem 0; }
.credit { color: var(--muted); font-size: .92rem; }
@media (max-width: 800px) {
  body { font-size: 1.05rem; }
  .hero { min-height: 64vh; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .phoenix-station, .scan { animation: none; }
  .js .brief, .js .welcome, .js .complete, .brief, .welcome, .complete {
    opacity: 1; transform: none; animation: none; transition: none;
  }
}

.meditation, .sidenote {
  margin: 1rem 0 1.15rem;
  padding: .9rem 1rem .85rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(20, 28, 54, 0.55);
}
.meditation .eyebrow, .sidenote .eyebrow { margin-bottom: .35rem; }
.meditation p:last-child, .sidenote p:last-child { margin-bottom: 0; }
.confession {
  font-family: Cinzel, serif;
  font-weight: 700;
  letter-spacing: .08em;
  text-align: center;
  color: var(--gold-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .85rem 1rem;
  margin: 1rem 0 1.15rem;
  background: rgba(20, 28, 54, 0.65);
}
#lesson-close { margin-top: 1.6rem; }

/* ---- Lesson 3 additions: living art, hotspots, drill ---- */
.art.living { position: relative; perspective: 900px; }
.art.living .frame {
  position: relative; overflow: hidden;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .25s ease-out;
}
.art.living .frame img { animation: drift 26s ease-in-out infinite alternate; transform-origin: 50% 50%; }
@keyframes drift {
  0% { transform: scale(1.02) translate3d(0, 0, 0); }
  100% { transform: scale(1.1) translate3d(-2%, -1.5%, 0); }
}
.art.living .frame::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(243, 226, 164, .16) 48%, rgba(127, 215, 255, .10) 52%, transparent 65%);
  background-size: 260% 100%;
  animation: sweep 7s ease-in-out infinite;
  mix-blend-mode: screen;
}
@keyframes sweep { 0% { background-position: 120% 0; } 60%, 100% { background-position: -40% 0; } }
.frame .hud-corners::before, .frame .hud-corners::after {
  content: ""; position: absolute; width: 38px; height: 38px; pointer-events: none;
  border: 2px solid rgba(127, 215, 255, .65); z-index: 2;
}
.frame .hud-corners::before { left: 10px; top: 10px; border-right: 0; border-bottom: 0; }
.frame .hud-corners::after { right: 10px; bottom: 10px; border-left: 0; border-top: 0; }
.embers { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.hotspot {
  position: absolute; z-index: 3; transform: translate(-50%, -50%);
  width: 30px; height: 30px; border-radius: 50%; padding: 0;
  border: 2px solid var(--gold-2); background: rgba(11, 16, 32, .55);
  color: var(--gold-2); font: 700 .9rem "Share Tech Mono", monospace;
  cursor: pointer; box-shadow: 0 0 0 0 rgba(243, 226, 164, .7);
  animation: ping 2.4s ease-out infinite;
}
.hotspot:hover, .hotspot:focus-visible, .hotspot[aria-pressed="true"] { background: var(--gold); color: #16120a; outline: none; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(243, 226, 164, .7); } 100% { box-shadow: 0 0 0 16px rgba(243, 226, 164, 0); } }
.intel {
  min-height: 2.6rem; margin: .55rem .15rem 0;
  font-family: "Share Tech Mono", "Source Sans 3", monospace; font-size: .9rem; color: var(--cyan);
}
.intel strong { color: var(--gold-2); }
.drill { margin-top: 1rem; padding: 1rem; border: 1px dashed rgba(224, 197, 106, .45); border-radius: 12px; background: rgba(8, 12, 24, .55); }
.drill h3 { font-family: "Source Sans 3", sans-serif; font-size: 1.02rem; color: var(--gold-2); }
.drill-pool, .drill-line { display: flex; flex-wrap: wrap; gap: .45rem; margin: .55rem 0; min-height: 2.4rem; }
.drill-line { border-top: 1px solid rgba(127, 215, 255, .25); padding-top: .55rem; counter-reset: rank; }
.drill-pool button, .drill-line span {
  font-family: "Source Sans 3", sans-serif; font-size: .95rem;
  border-radius: 8px; padding: .4rem .7rem; border: 1px solid rgba(127, 215, 255, .4);
  background: rgba(20, 40, 70, .55); color: var(--ink); cursor: pointer;
}
.drill-pool button:hover { border-color: var(--gold); }
.drill-line span { border-color: var(--gold); color: var(--gold-2); cursor: default; }
.drill-line span::before { counter-increment: rank; content: counter(rank) ". "; color: var(--cyan); }
.drill-pool button.shake { animation: shake .35s; border-color: #ff8f8f; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.quote-card {
  margin: 1rem 0 1.15rem; padding: .95rem 1.05rem; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(40, 30, 10, .35);
}
.quote-card blockquote { margin: .3rem 0 .55rem; font-style: italic; color: #fff3d0; }
.quote-card .src { font-family: "Source Sans 3", sans-serif; font-size: .85rem; color: var(--muted); }
.commander { border-left: 3px solid var(--gold); padding-left: .85rem; }
@media (prefers-reduced-motion: reduce) {
  .art.living .frame img, .art.living .frame::after, .hotspot { animation: none; }
  .art.living .frame { transform: none; }
}
.bugle {
  display: flex; align-items: center; gap: .9rem; flex-wrap: wrap;
  margin: 1.25rem 0; padding: .85rem 1.1rem; border-radius: 14px;
  border: 1px solid rgba(127, 215, 255, .35);
  background: linear-gradient(90deg, rgba(20, 40, 70, .65), rgba(12, 18, 36, .85));
}
.bugle p { margin: 0; font-family: "Source Sans 3", sans-serif; font-size: .95rem; color: var(--muted); flex: 1 1 260px; }
.bugle .hudtag { font-family: "Share Tech Mono", monospace; font-size: .7rem; letter-spacing: .16em; color: var(--cyan); display: block; }
#bugleBtn { display: inline-flex; align-items: center; gap: .5rem; }
#bugleBtn .horn { display: inline-block; width: 22px; height: 14px; }
#bugleBtn.playing { box-shadow: 0 0 0 0 rgba(243, 226, 164, .8); animation: ping 1s ease-out infinite; }
