:root {
  --orange: #F28A3B;
  --bone: #FFF7EA;
  --teal: #9FD8D2;
  --espresso: #2A1712;
  --frost: #FFE1B8;
  --clay: #6B3320;
  --burnt: #C65A24;
  --glass-strong: #FFFFFF66;
  --glass-soft: #FFFFFF24;
  --jost: Avenir Next, Futura, "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --outfit: "SF Pro Rounded", "Segoe UI", Inter, system-ui, sans-serif;
  --mono: "DM Mono", "Space Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--outfit);
  color: var(--bone);
  background: var(--espresso);
  overflow-x: hidden;
}

button, a { font: inherit; color: inherit; }

.ambient-shell {
  min-height: 100vh;
  position: relative;
  background:
    radial-gradient(circle at 17% 9%, rgba(242, 138, 59, .32), transparent 28rem),
    radial-gradient(circle at 90% 18%, rgba(159, 216, 210, .2), transparent 23rem),
    radial-gradient(circle at 55% 80%, rgba(198, 90, 36, .36), transparent 34rem),
    linear-gradient(145deg, #2A1712 0%, #6B3320 52%, #2A1712 100%);
  isolation: isolate;
}

.ambient-shell:before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(115deg, transparent 0 31%, rgba(255,255,255,.04) 32%, transparent 34% 100%),
    radial-gradient(circle, rgba(255, 247, 234, .08) 1px, transparent 1.5px);
  background-size: 29rem 29rem, 3.7rem 3.7rem;
  mix-blend-mode: screen;
  z-index: 0;
}

.kiln-glow {
  position: fixed;
  width: 38vmax;
  height: 38vmax;
  border-radius: 50%;
  filter: blur(40px);
  opacity: .38;
  pointer-events: none;
  animation: glowDrift 16s ease-in-out infinite alternate;
}

.glow-one { left: -13vmax; top: 4vmax; background: var(--burnt); }
.glow-two { right: -16vmax; top: 38vmax; background: var(--orange); animation-delay: -5s; }
.glow-three { left: 32vmax; bottom: -22vmax; background: var(--teal); opacity: .18; animation-delay: -8s; }

.amber-glass {
  background: linear-gradient(135deg, rgba(255,247,234,.72), rgba(242,138,59,.22), rgba(159,216,210,.18));
  border: 1px solid var(--glass-strong);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.54), inset 0 -22px 45px rgba(198,90,36,.13), 0 28px 70px rgba(42,23,18,.32), 0 0 0 1px rgba(255,225,184,.08);
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
}

.archive-rail {
  position: fixed;
  z-index: 30;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: .45rem;
  padding: .5rem;
  border-radius: 999px;
}

.rail-chip {
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .12em;
  font: 700 .72rem var(--mono);
  color: var(--espresso);
  padding: .72rem .9rem;
  border-radius: 999px;
  background: rgba(255,247,234,.24);
  transition: transform .25s ease, background .25s ease;
}

.rail-chip.active, .rail-chip:hover { background: var(--burnt); color: var(--bone); transform: translateY(-2px); }

.scroll-cabinet { position: relative; z-index: 2; }

.scene {
  min-height: 100vh;
  padding: clamp(5.5rem, 8vw, 8rem) clamp(1rem, 4vw, 4.5rem) 4rem;
  display: grid;
  gap: clamp(1.1rem, 3vw, 2.5rem);
  align-items: center;
}

.cabinet-scene { grid-template-columns: minmax(18rem, .92fr) minmax(22rem, 1.2fr); }

.wordmark-glass {
  border-radius: 3.2rem;
  padding: clamp(1.4rem, 4vw, 3rem);
  color: var(--espresso);
  min-height: 68vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transform-style: preserve-3d;
}

.wordmark-glass h1 {
  margin: .8rem 0 1rem;
  font-family: var(--jost);
  font-size: clamp(3.8rem, 11vw, 9.2rem);
  line-height: .82;
  letter-spacing: -.075em;
  color: rgba(42,23,18,.82);
  text-shadow: 0 2px 0 rgba(255,247,234,.3), 0 18px 38px rgba(107,51,32,.18);
}

