:root {
  --scholar-ink: #101119;
  --aged-parchment: #E7D6B1;
  --moss-green: #3F6F4E;
  --amethyst-violet: #6B4BB0;
  --burnt-copper: #C66A32;
  --neon-fern: #72FFB6;
  --dusty-charcoal: #26222A;
  --soft-shadow: rgba(16, 17, 25, 0.72);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--scholar-ink);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--aged-parchment);
  font-family: Nunito, "Nunito Sans", Inter, ui-rounded, "Segoe UI", system-ui, sans-serif;
  overflow-x: hidden;
  background: var(--scholar-ink);
}

.plaster {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 50% 25%, rgba(231, 214, 177, 0.12), transparent 34%),
    radial-gradient(circle at 20% 80%, rgba(107, 75, 176, 0.18), transparent 34%),
    radial-gradient(circle at 84% 76%, rgba(63, 111, 78, 0.22), transparent 30%),
    linear-gradient(135deg, #101119 0%, #1b1720 44%, #26222A 100%);
}

.plaster::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image:
    repeating-linear-gradient(18deg, transparent 0 18px, rgba(231, 214, 177, 0.025) 19px 20px),
    repeating-linear-gradient(96deg, rgba(114, 255, 182, 0.025) 0 1px, transparent 1px 27px);
}

.ribbon-nav {
  position: fixed;
  z-index: 30;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(231, 214, 177, 0.18);
  border-radius: 999px;
  background: rgba(38, 34, 42, 0.68);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32), inset 0 0 24px rgba(114, 255, 182, 0.05);
  backdrop-filter: blur(16px);
}

.nav-tab {
  color: var(--aged-parchment);
  text-decoration: none;
  font-family: Quicksand, "Nunito Sans", Inter, system-ui, sans-serif;
  font-weight: 800;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 9px 14px;
  border-radius: 999px;
  transition: transform 240ms cubic-bezier(.2, 1.6, .4, 1), background 240ms, color 240ms;
}

.nav-tab.active,
.nav-tab:hover {
  color: var(--scholar-ink);
  background: linear-gradient(135deg, var(--aged-parchment), var(--neon-fern));
  transform: translateY(-2px);
}

.room {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 96px 24px 64px;
  isolation: isolate;
}

.lamp-halo {
  position: absolute;
  width: min(82vw, 880px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(231, 214, 177, 0.24) 0%, rgba(114, 255, 182, 0.13) 24%, rgba(63, 111, 78, 0.07) 46%, transparent 70%);
  filter: blur(4px);
  z-index: -1;
  animation: breathe 5s ease-in-out infinite;
}

.copper-halo { background: radial-gradient(circle, rgba(198, 106, 50, 0.22), rgba(231, 214, 177, 0.10) 34%, transparent 70%); }
.violet-halo { background: radial-gradient(circle, rgba(107, 75, 176, 0.32), rgba(114, 255, 182, 0.10) 34%, transparent 70%); }

.central-axis {
  width: min(94vw, 760px);
  display: grid;
  justify-items: center;
  text-align: center;
}

.overline,
.catalog-number,
.soil-label,
.brass-tag,
.drawer-label {
  font-family: Quicksand, "Nunito Sans", Inter, system-ui, sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.overline {
  margin: 0 0 10px;
  color: var(--neon-fern);
  font-weight: 800;
  text-shadow: 0 0 18px rgba(114, 255, 182, 0.56);
}

.wordmark {
  margin: 0 0 28px;
  font-family: "Nunito Sans", Nunito, Inter, ui-rounded, system-ui, sans-serif;
  font-size: clamp(3.2rem, 11vw, 8.4rem);
  line-height: 0.86;
  font-weight: 1000;
  letter-spacing: -0.055em;
  color: var(--aged-parchment);
  text-shadow:
    0 0 1px var(--scholar-ink),
    0 0 18px rgba(114, 255, 182, 0.22),
    0 14px 42px rgba(0, 0, 0, 0.62);
}

.terrarium {
  position: relative;
  width: min(78vw, 430px);
  height: min(76vh, 590px);
  min-height: 500px;
  border-radius: 46% 46% 34% 34% / 38% 38% 22% 22%;
  border: 1px solid rgba(231, 214, 177, 0.32);
  background:
    radial-gradient(circle at 50% 20%, rgba(231, 214, 177, 0.13), transparent 26%),
    linear-gradient(180deg, rgba(231, 214, 177, 0.09), rgba(114, 255, 182, 0.045) 48%, rgba(16, 17, 25, 0.56));
  box-shadow:
    inset 0 0 38px rgba(231, 214, 177, 0.08),
    inset 0 -44px 78px rgba(63, 111, 78, 0.22),
    0 0 0 12px rgba(231, 214, 177, 0.025),
    0 28px 96px rgba(0, 0, 0, 0.62),
    0 0 64px rgba(114, 255, 182, 0.15);
  overflow: hidden;
}

.glass-shine {
  position: absolute;
  inset: 28px auto auto 54px;
  width: 28%;
  height: 72%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.18), transparent);
  filter: blur(1px);
  transform: rotate(9deg);
}

