:root {
  /* Typography compliance: IBM Plex Mono* Mono** from Google Fonts for tiny code-like recipe comments; Inter* Inter** from Google Fonts for clear annotation copy. */
  --obsidian: #07060B;
  --aubergine: #171024;
  --lime: #B6FF00;
  --magenta: #FF2BD6;
  --cyan: #00E7FF;
  --violet: #7B3CFF;
  --cream: #F5E8C8;
  --smoke: #CDEAF033;
  --glass: rgba(205, 234, 240, .12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--cream);
  background:
    radial-gradient(circle at 18% 8%, rgba(123, 60, 255, .36), transparent 30rem),
    radial-gradient(circle at 82% 18%, rgba(255, 43, 214, .23), transparent 28rem),
    linear-gradient(135deg, var(--obsidian), var(--aubergine) 48%, var(--obsidian));
  font-family: Inter, system-ui, sans-serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(245, 232, 200, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 232, 200, .025) 1px, transparent 1px);
  background-size: 74px 74px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
  z-index: 0;
}

.site-shell { position: relative; isolation: isolate; }

.ambient {
  position: fixed;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .34;
  pointer-events: none;
  z-index: -1;
}

.ambient-one { left: -12rem; top: 18vh; background: var(--magenta); }
.ambient-two { right: -14rem; bottom: 5vh; background: var(--cyan); }

.plate-nav {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  gap: .35rem;
  padding: .42rem;
  border: 1px solid rgba(245, 232, 200, .16);
  border-radius: 999px;
  background: rgba(7, 6, 11, .58);
  backdrop-filter: blur(18px);
  box-shadow: 0 0 32px rgba(0, 231, 255, .1);
}

.plate-nav a {
  color: rgba(245, 232, 200, .68);
  text-decoration: none;
  font: 500 .68rem/1 IBM Plex Mono, monospace;
  letter-spacing: .08em;
  padding: .6rem .85rem;
  border-radius: 999px;
  transition: color .3s ease, background .3s ease, box-shadow .3s ease;
}

.plate-nav a:hover, .plate-nav a.active {
  color: var(--obsidian);
  background: var(--lime);
  box-shadow: 0 0 18px rgba(182, 255, 0, .45);
}

.lesson {
  min-height: 100vh;
  position: relative;
  display: grid;
  grid-template-columns: minmax(18rem, .85fr) minmax(22rem, 1.15fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 6rem);
  padding: clamp(6rem, 9vw, 8rem) clamp(1.2rem, 5vw, 5rem);
}

.hero {
  grid-template-columns: 1fr;
  overflow: hidden;
  padding-top: 5rem;
  background:
    radial-gradient(ellipse at 50% 92%, rgba(245, 232, 200, .12), transparent 25rem),
    linear-gradient(to bottom, transparent 54%, rgba(0, 0, 0, .38));
}

.hero-wordmark { align-self: end; margin-top: auto; z-index: 2; }

.mono, code {
  font-family: IBM Plex Mono, ui-monospace, monospace;
  color: var(--cyan);
  letter-spacing: .08em;
}

.mono { text-transform: uppercase; font-size: .72rem; }

h1, h2, h3 {
  font-family: Cormorant Garamond, Georgia, serif;
  margin: 0;
  font-weight: 600;
}

h1 {
  font-size: clamp(5.4rem, 18vw, 18rem);
  line-height: .72;
  letter-spacing: .035em;
  color: var(--cream);
  text-shadow: 0 0 42px rgba(245, 232, 200, .12), 0 0 90px rgba(255, 43, 214, .16);
}

.hero-wordmark span {
  display: block;
  margin-top: 1rem;
  color: rgba(245, 232, 200, .7);
  font-size: clamp(1rem, 2vw, 1.5rem);
  letter-spacing: .18em;
  text-transform: uppercase;
}

.hero-modules {
  position: absolute;
  inset: 11vh 6vw auto auto;
  width: min(46rem, 86vw);
  min-height: 28rem;
}

.glass-card, .specimen-pane, .bento-cell, .orbit-node {
  border: 1px solid rgba(205, 234, 240, .22);
  background: linear-gradient(135deg, rgba(205, 234, 240, .18), rgba(23, 16, 36, .42));
  backdrop-filter: blur(22px) saturate(1.4);
  box-shadow: 0 26px 70px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(245, 232, 200, .18), 0 0 0 1px rgba(0, 231, 255, .06);
}

.step-card {
  position: absolute;
  width: 16rem;
  min-height: 12rem;
  padding: 1.2rem;
  border-radius: 1.45rem;
  animation: bounceEnter .9s cubic-bezier(.2, 1.35, .35, 1) both;
  animation-delay: var(--d);
}

