/*
 * learndungeon.com
 *
 * One hand-written stylesheet, no build step. The look is the game's own:
 * torch-lit stone, timber, pale carved pillars and gold, sampled from the
 * look-development renders in LearnDungeon/docs/lookdev (after_hall,
 * after_corridor, after_exit). The grammar is a game site's - a moving
 * hero, carved frames, a gold display face, embers - with the rule that
 * matters more than any of it: this is for children from five years old,
 * so there are no skulls, no blood, no weapons and nothing to be afraid of.
 * Warm, magical, a little mysterious. Never menacing.
 *
 * Contents
 *   1. Fonts and tokens
 *   2. Base
 *   3. Layout helpers
 *   4. Buttons, fields, tags
 *   5. Nav
 *   6. Hero
 *   7. Frames, ornaments, sections
 *   8. Steps, rules, lists
 *   9. Pictures, gallery and the reveal
 *  10. Pricing
 *  11. Forms: signup and contact
 *  12. Prose pages
 *  13. Footer
 *  14. Consent banner
 *  15. Motion
 */

/* ------------------------------------------------------------------ 1 -- */

/* Self-hosted on purpose. A font fetched from somebody else's server tells
   them every visitor's IP address, and the privacy page says nobody else
   learns you were here. Both are SIL Open Font License - see the LICENSE
   files beside them. */
@font-face {
  font-family: "Cinzel";
  src: url("/assets/fonts/cinzel-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/assets/fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/assets/fonts/atkinson-hyperlegible-next-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* The dark. Sampled from the shadowed corners of after_hall (#190c06,
     #2b180d) - a warm black, never a blue one. */
  --void: #0d0805;
  --bg: #120b07;
  --bg-2: #1a110a;
  /* Stone in torchlight: after_hall's mid browns (#381f10 .. #5e351c). */
  --stone: #2a1b11;
  --stone-2: #3a2617;
  --stone-3: #4c311d;
  /* Timber and iron. */
  --timber: #5e351c;
  --iron: #2b2a2c;

  /* The light. Torch amber from the lit walls (#ac764a, #ca925b), and the
     gold the frames and the display face are drawn in. */
  --torch: #e9a75a;
  --torch-deep: #b8722f;
  --gold: #f0c674;
  --gold-hi: #ffe7a8;
  --gold-lo: #a8742c;
  --ember: #ff8a3d;

  /* Magic, for the math. The one cool colour on the page, so the lessons
     are what draws the eye once they are revealed. */
  --mana: #8fb4ff;
  --mana-deep: #4a6fd6;

  /* Text: parchment on stone. Each pair is checked against --bg and
     --stone to WCAG AA (body text at least 4.5:1). */
  --text: #f2e6cf;          /* 15:1 on --bg */
  --text-2: #d3c2a3;        /* 10:1 */
  --text-3: #ad9b7e;        /* 6.9:1 */
  --line: #5a3e24;
  --line-gold: #8a6430;

  --ok: #9fd39b;
  --bad: #ffb4a6;

  --radius: 6px;
  --radius-lg: 10px;
  --font-display: "Cinzel", "Trajan Pro", "Times New Roman", serif;
  --font-body: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", sans-serif;
  --measure: 64ch;
  --focus: var(--gold-hi);

  /* Fields - redefined by the admin, which is light. */
  --field-bg: #0f0905;
  --field-text: var(--text);
  --field-line: var(--line-gold);
}

/* ------------------------------------------------------------------ 2 -- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  /* A faint warm glow high up, as if the page were lit from a torch above
     the fold, falling away to the dark. */
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(233, 167, 90, 0.10), transparent 60%),
    var(--bg);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  margin: 0;
  color: var(--gold);
  text-wrap: balance;
}
h1 { font-size: clamp(2.3rem, 6vw, 4.4rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.25rem; }

p, ul, ol, dl, figure { margin: 0; }

/* `hidden` wins over any display a class sets: the buttons that need
   script ship hidden, and must stay so until site.js shows them. */
[hidden] { display: none !important; }

a { color: var(--gold); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--gold-hi); }

