/* Lucernarium v2 */

@font-face {
  font-family: "Cinzel";
  src: url("fonts/cinzel.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("fonts/cormorant.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("fonts/cormorant-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
/* metric fallbacks (measured against Georgia), so the swap does not move the page */
@font-face {
  font-family: "Cormorant Fallback";
  src: local("Georgia");
  font-style: normal;
  size-adjust: 87.7%;
  ascent-override: 105.4%;
  descent-override: 32.7%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Cormorant Fallback";
  src: local("Georgia Italic"), local("Georgia-Italic");
  font-style: italic;
  size-adjust: 77.3%;
  ascent-override: 119.5%;
  descent-override: 37.1%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Cinzel Fallback";
  src: local("Georgia");
  size-adjust: 101.2%;
  ascent-override: 96.5%;
  descent-override: 36.8%;
  line-gap-override: 0%;
}

:root {
  --void: #000000;
  --bone: #F3EEE3;
  --ash: #807D74;      /* cooled for v2 */
  --gold: #B8923F;     /* deepened for v2 */
  --umber: #2A1F16;
  --film: linear-gradient(100deg, #7FFFD4 0%, #FF9BE0 36%, #9AD9FF 68%, #FFE58A 100%);
  --serif: "Cormorant Garamond", "Cormorant Fallback", Georgia, serif;
  --display: "Cinzel", "Cinzel Fallback", Georgia, serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
  color-scheme: dark;
}

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

html { background: var(--void); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: transparent;     /* the page's ground is the fixed glyph layer behind everything */
  color: var(--bone);
  font-family: var(--serif);
  font-size: clamp(1.1875rem, 1.05rem + 0.45vw, 1.375rem);
  line-height: 1.5;
  font-kerning: normal;
  font-variant-numeric: oldstyle-nums;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--umber); color: var(--bone); }

a { color: inherit; text-decoration-line: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; text-decoration-color: var(--ash); }
a:hover { text-decoration-color: var(--bone); }

/* focus: the iridescent ring */
a, button { position: relative; }
:focus-visible { outline: 2px solid #9AD9FF; outline-offset: 3px; }
@supports ((mask-composite: exclude) or (-webkit-mask-composite: xor)) {
  :focus-visible { outline: none; }
  :focus-visible::after {
    content: "";
    position: absolute;
    inset: -5px -7px;
    border-radius: 3px;
    padding: 2px;
    background: var(--film);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    pointer-events: none;
  }
}

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

/* the page's ground: one fixed, low-brightness glyph layer behind every section */
.ground {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  display: block;
}

/* ---- the hall ---- */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 34rem;
  overflow: hidden;
  background: var(--void);
  cursor: default;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.hall, .hall-still {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.hall-still { object-fit: cover; object-position: 50% 50%; }
.hall[hidden] { display: none; }
/* the still covers the canvas until the first frame of the live hall is drawn (and stays if WebGL is missing) */
.hall-live .hall-still { display: none; }

.hero-text {
  position: absolute;
  left: 0;
  right: 0;
  top: 15.5%;
  padding: 0 1rem;
  text-align: center;
  pointer-events: none;
}
.inscription {
  margin: 0 -0.13em 0 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.1rem, 7.1vw, 8rem);
  line-height: 1;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--gold);
}
/* once the letters are carved into the glyph grid, the HTML text stays only as a faint guide (and for readers) */
.carved .inscription { opacity: 0.1; }
/* below ~700 px the letters are only five cells tall: the carving can't carry them alone, so the type stays */
@media (max-width: 700px) { .carved .inscription { opacity: 0.8; } }
.line {
  margin: 0.7em 0 1.7em;
  font-style: italic;
  font-size: clamp(1.25rem, 1rem + 0.9vw, 1.75rem);
  line-height: 1.3;
  color: var(--bone);
}
.download {
  display: inline-block;
  pointer-events: auto;
  padding: 0.62em 1.5em 0.68em;
  border: 1px solid transparent;
  border-radius: 2px;
  background: linear-gradient(var(--void), var(--void)) padding-box, var(--film) border-box;
  color: var(--bone);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  text-decoration: none;
}
.download:hover { background: linear-gradient(var(--umber), var(--umber)) padding-box, var(--film) border-box; }

.cue {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1.6rem;
  margin: 0;
  text-align: center;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ash);
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.4s ease;
}
.cue.show { opacity: 1; }
.cue-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .cue-mouse { display: none; }
  .cue-touch { display: inline; }
}
/* ?static renders the still: the words are laid out (so the hall makes room for them) but not drawn */
.static .hero-text, .static .cue { visibility: hidden; }
.no-webgl .cue { display: none; }
/* ?card: the social card. The inscription alone, centred, drawn only by the carving */
.card .hero-text { top: 50%; transform: translateY(-50%); }
.card .line, .card .download, .card .cue { display: none; }
.card .inscription { opacity: 0 !important; font-size: 10.4vw; }

/* ---- the page below the hall ---- */
main { padding: 0 1rem; }
main section {
  max-width: 38rem;            /* about 64 characters of Cormorant at 22 px */
  margin: 0 auto;
  padding-top: clamp(5rem, 10vw, 8.5rem);
}
h2 {
  margin: 0 0 1.4rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.45rem, 1.2rem + 0.8vw, 1.85rem);
  line-height: 1.2;
  letter-spacing: 0.12em;
  color: var(--bone);
}
p { margin: 0 0 1em; }

