/* =========================================================================
   St Elowen's — the school, made into a website.
   Lumen servamus. We keep the light.

   A note to whoever reads this later: the rules of this stylesheet are the
   rules of the school. Gold is only ever light. House colours appear only in
   house contexts. Dove-grey belongs to France. Motion is weather, never an
   effect. Nothing sparkles. Nothing glows for the sake of glowing.
   ========================================================================= */

/* ----------------------------------------------------------------- Tokens */
:root {
  /* Primary */
  --elowen-blue:   #16243F;  /* the crest field; headers, footer          */
  --elowen-blue-2: #1E3255;  /* a lift of the blue, for depth on the blue */
  --star-silver:   #C9CEDA;  /* the star; rules, dividers, fine detail    */
  --lantern-gold:  #C8933A;  /* the single accent, and it always means light */
  --lantern-gold-lit: #E9B85C; /* the lit filament, for the flicker only  */

  /* The houses — used ONLY in house contexts, never as generic accents */
  --elm-green:     #2E4A3B;
  --oak-amber:     #B57224;
  --holly-scarlet: #8C2B2B;

  /* Supporting */
  --parchment:  #F4EDE1;   /* the page. The site is not white.            */
  --cream:      #FBF7F0;   /* cards and raised surfaces                   */
  --ink:        #241F1B;   /* body text                                  */
  --ink-soft:   #5A5149;   /* secondary text                             */
  --wood:       #6B4F35;   /* frames, furniture, the noticeboard         */
  --dove-grey:  #B7BCC2;   /* Sainte-Colombe only. Never for St Elowen's  */

  /* Derived, quiet */
  --parchment-deep: #EAE0CE;
  --hair:      rgba(36, 31, 27, 0.14);   /* hairlines on parchment        */
  --hair-soft: rgba(36, 31, 27, 0.08);
  --shadow:    rgba(31, 24, 16, 0.16);

  /* The house accent. Neutral by default; set by the Sorting, per-page. */
  --house:        var(--lantern-gold);
  --house-ink:    var(--elowen-blue);

  /* Type */
  --display: "Cormorant Garamond", "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --body:    "EB Garamond", "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --hand:    "Petit Formal Script", "Segoe Script", "Snell Roundhand", cursive;
  --sign:    "Tangerine", "Petit Formal Script", cursive;

  /* Scale — old-style, unhurried. Fluid, mobile-first. */
  --step--1: clamp(0.86rem, 0.83rem + 0.15vw, 0.95rem);
  --step-0:  clamp(1.05rem, 1.00rem + 0.28vw, 1.22rem);
  --step-1:  clamp(1.28rem, 1.18rem + 0.5vw, 1.6rem);
  --step-2:  clamp(1.6rem, 1.42rem + 0.9vw, 2.2rem);
  --step-3:  clamp(2.0rem, 1.7rem + 1.6vw, 3.1rem);
  --step-4:  clamp(2.6rem, 2.0rem + 3.0vw, 4.6rem);
  --step-5:  clamp(3.2rem, 2.2rem + 5vw, 6.4rem);

  /* Space — 8pt rhythm */
  --s-1: 0.5rem;  --s-2: 0.75rem; --s-3: 1rem;  --s-4: 1.5rem;
  --s-5: 2rem;    --s-6: 3rem;    --s-7: 4.5rem; --s-8: 7rem;

  --measure: 66ch;
  --page:    72rem;    /* max content width                              */
  --page-wide: 84rem;
  --radius:  3px;      /* the school is not rounded. Barely a softening.  */

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --slow: 900ms;
  --med:  520ms;
  --fast: 220ms;
}

/* ------------------------------------------------------------ Foundations */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.62;
  color: var(--ink);
  background-color: var(--parchment);
  background-image:
    radial-gradient(140% 120% at 50% -10%, rgba(255,255,255,0.5), transparent 46%),
    url("../img/paper.svg");
  background-attachment: fixed, scroll;
  font-feature-settings: "onum" 1, "liga" 1, "kern" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overflow-x: hidden;
}

img, svg, picture { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; text-decoration-color: color-mix(in srgb, var(--lantern-gold) 60%, transparent); text-underline-offset: 0.18em; }
a:hover { text-decoration-color: var(--lantern-gold); }

::selection { background: color-mix(in srgb, var(--lantern-gold) 30%, transparent); }

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

.skip-link {
  position: absolute; left: var(--s-3); top: -100px;
  background: var(--elowen-blue); color: var(--parchment);
  padding: var(--s-2) var(--s-4); border-radius: var(--radius);
  z-index: 200; transition: top var(--fast) var(--ease);
}
.skip-link:focus { top: var(--s-3); }

/* ------------------------------------------------------------- Typography */
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.08; color: var(--elowen-blue); letter-spacing: 0.005em; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p, ul, ol, blockquote, figure, dl { margin-block: 0 var(--s-4); }
p, li { max-width: var(--measure); }
li { margin-block: 0.35em; }

.lede { font-size: var(--step-1); line-height: 1.5; color: var(--ink); font-weight: 500; }
.dim  { color: var(--ink-soft); }
.small { font-size: var(--step--1); }
.hand  { font-family: var(--hand); font-weight: 400; }
.sign  { font-family: var(--sign); font-size: 2.4em; line-height: 0.8; color: var(--elowen-blue); }
.latin { font-style: italic; }
.center { text-align: center; }
.balance { text-wrap: balance; }
.uppercase { text-transform: uppercase; letter-spacing: 0.22em; font-size: var(--step--1); font-family: var(--body); }

/* Small caps eyebrow, used above section headings */
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.6em;
  font-family: var(--body); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.24em;
  font-size: var(--step--1);
  color: var(--ink-soft);
  margin-bottom: var(--s-3);
}
.eyebrow::before, .eyebrow.flanked::after {
  content: ""; width: 1.6em; height: 1px; background: var(--hair);
}

