@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,500&family=Inter:wght@400;500;600&display=swap");

:root {
  --night: #07090f;
  --night-2: #0d1018;
  --ivory: #efe4cc;
  --muted: #afa48f;
  --gold: #d4a556;
  --gold-light: #f0d08c;
  --blue: #102c3c;
  --line: rgba(212,165,86,.31);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ivory); background: radial-gradient(circle at 18% 15%, rgba(31,66,84,.23), transparent 31rem), radial-gradient(circle at 83% 36%, rgba(114,72,38,.2), transparent 34rem), var(--night); font-family: var(--serif); overflow-x: hidden; }
body::before { content: ""; position: fixed; inset: 0; z-index: 40; pointer-events: none; opacity: .21; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.14'/%3E%3C/svg%3E"); mix-blend-mode: soft-light; }
img { max-width: 100%; }
a { color: inherit; }
button { color: inherit; }
.reading-progress { position: fixed; inset: 0 0 auto; height: 2px; z-index: 100; background: rgba(255,255,255,.04); }
.reading-progress span { display: block; width: 0; height: 100%; background: linear-gradient(90deg,#7f4732,var(--gold-light)); box-shadow: 0 0 18px var(--gold); }
.star-field { position: fixed; inset: 0; pointer-events: none; opacity: .48; background-image: radial-gradient(circle at 13% 17%,var(--gold-light) 0 1px,transparent 1.5px),radial-gradient(circle at 79% 12%,#fff 0 1px,transparent 1.5px),radial-gradient(circle at 48% 72%,var(--gold) 0 1px,transparent 1.5px),radial-gradient(circle at 91% 63%,#fff 0 1px,transparent 1.5px); background-size: 29rem 31rem,37rem 41rem,43rem 47rem,53rem 59rem; animation: starDrift 38s linear infinite; }

.library-header { position: relative; z-index: 50; min-height: 88px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 2rem; padding: 16px clamp(20px,4vw,72px); border-bottom: 1px solid var(--line); background: rgba(7,9,15,.9); backdrop-filter: blur(18px); }
.library-brand { width: max-content; text-decoration: none; }
.library-brand small { display: block; color: var(--gold); font: 500 8px/1 var(--sans); letter-spacing: .26em; text-transform: uppercase; }
.library-brand strong { font-size: clamp(27px,2.5vw,42px); line-height: .9; font-weight: 500; letter-spacing: .03em; }
.library-header > p { margin: 0; color: var(--muted); text-align: center; font: 500 9px/1.2 var(--sans); letter-spacing: .22em; text-transform: uppercase; }
.library-header > p span { margin: 0 .7rem; color: var(--gold); }
.library-header > nav { display: flex; justify-content: flex-end; gap: 1.35rem; align-items: center; }
.cabinet-toggle,.atlas-return { border: 0; padding: 10px 0; background: none; text-decoration: none; cursor: pointer; font: 500 9px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; white-space: nowrap; }
.cabinet-toggle i,.atlas-return i { width: 13px; height: 13px; margin-right: 8px; display: inline-block; vertical-align: -2px; }
.cabinet-toggle i { border: 1px solid var(--gold); transform: rotate(45deg); box-shadow: inset 0 0 0 3px var(--night); background: var(--gold); }
.atlas-return { color: var(--muted); }
.atlas-return i { position: relative; border: 1px solid var(--line); border-radius: 50%; }
.atlas-return i::after { content: ""; position: absolute; left: 4px; top: 3px; width: 4px; height: 4px; border-left: 1px solid var(--gold); border-bottom: 1px solid var(--gold); transform: rotate(45deg); }

.story-cabinet { position: fixed; top: 0; right: 0; width: min(510px,93vw); height: 100dvh; z-index: 90; padding: 30px clamp(24px,4vw,52px); overflow-y: auto; background: linear-gradient(145deg,rgba(24,22,28,.99),rgba(8,9,16,.99)); border-left: 1px solid var(--gold); box-shadow: -40px 0 100px rgba(0,0,0,.7); transform: translateX(105%); transition: transform .55s cubic-bezier(.77,0,.18,1); }
.story-cabinet.is-open { transform: translateX(0); }
body.menu-open::after { content: ""; position: fixed; inset: 0; z-index: 45; background: rgba(0,0,0,.58); backdrop-filter: blur(2px); }
.cabinet-heading { display: flex; justify-content: space-between; align-items: start; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.cabinet-heading small { display: block; color: var(--gold); font: 500 8px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; }
.cabinet-heading strong { display: block; margin-top: 7px; font-size: 28px; font-weight: 500; }
.cabinet-close { width: 38px; height: 38px; border: 1px solid var(--line); background: transparent; border-radius: 50%; cursor: pointer; position: relative; }
.cabinet-close::before,.cabinet-close::after { content: ""; position: absolute; left: 11px; top: 18px; width: 15px; height: 1px; background: var(--gold); transform: rotate(45deg); }
.cabinet-close::after { transform: rotate(-45deg); }
.story-cabinet nav { display: grid; }
.story-cabinet nav a { display: grid; grid-template-columns: 44px 1fr; gap: 3px 10px; padding: 15px 10px; text-decoration: none; border-bottom: 1px solid rgba(212,165,86,.14); transition: background .25s,padding-left .25s; }
.story-cabinet nav a:hover,.story-cabinet nav a:focus-visible,.story-cabinet nav a.is-active { padding-left: 17px; background: rgba(212,165,86,.08); }
.story-cabinet nav a > span { grid-row: 1 / 3; color: var(--gold); font: 500 9px/1.6 var(--sans); }
.story-cabinet nav strong { font-size: 18px; font-weight: 500; }
.story-cabinet nav small { color: var(--muted); font: 400 9px/1.4 var(--sans); letter-spacing: .08em; }

.hypatia-chamber { position: relative; width: min(1600px,100%); min-height: calc(100vh - 88px); margin: auto; padding: clamp(50px,6vw,90px) clamp(20px,5vw,76px) clamp(75px,8vw,120px); display: grid; grid-template-columns: minmax(330px,.82fr) minmax(530px,1.18fr); gap: clamp(35px,5vw,85px); align-items: start; overflow: hidden; }
.hypatia-chamber::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg,transparent,rgba(212,165,86,.025),transparent); pointer-events: none; }
.temple-architecture i { position: absolute; top: 0; bottom: 0; width: 1px; background: linear-gradient(transparent,rgba(212,165,86,.2),transparent); }
.temple-architecture i:nth-child(1) { left: 5%; }
.temple-architecture i:nth-child(2) { left: 33%; }
.temple-architecture i:nth-child(3) { right: 42%; }
.temple-architecture i:nth-child(4) { right: 4%; }
.temple-architecture::before,.temple-architecture::after { content: ""; position: absolute; left: 2%; right: 2%; height: 1px; background: linear-gradient(90deg,transparent,var(--line),transparent); top: 11%; }
.temple-architecture::after { top: auto; bottom: 7%; }
.celestial-rings { position: absolute; width: min(58vw,780px); aspect-ratio: 1; left: -20%; top: -16%; border: 1px solid rgba(212,165,86,.2); border-radius: 50%; animation: orbit 40s linear infinite; }
.celestial-rings span { position: absolute; inset: 10%; border: 1px dashed rgba(212,165,86,.2); border-radius: 50%; }
.celestial-rings span:nth-child(2) { inset: 26%; border-style: solid; }
.celestial-rings span:nth-child(3) { inset: 42%; border-color: rgba(212,165,86,.4); }
.celestial-rings i,.celestial-rings b { position: absolute; left: 50%; top: 3%; width: 1px; height: 94%; background: linear-gradient(transparent,var(--gold),transparent); }
.celestial-rings b { transform: rotate(90deg); }
.hypatia-presence { position: sticky; top: 110px; z-index: 2; min-height: 720px; }
.title-lockup { position: relative; z-index: 3; }
.title-lockup > p { margin: 0 0 15px; color: var(--gold); font: 500 8px/1 var(--sans); letter-spacing: .23em; text-transform: uppercase; }
h1 { position: relative; margin: 0; font-size: clamp(68px,8vw,132px); line-height: .67; letter-spacing: -.055em; font-weight: 400; }
h1 em { color: var(--gold-light); font-weight: 400; text-shadow: 0 8px 30px rgba(0,0,0,.6); }
h1 sup { position: absolute; margin: 7px 0 0 8px; color: var(--gold); font: 500 9px/1 var(--sans); letter-spacing: .08em; }
.hypatia-presence figure { --rx: 0deg; --ry: 0deg; position: relative; width: min(410px,90%); height: 570px; margin: 3px 0 0 auto; transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .18s ease-out; }
.hypatia-presence figure::after { content: ""; position: absolute; inset: auto 5% 0; height: 18%; border-radius: 50%; background: rgba(0,0,0,.7); filter: blur(25px); z-index: -1; }
.hypatia-presence figure > img { position: absolute; inset: 0 0 auto; width: 100%; height: 100%; object-fit: contain; object-position: bottom; filter: drop-shadow(0 28px 35px rgba(0,0,0,.75)); animation: presenceFloat 7s ease-in-out infinite; }
.portrait-halo,.portrait-halo span { position: absolute; inset: 7% 0 18%; border: 1px solid rgba(212,165,86,.25); border-radius: 50%; }
.portrait-halo { animation: orbit 32s linear infinite; }
.portrait-halo::before,.portrait-halo::after { content: "✦"; position: absolute; left: 50%; top: -8px; color: var(--gold-light); text-shadow: 0 0 15px var(--gold); }
.portrait-halo::after { top: auto; bottom: -9px; }
.portrait-halo span:nth-child(1) { inset: 8%; border-style: dashed; animation: orbit 22s linear infinite reverse; }
.portrait-halo span:nth-child(2) { inset: 23%; }
.portrait-halo span:nth-child(3) { inset: 39%; border-color: rgba(212,165,86,.5); }

.consultation-panel { position: relative; z-index: 3; min-height: 810px; padding: clamp(22px,3.5vw,48px); border: 1px solid rgba(212,165,86,.52); border-radius: 190px 190px 4px 4px; background: linear-gradient(180deg,rgba(18,24,33,.97),rgba(10,11,17,.98)); box-shadow: 0 40px 100px rgba(0,0,0,.65),inset 0 0 85px rgba(212,165,86,.035); overflow: hidden; }
.consultation-panel::before,.consultation-panel::after { content: ""; position: absolute; inset: 15px; border: 1px solid rgba(212,165,86,.12); border-radius: 170px 170px 2px 2px; pointer-events: none; }
.consultation-panel::after { inset: 28px; border-style: dotted; }
.panel-arch { position: relative; z-index: 2; height: 92px; display: flex; align-items: center; justify-content: center; gap: 14px; }
.panel-arch span { width: 27%; height: 1px; background: linear-gradient(90deg,transparent,var(--gold)); }
.panel-arch span:last-child { transform: scaleX(-1); }
.panel-arch i { position: relative; width: 29px; height: 29px; border: 1px solid var(--gold); border-radius: 50%; }
.panel-arch i::before,.panel-arch i::after { content: ""; position: absolute; left: 50%; top: -9px; width: 1px; height: 45px; background: rgba(212,165,86,.45); }
.panel-arch i::after { transform: rotate(90deg); }
.portal-message { position: relative; z-index: 3; width: min(470px,90%); margin: -2px auto 22px; color: var(--muted); text-align: center; font-size: 17px; line-height: 1.35; }
.portal-message a { color: var(--gold-light); text-decoration-color: rgba(212,165,86,.55); text-underline-offset: 4px; }
.oracle-status { position: relative; z-index: 3; display: flex; justify-content: center; align-items: center; gap: 9px; margin-bottom: 25px; color: #80786b; font: 500 8px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; }
.oracle-status i { width: 6px; height: 6px; border-radius: 50%; background: #82a67c; box-shadow: 0 0 10px #82a67c; animation: pulse 2.3s ease-in-out infinite; }
.pickaxe-shell { position: relative; z-index: 4; min-height: 560px; padding: clamp(4px,1.5vw,18px); }
.pickaxe-shell > div[id^="deployment-"] { position: relative; z-index: 2; min-height: 540px; }
.oracle-loading { position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; justify-items: center; gap: 15px; color: #8e8577; transition: opacity .5s,visibility .5s; }
.oracle-loading span { width: 55px; height: 55px; border: 1px solid var(--line); border-top-color: var(--gold-light); border-radius: 50%; animation: orbit 1.3s linear infinite; }
.oracle-loading p { margin: 0; font: 500 8px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; }
.pickaxe-shell.is-loaded .oracle-loading { opacity: 0; visibility: hidden; }

.philosophical-preamble { position: relative; padding: clamp(80px,10vw,150px) clamp(20px,7vw,110px); border-top: 1px solid var(--line); background: linear-gradient(180deg,rgba(31,19,12,.3),transparent 38%); }
.preamble-frame { position: relative; width: min(1200px,100%); margin: auto; padding: 12px; border: 1px solid rgba(212,165,86,.5); box-shadow: 0 35px 90px rgba(0,0,0,.6); }
.preamble-frame::before,.preamble-frame::after { content: ""; position: absolute; inset: -18px 7%; border: 1px solid rgba(212,165,86,.13); z-index: -1; }
.preamble-frame::after { inset: 7% -18px; }
.preamble-frame img { display: block; width: 100%; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 28px clamp(20px,6vw,90px); border-top: 1px solid rgba(212,165,86,.16); color: #777064; font: 500 8px/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--gold); text-decoration: none; }
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease,transform .8s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes starDrift { to { background-position: 29rem 31rem,-37rem 41rem,43rem -47rem,-53rem -59rem; } }
@keyframes presenceFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-11px); } }
@keyframes pulse { 50% { opacity: .45; transform: scale(.8); } }

@media (max-width: 1080px) {
  .library-header { grid-template-columns: 1fr auto; }
  .library-header > p { display: none; }
  .hypatia-chamber { grid-template-columns: 1fr; }
  .hypatia-presence { position: relative; top: 0; min-height: 650px; }
  .title-lockup { position: absolute; left: 2%; top: 10%; }
  .hypatia-presence figure { width: 430px; margin-right: 7%; }
  .consultation-panel { width: min(760px,100%); margin: auto; }
}

@media (max-width: 680px) {
  .library-header { min-height: 76px; padding: 13px 17px; }
  .library-brand small,.atlas-return { display: none; }
  .library-brand strong { font-size: 27px; }
  .cabinet-toggle { font-size: 8px; }
  .hypatia-chamber { padding-top: 45px; }
  .hypatia-presence { min-height: 620px; }
  .title-lockup { top: 0; }
  h1 { font-size: clamp(64px,20vw,100px); }
  .hypatia-presence figure { width: 340px; height: 500px; margin: 95px auto 0; }
  .consultation-panel { min-height: 720px; padding: 26px 12px; border-radius: 105px 105px 3px 3px; }
  .consultation-panel::before { border-radius: 93px 93px 2px 2px; }
  .consultation-panel::after { display: none; }
  .panel-arch { height: 72px; }
  .portal-message { font-size: 15px; }
  .pickaxe-shell { padding: 0; }
  .philosophical-preamble { padding-inline: 12px; }
  .preamble-frame { padding: 6px; }
  .site-footer { display: grid; justify-content: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation: none !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