.paper-scrap {
  position: absolute;
  padding: 13px 16px;
  color: var(--scholar-ink);
  background:
    linear-gradient(135deg, rgba(231, 214, 177, 0.98), rgba(231, 214, 177, 0.78)),
    repeating-linear-gradient(0deg, transparent 0 8px, rgba(16, 17, 25, 0.12) 9px 10px);
  border-radius: 16px 10px 18px 12px;
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.28);
  font-family: Comfortaa, Quicksand, "Nunito Sans", system-ui, sans-serif;
  font-weight: 900;
  font-size: 0.78rem;
  transform: rotate(-9deg);
}
.paper-scrap small { font-weight: 700; color: var(--moss-green); }
.scrap-a { top: 110px; left: 48px; }
.scrap-b { top: 150px; right: 42px; transform: rotate(8deg); }
.scrap-c { top: 230px; left: 142px; transform: rotate(-2deg); }

.soil-stack {
  position: absolute;
  left: 11%;
  right: 11%;
  bottom: 72px;
  height: 190px;
  border-radius: 34px 34px 70px 70px;
  overflow: hidden;
  border: 1px solid rgba(231, 214, 177, 0.15);
  box-shadow: inset 0 16px 34px rgba(0,0,0,0.32);
}

.soil-label {
  position: absolute;
  z-index: 2;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--scholar-ink);
  background: var(--aged-parchment);
  font-size: 0.66rem;
  font-weight: 900;
}