blockquote {
  font-family: var(--display); font-size: var(--step-1);
  font-style: italic; line-height: 1.4; color: var(--elowen-blue);
  padding-left: var(--s-4); border-left: 2px solid var(--lantern-gold);
  max-width: 58ch;
}
blockquote cite { display: block; font-family: var(--body); font-style: normal; font-size: var(--step--1); color: var(--ink-soft); margin-top: var(--s-2); letter-spacing: 0.06em; }

.from-the-books {
  font-family: var(--display); font-style: italic;
  font-size: var(--step-1); line-height: 1.45; color: var(--elowen-blue);
  max-width: 54ch;
}

/* ---------------------------------------------------------------- Layout */
.wrap  { width: min(100% - 2 * var(--s-4), var(--page)); margin-inline: auto; }
.wrap-wide { width: min(100% - 2 * var(--s-4), var(--page-wide)); margin-inline: auto; }
.prose { width: min(100% - 2 * var(--s-4), 42rem); margin-inline: auto; }

section { padding-block: var(--s-7); }
.section-tight { padding-block: var(--s-6); }

.stack > * + * { margin-top: var(--s-4); }
.stack-lg > * + * { margin-top: var(--s-6); }

.grid { display: grid; gap: var(--s-4); }
@media (min-width: 640px) { .cols-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 860px) {
  .cols-3 { grid-template-columns: repeat(3, 1fr); }
  .cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* An ornamental divider: a seven-pointed star between two silver rules */
.rule-star {
  display: flex; align-items: center; gap: var(--s-3);
  color: var(--star-silver); margin-block: var(--s-5);
}
.rule-star::before, .rule-star::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--hair) 30%, var(--hair) 70%, transparent);
}
.rule-star svg { width: 22px; height: 22px; flex: none; color: var(--lantern-gold); opacity: 0.85; }

/* ----------------------------------------------------------- The top bar */
.topbar {
  position: sticky; top: 0; z-index: 90;
  background: color-mix(in srgb, var(--elowen-blue) 96%, black);
  color: var(--parchment);
  border-bottom: 1px solid rgba(201, 206, 218, 0.18);
  box-shadow: 0 1px 0 rgba(200,147,58,0.5), 0 6px 20px -14px rgba(0,0,0,0.8);
}
.topbar__row {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-4); min-height: 68px;
}
.brand { display: inline-flex; align-items: center; gap: var(--s-3); color: var(--parchment); text-decoration: none; }
.brand__crest { width: 40px; height: 48px; flex: none; }
.brand__name { display: flex; flex-direction: column; line-height: 1; }
.brand__name b { font-family: var(--display); font-weight: 600; font-size: 1.32rem; letter-spacing: 0.01em; }
.brand__name span { font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.34em; color: var(--star-silver); margin-top: 4px; }

.nav { display: none; }
.nav ul { display: flex; gap: clamp(var(--s-3), 2vw, var(--s-5)); list-style: none; padding: 0; margin: 0; }
.nav a {
  color: var(--star-silver); text-decoration: none;
  font-size: 0.98rem; letter-spacing: 0.03em;
  padding: 0.4em 0; position: relative; white-space: nowrap;
  transition: color var(--fast) var(--ease);
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
  background: var(--lantern-gold); transform: scaleX(0); transform-origin: left;
  transition: transform var(--med) var(--ease);
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--parchment); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }

@media (min-width: 900px) { .nav { display: block; } .menu-btn { display: none; } }

.menu-btn {
  appearance: none; background: transparent; border: 1px solid rgba(201,206,218,0.3);
  color: var(--parchment); border-radius: var(--radius);
  width: 46px; height: 42px; display: grid; place-items: center; cursor: pointer;
}
.menu-btn svg { width: 22px; height: 22px; }

/* Mobile drawer */
.drawer {
  position: fixed; inset: 0; z-index: 120;
  background: color-mix(in srgb, var(--elowen-blue) 98%, black);
  color: var(--parchment); padding: var(--s-5) var(--s-4);
  transform: translateX(100%); transition: transform var(--med) var(--ease);
  display: flex; flex-direction: column; overflow-y: auto;
}
.drawer[data-open="true"] { transform: translateX(0); }
.drawer__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s-5); }
.drawer nav ul { list-style: none; padding: 0; margin: 0; }
.drawer nav a {
  display: block; color: var(--parchment); text-decoration: none;
  font-family: var(--display); font-size: var(--step-2); padding: var(--s-3) 0;
  border-bottom: 1px solid rgba(201,206,218,0.14);
}
.drawer nav a[aria-current="page"] { color: var(--lantern-gold-lit); }

/* ------------------------------------------------------------ The gold bar
   Ruling Two, made physical. One click, from anywhere, always. */
.goldbar {
  background: linear-gradient(180deg, var(--lantern-gold-lit), var(--lantern-gold));
  color: #2A1B06;
}
.goldbar__row {
  display: flex; align-items: center; justify-content: center; gap: var(--s-3);
  padding: 0.7rem var(--s-4); text-align: center; flex-wrap: wrap;
}
.goldbar a {
  color: #2A1B06; font-weight: 600; text-decoration: none;
  display: inline-flex; align-items: center; gap: 0.5em;
  letter-spacing: 0.02em;
}
.goldbar a .lantern-ico { width: 18px; height: 22px; }
.goldbar a span { text-decoration: underline; text-decoration-color: rgba(42,27,6,0.4); text-underline-offset: 3px; }
.goldbar a:hover span { text-decoration-color: #2A1B06; }

/* Fixed at the foot of the viewport on small screens */
.goldbar--fixed {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  box-shadow: 0 -6px 20px -12px rgba(0,0,0,0.5);
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 900px) { .goldbar--fixed { display: none; } }
/* Reserve space so the fixed bar never covers content on mobile */
@media (max-width: 899px) { body { padding-bottom: 58px; } }

/* --------------------------------------------------------------- Buttons */
.btn {
  --btn-bg: var(--elowen-blue); --btn-fg: var(--parchment);
  display: inline-flex; align-items: center; gap: 0.6em;
  font-family: var(--body); font-weight: 600; font-size: var(--step-0);
  letter-spacing: 0.02em; line-height: 1;
  padding: 0.85em 1.4em; border: 1px solid transparent; border-radius: var(--radius);
  background: var(--btn-bg); color: var(--btn-fg);
  text-decoration: none; cursor: pointer;
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease), background var(--fast) var(--ease);
  box-shadow: 0 2px 0 rgba(0,0,0,0.12);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px -8px var(--shadow); }
