:root {
  --rice: #F7F5EF;
  --ink: #141414;
  --marble: #B8B5AE;
  --wash: #DCD8CF;
  --graphite: #56534E;
  --blueblack: #202A33;
  --paper-shadow: rgba(20, 20, 20, 0.14);
}

/* Font design audit: IBM Plex Mono** used sparingly as tiny etched inscriptions on marble tags. */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
  background: var(--rice);
  color: var(--ink);
  font-family: "Quicksand", Inter, system-ui, sans-serif;
}

body {
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: -12vmax;
  z-index: 0;
  background:
    radial-gradient(circle at 17% 22%, rgba(220, 216, 207, 0.72), transparent 24%),
    radial-gradient(circle at 76% 42%, rgba(184, 181, 174, 0.32), transparent 30%),
    radial-gradient(circle at 44% 78%, rgba(32, 42, 51, 0.08), transparent 28%),
    linear-gradient(115deg, transparent 18%, rgba(86, 83, 78, 0.10) 19%, transparent 20% 52%, rgba(220, 216, 207, 0.62) 53%, transparent 61%);
  filter: blur(14px);
  animation: slowWash 18s ease-in-out infinite alternate;
}

.paper-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  opacity: 0.34;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(20, 20, 20, 0.08) 0 1px, transparent 1.4px),
    radial-gradient(circle at 72% 66%, rgba(86, 83, 78, 0.07) 0 1px, transparent 1.2px),
    linear-gradient(90deg, rgba(255,255,255,0.16), rgba(20,20,20,0.02));
  background-size: 7px 7px, 11px 11px, 100% 100%;
  mix-blend-mode: multiply;
}

.marble-veins {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.56;
  background:
    linear-gradient(128deg, transparent 9%, rgba(86,83,78,0.18) 9.15%, transparent 9.35% 48%, rgba(184,181,174,0.42) 48.2%, transparent 48.5%),
    linear-gradient(32deg, transparent 28%, rgba(32,42,51,0.10) 28.2%, transparent 28.42% 71%, rgba(86,83,78,0.12) 71.2%, transparent 71.45%),
    repeating-linear-gradient(96deg, transparent 0 86px, rgba(184,181,174,0.16) 87px, transparent 88px);
}

.atelier-head {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto;
  align-items: start;
  padding: clamp(18px, 3vw, 38px) clamp(18px, 4.8vw, 70px);
  pointer-events: none;
}

.wordmark {
  width: max-content;
  color: var(--ink);
  text-decoration: none;
  font-family: "Nunito Sans", Inter, system-ui, sans-serif;
  font-size: clamp(1.35rem, 2.7vw, 2.7rem);
  font-weight: 900;
  letter-spacing: 0.015em;
  pointer-events: auto;
}

.inlay-nav {
  display: flex;
  gap: 10px;
  pointer-events: auto;
}

.nav-tick {
  border: 1px solid rgba(86, 83, 78, 0.28);
  color: var(--graphite);
  background: rgba(247, 245, 239, 0.62);
  border-radius: 999px;
  padding: 8px 12px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 8px 24px rgba(20,20,20,0.04);
  cursor: pointer;
  transition: transform 420ms cubic-bezier(.2,1.6,.3,1), background 420ms ease, color 420ms ease;
}

.nav-tick span {
  color: var(--ink);
}

.nav-tick.active,
.nav-tick:hover {
  color: var(--rice);
  background: var(--blueblack);
  transform: translateY(3px);
}

.nav-tick.active span,
.nav-tick:hover span {
  color: var(--rice);
}

.plates {
  position: relative;
  z-index: 5;
  width: 100vw;
  height: 100vh;
}

.plate {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 1.3vw;
  padding: clamp(82px, 13vh, 130px) clamp(18px, 4.8vw, 70px) clamp(28px, 6vh, 58px);
  opacity: 0;
  transform: translateX(3vw) scale(0.992);
  pointer-events: none;
  transition: opacity 700ms ease, transform 900ms cubic-bezier(.2,1,.2,1);
}

.plate.active {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}