.step-card:nth-child(1) { left: 2rem; top: 0; }
.step-card:nth-child(2) { right: 4rem; top: 3rem; }
.step-card:nth-child(3) { left: 7rem; top: 14rem; }
.step-card:nth-child(4) { right: 0; top: 18rem; }

.step-card b { color: var(--lime); font-family: IBM Plex Mono, monospace; }
.step-card h3, .tasting-card h3, .specimen-pane h3 { font-size: 2rem; color: var(--cream); margin: .3rem 0 .7rem; }
.step-card p, .tasting-card p, .chapter-copy p { color: rgba(245, 232, 200, .72); line-height: 1.7; }
.step-card code, .tasting-card code, .specimen-pane code { display: block; margin-top: 1rem; font-size: .7rem; color: var(--magenta); }

.open-tutorial {
  justify-self: start;
  margin-top: 1.5rem;
  z-index: 3;
  border: 1px solid rgba(182, 255, 0, .55);
  border-radius: 999px;
  background: rgba(182, 255, 0, .08);
  color: var(--lime);
  padding: 1rem 1.4rem;
  font: 600 .78rem/1 Inter, sans-serif;
  letter-spacing: .18em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 32px rgba(182, 255, 0, .18);
}

.orchid { position: absolute; width: 26rem; height: 26rem; opacity: .45; filter: blur(.2px); }
.orchid::before, .orchid::after {
  content: ""; position: absolute; inset: 18%; border: 1px solid var(--magenta); border-radius: 70% 30% 65% 35%; transform: rotate(28deg); box-shadow: 0 0 30px rgba(255, 43, 214, .35);
}
.orchid::after { border-color: var(--cyan); transform: rotate(-34deg) scale(.72); }
.orchid-left { left: -8rem; bottom: 5rem; }
.orchid-right { right: -8rem; top: 5rem; transform: rotate(180deg); }

.chapter-copy { max-width: 42rem; z-index: 2; }
.chapter-copy h2 {
  font-size: clamp(3rem, 7vw, 7.4rem);
  line-height: .9;
  letter-spacing: .02em;
  color: var(--cream);
}
.chapter-copy p:last-child { max-width: 34rem; font-size: 1.04rem; }