.btn:active { transform: translateY(0); }
.btn--gold { --btn-bg: var(--lantern-gold); --btn-fg: #2A1B06; }
.btn--gold:hover { --btn-bg: var(--lantern-gold-lit); }
.btn--ghost {
  --btn-bg: transparent; --btn-fg: var(--elowen-blue);
  border-color: color-mix(in srgb, var(--elowen-blue) 30%, transparent);
  box-shadow: none;
}
.btn--ghost:hover { --btn-bg: rgba(22,36,63,0.05); }
.btn--on-blue { --btn-bg: transparent; --btn-fg: var(--parchment); border-color: rgba(201,206,218,0.4); box-shadow: none; }
.btn--on-blue:hover { --btn-bg: rgba(255,255,255,0.06); }
.btn--lg { font-size: var(--step-1); padding: 0.95em 1.7em; }

.textlink {
  display: inline-flex; align-items: center; gap: 0.4em;
  color: var(--elowen-blue); font-weight: 600; text-decoration: none;
  border-bottom: 1px solid var(--lantern-gold); padding-bottom: 1px;
}
.textlink svg { width: 0.9em; height: 0.9em; transition: transform var(--fast) var(--ease); }
.textlink:hover svg { transform: translateX(3px); }

/* ----------------------------------------------------------------- Cards */
.card {
  background: var(--cream);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  padding: var(--s-5);
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 14px 30px -26px var(--shadow);
  position: relative;
}
.card h3 { margin-bottom: var(--s-2); }
.card--framed { border: 1px solid color-mix(in srgb, var(--wood) 40%, transparent); box-shadow: 0 0 0 1px var(--hair-soft) inset, 0 18px 34px -28px var(--shadow); }

/* A link card that lifts gently */
.linkcard { text-decoration: none; color: inherit; display: block; transition: transform var(--med) var(--ease), box-shadow var(--med) var(--ease); }
.linkcard:hover { transform: translateY(-3px); box-shadow: 0 24px 40px -30px var(--shadow); }
.linkcard:hover h3 { color: color-mix(in srgb, var(--elowen-blue) 80%, var(--lantern-gold)); }

/* Scene image with an inked frame, the way a book plate sits on the page */
.plate { position: relative; border: 1px solid rgba(107,79,53,0.5); background: var(--cream); padding: 6px; box-shadow: 0 20px 40px -30px var(--shadow); }
.plate::after { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(107,79,53,0.35); pointer-events: none; }
.plate img { width: 100%; }
.plate figcaption { padding: var(--s-2) var(--s-1) 0; font-size: var(--step--1); color: var(--ink-soft); font-style: italic; text-align: center; }

/* ----------------------------------------------------------- The hero */
.hero { position: relative; isolation: isolate; overflow: clip; background: var(--elowen-blue); min-height: 82svh; }
@media (min-width: 900px) { .hero { min-height: 88svh; max-height: 900px; } }
.hero__media, .hero__scrim, .hero__inner { position: absolute; inset: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 40%; display: block; }
@media (min-width: 900px) { .hero__media img { object-position: center; } }
.hero__scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(9,15,28,0.42) 0%, rgba(9,15,28,0.05) 30%, rgba(9,15,28,0.16) 62%, rgba(9,15,28,0.72) 100%);
}
.hero__inner {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  text-align: center; padding: var(--s-6) var(--s-4) var(--s-7);
  color: var(--parchment);
}
.hero__crest { width: clamp(70px, 12vw, 120px); height: auto; margin-bottom: var(--s-3); filter: drop-shadow(0 6px 14px rgba(0,0,0,0.5)); }
.hero h1 {
  color: var(--parchment);
  font-size: var(--step-5);
  text-shadow: 0 2px 24px rgba(0,0,0,0.55), 0 1px 2px rgba(0,0,0,0.5);
  letter-spacing: 0.01em;
}
.hero__tag {
  font-family: var(--display); font-style: italic;
  font-size: var(--step-1); color: var(--star-silver);
  text-shadow: 0 1px 12px rgba(0,0,0,0.6); margin-top: var(--s-2);
}
.hero__scroll {
  position: absolute; bottom: var(--s-4); left: 50%; transform: translateX(-50%);
  z-index: 3; color: var(--star-silver); font-size: 0.7rem; letter-spacing: 0.3em; text-transform: uppercase;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.hero__scroll svg { width: 18px; height: 18px; }

/* Full-bleed illustrated band (the tower panel, section breaks) */
.band { position: relative; overflow: clip; background: var(--elowen-blue); color: var(--parchment); isolation: isolate; }
.band__media { position: absolute; inset: 0; z-index: 0; }
.band__media img { width: 100%; height: 100%; object-fit: cover; }
.band__media::after { content:""; position:absolute; inset:0; background: linear-gradient(180deg, rgba(9,14,26,0.7), rgba(9,14,26,0.55) 45%, rgba(9,14,26,0.8)); }
.band__inner { position: relative; z-index: 2; padding-block: var(--s-8); }
.band h2, .band h3 { color: var(--parchment); }

/* ----------------------------------------------------- The tower panel */
.tower {
  text-align: center; color: var(--parchment);
  max-width: 40ch; margin-inline: auto;
}
.tower h2 { color: var(--parchment); font-size: var(--step-4); margin-bottom: var(--s-4); }
.tower p { margin-inline: auto; font-size: var(--step-1); line-height: 1.5; color: color-mix(in srgb, var(--parchment) 92%, transparent); }
.tower p + p { margin-top: var(--s-3); }
.tower .book-ref { color: var(--lantern-gold-lit); font-style: italic; }

/* ------------------------------------------------ The lantern (a motif) */
.lantern-flame { transform-origin: center; }

/* --------------------------------------------------------- Porter's Lodge */
.doors { display: grid; gap: var(--s-4); }
@media (min-width: 640px) { .doors { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .doors { grid-template-columns: repeat(4, 1fr); } }
.door {
  display: flex; flex-direction: column; gap: var(--s-2);
  background: var(--cream); border: 1px solid var(--hair);
  border-radius: var(--radius); padding: var(--s-4);
  text-decoration: none; color: inherit;
  transition: transform var(--med) var(--ease), box-shadow var(--med) var(--ease), border-color var(--med) var(--ease);
  position: relative; overflow: hidden;
}
.door:hover { transform: translateY(-4px); box-shadow: 0 22px 40px -28px var(--shadow); border-color: color-mix(in srgb, var(--lantern-gold) 55%, transparent); }
.door__ico { width: 54px; height: 66px; color: var(--wood); }
.door h3 { font-size: var(--step-1); }
.door p { font-size: var(--step--1); color: var(--ink-soft); margin: 0; }
.door[data-preferred="true"]::before { content: "Your door"; position: absolute; top: 10px; right: -30px; transform: rotate(45deg); background: var(--lantern-gold); color: #2A1B06; font-size: 0.6rem; letter-spacing: 0.15em; text-transform: uppercase; padding: 3px 34px; }

/* --------------------------------------------------------- The noticeboard */
.board { background:
    linear-gradient(180deg, rgba(107,79,53,0.12), rgba(107,79,53,0.05)),
    var(--parchment);
  border: 10px solid var(--wood);
  border-radius: 4px;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.15) inset, 0 30px 60px -40px var(--shadow);
  padding: clamp(var(--s-4), 4vw, var(--s-6));
}
.notes { display: grid; gap: var(--s-5); grid-template-columns: 1fr; }
@media (min-width: 720px) { .notes { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .notes { grid-template-columns: repeat(3, 1fr); } }
.note {
  position: relative; background: var(--cream);
  padding: var(--s-4) var(--s-4) var(--s-5);
  box-shadow: 0 12px 24px -18px var(--shadow);
  border: 1px solid var(--hair-soft);
}
.note:nth-child(3n)   { transform: rotate(-1.1deg); background: #FBF6EA; }
.note:nth-child(3n+1) { transform: rotate(0.8deg); }
.note:nth-child(3n+2) { transform: rotate(-0.4deg); background: #F7F1E3; }
.note::before { /* the drawing pin */
  content: ""; position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--lantern-gold-lit), var(--lantern-gold) 55%, #7d5a1f);
  box-shadow: 0 3px 5px rgba(0,0,0,0.3);
}
.note__kind { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.2em; color: var(--wood); font-weight: 600; }
.note h4 { font-size: var(--step-1); margin: var(--s-1) 0; color: var(--elowen-blue); }
.note__term { font-size: var(--step--1); color: var(--ink-soft); font-style: italic; }
.note.note--comp .note__kind { color: var(--holly-scarlet); }
.note.note--news .note__kind { color: var(--elm-green); }
.note.note--new .note__kind { color: var(--elowen-blue); }

/* --------------------------------------------------------- The pupils */
.monogram {
  width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center;
  background: var(--cream); border: 2px solid var(--house); color: var(--house);
  font-family: var(--display); font-weight: 600; font-size: 2.6rem; flex: none;
  box-shadow: 0 10px 24px -18px var(--shadow);
}
.pupil-head { display: flex; gap: var(--s-4); align-items: center; flex-wrap: wrap; }
.pupil-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.pupil-grid a { text-decoration: none; color: inherit; display: flex; gap: var(--s-3); align-items: center; background: var(--cream); border: 1px solid var(--hair); border-radius: var(--radius); padding: var(--s-3); transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease); }
.pupil-grid a:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -22px var(--shadow); }
.pupil-grid .monogram { width: 52px; height: 52px; font-size: 1.4rem; border-width: 1.5px; }
.pupil-grid b { color: var(--elowen-blue); display: block; }
.pupil-grid span { font-size: var(--step--1); color: var(--ink-soft); }
.traits { display: grid; gap: 0; border-top: 1px solid var(--hair); margin-top: var(--s-4); }
.traits div { display: grid; grid-template-columns: 8rem 1fr; gap: var(--s-3); padding: var(--s-3) 0; border-bottom: 1px solid var(--hair); }
.traits dt { color: var(--wood); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.72rem; align-self: center; font-weight: 600; }
.traits dd { margin: 0; }
.secret-line { background: color-mix(in srgb, var(--lantern-gold) 12%, var(--cream)); border-left: 3px solid var(--lantern-gold); padding: var(--s-4); border-radius: var(--radius); font-family: var(--display); font-style: italic; font-size: var(--step-1); color: var(--elowen-blue); }
.pupil-e--elm { --house: var(--elm-green); }
.pupil-e--oak { --house: var(--oak-amber); }
.pupil-e--holly { --house: var(--holly-scarlet); }
.pupil-e--none { --house: var(--wood); }

/* --------------------------------------------------------- The cipher */
.cipher { background: var(--elowen-blue); color: var(--parchment); border-radius: var(--radius); padding: clamp(var(--s-5), 5vw, var(--s-7)); box-shadow: 0 30px 60px -40px var(--shadow); position: relative; overflow: hidden; }
.cipher h2, .cipher h3 { color: var(--parchment); }
.cipher__grid { display: grid; gap: var(--s-5); align-items: center; }
@media (min-width: 780px) { .cipher__grid { grid-template-columns: 260px 1fr; } }
.cipher__star { width: 100%; max-width: 240px; margin: 0 auto; }
.cipher__clues { list-style: none; padding: 0; margin: 0; counter-reset: c; display: grid; gap: var(--s-2); }
.cipher__clues li { counter-increment: c; padding-left: 2.2em; position: relative; color: var(--star-silver); max-width: none; }
.cipher__clues li::before { content: counter(c); position: absolute; left: 0; top: 0; width: 1.5em; height: 1.5em; border: 1px solid var(--lantern-gold); border-radius: 50%; display: grid; place-items: center; font-size: 0.8em; color: var(--lantern-gold); }
.cipher__form { display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: flex-end; margin-top: var(--s-5); }
.cipher__form .input { background: rgba(255,255,255,0.08); color: var(--parchment); border-color: rgba(201,206,218,0.4); letter-spacing: 0.3em; text-transform: uppercase; }
.cipher__reveal { margin-top: var(--s-5); padding: var(--s-5); border: 1px solid var(--lantern-gold); border-radius: var(--radius); background: rgba(200,147,58,0.1); }
.cipher__reveal[hidden] { display: none; }
.cipher__msg { color: var(--holly-scarlet); font-weight: 600; margin-top: var(--s-3); }
.pledge { font-family: var(--display); font-style: italic; font-size: var(--step-1); line-height: 1.5; color: var(--elowen-blue); border-left: 2px solid var(--lantern-gold); padding-left: var(--s-4); }

/* ----------------------------------------------------------- Definition rows */
.beats { border-top: 1px solid var(--hair); }
.beat { display: grid; gap: var(--s-1) var(--s-4); padding: var(--s-4) 0; border-bottom: 1px solid var(--hair); }
@media (min-width: 720px) { .beat { grid-template-columns: 14rem 1fr; align-items: baseline; } }
.beat dt { font-family: var(--display); font-size: var(--step-1); color: var(--elowen-blue); font-weight: 600; }
.beat dd { margin: 0; color: var(--ink-soft); max-width: 60ch; }

/* --------------------------------------------------------------- House chips */
.house-chip { display: inline-flex; align-items: center; gap: 0.5em; font-size: var(--step--1); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.house-chip .dot { width: 12px; height: 12px; border-radius: 50%; }
.house--elm   { --house: var(--elm-green); }
.house--oak   { --house: var(--oak-amber); }
.house--holly { --house: var(--holly-scarlet); }
.house--elm .dot   { background: var(--elm-green); }
.house--oak .dot   { background: var(--oak-amber); }
.house--holly .dot { background: var(--holly-scarlet); }

/* The site "quietly wears her house": a ribbon under the top bar */
.house-ribbon { display: none; }
body[data-house] .house-ribbon {
  display: block; height: 4px;
  background: var(--house);
}
body[data-house] .brand__name span::after {
  content: " · " attr(data-house-name); color: var(--house);
}

/* ----------------------------------------------------------------- Footer */
.footer {
  background: color-mix(in srgb, var(--elowen-blue) 97%, black);
  color: var(--star-silver);
  padding-block: var(--s-7) var(--s-5);
  border-top: 2px solid var(--lantern-gold);
}
.footer a { color: var(--star-silver); text-decoration: none; }
.footer a:hover { color: var(--parchment); text-decoration: underline; text-decoration-color: var(--lantern-gold); }
.footer__grid { display: grid; gap: var(--s-5); grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer h4 { color: var(--parchment); font-size: var(--step-0); font-family: var(--body); text-transform: uppercase; letter-spacing: 0.16em; margin-bottom: var(--s-3); }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-block: 0.4em; }
.footer__motto { font-family: var(--display); font-style: italic; font-size: var(--step-1); color: var(--parchment); }
.footer__mark { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-3); }
.footer__mark svg { width: 46px; height: 55px; }
.footer__fine { margin-top: var(--s-6); padding-top: var(--s-4); border-top: 1px solid rgba(201,206,218,0.16); display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-5); align-items: center; justify-content: space-between; font-size: var(--step--1); }
.footer__story { font-style: italic; color: var(--star-silver); }

/* -------------------------------------------------------- Forget-me control */
.forget { background: none; border: 1px solid rgba(201,206,218,0.3); color: var(--star-silver); font: inherit; font-size: var(--step--1); padding: 0.4em 0.9em; border-radius: var(--radius); cursor: pointer; }
.forget:hover { border-color: var(--lantern-gold); color: var(--parchment); }

/* ----------------------------------------------------------- Page header */
.pagehead { padding-block: var(--s-7) var(--s-5); text-align: center; }
.pagehead .eyebrow { justify-content: center; }
.pagehead h1 { font-size: var(--step-4); }
.pagehead p { margin-inline: auto; margin-top: var(--s-3); color: var(--ink-soft); font-size: var(--step-1); }
.breadcrumb { font-size: var(--step--1); color: var(--ink-soft); letter-spacing: 0.04em; margin-bottom: var(--s-3); }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* --------------------------------------------------------------- France */
/* When the visitor crosses the Channel, the palette shifts. Dove-grey.
   A returning visitor should feel it in her chest before she reads a word. */
.france {
  --elowen-blue: #3A4048;
  --lantern-gold: #8892A0;
  --lantern-gold-lit: #AAB2BD;
  --star-silver: #D7DBE0;
  --house: var(--dove-grey);
}
.france body, body.france { background-image: radial-gradient(140% 120% at 50% -10%, rgba(255,255,255,0.55), transparent 46%), url("../img/paper.svg"); }

/* --------------------------------------------------------- Forms (adult) */
.field { display: flex; flex-direction: column; gap: 0.4em; margin-bottom: var(--s-4); }
.field label { font-weight: 600; color: var(--elowen-blue); }
.field .help { font-size: var(--step--1); color: var(--ink-soft); }
.input {
  font: inherit; font-size: var(--step-0); color: var(--ink);
  background: var(--cream); border: 1px solid color-mix(in srgb, var(--wood) 40%, transparent);
  border-radius: var(--radius); padding: 0.75em 0.9em; width: 100%;
}
.input:focus-visible { outline: 3px solid var(--lantern-gold); outline-offset: 1px; border-color: var(--lantern-gold); }
.checkrow { display: flex; align-items: flex-start; gap: 0.6em; margin-bottom: var(--s-4); }
.checkrow input { width: 1.2em; height: 1.2em; margin-top: 0.25em; accent-color: var(--elowen-blue); flex: none; }
.form-note { font-size: var(--step--1); color: var(--ink-soft); }

/* --------------------------------------------------------------- Utility */
.hr { border: 0; border-top: 1px solid var(--hair); margin-block: var(--s-6); }
.tag { display: inline-block; font-size: var(--step--1); letter-spacing: 0.14em; text-transform: uppercase; color: var(--wood); }
.pill { display: inline-flex; align-items: center; gap: 0.4em; font-size: var(--step--1); padding: 0.3em 0.8em; border: 1px solid var(--hair); border-radius: 100px; background: var(--cream); color: var(--ink-soft); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.on-blue { color: var(--parchment); }
.on-blue h1, .on-blue h2, .on-blue h3 { color: var(--parchment); }
.gold { color: var(--lantern-gold); }

/* ------------------------------------------------------ The term line */
.term-line {
  font-family: var(--display); font-style: italic; font-size: var(--step-2);
  color: var(--elowen-blue); text-align: center; letter-spacing: 0.01em;
  display: flex; align-items: center; justify-content: center; gap: var(--s-3); flex-wrap: wrap;
}
.term-line svg { width: 16px; height: 16px; color: var(--lantern-gold); opacity: 0.8; }

/* --------------------------------------------------- Two books, two lines */
.booklet {
  display: grid; grid-template-columns: 64px 1fr; gap: var(--s-4); align-items: start;
  background: var(--cream); border: 1px solid var(--hair); border-radius: var(--radius);
  padding: var(--s-5); text-decoration: none; color: inherit;
  transition: transform var(--med) var(--ease), box-shadow var(--med) var(--ease);
}
.booklet:hover { transform: translateY(-3px); box-shadow: 0 22px 40px -30px var(--shadow); }
.booklet__spine {
  width: 64px; height: 92px; border-radius: 2px 4px 4px 2px;
  background: linear-gradient(120deg, var(--elowen-blue), var(--elowen-blue-2));
  border-left: 4px solid var(--lantern-gold);
  box-shadow: 0 8px 18px -12px var(--shadow), inset -6px 0 12px -8px rgba(0,0,0,0.5);
  display: grid; place-items: center; position: relative;
}
.booklet__spine svg { width: 30px; height: 30px; color: var(--lantern-gold); }
.booklet--france .booklet__spine { background: linear-gradient(120deg, #3A4048, #4A525C); border-left-color: var(--dove-grey); }
.booklet--france .booklet__spine svg { color: var(--dove-grey); }
.booklet h3 { font-size: var(--step-1); margin-bottom: 2px; }
.booklet .tag { margin-bottom: var(--s-2); }
.booklet p { font-family: var(--display); font-style: italic; color: var(--ink-soft); margin: 0; max-width: 42ch; }

/* --------------------------------------------------- Teaser (two-up scene) */
.teaser { display: grid; gap: var(--s-5); align-items: center; }
@media (min-width: 860px) { .teaser { grid-template-columns: 1fr 1fr; gap: var(--s-6); } .teaser--flip .teaser__body { order: -1; } }
.teaser__body { max-width: 46ch; }

/* --------------------------------------------------------------- Houses */
.housecard { background: var(--cream); border: 1px solid var(--hair); border-radius: var(--radius); overflow: hidden; box-shadow: 0 14px 30px -26px var(--shadow); display: flex; flex-direction: column; }
.housecard__crown { height: 8px; background: var(--house); }
.housecard__in { padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-2); flex: 1; }
.housecard__tree { width: 40px; height: 40px; color: var(--house); }
.housecard h3 { color: var(--house); font-size: var(--step-2); }
.housecard .virtue { font-family: var(--display); font-style: italic; font-size: var(--step-1); color: var(--ink); }
.housecard dl { display: grid; grid-template-columns: auto 1fr; gap: 0.2em var(--s-3); margin: var(--s-2) 0 0; font-size: var(--step--1); }
.housecard dt { color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.7rem; align-self: center; }
.housecard dd { margin: 0; color: var(--ink); }
.house-e--elm   { --house: var(--elm-green); }
.house-e--oak   { --house: var(--oak-amber); }
.house-e--holly { --house: var(--holly-scarlet); }

/* The House Cup standing bars */
.cup { display: grid; gap: var(--s-3); }
.cup__row { display: grid; grid-template-columns: 5rem 1fr auto; align-items: center; gap: var(--s-3); }
.cup__name { font-weight: 600; color: var(--house); }
.cup__track { display: block; height: 12px; background: rgba(36,31,27,0.08); border-radius: 100px; overflow: hidden; }
.cup__fill { display: block; height: 100%; background: var(--house); border-radius: 100px; }

/* --------------------------------------------------------- Location panel */
.locpanel { background: var(--cream); border: 1px solid var(--hair); border-left: 4px solid var(--house); border-radius: var(--radius); padding: var(--s-5); }

/* --------------------------------------------------------- Book covers */
.bookcover {
  aspect-ratio: 3 / 4.4; border-radius: 3px 6px 6px 3px;
  background: linear-gradient(135deg, var(--elowen-blue-2), var(--elowen-blue) 70%);
  border-left: 6px solid var(--lantern-gold);
  box-shadow: 0 30px 50px -30px var(--shadow), inset -10px 0 24px -14px rgba(0,0,0,0.6);
  color: var(--parchment); padding: var(--s-5); display: flex; flex-direction: column;
  text-align: center; position: relative; overflow: hidden;
}
.bookcover--france { background: linear-gradient(135deg, #4A525C, #3A4048 70%); border-left-color: var(--dove-grey); }
.bookcover__star { width: 58px; height: 58px; margin: var(--s-3) auto; color: var(--lantern-gold); }
.bookcover--france .bookcover__star { color: var(--dove-grey); }
.bookcover__series { font-size: 0.7rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--star-silver); }
.bookcover__title { font-family: var(--display); font-size: clamp(1.6rem, 1.2rem + 2vw, 2.4rem); line-height: 1.05; margin: var(--s-2) 0; color: var(--parchment); }
.bookcover__tag { font-family: var(--display); font-style: italic; color: var(--star-silver); font-size: var(--step-0); margin-top: auto; }
.bookcover__author { margin-top: var(--s-3); font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--star-silver); }

.booklayout { display: grid; gap: var(--s-6); align-items: start; }
@media (min-width: 820px) { .booklayout { grid-template-columns: 300px 1fr; } }

/* The swappable commercial seam. One component. One file. */
.buypath { background: var(--cream); border: 1px solid var(--hair); border-top: 3px solid var(--lantern-gold); border-radius: var(--radius); padding: var(--s-5); }
.buypath h3 { font-size: var(--step-1); margin-bottom: var(--s-2); }
.buypath p { color: var(--ink-soft); }
.buypath .btn { margin-top: var(--s-3); }

/* Chapter reading */
.chapter { max-width: 40rem; margin-inline: auto; }
.chapter h2 { text-align: center; margin-bottom: var(--s-2); }
.chapter .chap-no { text-align: center; color: var(--wood); letter-spacing: 0.2em; text-transform: uppercase; font-size: var(--step--1); margin-bottom: var(--s-5); }
.chapter p { font-size: var(--step-0); }
.chapter p:first-of-type::first-letter { font-family: var(--display); font-size: 3.4em; line-height: 0.8; float: left; padding: 0.05em 0.1em 0 0; color: var(--lantern-gold); font-weight: 600; }
.chapter p + p { margin-top: var(--s-3); }

/* --------------------------------------------------------- The estate map */
.mapstage { position: relative; }
.mapwrap {
  position: relative; background: var(--cream);
  border: 10px solid var(--wood); border-radius: 4px;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.15) inset, 0 30px 60px -40px var(--shadow);
  overflow: hidden; touch-action: pan-y pinch-zoom;
}
.estate-map { width: 100%; height: auto; display: block; background: #F6EFE0; }
.estate-map text { font-family: var(--body); }

.map-pin { cursor: pointer; }
.map-pin__halo { fill: rgba(22,36,63,0.14); transition: r 200ms var(--ease), fill 200ms var(--ease); }
.map-pin__dot  { fill: var(--elowen-blue); stroke: #F6EFE0; stroke-width: 2; transition: fill 200ms var(--ease); }
.map-pin__star { fill: var(--star-silver); }
.map-pin__label {
  font-size: 15px; fill: var(--elowen-blue); text-anchor: middle; font-weight: 600;
  paint-order: stroke; stroke: #F6EFE0; stroke-width: 4px; opacity: 0;
  transition: opacity 180ms var(--ease); pointer-events: none;
}
.map-pin:hover .map-pin__halo, .map-pin:focus-visible .map-pin__halo { r: 20; fill: rgba(200,147,58,0.28); }
.map-pin:hover .map-pin__dot,  .map-pin:focus-visible .map-pin__dot  { fill: var(--wood); }
.map-pin:hover .map-pin__label, .map-pin:focus-visible .map-pin__label, .map-pin.is-open .map-pin__label { opacity: 1; }
.map-pin.is-open .map-pin__dot { fill: var(--lantern-gold); }
.map-pin:focus-visible { outline: none; }
.map-pin:focus-visible .map-pin__dot { stroke: var(--lantern-gold); stroke-width: 3; }
.map-pin[hidden] { display: none; }
.map-pin--secret .map-pin__dot { fill: var(--elm-green); }
.map-pin--secret .map-pin__halo { fill: rgba(46,74,59,0.2); }

/* The panel that opens when a pin is chosen */
.map-panel {
  background: var(--cream); border: 1px solid var(--hair); border-left: 4px solid var(--lantern-gold);
  border-radius: var(--radius); padding: var(--s-5); box-shadow: 0 20px 40px -30px var(--shadow);
  margin-top: var(--s-4);
}
.map-panel[hidden] { display: none; }
.map-panel__area { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.18em; color: var(--wood); font-weight: 600; }
.map-panel h3 { margin: 2px 0 var(--s-2); }
.map-panel .from-the-books { font-size: var(--step-0); margin-top: var(--s-3); }
.map-panel__close { float: right; background: none; border: 1px solid var(--hair); border-radius: 50%; width: 34px; height: 34px; cursor: pointer; color: var(--ink-soft); font-size: 1.1rem; line-height: 1; }
.map-hint { font-size: var(--step--1); color: var(--ink-soft); text-align: center; margin-top: var(--s-3); }

.loclist { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: var(--s-6); }
@media (max-width: 640px) { .loclist { columns: 1; } }
.loclist li { break-inside: avoid; margin-bottom: var(--s-3); max-width: none; }
.loclist a { text-decoration: none; color: var(--ink); display: block; padding: var(--s-2) 0; border-bottom: 1px solid var(--hair-soft); }
.loclist a:hover b { color: var(--elowen-blue); text-decoration: underline; text-decoration-color: var(--lantern-gold); }
.loclist b { color: var(--elowen-blue); }
.loclist .dim { display: block; font-size: var(--step--1); }

/* --------------------------------------------------------- The letter */
.letter {
  background: #FCF8EF; color: var(--ink);
  border: 1px solid rgba(107,79,53,0.35);
  box-shadow: 0 30px 60px -40px var(--shadow), 0 1px 0 rgba(255,255,255,0.7) inset;
  padding: clamp(var(--s-5), 5vw, var(--s-7));
  max-width: 44rem; margin-inline: auto; position: relative;
  background-image: linear-gradient(rgba(107,79,53,0.05) 1px, transparent 1px);
  background-size: 100% 2.1em; background-position: 0 5.3em;
}
.letter__head { text-align: center; margin-bottom: var(--s-5); }
.letter__head img { width: 66px; height: auto; margin: 0 auto var(--s-2); }
.letter__head .school { font-family: var(--display); letter-spacing: 0.34em; text-transform: uppercase; color: var(--elowen-blue); font-size: var(--step-0); }
.letter__head .latin { display: block; font-style: italic; color: var(--ink-soft); font-size: var(--step--1); letter-spacing: 0.1em; }
.letter__body p { font-size: var(--step-0); }
.letter__salut { font-family: var(--hand); font-size: 1.35em; color: var(--elowen-blue); }
.letter__sign { margin-top: var(--s-4); }
.letter__sign .name { font-family: var(--sign); font-size: 3rem; line-height: 0.7; color: var(--elowen-blue); display: block; }
.letter__sign .role { font-size: var(--step--1); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }
.letter .house-line { color: var(--house); font-weight: 600; }

/* --------------------------------------------------------- The Sorting */
.sorter { background: var(--cream); border: 1px solid var(--hair); border-radius: var(--radius); padding: clamp(var(--s-4), 4vw, var(--s-6)); box-shadow: 0 20px 40px -34px var(--shadow); }
.sorter__step { display: none; }
.sorter__step.is-active { display: block; animation: sorter-in var(--med) var(--ease); }
@keyframes sorter-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.sorter__progress { display: flex; gap: 6px; margin-bottom: var(--s-4); }
.sorter__progress span { height: 4px; flex: 1; background: rgba(36,31,27,0.12); border-radius: 4px; }
.sorter__progress span.done { background: var(--lantern-gold); }
.sorter__q { font-family: var(--display); font-size: var(--step-2); color: var(--elowen-blue); margin-bottom: var(--s-4); }
.sorter__opts { display: grid; gap: var(--s-3); }
.opt {
  text-align: left; font: inherit; font-size: var(--step-0); color: var(--ink);
  background: var(--parchment); border: 1px solid var(--hair); border-radius: var(--radius);
  padding: var(--s-3) var(--s-4); cursor: pointer; line-height: 1.4;
  transition: transform var(--fast) var(--ease), border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.opt:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--lantern-gold) 55%, transparent); box-shadow: 0 12px 24px -20px var(--shadow); }
.namefield { display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: flex-end; }
.namefield .field { flex: 1; min-width: 12rem; margin-bottom: 0; }

/* The reveal of the house */
.result { text-align: center; }
.result__crown { width: 64px; height: 64px; margin: 0 auto var(--s-2); color: var(--house); }
.result h3 { color: var(--house); font-size: var(--step-3); }
.result .virtue { font-family: var(--display); font-style: italic; font-size: var(--step-1); color: var(--ink); margin-bottom: var(--s-3); }
.result p { margin-inline: auto; }

.letter__actions { display: flex; gap: var(--s-3); flex-wrap: wrap; justify-content: center; margin-top: var(--s-5); }
.grownup-line { text-align: center; font-size: var(--step--1); color: var(--ink-soft); margin-top: var(--s-4); }

/* Downloads */
.dl { display: grid; gap: var(--s-3); grid-template-columns: 1fr; }
@media (min-width: 640px) { .dl { grid-template-columns: repeat(2, 1fr); } }
.dl a { display: flex; align-items: center; gap: var(--s-3); background: var(--cream); border: 1px solid var(--hair); border-radius: var(--radius); padding: var(--s-3) var(--s-4); text-decoration: none; color: var(--ink); transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease); }
.dl a:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -20px var(--shadow); }
.dl svg { width: 28px; height: 28px; color: var(--wood); flex: none; }
.dl b { color: var(--elowen-blue); display: block; }
.dl span { font-size: var(--step--1); color: var(--ink-soft); }