.wordmark-glass p, .scene-heading p, .final-note p { font-size: clamp(1rem, 1.5vw, 1.22rem); line-height: 1.65; color: rgba(42,23,18,.82); max-width: 42rem; }

.frosted-label, .accession, .tab-pull, .relic-note {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .72rem;
  color: var(--clay);
}

.cabinet-stack {
  min-height: 72vh;
  position: relative;
}

.modular-relic, .specimen-tray, .scene-heading, .motion-bench, .final-note, .seal-piece {
  border-radius: 2.2rem;
  color: var(--espresso);
  position: relative;
  overflow: hidden;
}

.modular-relic:after, .specimen-tray:after, .motion-bench:after, .seal-piece:after, .wordmark-glass:after {
  content: "";
  position: absolute;
  inset: 7px 12px auto;
  height: 34%;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(255,255,255,.5), transparent 62%);
  pointer-events: none;
}

.glass-runner {
  position: absolute;
  width: 8rem;
  height: .45rem;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.72), transparent);
  filter: blur(.5px);
  opacity: .62;
  pointer-events: none;
  animation: runnerGlide 5.8s ease-in-out infinite;
}

.runner-one { left: 12%; top: 16%; }
.runner-two { right: 14%; top: 22%; animation-delay: -2.4s; }
.runner-three { left: 18%; bottom: 24%; animation-delay: -3.6s; }

.central-relic {
  width: min(27rem, 72%);
  padding: 1.4rem;
  position: absolute;
  left: 18%;
  top: 16%;
  animation: floatCase 6.5s ease-in-out infinite;
}

.central-relic h2, .scene-heading h2, .final-note h2 {
  font-family: var(--jost);
  font-size: clamp(2rem, 5vw, 4.8rem);
  line-height: .9;
  letter-spacing: -.045em;
  margin: 1rem 0;
}

.central-relic p { line-height: 1.5; color: rgba(42,23,18,.76); }

.bubble-lens {
  border-radius: 999px;
  background: radial-gradient(circle at 32% 24%, rgba(255,255,255,.74), rgba(255,225,184,.43) 38%, rgba(159,216,210,.32) 72%, rgba(255,255,255,.14));
  border: 1px solid var(--glass-strong);
  box-shadow: inset -18px -20px 35px rgba(198,90,36,.15), inset 8px 8px 24px rgba(255,255,255,.42), 0 18px 50px rgba(42,23,18,.24);
  backdrop-filter: blur(14px);
}

.central-relic .bubble-lens { width: 12rem; height: 12rem; display: grid; place-items: center; margin: 0 auto; }

.floating-lens { position: absolute; display: grid; place-items: center; color: var(--burnt); font: 900 3rem var(--jost); animation: bubbleBob 7s ease-in-out infinite; }
.lens-a { width: 8rem; height: 8rem; right: 7%; top: 7%; }
.lens-b { width: 6rem; height: 6rem; left: 1%; bottom: 11%; animation-delay: -3s; }

.tall-vitrine { position: absolute; right: 1%; top: 29%; width: 13rem; min-height: 27rem; padding: 1.1rem; animation: floatCase 7s ease-in-out infinite -2s; }
.specimen-tray { position: absolute; left: 4%; bottom: 2%; width: 23rem; min-height: 12rem; padding: 1rem; animation: floatCase 8s ease-in-out infinite -4s; }
.tab-pull { display: inline-block; padding: .55rem .8rem; border-radius: 999px; background: rgba(255,247,234,.34); }

.icon-docent {
  width: 100%;
  max-width: 12rem;
  fill: none;
  stroke: var(--burnt);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 9px 12px rgba(107,51,32,.18));
}

.tall-vitrine .icon-docent { margin-top: 2.5rem; }
.specimen-tray .icon-docent { position: absolute; right: 1rem; bottom: .4rem; max-width: 9rem; }

.scene-heading, .final-note { padding: clamp(1.2rem, 3vw, 2.3rem); max-width: 52rem; }
.marks-scene, .bench-scene { align-content: center; }

