/* Atlas Within — descent-v2 */

:root {
  --ink: #0d1028;
  --ink-raise: #11152d;
  --parchment: #f4edd9;
  --gold: #c7a85b;
  --gold-light: #e8d9a8;
  --lavender: #d8cfe6;
  --lavender-dim: #9d95b8;
  --lavender-faint: #6f679a;
  --text-dim: #c9c0dd;
  --text-dimmer: #b3aacb;
}

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--parchment);
  font-family: 'Cormorant Garamond', Georgia, serif;
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: var(--gold-light); }
a:hover { color: var(--parchment); }
::selection { background: rgba(199, 168, 91, .35); color: #fff; }

@keyframes aw-drift { 0% { transform: translateY(0); } 50% { transform: translateY(-14px); } 100% { transform: translateY(0); } }
@keyframes aw-pulse { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
@keyframes aw-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes aw-spin-r { from { transform: rotate(0deg); } to { transform: rotate(-360deg); } }
@keyframes aw-glow {
  0%, 100% { text-shadow: 0 0 22px rgba(232, 217, 168, .25); }
  50% { text-shadow: 0 0 44px rgba(232, 217, 168, .6); }
}

/* ---------- Backdrop ---------- */

#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* ---------- Depth meter ---------- */

.depth-meter {
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 26px;
  align-items: flex-end;
}

.depth-meter .meter-track {
  position: absolute;
  right: 3px;
  top: 6px;
  bottom: 34px;
  width: 1px;
  background: rgba(216, 207, 230, .18);
}

.depth-meter .meter-fill {
  position: absolute;
  right: 3px;
  top: 6px;
  width: 1px;
  height: 0%;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  box-shadow: 0 0 8px rgba(199, 168, 91, .7);
}

.meter-stop {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  opacity: .45;
  transition: opacity .4s ease;
}

.meter-stop .stop-label {
  font-family: Jost, sans-serif;
  font-size: 9px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--lavender);
}

.meter-stop .stop-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(199, 168, 91, .8);
  display: block;
}

.depth-pct {
  position: relative;
  font-family: Jost, sans-serif;
  font-size: 8.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(20px, 4vw, 52px);
  background: linear-gradient(180deg, rgba(13, 16, 40, .85), rgba(13, 16, 40, 0));
  backdrop-filter: blur(2px);
}

.brand {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(199, 168, 91, .7);
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 38% 34%, #f7f0da, #d9cba0);
  box-shadow: 0 0 18px rgba(244, 237, 217, .35);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-size: 20px; letter-spacing: .02em; color: var(--parchment); }

.brand-tag {
  font-family: Jost, sans-serif;
  font-size: 8.5px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--lavender-dim);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.5vw, 30px);
}

.nav-link {
  font-family: Jost, sans-serif;
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--lavender);
}
.nav-link:hover { color: var(--parchment); }

.nav-cta {
  font-family: Jost, sans-serif;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-raise);
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(199, 168, 91, .3);
}
.nav-cta:hover { color: var(--ink-raise); box-shadow: 0 8px 26px rgba(199, 168, 91, .5); }

/* ---------- Sections / fold stack ---------- */

main { position: relative; z-index: 1; }

.stack {
  min-height: 100vh;
  perspective: 1300px;
}

.fold {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: 110px clamp(20px, 5vw, 60px);
  transform-origin: 50% 18%;
  will-change: transform, opacity;
}

.fold--center {
  place-items: center;
  text-align: center;
  padding: 120px clamp(20px, 5vw, 60px) 80px;
  position: relative;
}

#begin .fold--center { padding: 120px clamp(20px, 5vw, 60px); }

.section-inner { width: 100%; max-width: 1180px; margin: 0 auto; }

main em { font-style: italic; color: var(--gold-light); }
.glow { animation: aw-glow 5s ease-in-out infinite; }

/* ---------- Type ---------- */

.kicker {
  font-family: Jost, sans-serif;
  font-size: 10.5px;
  letter-spacing: .38em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
}