.lesson-label {
  grid-column: 1 / 5;
  grid-row: 1;
  align-self: end;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  color: var(--graphite);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.plate-copy {
  position: relative;
  z-index: 4;
  color: var(--graphite);
}

.upper-note {
  grid-column: 1 / 6;
  grid-row: 2 / 5;
  align-self: start;
  padding: clamp(18px, 3vw, 36px);
  border: 1px solid rgba(184,181,174,0.54);
  border-radius: 44% 56% 46% 54% / 58% 38% 62% 42%;
  background:
    radial-gradient(circle at 28% 15%, rgba(247,245,239,0.82), transparent 36%),
    radial-gradient(circle at 76% 70%, rgba(220,216,207,0.58), transparent 46%),
    rgba(247,245,239,0.45);
  box-shadow: 0 30px 70px rgba(20,20,20,0.08);
}

.upper-note.compact {
  grid-column: 2 / 6;
  grid-row: 2 / 4;
}

.stamp,
.mono {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stamp {
  display: inline-block;
  color: var(--blueblack);
  border-bottom: 1px solid rgba(32,42,51,0.32);
  margin-bottom: 10px;
}

h1,
h2 {
  margin: 0;
  color: var(--ink);
  font-family: "Nunito Sans", Inter, system-ui, sans-serif;
  font-weight: 900;
  line-height: 0.94;
  letter-spacing: -0.035em;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 6.9rem);
}

h2 {
  font-size: clamp(1.85rem, 4vw, 4.4rem);
}

p {
  margin: 15px 0 0;
  font-size: clamp(1rem, 1.3vw, 1.28rem);
  line-height: 1.55;
  font-weight: 500;
}

.simulation-plinth {
  position: absolute;
  left: 26vw;
  top: 15vh;
  width: min(70vw, 980px);
  height: min(70vh, 640px);
  border-radius: 56% 44% 50% 50% / 44% 56% 44% 56%;
  background:
    radial-gradient(circle at 35% 28%, rgba(247,245,239,0.86), transparent 32%),
    radial-gradient(circle at 70% 62%, rgba(220,216,207,0.70), transparent 38%),
    linear-gradient(135deg, rgba(184,181,174,0.46), rgba(247,245,239,0.50));
  box-shadow: 0 46px 100px rgba(20,20,20,0.14), inset 0 0 0 1px rgba(86,83,78,0.20);
  overflow: hidden;
}

.simulation-plinth::before,
.simulation-plinth::after {
  content: "";
  position: absolute;
  inset: 9%;
  border-radius: inherit;
  border: 1px solid rgba(86,83,78,0.14);
  transform: rotate(-8deg);
}

.simulation-plinth::after {
  inset: 18%;
  transform: rotate(13deg);
  border-color: rgba(32,42,51,0.12);
}

#simulationCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
}

.plaster-hand {
  position: absolute;
  left: -10px;
  bottom: 4%;
  width: min(30vw, 260px);
  z-index: 2;
  opacity: 0.32;
  fill: rgba(184,181,174,0.72);
  stroke: rgba(86,83,78,0.48);
  stroke-width: 2.2;
}

.water-bloom {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(32,42,51,0.18), rgba(220,216,207,0.28) 42%, transparent 72%);
  filter: blur(2px);
  z-index: 1;
  animation: bloom 9s ease-in-out infinite alternate;
}

.bloom-a { width: 46%; height: 38%; left: 42%; top: 12%; }
.bloom-b { width: 36%; height: 42%; left: 18%; top: 44%; animation-delay: -3s; }

.axis-label {
  position: absolute;
  right: 8%;
  bottom: 9%;
  z-index: 4;
  color: rgba(86,83,78,0.86);
}

.lower-right {
  grid-column: 8 / 13;
  grid-row: 6 / 9;
  align-self: center;
  justify-self: end;
}

.annotation,
.outcome-card,
.formula-stone,
.chip-slider {
  max-width: 450px;
  border: 1px solid rgba(86,83,78,0.24);
  border-radius: 28px;
  color: var(--graphite);
  background:
    linear-gradient(135deg, rgba(247,245,239,0.76), rgba(220,216,207,0.54)),
    radial-gradient(circle at 100% 0, rgba(184,181,174,0.52), transparent 34%);
  box-shadow: 0 24px 64px rgba(20,20,20,0.10);
  padding: 22px 26px;
}

button.annotation,
.capsule,
.chip {
  font: inherit;
  cursor: pointer;
}

.annotation {
  font-weight: 600;
  text-align: left;
}

.column-timeline {
  grid-column: 1 / 4;
  grid-row: 5 / 8;
  align-self: center;
  display: grid;
  gap: 18px;
  padding-left: 3vw;
}

.column-timeline::before {
  content: "";
  position: absolute;
  width: 34px;
  height: 34vh;
  left: 6.2vw;
  top: 45vh;
  border-radius: 44% 56% 45% 55%;
  background: linear-gradient(90deg, rgba(184,181,174,0.42), rgba(247,245,239,0.16));
  transform: rotate(7deg);
}

.chip,
.capsule {
  width: max-content;
  border: 1px solid rgba(86,83,78,0.25);
  border-radius: 999px;
  padding: 10px 15px;
  background: rgba(247,245,239,0.72);
  color: var(--blueblack);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 12px 28px rgba(20,20,20,0.08);
}

.tutorial-capsules {
  grid-column: 6 / 11;
  grid-row: 4 / 5;
  display: flex;
  gap: 14px;
  transform: rotate(-7deg);
}

.outcome-card p,
.formula-stone p {
  font-size: 1.02rem;
}