img, video, svg { max-width: 100%; }

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

::selection { background: var(--torch); color: var(--void); }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--gold);
  color: var(--void);
  font-weight: 700;
  border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ 3 -- */

.shell { width: min(100% - 2rem, 72rem); margin-inline: auto; }
.shell--narrow { width: min(100% - 2rem, 48rem); }

.section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.section--tight { padding-block: clamp(2rem, 5vw, 3.5rem); }

.stack > * + * { margin-top: var(--gap, 1.25rem); }

.cols {
  display: grid;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--torch);
}
.lede { font-size: clamp(1.1rem, 1.9vw, 1.3rem); color: var(--text-2); max-width: var(--measure); }
.muted { color: var(--text-3); }
.small { font-size: 0.92rem; }
.center { text-align: center; }
.center .lede { margin-inline: auto; }

/* ------------------------------------------------------------------ 4 -- */

/*
 * Buttons are plates. The primary is lit gold, the one thing on a screen a
 * child's grown-up should press; the default is dark iron with a gold edge.
 * Both are the same size and shape, so the consent banner can use two of the
 * default and have them be genuinely equal.
 */
.btn {
  --b-bg: linear-gradient(180deg, #3a2a1c, #22170f);
  --b-text: var(--gold);
  --b-line: var(--line-gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.9rem;
  padding: 0.7rem 1.35rem;
  border: 1px solid var(--b-line);
  border-radius: var(--radius);
  background: var(--b-bg);
  color: var(--b-text);
  font: 700 0.95rem/1.1 var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 231, 168, 0.12), 0 2px 0 rgba(0, 0, 0, 0.6);
  transition: filter 0.15s ease, box-shadow 0.2s ease, transform 0.1s ease;
}
.btn:hover { color: var(--gold-hi); filter: brightness(1.15); box-shadow: inset 0 1px 0 rgba(255, 231, 168, 0.2), 0 0 18px rgba(240, 198, 116, 0.18); }
.btn:active { transform: translateY(1px); }
.btn[disabled],
.btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; filter: grayscale(0.4); }
.btn svg { width: 1.1em; height: 1.1em; flex: none; }

.btn--primary {
  --b-bg: linear-gradient(180deg, #ffe39c 0%, #f0c674 38%, #c98f3c 100%);
  --b-text: #2a1606;
  --b-line: #ffe7a8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -2px 0 rgba(120, 70, 20, 0.45), 0 0 22px rgba(240, 168, 80, 0.32);
}
.btn--primary:hover { color: #1a0c02; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), inset 0 -2px 0 rgba(120, 70, 20, 0.45), 0 0 32px rgba(255, 190, 100, 0.5); }

.btn--sm { min-height: 2.4rem; padding: 0.5rem 1rem; font-size: 0.8rem; }
.btn--lg { min-height: 3.4rem; padding: 0.9rem 1.9rem; font-size: 1.05rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; }

.field {
  width: 100%;
  min-height: 2.9rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--field-line);
  border-radius: var(--radius);
  background: var(--field-bg);
  color: var(--field-text);
  font: inherit;
}
.field::placeholder { color: var(--text-3); }
.field[aria-invalid="true"] { border-color: var(--bad); }
textarea.field { min-height: 9rem; resize: vertical; }

.label { display: block; font-weight: 700; margin-bottom: 0.35rem; }
/* /account (Epic 6): what a licence covers, and its key. The key is about
   195 characters with no spaces, so it must be allowed to break anywhere
   or it pushes a phone screen sideways. */
.account-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  gap: 0.9rem 1.5rem;
  margin: 0;
}
.account-facts dt {
  font: 700 0.75rem/1.2 var(--font-display);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--torch);
}
.account-facts dd { margin: 0.25rem 0 0; }
.account-key {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
  word-break: break-all;
}
textarea.account-key { resize: vertical; min-height: 6rem; }