.kicker--hero {
  font-size: 11px;
  letter-spacing: .42em;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.kicker--hero .rule-l { width: 44px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.kicker--hero .rule-r { width: 44px; height: 1px; background: linear-gradient(270deg, transparent, var(--gold)); }

.hero-title {
  font-size: clamp(3.2rem, 9vw, 7.6rem);
  line-height: .98;
  font-weight: 400;
  letter-spacing: -.02em;
  margin: 0 0 30px;
  color: var(--parchment);
}

.chapter-title {
  font-size: clamp(2.6rem, 5vw, 4.6rem);
  line-height: 1.02;
  font-weight: 400;
  letter-spacing: -.02em;
  margin: 0 0 24px;
  color: var(--parchment);
}

.chapter-title--md { font-size: clamp(2.6rem, 5vw, 4.4rem); }
.chapter-title--xl { font-size: clamp(2.8rem, 6vw, 5.4rem); margin-bottom: 26px; }

.lede {
  max-width: 620px;
  margin: 0 auto 44px;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  color: var(--text-dim);
  font-weight: 400;
}

.body-copy {
  font-size: 1.15rem;
  color: var(--text-dim);
  max-width: 520px;
  margin: 0 0 18px;
}

.body-copy strong { color: var(--parchment); font-weight: 500; }

/* ---------- Buttons ---------- */

.btn {
  font-family: Jost, sans-serif;
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 16px 30px;
  border-radius: 999px;
  display: inline-block;
}

.btn--primary {
  color: var(--ink-raise);
  background: linear-gradient(135deg, var(--parchment), #d9c88f);
  box-shadow: 0 10px 34px rgba(199, 168, 91, .35);
  transition: transform .25s ease;
}
.btn--primary:hover { color: var(--ink-raise); transform: translateY(-3px); }

.btn--gold {
  color: var(--ink-raise);
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  padding: 15px 28px;
  box-shadow: 0 10px 30px rgba(199, 168, 91, .3);
  transition: transform .25s ease;
}
.btn--gold:hover { color: var(--ink-raise); transform: translateY(-3px); }

.btn--outline {
  color: var(--parchment);
  border: 1px solid rgba(244, 237, 217, .35);
  transition: border-color .25s ease;
}
.btn--outline:hover { color: var(--parchment); border-color: rgba(244, 237, 217, .8); }

.cta-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.cta-row--start { justify-content: flex-start; align-items: center; }

.link-note {
  font-family: Jost, sans-serif;
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--lavender-dim);
}

.scroll-cue {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: aw-pulse 2.6s ease infinite;
}

.scroll-cue .cue-label {
  font-family: Jost, sans-serif;
  font-size: 9.5px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--lavender-dim);
}

.scroll-cue .cue-line {
  width: 1px;
  height: 44px;
  background: linear-gradient(180deg, var(--gold), transparent);
}

/* ---------- Chapter I — Soulprint ---------- */

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: clamp(40px, 6vw, 90px);
  align-items: center;
}

.moon-stage {
  display: grid;
  place-items: center;
  min-height: min(78vw, 460px);
  position: relative;
  perspective: 900px;
}

.moon-scene {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transition: transform .3s ease-out;
  transform-style: preserve-3d;
}

.orbit {
  position: absolute;
  border-radius: 50%;
}

.orbit--outer {
  width: min(78vw, 440px);
  height: min(78vw, 440px);
  border: 1px solid rgba(199, 168, 91, .28);
  animation: aw-spin 90s linear infinite;
}

.orbit--inner {
  width: min(52vw, 290px);
  height: min(52vw, 290px);
  border: 1px dashed rgba(216, 207, 230, .22);
  animation: aw-spin-r 70s linear infinite;
}

.orbit-item {
  position: absolute;
  transform: translate(-50%, -50%);
}

.orbit-pill {
  background: rgba(19, 23, 52, .88);
  border: 1px solid rgba(199, 168, 91, .4);
  border-radius: 999px;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .4);
  white-space: nowrap;
}

.orbit--outer .orbit-pill { animation: aw-spin-r 90s linear infinite; }
.orbit--inner .orbit-pill { animation: aw-spin 70s linear infinite; }

.orbit-pill .pill-glyph { color: var(--gold-light); font-size: 15px; }

.orbit-pill .pill-name {
  font-family: Jost, sans-serif;
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--lavender);
}