.scene-stage { min-height: 34rem; position: relative; }
.orbit-lab { border-radius: 50%; }
.sun-dial {
  position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%);
  width: 10rem; height: 10rem; border-radius: 50%; display: grid; place-items: center;
  font: 500 1rem/1 IBM Plex Mono, monospace; color: var(--obsidian);
  background: radial-gradient(circle, var(--cream), var(--lime)); box-shadow: 0 0 70px rgba(182, 255, 0, .28);
}
.orbit-node {
  position: absolute; width: 7.4rem; height: 7.4rem; border-radius: 50%; color: var(--cream); cursor: pointer;
  font: 600 .8rem/1 Inter, sans-serif; letter-spacing: .16em; text-transform: uppercase;
}
.orbit-node:nth-of-type(1) { left: 50%; top: 0; transform: translateX(-50%); }
.orbit-node:nth-of-type(2) { right: 0; top: 50%; transform: translateY(-50%); }
.orbit-node:nth-of-type(3) { left: 50%; bottom: 0; transform: translateX(-50%); }
.orbit-node:nth-of-type(4) { left: 0; top: 50%; transform: translateY(-50%); }
.linework { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.linework path { fill: none; stroke: rgba(0, 231, 255, .5); stroke-width: 1; stroke-dasharray: 7 9; }

.stacks { background: radial-gradient(circle at 20% 50%, rgba(255, 43, 214, .14), transparent 34rem); }
.tray-stack { perspective: 1200px; }
.tasting-card {
  position: absolute; width: min(30rem, 82vw); padding: 1.5rem; border-radius: 1.4rem;
  transition: transform .45s ease, box-shadow .45s ease;
}
.tasting-card:nth-child(1) { left: 5%; top: 12%; transform: rotate(-5deg); }
.tasting-card:nth-child(2) { left: 15%; top: 34%; transform: rotate(3deg); }
.tasting-card:nth-child(3) { left: 2%; top: 56%; transform: rotate(-2deg); }
.tasting-card:hover { transform: translateY(-18px) rotate(0deg) scale(1.03); box-shadow: 0 34px 90px rgba(255, 43, 214, .22); }
.right-copy { justify-self: end; }

.specimen { background: radial-gradient(circle at 76% 54%, rgba(0, 231, 255, .12), transparent 30rem); }
.specimen-grid { display: grid; grid-template-columns: 1fr 1fr 4rem; gap: 1rem; }
.specimen-pane { border-radius: 2rem; padding: 1.4rem; min-height: 28rem; position: relative; overflow: hidden; }
.leaf-pane::before, .circuit-pane::before {
  content: ""; position: absolute; inset: 15%; border-radius: 50% 5% 50% 5%; border: 2px solid var(--lime); transform: rotate(36deg); box-shadow: inset 0 0 70px rgba(182, 255, 0, .12), 0 0 40px rgba(182, 255, 0, .2);
}
.leaf-pane::after { content: ""; position: absolute; left: 50%; top: 18%; width: 1px; height: 62%; background: var(--lime); transform: rotate(36deg); }
.circuit-pane::before { border-color: var(--cyan); border-radius: 1rem; transform: rotate(0); }
.circuit-pane::after { content: ""; position: absolute; inset: 34% 18%; background: linear-gradient(90deg, transparent 49%, var(--cyan) 50%, transparent 51%), linear-gradient(transparent 49%, var(--magenta) 50%, transparent 51%); }
.annotation-rail { display: flex; flex-direction: column; justify-content: space-around; align-items: center; border-left: 1px solid rgba(245, 232, 200, .2); font: .68rem IBM Plex Mono, monospace; color: var(--lime); text-transform: uppercase; letter-spacing: .15em; }
.annotation-rail span { writing-mode: vertical-rl; }

.finale { grid-template-columns: 1.1fr .9fr; background: radial-gradient(circle at 50% 50%, rgba(245, 232, 200, .1), transparent 38rem); }
.final-table { display: grid; grid-template-columns: 1.1fr .9fr; grid-template-rows: 1fr 1fr; gap: 1rem; padding: 1rem; border-radius: 2.5rem; border: 1px solid rgba(245, 232, 200, .2); background: rgba(7, 6, 11, .48); box-shadow: 0 40px 130px rgba(0, 0, 0, .65); }
.bento-cell { border-radius: 1.7rem; min-height: 14rem; display: grid; place-items: center; position: relative; overflow: hidden; color: var(--cream); font-family: IBM Plex Mono, monospace; text-transform: uppercase; letter-spacing: .12em; }
.flower-cell::before { content: ""; width: 9rem; height: 9rem; border: 2px solid var(--magenta); border-radius: 70% 30%; box-shadow: 0 0 45px rgba(255, 43, 214, .55); }
.lime-cell { background: radial-gradient(circle, rgba(182, 255, 0, .28), rgba(205, 234, 240, .08)); }
.cream-cell { color: var(--obsidian); background: linear-gradient(135deg, rgba(245, 232, 200, .88), rgba(205, 234, 240, .24)); }

.hover-card { transition: transform .35s ease, border-color .35s ease, box-shadow .35s ease; }
.hover-card:hover { border-color: rgba(182, 255, 0, .72); box-shadow: 0 30px 90px rgba(0, 231, 255, .18), 0 0 28px rgba(182, 255, 0, .22); }
.is-visible .glass-card, .is-visible .specimen-pane, .is-visible .bento-cell, .is-visible .orbit-node { animation: bounceEnter .8s cubic-bezier(.2, 1.25, .35, 1) both; }

.annotation-toast {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%) translateY(130%); z-index: 30;
  max-width: min(34rem, 90vw); padding: .9rem 1.1rem; border: 1px solid rgba(0, 231, 255, .28); border-radius: 999px;
  background: rgba(7, 6, 11, .74); color: var(--cream); backdrop-filter: blur(18px); font: .76rem IBM Plex Mono, monospace; letter-spacing: .05em;
  transition: transform .35s ease;
}
.annotation-toast.show { transform: translateX(-50%) translateY(0); }

@keyframes bounceEnter {
  0% { opacity: 0; transform: translateY(-34px) scale(.96); }
  62% { opacity: 1; transform: translateY(8px) scale(1.012); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 900px) {
  .plate-nav { width: calc(100% - 1rem); overflow-x: auto; justify-content: flex-start; }
  .lesson, .finale { grid-template-columns: 1fr; }
  .hero-modules { position: relative; inset: auto; width: 100%; min-height: auto; display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: 2rem; }
  .step-card { position: relative; inset: auto !important; width: 100%; }
  h1 { font-size: clamp(5rem, 24vw, 9rem); }
  .specimen-grid { grid-template-columns: 1fr; }
  .annotation-rail { flex-direction: row; border-left: 0; border-top: 1px solid rgba(245, 232, 200, .2); padding: 1rem; }
  .annotation-rail span { writing-mode: horizontal-tb; }
}