.hint { font-size: 0.9rem; color: var(--text-3); margin-top: 0.3rem; }
.error { color: var(--bad); font-weight: 700; font-size: 0.95rem; margin-top: 0.35rem; }

/* The honeypot: a field for bots, kept away from people and their readers. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* A stage, set like a wax seal: what state the game is in. */
.seal {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--line-gold);
  border-radius: 999px;
  background: rgba(20, 12, 6, 0.75);
  color: var(--gold);
  font: 700 0.75rem/1.2 var(--font-display);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.seal::before {
  content: "";
  width: 0.5rem; height: 0.5rem;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 8px var(--ember);
}

/* ------------------------------------------------------------------ 5 -- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, rgba(13, 8, 5, 0.96), rgba(13, 8, 5, 0.86));
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line-gold);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.8), 0 10px 30px rgba(0, 0, 0, 0.35);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.2rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--gold);
  text-decoration: none;
  font: 800 1.25rem/1 var(--font-display);
  letter-spacing: 0.06em;
}
.brand:hover { color: var(--gold-hi); }
.brand .logo { width: 2.3rem; height: 2.3rem; flex: none; }

.nav-links { display: flex; align-items: center; gap: 0.3rem; }
.nav-link {
  padding: 0.55rem 0.8rem;
  color: var(--text-2);
  text-decoration: none;
  font: 700 0.85rem/1 var(--font-display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: var(--radius);
}
.nav-link:hover { color: var(--gold-hi); }
.nav-link[aria-current="page"] { color: var(--gold); box-shadow: inset 0 -2px 0 var(--torch); }
.nav-cta { margin-left: 0.5rem; }

.nav-burger {
  display: none;
  width: 2.8rem; height: 2.8rem;
  padding: 0.55rem;
  border: 1px solid var(--line-gold);
  border-radius: var(--radius);
  background: var(--stone);
  color: var(--gold);
  cursor: pointer;
}

@media (max-width: 52rem) {
  .nav-burger { display: inline-block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 1rem 1.25rem;
    background: var(--void);
    border-bottom: 1px solid var(--line-gold);
  }
  .nav-links.is-open { display: flex; }
  .nav-link { padding: 0.9rem 0.5rem; }
  .nav-cta { margin: 0.5rem 0 0; }
}

/* ------------------------------------------------------------------ 6 -- */

/*
 * The hero: the Hall, moving. The video is decoration - the words carry the
 * page - so it sits behind a vignette dark enough that the headline reads
 * over its brightest frame, and the still poster stands in for it whenever
 * it is not playing (no script, reduced motion, Save-Data, or paused).
 */