.moon {
  width: min(34vw, 170px);
  height: min(34vw, 170px);
  border-radius: 50%;
  background: radial-gradient(circle at 36% 32%, #f9f3e0, #e6d7ac 55%, #cbb478);
  box-shadow: 0 0 0 1px rgba(199, 168, 91, .8), 0 0 0 18px rgba(199, 168, 91, .07), 0 0 90px rgba(244, 237, 217, .25);
  position: relative;
  animation: aw-drift 7s ease-in-out infinite;
}

.moon .crater {
  position: absolute;
  border-radius: 50%;
}

.moon .crater--1 { left: 30%; top: 28%; width: 14%; height: 14%; background: rgba(180, 160, 110, .5); }
.moon .crater--2 { left: 58%; top: 52%; width: 20%; height: 20%; background: rgba(180, 160, 110, .35); }
.moon .crater--3 { left: 40%; top: 66%; width: 9%; height: 9%; background: rgba(180, 160, 110, .45); }

/* ---------- Chapter II — Paths ---------- */

.paths-head {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 60px;
}

.paths-head .body-copy { max-width: none; margin: 0; }

.paths-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 22px;
}

.plate-wrap { perspective: 800px; }

.plate {
  text-decoration: none;
  position: relative;
  border: 1px solid rgba(216, 207, 230, .16);
  border-radius: 22px;
  padding: 34px 28px 30px;
  background: linear-gradient(180deg, rgba(25, 30, 62, .75), rgba(17, 21, 45, .85));
  display: flex;
  flex-direction: column;
  min-height: 300px;
  transform-style: preserve-3d;
  transition: transform .18s ease-out, border-color .35s ease, box-shadow .35s ease;
}

.plate:hover {
  border-color: rgba(199, 168, 91, .6);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .5), 0 0 40px rgba(199, 168, 91, .12);
}

.plate .constellation {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  opacity: .85;
}

.plate .edge {
  stroke: rgba(232, 217, 168, .55);
  stroke-width: 1;
  stroke-dasharray: 70;
  stroke-dashoffset: 70;
  transition: stroke-dashoffset .9s ease;
}

.plate .star {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--parchment);
  box-shadow: 0 0 6px rgba(244, 237, 217, .7);
  transform: translate(-50%, -50%) translateZ(20px);
  transition: box-shadow .5s ease, transform .5s ease;
  pointer-events: none;
}

.plate .star--main { width: 6px; height: 6px; }

.plate-content {
  transform: translateZ(38px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.plate-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.plate-glyph {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(199, 168, 91, .5);
  display: grid;
  place-items: center;
  color: var(--gold-light);
  font-size: 19px;
  background: rgba(19, 23, 52, .7);
}

.plate-num {
  font-family: Jost, sans-serif;
  font-size: 9px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--lavender-faint);
}

.plate-title { font-size: 1.5rem; line-height: 1.15; color: var(--parchment); }
.plate-desc { font-size: 1.02rem; color: var(--text-dimmer); flex: 1; }

.plate-cta {
  font-family: Jost, sans-serif;
  font-size: 10.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---------- Chapter III — Workbook ---------- */

.split--workbook {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: clamp(40px, 6vw, 80px);
}

.book-frame { position: relative; perspective: 1000px; }

.book-frame::before {
  content: '';
  position: absolute;
  inset: -24px;
  border: 1px solid rgba(199, 168, 91, .2);
  border-radius: 30px;
  transform: rotate(-1.5deg);
}

.book-tilt {
  transition: transform .2s ease-out;
  transform-style: preserve-3d;
}

.book-cover {
  width: 100%;
  border-radius: 22px;
  box-shadow: 0 40px 90px rgba(0, 0, 0, .55);
  display: block;
}

.chip-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 34px;
}

.chip {
  font-family: Jost, sans-serif;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--lavender);
  border: 1px solid rgba(216, 207, 230, .3);
  padding: 9px 14px;
  border-radius: 999px;
}

.workbook-copy { max-width: 540px; }

/* ---------- The Center ---------- */

.center-inner { max-width: 820px; }

.center-inner .kicker { margin-bottom: 24px; }

.center-inner .lede { max-width: 600px; margin-bottom: 42px; font-size: 1.18rem; }

/* ---------- Footer ---------- */

.site-footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid rgba(216, 207, 230, .14);
  padding: 34px clamp(20px, 5vw, 60px);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
  background: rgba(13, 16, 40, .85);
  backdrop-filter: blur(6px);
}

.site-footer span {
  font-family: Jost, sans-serif;
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--lavender-dim);
}

/* ---------- Responsive / motion ---------- */

@media (max-width: 720px) {
  .depth-meter { display: none; }
  .site-nav .nav-link { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .orbit--outer, .orbit--inner, .orbit-pill, .moon, .scroll-cue, .glow { animation: none; }
}