.soil-layer { position: absolute; left: 0; right: 0; }
.layer-top { top: 0; height: 34%; background: linear-gradient(90deg, #3F6F4E, #26222A, #3F6F4E); }
.layer-mid { top: 34%; height: 31%; background: linear-gradient(90deg, #26222A, #101119, #6B4BB0); }
.layer-low { bottom: 0; height: 35%; background: linear-gradient(90deg, #101119, #3F6F4E, #101119); }

.root-map {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 42px;
  width: 84%;
  height: 290px;
  filter: drop-shadow(0 0 10px rgba(114, 255, 182, 0.62));
}

.root {
  fill: none;
  stroke: var(--neon-fern);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 380;
  stroke-dashoffset: 380;
  animation: growRoot 3.8s ease-in-out infinite alternate;
}
.root-two { animation-delay: 450ms; }
.root-three { animation-delay: 800ms; }
.root-four { animation-delay: 1200ms; }
.root-five { animation-delay: 1500ms; }

.moss-bed {
  position: absolute;
  left: 15%;
  right: 15%;
  bottom: 54px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(114, 255, 182, 0.58), rgba(63, 111, 78, 0.7) 48%, transparent 72%);
  filter: blur(0.2px);
}

.fern {
  position: absolute;
  bottom: 18px;
  width: 14px;
  height: 72px;
  border-radius: 999px;
  background: var(--neon-fern);
  box-shadow: 0 0 18px rgba(114, 255, 182, 0.82);
  transform-origin: bottom;
  animation: sprout 2.8s cubic-bezier(.2, 1.8, .3, 1) infinite alternate;
}
.fern::before,
.fern::after {
  content: "";
  position: absolute;
  width: 40px;
  height: 16px;
  top: 18px;
  border-radius: 999px 0 999px 0;
  background: var(--moss-green);
  box-shadow: 0 0 12px rgba(114, 255, 182, 0.45);
}
.fern::before { right: 8px; transform: rotate(-28deg); }
.fern::after { left: 8px; transform: rotate(28deg); }
.fern-a { left: 28%; }
.fern-b { left: 50%; height: 92px; animation-delay: 500ms; }
.fern-c { right: 26%; height: 64px; animation-delay: 900ms; }

.brass-tag {
  position: absolute;
  right: 38px;
  bottom: 34px;
  padding: 9px 14px;
  border-radius: 8px;
  color: var(--scholar-ink);
  background: linear-gradient(135deg, var(--burnt-copper), var(--aged-parchment));
  box-shadow: 0 8px 22px rgba(0,0,0,0.38);
  font-size: 0.66rem;
  font-weight: 1000;
}

.intro-copy {
  max-width: 620px;
  margin: 26px 0 0;
  color: rgba(231, 214, 177, 0.84);
  font-size: 1.08rem;
  line-height: 1.75;
}

.side-card {
  position: absolute;
  width: 230px;
  padding: 20px;
  border: 1px solid rgba(231, 214, 177, 0.18);
  border-radius: 24px;
  background: rgba(38, 34, 42, 0.76);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(12px);
}
.side-card strong { display: block; margin: 8px 0; color: var(--neon-fern); font-family: "Nunito Sans", Nunito, system-ui, sans-serif; }
.side-card p { margin: 0; line-height: 1.55; font-size: 0.92rem; }
.catalog-number { color: var(--burnt-copper); font-size: 0.64rem; font-weight: 1000; }
.left-card { left: max(24px, calc(50% - 620px)); top: 34%; transform: rotate(-5deg); }
.right-card { right: max(24px, calc(50% - 628px)); top: 42%; transform: rotate(4deg); }

.moth {
  position: absolute;
  width: 34px;
  height: 18px;
  top: 78px;
  right: 108px;
  opacity: 0.68;
  animation: flutter 3.6s ease-in-out infinite;
}
.moth::before,
.moth::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 70% 20% 70% 20%;
  background: rgba(231, 214, 177, 0.72);
}
.moth::before { left: 0; transform: rotate(-24deg); }
.moth::after { right: 0; transform: rotate(114deg); }

.chapter-card {
  position: absolute;
  top: 13vh;
  width: min(90vw, 610px);
  text-align: center;
  padding: 26px;
  border-radius: 30px;
  background: rgba(38, 34, 42, 0.54);
  border: 1px solid rgba(231, 214, 177, 0.16);
  box-shadow: 0 22px 60px rgba(0,0,0,0.34);
}
.chapter-card h2 {
  margin: 0;
  font-family: "Nunito Sans", Nunito, Inter, system-ui, sans-serif;
  font-size: clamp(2.3rem, 7vw, 5rem);
  line-height: 0.9;
  letter-spacing: -0.045em;
}
.chapter-card p:last-child { margin-bottom: 0; line-height: 1.65; color: rgba(231,214,177,0.82); }

.drawer-cabinet {
  width: min(92vw, 650px);
  margin-top: 210px;
  padding: 26px;
  border-radius: 38px;
  background: linear-gradient(180deg, rgba(38,34,42,0.92), rgba(16,17,25,0.92));
  border: 1px solid rgba(231,214,177,0.18);
  box-shadow: inset 0 0 40px rgba(198,106,50,0.08), 0 34px 90px rgba(0,0,0,0.52);
}

.drawer {
  position: relative;
  display: block;
  width: 100%;
  height: 120px;
  margin: 0 0 18px;
  border: 1px solid rgba(231,214,177,0.18);
  border-radius: 22px;
  color: var(--aged-parchment);
  background: linear-gradient(90deg, #26222A, #3F6F4E 140%);
  box-shadow: inset 0 -18px 34px rgba(0,0,0,0.28), 0 15px 32px rgba(0,0,0,0.32);
  cursor: pointer;
  transition: transform 360ms cubic-bezier(.2, 1.7, .35, 1), background 300ms;
  overflow: hidden;
}
.drawer:last-child { margin-bottom: 0; }
.drawer.open,
.drawer:hover { transform: translateY(-3px) scale(1.015); background: linear-gradient(90deg, #26222A, rgba(198,106,50,0.52)); }
.drawer-label { position: absolute; left: 28px; top: 28px; font-weight: 1000; }
.drawer-pull {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 84px;
  height: 20px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--burnt-copper), var(--aged-parchment));
  box-shadow: 0 0 18px rgba(198,106,50,0.32);
}
.settling-scrap {
  position: absolute;
  right: 34px;
  top: 25px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--scholar-ink);
  background: var(--aged-parchment);
  font-style: normal;
  font-family: Comfortaa, Quicksand, system-ui, sans-serif;
  font-weight: 900;
  transform: rotate(8deg);
  transition: top 450ms cubic-bezier(.2,1.7,.4,1), transform 450ms;
}
.settling-scrap.second { right: 120px; top: 65px; transform: rotate(-7deg); }
.drawer.open .settling-scrap { top: 58px; transform: rotate(-3deg); background: var(--neon-fern); }
.drawer.open .settling-scrap.second { top: 34px; transform: rotate(4deg); }

.drawer-note,
.marginal-note {
  position: absolute;
  bottom: 8vh;
  width: min(88vw, 560px);
  padding: 18px 22px;
  border-radius: 22px;
  color: var(--scholar-ink);
  background: linear-gradient(135deg, var(--aged-parchment), rgba(114,255,182,0.86));
  box-shadow: 0 18px 44px rgba(0,0,0,0.34), 0 0 24px rgba(114,255,182,0.18);
  text-align: center;
  font-family: Quicksand, "Nunito Sans", system-ui, sans-serif;
  font-weight: 800;
  transition: transform 260ms cubic-bezier(.2,1.7,.35,1), opacity 260ms;
}
.drawer-note.pop,
.marginal-note.pop { transform: translateY(-7px) scale(1.025); }

.leaf-orbit {
  position: relative;
  width: min(92vw, 680px);
  aspect-ratio: 1;
  margin-top: 160px;
}
.index-core {
  position: absolute;
  inset: 35%;
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: 44% 44% 34% 34%;
  border: 1px solid rgba(231,214,177,0.25);
  background: radial-gradient(circle, rgba(114,255,182,0.22), rgba(38,34,42,0.86));
  box-shadow: inset 0 0 30px rgba(231,214,177,0.08), 0 0 46px rgba(114,255,182,0.2);
  font-family: "Nunito Sans", Nunito, system-ui, sans-serif;
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  font-weight: 1000;
  line-height: 1.1;
}
.leaf {
  position: absolute;
  width: 148px;
  height: 74px;
  border: 1px solid rgba(114,255,182,0.35);
  border-radius: 100% 8% 100% 8%;
  color: var(--scholar-ink);
  background: linear-gradient(135deg, var(--neon-fern), var(--moss-green));
  box-shadow: 0 0 24px rgba(114,255,182,0.22), 0 20px 36px rgba(0,0,0,0.28);
  font-family: Quicksand, "Nunito Sans", system-ui, sans-serif;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 300ms cubic-bezier(.2,1.8,.35,1), filter 300ms;
  z-index: 2;
}
.leaf:hover,
.leaf.active { transform: scale(1.12) rotate(var(--r, 0deg)); filter: brightness(1.16); }
.leaf-one { top: 6%; left: 14%; --r: -18deg; transform: rotate(-18deg); }
.leaf-two { top: 9%; right: 12%; --r: 24deg; transform: rotate(24deg); }
.leaf-three { top: 46%; left: 0; --r: -58deg; transform: rotate(-58deg); }
.leaf-four { top: 49%; right: 0; --r: 58deg; transform: rotate(58deg); }
.leaf-five { bottom: 6%; left: 50%; --r: 134deg; transform: translateX(-50%) rotate(134deg); }
.leaf-five:hover,
.leaf-five.active { transform: translateX(-50%) scale(1.12) rotate(134deg); }

.orbit-roots {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 0 12px rgba(114,255,182,0.42));
}
.orbit-roots circle,
.orbit-roots path {
  fill: none;
  stroke: rgba(114,255,182,0.48);
  stroke-width: 2.5;
  stroke-dasharray: 10 12;
  animation: pulseDash 7s linear infinite;
}

.bounce-in { animation: bounceEnter 900ms cubic-bezier(.2,1.65,.45,1) both; }
.delay-1 { animation-delay: 140ms; }
.delay-2 { animation-delay: 280ms; }
.delay-3 { animation-delay: 430ms; }
.delay-4 { animation-delay: 590ms; }
.delay-5 { animation-delay: 760ms; }

@keyframes bounceEnter {
  0% { opacity: 0; transform: translateY(-42px) scale(0.86) rotate(var(--start-rotate, 0deg)); }
  62% { opacity: 1; transform: translateY(8px) scale(1.04) rotate(var(--start-rotate, 0deg)); }
  82% { transform: translateY(-4px) scale(0.99) rotate(var(--start-rotate, 0deg)); }
  100% { opacity: 1; transform: translateY(0) scale(1) rotate(var(--start-rotate, 0deg)); }
}
@keyframes breathe { 0%, 100% { transform: scale(0.96); opacity: 0.72; } 50% { transform: scale(1.04); opacity: 1; } }
@keyframes growRoot { to { stroke-dashoffset: 42; } }
@keyframes sprout { 0% { transform: scaleY(0.72) rotate(-2deg); } 100% { transform: scaleY(1.08) rotate(3deg); } }
@keyframes flutter { 0%, 100% { transform: translateY(0) rotate(6deg); } 50% { transform: translateY(12px) rotate(-9deg); } }
@keyframes pulseDash { to { stroke-dashoffset: -140; } }

@media (max-width: 900px) {
  .side-card { display: none; }
  .chapter-card { top: 11vh; }
  .drawer-cabinet { margin-top: 230px; }
}

@media (max-width: 620px) {
  .room { padding-left: 14px; padding-right: 14px; }
  .ribbon-nav { top: 12px; gap: 4px; }
  .nav-tab { padding: 8px 10px; font-size: 0.66rem; }
  .terrarium { width: 92vw; min-height: 450px; }
  .paper-scrap { font-size: 0.64rem; padding: 10px 11px; }
  .scrap-a { left: 26px; }
  .scrap-b { right: 24px; }
  .scrap-c { left: 38%; }
  .chapter-card { padding: 18px; }
  .drawer { height: 110px; }
  .settling-scrap.second { right: 94px; }
  .leaf { width: 112px; height: 62px; font-size: 0.72rem; }
  .leaf-orbit { margin-top: 210px; }
}