.hero {
  position: relative;
  isolation: isolate;
  min-height: min(88vh, 52rem);
  display: grid;
  align-items: end;
  overflow: hidden;
  background: var(--void) var(--poster, none) center / cover no-repeat;
  border-bottom: 1px solid var(--line-gold);
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(90% 70% at 50% 35%, transparent 30%, rgba(13, 8, 5, 0.55) 75%, rgba(13, 8, 5, 0.9) 100%),
    linear-gradient(180deg, rgba(13, 8, 5, 0.35) 0%, transparent 25%, transparent 45%, rgba(13, 8, 5, 0.92) 85%, var(--bg) 100%);
}
.hero-copy {
  padding-block: clamp(7rem, 22vh, 14rem) clamp(2.5rem, 7vh, 4.5rem);
  text-align: center;
}
.hero-copy > * + * { margin-top: 1.1rem; }
.hero h1 {
  /* Gold leaf: a gradient through the letters, and a glow so the edges hold
     against a bright frame of the video. */
  background: linear-gradient(180deg, #fff3cf 0%, #f6d184 45%, #c88a35 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.9)) drop-shadow(0 0 24px rgba(240, 168, 80, 0.35));
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero h1 { color: var(--gold); }
}
.hero .lede {
  margin-inline: auto;
  color: var(--text);
  text-shadow: 0 1px 2px #000, 0 0 18px rgba(0, 0, 0, 0.8);
}
.hero .btn-row { justify-content: center; margin-top: 1.8rem; }
.hero-caption {
  margin-top: 2.2rem;
  font-size: 0.82rem;
  color: var(--text-3);
  text-shadow: 0 1px 2px #000;
}

/* WCAG 2.2.2: anything that moves for more than five seconds can be paused. */
.hero-pause {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 2;
}
.hero-pause[aria-pressed="true"] .hero-pause-off,
.hero-pause[aria-pressed="false"] .hero-pause-on { display: none; }

/* Embers rising from below the fold. Fourteen sparks, each its own path
   and pace; pointer-events off so they never sit between a click and a
   button. Off entirely under reduced motion (section 15). */
.embers {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.embers span {
  position: absolute;
  bottom: -1rem;
  left: var(--x);
  width: var(--s, 4px);
  height: var(--s, 4px);
  border-radius: 50%;
  background: radial-gradient(circle, #fff1c4 0%, var(--ember) 45%, transparent 70%);
  box-shadow: 0 0 8px 2px rgba(255, 138, 61, 0.55);
  opacity: 0;
}

/* ------------------------------------------------------------------ 7 -- */

/*
 * A frame: a panel of dark stone with a gold edge, an inner rule and a gold
 * rivet in each corner. The game's carved pillars and iron-banded door, said
 * in CSS - no images, so it is crisp at any size and costs nothing to load.
 * The rivets are background layers, not pseudo-elements, so anything placed
 * in a frame keeps ::before and ::after for itself (the steps use one).
 */
.frame {
  --rivet: radial-gradient(circle, var(--gold-hi) 0 1.5px, var(--gold-lo) 2.5px, transparent 3.5px);
  position: relative;
  padding: clamp(1.4rem, 3.5vw, 2.4rem);
  border: 1px solid var(--line-gold);
  border-radius: var(--radius-lg);
  background:
    var(--rivet) 6px 6px / 12px 12px no-repeat,
    var(--rivet) calc(100% - 6px) 6px / 12px 12px no-repeat,
    var(--rivet) 6px calc(100% - 6px) / 12px 12px no-repeat,
    var(--rivet) calc(100% - 6px) calc(100% - 6px) / 12px 12px no-repeat,
    linear-gradient(180deg, rgba(255, 220, 160, 0.045), transparent 40%),
    linear-gradient(160deg, var(--stone-2), var(--stone) 55%, var(--bg-2));
  box-shadow:
    inset 0 0 0 4px rgba(13, 8, 5, 0.55),
    inset 0 0 0 5px rgba(138, 100, 48, 0.35),
    0 18px 40px rgba(0, 0, 0, 0.45);
}
.frame > * + * { margin-top: 0.9rem; }

/* A frame that glows - the one thing on a page to look at. */
.frame--lit {
  border-color: var(--gold-lo);
  box-shadow:
    inset 0 0 0 4px rgba(13, 8, 5, 0.55),
    inset 0 0 0 5px rgba(240, 198, 116, 0.45),
    0 0 0 1px rgba(0, 0, 0, 0.6),
    0 0 50px rgba(233, 167, 90, 0.18),
    0 18px 40px rgba(0, 0, 0, 0.5);
}

/* A heading with a carved rule either side of it and a diamond under it. */
.section-head { text-align: center; margin-bottom: clamp(2rem, 5vw, 3.2rem); }
.section-head > * + * { margin-top: 0.8rem; }
.section-head .lede { margin-inline: auto; }
.rule-orn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin: 1rem auto 0;
  width: min(100%, 22rem);
  color: var(--gold-lo);
}
.rule-orn::before,
.rule-orn::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-gold));
}
.rule-orn::after { background: linear-gradient(270deg, transparent, var(--line-gold)); }
.rule-orn i {
  width: 9px; height: 9px;
  transform: rotate(45deg);
  background: var(--torch);
  box-shadow: 0 0 10px rgba(233, 167, 90, 0.7);
}

