/* Self-hosted historical book face; SIL OFL in assets/fonts/OFL.txt. */
@font-face {
  font-family: 'IM Fell English';
  src: url('assets/fonts/IMFeENit28P.ttf') format('truetype');
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --ornamental-font: 'Palatino Linotype', 'Book Antiqua', Palatino, 'URW Palladio L', Georgia, serif;
  --gold: #e5c991;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #eee3ff;
  background: #090713;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 240px; min-height: 100vh; min-height: 100svh; position: relative; isolation: isolate; display: flex; flex-direction: column; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
.cosmos { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background:radial-gradient(ellipse at 73% 44%,#27133e60,transparent 54%),#090713; }
.cosmos::before, .cosmos::after { content: ''; position: absolute; inset: 0; background-repeat: repeat; }
.cosmos::before { opacity: .65; background-image: radial-gradient(1px 1px at 24px 39px, #eedaff 80%, transparent), radial-gradient(1px 1px at 133px 189px, #c9a9ff 80%, transparent), radial-gradient(1.5px 1.5px at 291px 81px, #dac1ff 65%, transparent), radial-gradient(1px 1px at 218px 304px, #e6d1ff 80%, transparent); background-size: 367px 349px; }
.cosmos::after { opacity: .3; background-image: radial-gradient(1px 1px at 101px 201px, #c9a9ff 80%, transparent), radial-gradient(1px 1px at 52px 84px, #b88bff 80%, transparent); background-size: 239px 277px; transform: rotate(9deg) scale(1.15); }
.masthead { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 32px 24px 18px; }
.masthead h1 { margin: 0; font-family: var(--ornamental-font); font-size: 15px; font-weight: 400; text-transform: uppercase; letter-spacing: .32em; }
.brand-mark { font-size: 29px; color: var(--gold); line-height: 1; }
.portal-page { overflow: clip; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 22px 16px 26px; }
.gear-stage { position: relative; width: min(960px, 94vw, calc(150svh - 400px)); aspect-ratio: 960 / 640; margin: 24px 0; }
.pulsar { position: absolute; width: 62.5%; left: 2.083333%; top: 3.125%; aspect-ratio: 1; display: grid; place-items: center; margin: 0; }
.pulsar-energy { position: absolute; inset: 0; }
.momentum-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.momentum-orbit { transform-origin: 300px 300px; animation: orbit 90s linear infinite; }
.momentum-words { fill: #dfd0ed; font-family: var(--ornamental-font); font-size: 26px; font-style: italic; font-weight: 400; }
.momentum-dots { fill: var(--gold); }
/* Fixed in the shared gear coordinates, not in the rotating text group. */
.momentum-occluder { cx: 716.57368px; cy: 373.45318px; }
/* Nebula box radius = 360 Pulsar units; 70% = 252, inside the engraved rim (r 256). */
.nebula { position: absolute; inset: -10%; width: 120%; height: 120%; pointer-events: none; opacity: .76; -webkit-mask-image: radial-gradient(circle closest-side, #000 55%, transparent 70%); mask-image: radial-gradient(circle closest-side, #000 55%, transparent 70%); }
.aura { position: absolute; inset: 8%; border-radius: 50%; background: radial-gradient(circle, #d2a4ff12 16%, #a05bff25 32%, #8b41eb16 47%, transparent 70%); animation: breathe 6s ease-in-out infinite; }
.sacred-geometry { position: relative; width: 100%; height: 100%; overflow: visible; }
.outer-orbit, .mandala, .star-spin, .wave, .frequency { transform-origin: 300px 300px; }
.outer-orbit { animation: orbit 130s linear infinite; }
.mandala { animation: orbit 85s linear infinite reverse; }
.star-spin { animation: orbit 65s linear infinite; }
.frequency { animation: breathe 6s ease-in-out infinite; }
.wave { animation: radiate 6s ease-out infinite; opacity: 0; }
.wave-two { animation-delay: 3s; }
.enter-button { position: relative; width: 32%; aspect-ratio: 1; border: 1px solid #e5c99199; border-radius: 50%; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; padding: 12px; color: #fff1ff; background: radial-gradient(circle at 50% 25%, #39234f, #1c0f31 75%); box-shadow: inset 0 0 24px #b071f22a, 0 0 0 7px #b385ef0c, 0 0 36px #b67aff40; font-family: var(--ornamental-font); font-style: italic; font-size: clamp(22px, 2.8vw, 32px); letter-spacing: .055em; text-align: center; text-wrap: balance; cursor: pointer; transition: border-color .25s, box-shadow .25s, background .25s; }
.enter-engraving { position: absolute; inset: 0; width: 100%; height: 100%; stroke: var(--gold); pointer-events: none; }
.enter-hatching { opacity: .82; }
.enter-button:hover { border-color: #f4dfb4; background: radial-gradient(circle at 50% 25%, #54316e, #26113f 75%); box-shadow: inset 0 0 24px #b071f244, 0 0 0 8px #b385ef16, 0 0 55px #b67aff65; }
.enter-button:focus-visible, .motion-toggle:focus-visible, .fallback:focus-visible { outline: 2px solid #f2ddff; outline-offset: 8px; }
.enter-label { display: block; font-family: 'IM Fell English', var(--ornamental-font); font-size: 1.1em; font-style: italic; font-weight: 400; line-height: 1.1; letter-spacing: .025em; white-space: nowrap; color: #f5ead6; text-shadow: 0 0 16px #e5c99126; }
.enter-label::first-letter { font-size: 1.2em; color: #edcf96; }
.button-star { font-size: 18px; color: var(--gold); text-shadow: 0 0 14px #e5c99155; }
.button-line { width: 23px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.page-footer { display: flex; justify-content: flex-end; align-items: center; padding: 14px 40px 24px; }
.motion-toggle { width: 44px; height: 44px; display: grid; place-items: center; padding: 10px; color: #c2acd8; background: transparent; border: 0; border-radius: 50%; cursor: pointer; }
.play-icon, .motion-toggle[aria-pressed="true"] .pause-icon { display: none; }
.motion-toggle[aria-pressed="true"] .play-icon { display: block; }
.motion-toggle:hover { color: #fff1ff; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.fallback { color: #eee3ff; display: inline-block; padding: 20px; }
.motion-paused .pulsar-energy, .motion-paused .pulsar-energy * { animation-play-state: paused; }
.entering .gear-stage { animation: core-open 1.45s ease-in forwards; }
.entering .star-spin { animation: orbit .65s linear infinite; }
.entering .mandala { animation: orbit 1s linear infinite reverse; }
/* Keep the geared rims in mesh, including during the Enter transition. */
.entering .enter-button { animation: core-open 1.45s ease-in forwards; cursor: wait; }


@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes breathe { 0%, 100% { opacity: .55; transform: scale(.97); } 50% { opacity: 1; transform: scale(1.025); } }
@keyframes radiate { 0% { transform: scale(.95); opacity: 0; } 20% { opacity: .35; } 100% { transform: scale(2.25); opacity: 0; } }
@keyframes vibration { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(2px, -1px); } 75% { transform: translate(-2px, 1px); } }
@keyframes portal-open { 0% { transform: scale(1) rotate(0); opacity: 1; } 60% { transform: scale(1.12) rotate(110deg); opacity: 1; } 100% { transform: scale(1.35) rotate(300deg); opacity: 0; } }
@keyframes core-open { 45% { transform: scale(.94); opacity: 1; } 100% { transform: scale(1.15); opacity: 0; } }
@media (max-width: 600px) { .masthead { padding-top: 28px; } .portal-page { padding: 30px 12px; } .enter-button { width: 36%; gap: 9px; } .page-footer { padding: 12px 22px 18px; justify-content: center; } }
@media (max-height: 580px) and (min-width: 601px) { .gear-stage { width: min(94vw, calc(150svh - 240px)); margin: 8px 0; } .masthead { padding: 12px; } .portal-page { padding: 8px; } .page-footer { padding-bottom: 8px; } .enter-button { font-size: 14px; gap: 5px; width: 38%; } }
/* One coordinate system: pitch radii 282 + 141 = 423; 72:36 teeth. */
.portal-page { position: relative; isolation: isolate; }
.pulsar { z-index: 1; }
.diamond-mechanism { position: absolute; z-index: 2; width: 34.37500000%; left: 59.53892495%; top: 35.69580924%; padding: 0; border: 0; border-radius: 50%; color: #c5b4d5; background: transparent; cursor: pointer; }
.mechanism-tilt { display: block; transform: none; }
/* Only the crystal responds to attention; its geared frame stays aligned. */
.diamond-facets, .diamond-spark { transform-origin: 200px 235px; transform: perspective(650px) rotateY(var(--diamond-x, 0deg)) rotateX(var(--diamond-y, 0deg)); transition: transform .25s ease-out; }
.mechanism-art { display: block; width: 100%; height: auto; opacity: .85; transition: opacity .6s, filter .6s; }
.mechanism-rotor { transform-origin: 200px 235px; animation: gear-driven 65s linear infinite; }
@keyframes gear-driven { to { transform: rotate(-360deg); } }
.satellite-gear { position: absolute; width: 18.75000000%; left: 74.88655623%; top: 16.36065467%; pointer-events: none; opacity: .8; }
.satellite-rotor { transform-origin: 90px 90px; animation: orbit 32.5s linear infinite; }
.motion-paused .satellite-rotor { animation-play-state: paused; }

.diamond-lit-facet { opacity: .12; transition: opacity .6s; }
.diamond-spark { opacity: .5; }
.diamond-halo { opacity: .5; transition: opacity .6s; }

.diamond-mechanism[aria-pressed="true"] .mechanism-art, .diamond-mechanism:focus-visible .mechanism-art { opacity: .95; filter: drop-shadow(0 0 9px #bca0e33a); }
.diamond-mechanism[aria-pressed="true"] .diamond-lit-facet { opacity: .65; }
.diamond-mechanism[aria-pressed="true"] .diamond-halo { opacity: 1; }
.diamond-mechanism:focus-visible { outline: 2px solid #e5c991; outline-offset: -4px; }
@media (hover: hover) { .diamond-mechanism:hover .mechanism-art { opacity: .8; } }
.motion-paused .mechanism-art * { animation-play-state: paused; transition: none; }
.motion-paused .mechanism-tilt, .motion-paused .diamond-facets, .motion-paused .diamond-spark { transform: none; transition: none; }
@media (max-width: 600px) {
  .momentum-occluder { cx: 542.62283px; cy: -46.50131px; }
  /* -55 degree mesh angle: advance the diamond teeth by 5 degrees. */
  .gear-stage { width: min(94vw, 61svh); aspect-ratio: 720 / 1040; margin: 0; }
  .pulsar { width: 83.333333%; left: 2.777778%; top: 40.384615%; }
  .diamond-mechanism { width: 45.83333333%; left: 55.22539341%; top: 20.04795051%; }
  .mechanism-phase { transform-origin: 200px 235px; transform: rotate(5deg); }
  .satellite-gear { width: 25.00000000%; left: 50.95456008%; top: 9.64753004%; }
  .portal-page { padding: 8px 10px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .motion-toggle { display: none; } .mechanism-tilt, .diamond-facets, .diamond-spark { transform: none; } }
