:root {
  --ink: #0a0318;
  --ink-2: #140726;
  --magenta: #ff2bd6;
  --cyan: #2de2ff;
  --violet: #8a5bff;
  --gold: #ffd36b;
  --gold-deep: #c8862a;
  --text: #efe4ff;
  --muted: #b9a6d9;
  --blackletter: 'Grenze Gotisch', 'UnifrakturMaguntia', serif;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --mono: 'VT323', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 15% 10%, rgba(138, 91, 255, .14), transparent 60%),
    radial-gradient(900px 600px at 85% 40%, rgba(255, 43, 214, .10), transparent 60%),
    radial-gradient(900px 700px at 30% 90%, rgba(45, 226, 255, .08), transparent 60%),
    var(--ink);
  color: var(--text);
  font-family: var(--serif);
  font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem);
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: inherit; }

/* ───────────── Hero ───────────── */

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 520px;
  overflow: hidden;
  background: #05010f;
  cursor: crosshair;
  touch-action: pan-y;
}

#glass {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* scanlines + vignette in one flat layer; no blend modes, which force the page to be re-blended every frame */
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, .16) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .7) 100%);
}

.frame {
  position: absolute;
  inset: 14px;
  pointer-events: none;
  border: 1px solid rgba(255, 211, 107, .35);
  outline: 1px solid rgba(255, 211, 107, .12);
  outline-offset: 5px;
}

.corner {
  position: absolute;
  width: 64px;
  height: 64px;
  background: url(img/corner.svg) no-repeat center / contain;
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(255, 211, 107, .45));
}
.corner.tl { top: -6px; left: -6px; }
.corner.tr { top: -6px; right: -6px; transform: scaleX(-1); }
.corner.bl { bottom: -6px; left: -6px; transform: scaleY(-1); }
.corner.br { bottom: -6px; right: -6px; transform: scale(-1, -1); }

.nav {
  position: absolute;
  top: 26px;
  right: 40px;
  display: flex;
  gap: .9em;
  align-items: center;
  font-family: var(--mono);
  font-size: 1.25rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cyan);
  z-index: 2;
}
.nav span { color: var(--magenta); font-size: .8em; }
.nav a {
  text-decoration: none;
  text-shadow: 0 0 8px rgba(45, 226, 255, .7);
  transition: color .2s, text-shadow .2s;
}
.nav a:hover, .nav a:focus-visible {
  color: #fff;
  text-shadow: 0 0 6px #fff, 0 0 18px var(--magenta);
}

.title-block {
  position: absolute;
  top: clamp(56px, 7vh, 96px);
  left: 0;
  right: 0;
  text-align: center;
  pointer-events: none;
  padding: 0 16px;
}

.eyebrow {
  margin: 0 0 .2em;
  font-family: var(--mono);
  font-size: clamp(1rem, .9rem + .5vw, 1.4rem);
  letter-spacing: .45em;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 0 10px rgba(255, 211, 107, .6);
}