/* A band of slightly lighter stone, to change the room between sections. */
.band {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.35)),
    var(--bg-2);
  border-block: 1px solid var(--line);
}

.page-head {
  padding-block: clamp(3rem, 7vw, 5rem) clamp(1.5rem, 3vw, 2.5rem);
  text-align: center;
  background: radial-gradient(70% 100% at 50% 0%, rgba(233, 167, 90, 0.12), transparent 70%);
}
.page-head > .shell > * + * { margin-top: 1rem; }
.page-head .lede { margin-inline: auto; }

/* ------------------------------------------------------------------ 8 -- */

.steps {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  counter-reset: step;
}
.step { counter-increment: step; text-align: center; }
.step::before {
  content: counter(step, upper-roman);
  display: grid;
  place-items: center;
  width: 3.2rem; height: 3.2rem;
  margin: 0 auto 1rem;
  border: 1px solid var(--gold-lo);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #4a3018, #1a110a);
  color: var(--gold);
  font: 800 1.1rem/1 var(--font-display);
  box-shadow: 0 0 0 4px rgba(13, 8, 5, 0.7), 0 0 0 5px var(--line-gold), 0 0 24px rgba(233, 167, 90, 0.25);
}
.step h3 { font-size: 1.5rem; }
.step p { color: var(--text-2); margin-top: 0.6rem; }

.rules {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}
.rules .frame h3 { font-size: 1.15rem; }
.rules .frame p { color: var(--text-2); }

.ticks,
.dots { list-style: none; padding: 0; margin-top: 1rem; }
.ticks li,
.dots li { position: relative; padding-left: 1.9rem; }
.ticks li + li,
.dots li + li { margin-top: 0.7rem; }
.ticks li::before {
  content: "";
  position: absolute;
  left: 0.2rem; top: 0.42em;
  width: 0.7rem; height: 0.7rem;
  transform: rotate(45deg);
  background: var(--torch);
  box-shadow: 0 0 8px rgba(233, 167, 90, 0.7);
}
.dots li::before {
  content: "";
  position: absolute;
  left: 0.2rem; top: 0.42em;
  width: 0.7rem; height: 0.7rem;
  transform: rotate(45deg);
  border: 1px solid var(--text-3);
}

.facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 2rem;
  color: var(--text-2);
}
.facts dt {
  display: inline;
  font: 700 0.75rem/1 var(--font-display);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--torch);
  margin-right: 0.5rem;
}
.facts dd { display: inline; margin: 0; }
.facts div { white-space: nowrap; }

/* ------------------------------------------------------------------ 9 -- */

.shot { margin: 0; }
.shot img,
.shot video {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line-gold);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6), 0 18px 40px rgba(0, 0, 0, 0.5);
}
.shot figcaption,
.reveal-caption {
  margin-top: 0.8rem;
  font-size: 0.9rem;
  color: var(--text-3);
}

.gallery {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  margin-top: 1.5rem;
}
.gallery a { display: block; }
.gallery a:hover img { border-color: var(--gold); box-shadow: 0 0 30px rgba(233, 167, 90, 0.25), 0 18px 40px rgba(0, 0, 0, 0.5); }

/*
 * The reveal: a picture, numbered pins on it, and what each pin is really
 * teaching. Positions are percentages of the picture, turned into lengths
 * with container units so they follow the picture rather than the window.
 * Every picture here is 16:9, which is where 0.5625 comes from.
 *
 * The pins glow mana-blue - the one cool colour on the site - because they
 * are the magic: the lesson that was there all along.
 */
.reveal { margin: 0; }
.reveal-stage {
  position: relative;
  container-type: inline-size;
  border: 1px solid var(--line-gold);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--void);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}