.mosaic-grid {
  display: grid;
  grid-template-columns: 1.05fr .8fr 1.2fr;
  grid-auto-rows: minmax(10rem, 20vh);
  gap: 1rem;
}

.mosaic-grid button, .micro-card {
  border: 0;
  cursor: pointer;
  text-align: left;
  padding: 1.1rem;
  transition: transform .34s cubic-bezier(.2, 1.35, .34, 1), filter .3s ease;
}

.mosaic-grid button:hover, .micro-card:hover, .openable.is-open { transform: translateY(-7px) rotate(var(--hover-rotate, -1deg)); filter: saturate(1.12); }
.openable.is-open { box-shadow: inset 0 1px 0 rgba(255,255,255,.66), inset 0 -22px 45px rgba(198,90,36,.18), 0 32px 86px rgba(198,90,36,.3), 0 0 0 1px rgba(255,225,184,.18); }
.inline-accession { position: absolute; z-index: 4; right: .85rem; top: .85rem; max-width: calc(100% - 1.7rem); padding: .55rem .75rem; border-radius: 999px; background: rgba(255,247,234,.72); color: var(--clay); font: 700 .62rem var(--mono); letter-spacing: .08em; text-transform: uppercase; box-shadow: 0 10px 25px rgba(42,23,18,.14); animation: labelPop .32s cubic-bezier(.16, 1.3, .35, 1) both; }
.mosaic-grid span { position: absolute; left: 1.2rem; bottom: 1rem; font: 800 1.08rem var(--jost); }
.squat { grid-row: span 1; --hover-rotate: 1.5deg; }
.circle-case { border-radius: 999px; grid-row: span 2; display: grid; place-items: center; text-align: center; }
.thermometer { border-radius: 5rem; grid-row: span 2; }
.drawer-card { grid-column: span 2; }
.mask-case { grid-column: span 1; border-radius: 2rem 5rem 2rem 2rem; }

.motion-bench { padding: clamp(1rem, 3vw, 2rem); }
.bench-track { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; min-height: 23rem; }
.micro-card { background: rgba(255,247,234,.24); border: 1px solid var(--glass-soft); border-radius: 2rem; position: relative; overflow: hidden; color: var(--espresso); display: grid; place-items: center; }
.micro-card b { position: absolute; left: 1rem; bottom: 1rem; font-family: var(--jost); font-size: 1.35rem; }
.tapping { animation: tapTool 1.7s ease-in-out infinite; }
.spark-dot { animation: sparkBlink 1.7s steps(2) infinite; fill: var(--orange); stroke: var(--orange); }
.inflating-bubble { position: absolute; width: 5rem; height: 5rem; top: 1.2rem; right: 2rem; border-radius: 50%; background: rgba(159,216,210,.34); border: 1px solid var(--glass-strong); animation: inflate 2.5s ease-in-out infinite; }
.stamp { animation: stampPress 2.2s cubic-bezier(.4,0,.2,1) infinite; }
.wax-dot { fill: var(--burnt); animation: waxPulse 2.2s ease-in-out infinite; }
.drawer-pull { margin-top: 1rem; border: 0; border-radius: 999px; background: var(--burnt); color: var(--bone); padding: .9rem 1.2rem; font: 800 .78rem var(--mono); text-transform: uppercase; letter-spacing: .16em; cursor: pointer; }