.box {
  border: 1px solid var(--gold);
  background: transparent;
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.25rem, 4.5vw, 2.75rem);
}
.box p:last-child { margin-bottom: 0; }
.soon { margin-top: 1.6em; }

.lamp-list { list-style: none; margin: 2rem 0 0; padding: 0; }
.lamp {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 1.5rem;
  align-items: center;
  margin: 0 0 0.75rem;
  min-height: 8.5rem;
}
.lamp h3 { margin: 0 0 0.3rem; font-size: 1.35em; font-weight: 600; line-height: 1.25; }
.lamp p { margin: 0; }
.lamp.is-unlit { cursor: default; position: relative; }
/* a glyph lamp is drawn by the ground layer around this box (flame base at 55 % of its height) */
.lamp-anchor { display: flex; align-items: center; justify-content: center; height: 8.5rem; }
.is-lit .lamp-anchor { height: 11rem; }
.ground-live .lamp-anchor .lamp-art { visibility: hidden; }
.lamp-art {
  margin: 0;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.02;
  color: var(--ash);
}
.lamp-art span { display: inline-block; }
.is-lit .ch { color: var(--ash); }
.is-lit .bw { color: var(--bone); }
.is-lit .fl {
  background: var(--film);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.is-unlit .lamp-art { opacity: 0.55; }
.unlit { font-style: italic; color: var(--ash); }

/* each question is a dark lamp: pressing it lights the lamp and the answer resolves out of the glyphs */
.qa {
  display: grid;
  grid-template-columns: 2.75rem 1fr;
  column-gap: 0.75rem;
  margin: 0 0 0.5rem;
}
.qa .lamp-anchor { grid-row: 1 / span 2; height: 3.2rem; align-self: start; }
.qa h3 { margin: 0; font-size: 1em; }
.q {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0 0.45rem;
  border: 0;
  background: none;
  color: var(--bone);
  font: inherit;
  font-weight: 600;
  font-size: 1.12em;
  text-align: left;
  cursor: pointer;
}
.q[aria-expanded="false"] { color: var(--ash); }
.q:hover { color: var(--bone); }
.a { padding: 0 0 1.4rem; transition: opacity 0.28s ease; }
.a p { margin: 0; }
.a.resolving { opacity: 0; }

.foot {
  margin-top: clamp(6rem, 12vw, 10rem);
  padding: 0 1rem 3.25rem;
  font-size: 1.125rem;
}
.foot-in { max-width: 38rem; margin: 0 auto; }
.foot-lamp { height: 7rem; }
.disclaimer { margin: 0 0 1.75rem; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 1rem 2rem; }
.domain { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .cue, .a { transition: none; }
}
@media (max-width: 600px) {
  .lamp { grid-template-columns: 4.5rem 1fr; gap: 1rem; }
}