.reveal-stage img {
  display: block;
  width: 100%;
  height: auto;
  transition: filter 0.4s ease;
}
.reveal:not([data-ready]) .reveal-stage img,
.reveal.is-revealed .reveal-stage img { filter: brightness(0.6) saturate(0.8); }

.reveal-notes {
  margin: 0;
  padding: 1rem 1.15rem 1.15rem;
  list-style: none;
  counter-reset: note;
  display: grid;
  gap: 0.6rem;
  background: var(--void);
  border-top: 1px solid var(--line-gold);
  font-size: 0.97rem;
  line-height: 1.4;
}
.reveal-note {
  counter-increment: note;
  display: flex;
  gap: 0.7rem;
  align-items: baseline;
}
.reveal-note::before {
  content: counter(note);
  flex: none;
  width: 1.6rem; height: 1.6rem;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: var(--mana);
  color: #0b1430;
  font-weight: 800;
  font-size: 0.85rem;
}
.reveal-text strong { color: var(--mana); }

.reveal-pin {
  position: absolute;
  left: calc(var(--x) * 1cqw);
  top: calc(var(--y) * 0.5625cqw);
  width: 2.1rem; height: 2.1rem;
  margin: -1.05rem 0 0 -1.05rem;
  border: 2px solid #dfe9ff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--mana-deep);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 0 0 5px rgba(143, 180, 255, 0.25), 0 0 22px rgba(143, 180, 255, 0.8);
}

@container (min-width: 700px) {
  .reveal-notes {
    position: absolute;
    inset: 0;
    display: block;
    padding: 0;
    background: none;
    border: 0;
  }
  .reveal-note {
    position: absolute;
    left: calc(var(--x) * 1cqw);
    top: calc(var(--y) * 0.5625cqw);
    display: block;
  }
  .reveal-note::before { content: none; }
  .reveal-pin { left: 0; top: 0; }
  .reveal-text {
    position: absolute;
    top: 0;
    left: 1.6rem;
    width: max-content;
    max-width: min(17rem, 30cqw);
    transform: translateY(-50%);
    padding: 0.55rem 0.85rem;
    border: 1px solid rgba(143, 180, 255, 0.6);
    border-radius: 8px;
    background: rgba(8, 12, 28, 0.92);
    color: #eef3ff;
    box-shadow: 0 0 20px rgba(74, 111, 214, 0.35);
  }
  .reveal-note--left .reveal-text { left: auto; right: 1.6rem; }
}

/* Hidden until asked for - but only once the script is there to ask with. */
.reveal[data-ready]:not(.is-revealed) .reveal-note { visibility: hidden; opacity: 0; }
@container (max-width: 699.98px) {
  .reveal[data-ready]:not(.is-revealed) .reveal-notes { display: none; }
}

.reveal-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
}

/* A toggle that says whether it is on: pressed, it glows with mana. */
[data-reveal-toggle][aria-pressed="true"] {
  --b-bg: linear-gradient(180deg, #6f93f0, var(--mana-deep));
  --b-text: #fff;
  --b-line: #dfe9ff;
  box-shadow: 0 0 22px rgba(143, 180, 255, 0.55);
}

/* ----------------------------------------------------------------- 10 -- */

/*
 * The calculator. A plain GET form that the server answers on submit; with
 * script, pricing.js answers as the numbers change and the submit button
 * goes away. Either way the breakdown is a list a screen reader can read in
 * order: a line per rate, then the total.
 */
.pricing {
  display: grid;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  align-items: start;
}

.choice { border: 0; padding: 0; margin: 0; min-width: 0; }
.choice legend {
  padding: 0;
  margin-bottom: 0.6rem;
  font: 700 0.8rem/1 var(--font-display);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--torch);
}
.choice + .choice { margin-top: 1.6rem; }