.seal-scene { grid-template-columns: 1fr .82fr; }
.studio-seal { min-height: 68vh; position: relative; }
.seal-piece { position: absolute; display: grid; place-items: center; font: 900 clamp(1.4rem, 4vw, 3.3rem) var(--jost); color: var(--espresso); transition: transform .7s cubic-bezier(.16, 1.3, .35, 1); }
.piece-one { left: 7%; top: 8%; width: 48%; height: 26%; border-radius: 2rem 4rem 2rem 2rem; }
.piece-two { right: 7%; top: 27%; width: 42%; height: 32%; border-radius: 4rem 2rem 2rem 2rem; }
.piece-three { left: 12%; bottom: 12%; width: 25%; height: 25%; border-radius: 999px; color: var(--burnt); }
.piece-four { right: 18%; bottom: 8%; width: 35%; height: 18%; font: 700 1rem var(--mono); }
.seal-core { position: absolute; left: 39%; top: 37%; width: 10rem; height: 10rem; display: grid; place-items: center; font: 900 2.4rem var(--jost); color: var(--espresso); }
.studio-seal.settled .piece-one { transform: translate(7%, 18%) rotate(-2deg); }
.studio-seal.settled .piece-two { transform: translate(-8%, -7%) rotate(2deg); }
.studio-seal.settled .piece-three { transform: translate(45%, -12%) rotate(18deg); }
.studio-seal.settled .piece-four { transform: translate(-18%, -38%) rotate(-1deg); }

.bubble-field { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.ambient-bubble { position: absolute; border-radius: 50%; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.22); animation: driftUp linear infinite; }
.cursor-bubble { position: fixed; z-index: 40; width: 4.4rem; height: 4.4rem; border-radius: 50%; pointer-events: none; transform: translate(-50%, -50%); opacity: 0; background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.68), rgba(255,225,184,.22)); border: 1px solid rgba(255,255,255,.45); mix-blend-mode: screen; transition: opacity .2s ease; }
.accession-toast { position: fixed; z-index: 50; left: 50%; bottom: 1rem; transform: translate(-50%, 150%); border-radius: 999px; padding: .85rem 1.2rem; color: var(--espresso); font: 700 .78rem var(--mono); letter-spacing: .08em; max-width: min(46rem, calc(100vw - 2rem)); transition: transform .42s cubic-bezier(.16, 1, .3, 1); }
.accession-toast.show { transform: translate(-50%, 0); }

@keyframes glowDrift { to { transform: translate3d(4vw, -3vh, 0) scale(1.08); } }
@keyframes floatCase { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-12px) rotate(1deg); } }
@keyframes bubbleBob { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-18px) scale(1.04); } }
@keyframes driftUp { from { transform: translateY(105vh) scale(.8); } to { transform: translateY(-20vh) scale(1.15); } }
@keyframes tapTool { 0%,100% { transform: rotate(0deg) translate(0,0); } 45% { transform: rotate(-12deg) translate(-7px, 8px); } 55% { transform: rotate(4deg) translate(3px, -3px); } }
@keyframes sparkBlink { 0%,40% { opacity: .18; transform: scale(.5); } 45%,80% { opacity: 1; transform: scale(1.25); } 100% { opacity: .18; transform: scale(.5); } }
@keyframes inflate { 0%,100% { transform: scale(.42); opacity: .35; } 50% { transform: scale(1.08); opacity: .9; } }
@keyframes stampPress { 0%,100% { transform: translateY(-11px); } 45%,55% { transform: translateY(10px); } }
@keyframes waxPulse { 0%,44% { transform: scale(.65); opacity: .45; } 56%,100% { transform: scale(1.1); opacity: 1; } }
@keyframes runnerGlide { 0%,100% { transform: translateX(-.8rem) rotate(-4deg); opacity: .22; } 50% { transform: translateX(1.2rem) rotate(3deg); opacity: .72; } }
@keyframes labelPop { from { opacity: 0; transform: translateY(-8px) scale(.92); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 860px) {
  .cabinet-scene, .seal-scene { grid-template-columns: 1fr; }
  .wordmark-glass { min-height: auto; }
  .cabinet-stack { min-height: 52rem; }
  .central-relic { left: 4%; width: 80%; }
  .tall-vitrine { right: 0; top: 45%; }
  .specimen-tray { left: 0; width: 82%; }
  .mosaic-grid, .bench-track { grid-template-columns: 1fr; grid-auto-rows: minmax(12rem, auto); }
  .drawer-card, .circle-case, .thermometer, .mask-case { grid-column: auto; grid-row: auto; border-radius: 2rem; }
  .archive-rail { width: calc(100vw - 1rem); overflow-x: auto; justify-content: flex-start; }
}