.title {
  position: relative;
  display: inline-block;
  margin: 0;
  font-family: var(--blackletter);
  font-weight: 900;
  font-size: clamp(3rem, 1.5rem + 6.5vw, 7.2rem);
  line-height: 1;
  letter-spacing: .01em;
  color: transparent;
  background: linear-gradient(180deg, #ffffff 0%, #ffe6fb 30%, #ff8ae2 52%, #7fe9ff 72%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 10px rgba(255, 60, 210, .55)) drop-shadow(0 0 28px rgba(60, 220, 255, .35));
}
.title::before,
.title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  -webkit-background-clip: text;
  background-clip: text;
  opacity: .4;
  pointer-events: none;
}
.title::before { background-image: linear-gradient(#ff2bd6, #ff2bd6); transform: translate(-2px, 0); animation: glitch-a 7s infinite steps(1); }
.title::after  { background-image: linear-gradient(#2de2ff, #2de2ff); transform: translate(2px, 0);  animation: glitch-b 7s infinite steps(1); }

@keyframes glitch-a {
  0%, 92%, 100% { transform: translate(-2px, 0); clip-path: none; }
  93% { transform: translate(-7px, 1px); clip-path: inset(10% 0 55% 0); }
  95% { transform: translate(5px, -1px); clip-path: inset(60% 0 8% 0); }
  97% { transform: translate(-3px, 0); clip-path: inset(35% 0 40% 0); }
}
@keyframes glitch-b {
  0%, 92%, 100% { transform: translate(2px, 0); clip-path: none; }
  93% { transform: translate(6px, -1px); clip-path: inset(50% 0 20% 0); }
  95% { transform: translate(-5px, 1px); clip-path: inset(5% 0 70% 0); }
  97% { transform: translate(4px, 0); clip-path: inset(70% 0 5% 0); }
}
@media (prefers-reduced-motion: reduce) {
  .title::before, .title::after { animation: none; }
}

.tagline {
  margin: .5em 0 0;
  font-style: italic;
  font-size: clamp(1rem, .9rem + .5vw, 1.35rem);
  color: #f3dcff;
  text-shadow: 0 0 3px #12002a, 0 0 8px #12002a, 0 0 18px rgba(138, 91, 255, .9);
}

.hint {
  position: absolute;
  bottom: 34px;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 1.15rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: rgba(190, 245, 255, .75);
  text-shadow: 0 0 8px rgba(45, 226, 255, .8);
  pointer-events: none;
  animation: breathe 4s ease-in-out infinite;
}
@keyframes breathe { 50% { opacity: .45; } }

.descend {
  position: absolute;
  bottom: 30px;
  right: 40px;
  font-size: 1rem;
  color: var(--gold);
  text-decoration: none;
  text-shadow: 0 0 10px var(--gold);
  z-index: 2;
}

/* ───────────── Folios (illuminated manuscript) ───────────── */

.folios {
  width: min(860px, 100% - 32px);
  margin: 0 auto;
  padding: clamp(56px, 10vw, 120px) 0 40px;
}

.folio {
  position: relative;
  padding: clamp(36px, 6vw, 64px) clamp(24px, 6vw, 72px);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, 0) 40%),
    linear-gradient(180deg, rgba(36, 14, 70, .72), rgba(16, 6, 34, .82));
  border: 1px solid rgba(255, 211, 107, .5);
  outline: 1px solid rgba(255, 211, 107, .18);
  outline-offset: -9px;
  box-shadow:
    0 0 0 1px rgba(255, 43, 214, .15),
    0 20px 60px rgba(0, 0, 0, .55),
    0 0 80px rgba(138, 91, 255, .12),
    inset 0 0 60px rgba(45, 226, 255, .05);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.folio .corner { width: 54px; height: 54px; }

.folio-num {
  margin: 0;
  font-family: var(--mono);
  font-size: 1.15rem;
  letter-spacing: .4em;
  text-transform: uppercase;
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(45, 226, 255, .6);
}

.folio h2 {
  margin: .1em 0 .55em;
  font-family: var(--blackletter);
  font-weight: 700;
  font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.4rem);
  line-height: 1.05;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(255, 211, 107, .35), 2px 2px 0 rgba(255, 43, 214, .35);
}

.folio p { margin: 0 0 1em; }
.folio p:last-of-type { margin-bottom: 0; }

.dropcap {
  float: left;
  display: grid;
  place-items: center;
  width: 2.9em;
  height: 2.9em;
  margin: .3em .45em 0 0;
  border: 2px solid var(--gold);
  outline: 1px solid rgba(255, 211, 107, .45);
  outline-offset: 3px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 43, 214, .55), transparent 60%),
    radial-gradient(circle at 75% 80%, rgba(45, 226, 255, .45), transparent 55%),
    repeating-conic-gradient(#2c1060 0 25%, #1a0838 0 50%) 0 0 / 14px 14px;
  box-shadow: 0 0 22px rgba(255, 211, 107, .3), inset 0 0 14px rgba(0, 0, 0, .7);
}
.dropcap > span {
  font-family: var(--blackletter);
  font-weight: 900;
  font-size: 2.6em;
  line-height: 1;
  color: transparent;
  background: linear-gradient(180deg, #fff6c9 0%, var(--gold) 45%, var(--gold-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .6)) drop-shadow(0 0 6px rgba(255, 211, 107, .5));
}

.marginalia {
  margin-top: 1.6em;
  font-family: var(--mono);
  font-size: 1.05rem;
  letter-spacing: .12em;
  color: var(--magenta);
  text-align: right;
  opacity: .85;
  text-shadow: 0 0 8px rgba(255, 43, 214, .55);
}

.soon {
  text-align: center;
  font-style: italic;
  color: var(--muted);
}

.fleuron {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 42px auto;
  color: var(--gold);
  font-size: 1.8rem;
  text-shadow: 0 0 12px rgba(255, 211, 107, .6);
}
.fleuron span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--magenta), var(--cyan), transparent);
}