/* Monthly / yearly: two radios dressed as one switch. */
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line-gold);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--field-bg);
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
  display: grid;
  place-items: center;
  gap: 0.15rem;
  padding: 0.75rem 0.5rem;
  cursor: pointer;
  text-align: center;
  font-weight: 700;
  color: var(--text-2);
}
.segmented label small { font-weight: 400; color: var(--text-3); font-size: 0.8rem; }
.segmented input:checked + label {
  background: linear-gradient(180deg, #ffe39c, #f0c674 40%, #c98f3c);
  color: #2a1606;
}
.segmented input:checked + label small { color: #4a2c0c; }
.segmented input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: -3px; }

.stepper {
  display: grid;
  grid-template-columns: 3.2rem minmax(4rem, 1fr) 3.2rem;
  max-width: 17rem;
  border: 1px solid var(--line-gold);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--field-bg);
}
.stepper button {
  border: 0;
  background: var(--stone-2);
  color: var(--gold);
  font: 800 1.5rem/1 var(--font-display);
  cursor: pointer;
}
.stepper button:hover:not(:disabled) { background: var(--stone-3); color: var(--gold-hi); }
.stepper button:disabled { color: var(--text-3); cursor: not-allowed; opacity: 0.6; }
.stepper input {
  width: 100%;
  min-height: 3.2rem;
  border: 0;
  border-inline: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: center;
  font: 800 1.5rem/1 var(--font-display);
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.breakdown { list-style: none; padding: 0; }
.breakdown li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px dashed var(--line);
  color: var(--text-2);
}
.breakdown .amount { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }

.total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-top: 1rem;
}
.total-label {
  font: 700 0.85rem/1 var(--font-display);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--torch);
}
.total-n {
  font: 800 clamp(2.2rem, 5vw, 3rem)/1 var(--font-display);
  color: var(--gold);
  text-shadow: 0 0 24px rgba(240, 198, 116, 0.35);
  font-variant-numeric: tabular-nums;
}
.total-n small { font-size: 0.4em; color: var(--text-2); letter-spacing: 0.04em; }

.covers { margin-top: 1.2rem; color: var(--text-2); font-size: 0.97rem; }
.covers strong { color: var(--text); }

.checkout { margin-top: 1.6rem; }
.checkout .btn { width: 100%; }
.checkout-go { flex-direction: column; gap: 0.15rem; }
.checkout-go small { font-family: var(--font-body); font-size: 0.82rem; letter-spacing: 0; text-transform: none; opacity: 0.85; }
.checkout-note { margin-top: 0.9rem; font-size: 0.92rem; color: var(--text-3); }
.checkout-note a { color: var(--gold); }

.rate-table { width: 100%; border-collapse: collapse; font-size: 0.97rem; }
.rate-table th,
.rate-table td { padding: 0.7rem 0.6rem; border-bottom: 1px solid var(--line); text-align: left; }
.rate-table th { font: 700 0.75rem/1.2 var(--font-display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--torch); }
.rate-table td.num { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); font-weight: 700; }
.rate-table th.num { text-align: right; }

/* ----------------------------------------------------------------- 11 -- */

.signup > * + * { margin-top: 0.8rem; }
.signup h2,
.signup h3 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.signup-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  max-width: 34rem;
}
.signup-row .field { flex: 1 1 15rem; }
.signup-blurb { color: var(--text-2); }
.signup-fine { font-size: 0.9rem; color: var(--text-3); max-width: 34rem; }
.signup-status { font-weight: 700; color: var(--ok); min-height: 1.6em; }
.signup-status:empty { min-height: 0; margin: 0; }
.signup--dark { color: var(--text); }

.form { max-width: 38rem; }
.form > * + * { margin-top: 1.25rem; }

.notice {
  padding: 1.1rem 1.3rem;
  border: 1px solid var(--line-gold);
  border-left: 4px solid var(--ok);
  border-radius: var(--radius);
  background: var(--stone);
}
.notice--warn { border-left-color: var(--ember); }