.chip-slider {
  width: min(480px, 40vw);
}

.chip-slider label {
  display: block;
  margin-bottom: 18px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blueblack);
}

input[type="range"] {
  width: 100%;
  appearance: none;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blueblack) var(--tension, 48%), rgba(184,181,174,0.42) var(--tension, 48%));
  border: 1px solid rgba(86,83,78,0.30);
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 42px;
  height: 34px;
  border-radius: 46% 54% 43% 57%;
  background:
    linear-gradient(135deg, rgba(247,245,239,0.95), rgba(184,181,174,0.75)),
    linear-gradient(45deg, transparent 40%, rgba(86,83,78,0.35) 41%, transparent 43%);
  border: 1px solid rgba(86,83,78,0.42);
  box-shadow: 0 10px 22px rgba(20,20,20,0.16);
}

.slider-readout {
  margin-top: 15px;
  color: var(--graphite);
}

.laurel-contours {
  grid-column: 7 / 13;
  grid-row: 2 / 7;
  position: relative;
}

.laurel-contours span {
  position: absolute;
  inset: calc(var(--i, 0) * 30px);
  border: 1px solid rgba(32,42,51,0.18);
  border-radius: 50%;
  transform: rotate(-23deg) skewX(-8deg);
}

.laurel-contours span:nth-child(1) { --i: 1; }
.laurel-contours span:nth-child(2) { --i: 2; border-color: rgba(86,83,78,0.22); }
.laurel-contours span:nth-child(3) { --i: 3; border-color: rgba(184,181,174,0.42); }

.bust-vector {
  grid-column: 6 / 10;
  grid-row: 3 / 6;
  position: relative;
  align-self: center;
  justify-self: center;
  width: 230px;
  height: 260px;
  opacity: 0.58;
}

.bust-head {
  position: absolute;
  inset: 20px 35px 52px;
  border-radius: 48% 52% 44% 56% / 36% 40% 60% 64%;
  background: radial-gradient(circle at 42% 32%, rgba(247,245,239,0.9), rgba(184,181,174,0.64));
  box-shadow: inset -16px -18px 28px rgba(86,83,78,0.12), 0 28px 60px rgba(20,20,20,0.10);
}

.bust-head::after {
  content: "";
  position: absolute;
  left: 54%;
  top: 42%;
  width: 36px;
  height: 7px;
  border-radius: 50%;
  background: var(--blueblack);
  opacity: 0.52;
}

.vector-eye {
  position: absolute;
  left: 62%;
  top: 44%;
  width: 230px;
  height: 2px;
  background: var(--blueblack);
  transform: rotate(21deg);
  transform-origin: left center;
}

.vector-eye::after {
  content: "";
  position: absolute;
  right: -2px;
  top: -5px;
  border-left: 12px solid var(--blueblack);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.formula-stone {
  min-width: min(510px, 46vw);
  transition: transform 500ms cubic-bezier(.2,1.7,.3,1), background 500ms ease;
}

.formula-stone strong {
  display: block;
  margin-top: 14px;
  color: var(--ink);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: clamp(1.35rem, 2.1vw, 2.1rem);
  font-weight: 600;
}

.formula-stone:hover,
.formula-stone.active {
  transform: translate(-12px, -10px) rotate(-1deg);
  background: linear-gradient(135deg, rgba(247,245,239,0.9), rgba(184,181,174,0.62));
}

.path-thickening .simulation-plinth {
  box-shadow: 0 50px 110px rgba(32,42,51,0.18), inset 0 0 0 1px rgba(32,42,51,0.38);
}

@keyframes slowWash {
  from { transform: translate(-1vw, -1vh) rotate(-1deg) scale(1); }
  to { transform: translate(2vw, 1vh) rotate(1deg) scale(1.04); }
}

@keyframes bloom {
  from { transform: scale(0.86) rotate(0deg); opacity: 0.42; }
  to { transform: scale(1.14) rotate(9deg); opacity: 0.72; }
}

@media (max-width: 840px) {
  html,
  body { overflow: auto; }
  .atelier-head { position: absolute; grid-template-columns: 1fr; gap: 16px; }
  .inlay-nav { flex-wrap: wrap; }
  .plates { height: auto; min-height: 100vh; }
  .plate { position: relative; min-height: 100vh; display: block; padding-top: 170px; }
  .plate:not(.active) { display: none; }
  .simulation-plinth { left: 4vw; top: 43vh; width: 92vw; height: 45vh; }
  .upper-note, .upper-note.compact, .lower-right { width: 100%; margin-top: 18px; }
  .chip-slider, .formula-stone { width: 100%; min-width: 0; }
  .tutorial-capsules { transform: none; margin-top: 24px; flex-wrap: wrap; }
  .column-timeline, .laurel-contours, .bust-vector { display: none; }
}