/* --------------------------------------------- Motion: weather, not effects */
/* Reveal only when JavaScript is present. With JS disabled, everything is
   visible from the start, so the site is fully readable without scripts. */
html.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity var(--slow) var(--ease), transform var(--slow) var(--ease); }
html.js [data-reveal].is-in { opacity: 1; transform: none; }
html.js [data-reveal][data-delay="1"] { transition-delay: 90ms; }
html.js [data-reveal][data-delay="2"] { transition-delay: 180ms; }
html.js [data-reveal][data-delay="3"] { transition-delay: 270ms; }

/* The lantern flickers very slightly. It never pulses, never glows out. */
@keyframes lantern-breathe {
  0%, 100% { opacity: 0.92; }
  40%      { opacity: 1; }
  55%      { opacity: 0.86; }
  70%      { opacity: 0.98; }
}
.flicker { animation: lantern-breathe 6.5s ease-in-out infinite; will-change: opacity; }

/* A rook crosses the sky once, unhurriedly, on a long loop. */
@keyframes rook-cross {
  0%   { transform: translate(-8vw, 12vh) scale(0.9); opacity: 0; }
  6%   { opacity: 0.85; }
  46%  { opacity: 0.85; }
  55%  { transform: translate(70vw, 2vh) scale(1); opacity: 0; }
  100% { transform: translate(70vw, 2vh) scale(1); opacity: 0; }
}
.rook { position: absolute; top: 0; left: 0; width: 42px; color: rgba(20,20,24,0.72); animation: rook-cross 34s ease-in-out infinite; z-index: 4; pointer-events: none; }

/* Mist drifts low and slow. */
@keyframes mist-drift { from { transform: translateX(-4%); } to { transform: translateX(4%); } }
.mist { animation: mist-drift 22s ease-in-out infinite alternate; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  html.js [data-reveal] { opacity: 1; transform: none; }
  .rook, .mist { display: none; }
}

/* Print: give the letter and the pages away cleanly. */
@media print {
  .topbar, .goldbar, .footer, .hero__scroll, .menu-btn, .drawer { display: none !important; }
  body { background: #fff; }
  /* Print only the letter when asked. */
  body[data-print-letter] * { visibility: hidden !important; }
  body[data-print-letter] #letter-out .letter,
  body[data-print-letter] #letter-out .letter * { visibility: visible !important; }
  body[data-print-letter] #letter-out .letter { position: absolute; left: 0; top: 0; width: 100%; box-shadow: none; border: 0; }
  body[data-print-letter] .letter__actions, body[data-print-letter] .grownup-line { display: none !important; }
}