.callout {
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border: 1px solid var(--line-gold);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--stone-2), var(--stone));
}
.callout > * + * { margin-top: 0.8rem; }
.callout--mana { border-color: rgba(143, 180, 255, 0.5); box-shadow: 0 0 30px rgba(74, 111, 214, 0.15); }

.single { width: min(100% - 2rem, 30rem); margin: clamp(3rem, 8vw, 5rem) auto; }
.single > * + * { margin-top: 1.1rem; }
.single h1 { font-size: clamp(2rem, 4.4vw, 2.8rem); }

/* ----------------------------------------------------------------- 12 -- */

.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1rem; }
.prose h2 { font-size: 1.6rem; margin-top: 2.6rem; scroll-margin-top: 5.5rem; }
.prose h3 { font-size: 1.15rem; margin-top: 1.8rem; color: var(--torch); }
.prose ul,
.prose ol { padding-left: 1.3rem; }
.prose li + li { margin-top: 0.45rem; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.97rem; }
.prose th,
.prose td { text-align: left; vertical-align: top; padding: 0.6rem 0.75rem; border: 1px solid var(--line); }
.prose th { background: var(--stone); color: var(--gold); }
.prose .table-wrap,
.table-wrap { overflow-x: auto; }
.prose code { font-size: 0.92em; background: var(--stone); padding: 0.1em 0.35em; border-radius: 4px; }

/* ----------------------------------------------------------------- 13 -- */

.footer {
  margin-top: 0;
  background: var(--void);
  border-top: 1px solid var(--line-gold);
  box-shadow: 0 -1px 0 #000;
}
.footer-signup { padding-block: clamp(2.25rem, 5vw, 3.5rem); border-bottom: 1px solid var(--line); }
.footer-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-block: 1.75rem 2.25rem;
  font-size: 0.92rem;
  color: var(--text-3);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; }
.footer-links a { color: var(--text-2); text-decoration: none; }
.footer-links a:hover { color: var(--gold-hi); text-decoration: underline; }
.footer-maker a { color: var(--text-2); }

/* ----------------------------------------------------------------- 14 -- */

.consent {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  padding: 0.9rem;
  pointer-events: none;
}
.consent-inner {
  pointer-events: auto;
  width: min(100%, 58rem);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem 1.5rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--line-gold);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--stone-2), var(--stone));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}
.consent-copy { flex: 1 1 22rem; font-size: 0.97rem; line-height: 1.5; }
/* Deliberately identical buttons: refusing must not be harder to find, or
   to press, than accepting. */
.consent-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; }
/* The second, optional yes: full width under the question, unticked. */
.consent-extra {
  flex: 1 1 100%;
  order: 1;
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-2);
}
.consent-extra input { margin-top: 0.2rem; inline-size: 1.05rem; block-size: 1.05rem; accent-color: var(--gold); flex: none; }
.consent-actions { order: 2; }

/* ----------------------------------------------------------------- 15 -- */

@media (prefers-reduced-motion: no-preference) {
  .embers span { animation: rise var(--d, 9s) linear infinite; animation-delay: var(--delay, 0s); }
  .rule-orn i,
  .seal::before { animation: flicker 3.2s ease-in-out infinite; }
}

@keyframes rise {
  0%   { transform: translate(0, 0) scale(1); opacity: 0; }
  10%  { opacity: 0.9; }
  60%  { opacity: 0.7; }
  100% { transform: translate(var(--drift, 30px), -85vh) scale(0.4); opacity: 0; }
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  40% { opacity: 0.75; }
  55% { opacity: 0.95; }
  70% { opacity: 0.8; }
}

/* ------------------------------------------------------ landing pages -- */
/* pages/landing.blade.php: the grade and homeschool pages. */

.concept-cols { grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); }
.concepts { font-size: 0.98rem; }
.concepts li { color: var(--text-2); }
.concepts strong { color: var(--text); font-weight: 700; }

.landing-others {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem 1.4rem;
  margin-top: 1.5rem;
}
.landing-others a { color: var(--gold); }