.footer {
  padding: 40px 16px 56px;
  text-align: center;
  color: var(--gold);
  font-family: var(--blackletter);
  font-size: 1.4rem;
}
.footer p { margin: .2em 0; }
.footer .mono {
  font-family: var(--mono);
  font-size: 1.05rem;
  letter-spacing: .3em;
  color: var(--muted);
}

@media (max-width: 640px) {
  .nav { left: 0; right: 0; justify-content: center; top: 24px; font-size: .95rem; letter-spacing: .06em; gap: .5em; }
  .title-block { top: 64px; }
  .hint { font-size: .95rem; letter-spacing: .15em; bottom: 30px; }
  .descend { display: none; }
  .corner { width: 44px; height: 44px; }
  .frame { inset: 10px; }
  .dropcap { width: 2.5em; height: 2.5em; }
}
.footer .copyright {
  margin-top: 1em;
  font-family: var(--serif);
  font-size: .95rem;
  color: var(--muted);
  opacity: .8;
}

/* ───────────── Sound toggle ───────────── */

.sound-toggle {
  position: fixed;
  left: 24px;
  bottom: 22px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: .7em;
  padding: .55em 1em .55em .8em;
  font-family: var(--mono);
  font-size: 1.05rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(20, 8, 40, .85);
  border: 1px solid rgba(255, 211, 107, .55);
  box-shadow: 0 0 14px rgba(255, 211, 107, .22);
  cursor: pointer;
  transition: box-shadow .2s, color .2s;
}
.sound-toggle:hover, .sound-toggle:focus-visible { box-shadow: 0 0 20px rgba(255, 43, 214, .6); color: #fff; }
.sound-toggle .readout { display: none; color: var(--cyan); font-size: .9rem; letter-spacing: .08em; text-shadow: 0 0 8px rgba(45, 226, 255, .6); }
.sound-toggle.playing .readout { display: inline; }
.sound-toggle .eq { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.sound-toggle .eq i { width: 3px; height: 14px; background: currentColor; transform: scaleY(.3); transform-origin: bottom; }
.sound-toggle.playing .eq i { animation: eq 1s ease-in-out infinite; }
.sound-toggle.playing .eq i:nth-child(2) { animation-delay: -.3s; }
.sound-toggle.playing .eq i:nth-child(3) { animation-delay: -.6s; }
.sound-toggle.playing .eq i:nth-child(4) { animation-delay: -.15s; }
.sound-toggle.waiting { animation: breathe 2.5s ease-in-out infinite; }
@keyframes eq { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .sound-toggle.playing .eq i, .sound-toggle.waiting { animation: none; } }
@media (max-width: 640px) {
  .sound-toggle { left: 16px; bottom: 16px; font-size: .95rem; }
  .sound-toggle .readout { display: none !important; }
}
