:root {
  /* Space Grotesk, IBM Plex Sans, and IBM Plex Mono are loaded via (Google Fonts. */
  --carbon-black: #16120F;
  --graphite-dust: #2B2722;
  --burnt-orange: #C9551B;
  --molten-ochre: #E78A3C;
  --kiln-clay: #8F3F24;
  --ash-cream: #F3E1C8;
  --pale-carbonate: #BCA58E;
  --deep-ember: #5C2A1E;
  --display: "Space Grotesk", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--carbon-black);
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--carbon-black);
  color: var(--ash-cream);
  font-family: var(--body);
  cursor: none;
}

a { color: inherit; text-decoration: none; }

.noise-layer {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: .18;
  mix-blend-mode: soft-light;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(243,225,200,.32) 0 1px, transparent 1.6px),
    radial-gradient(circle at 82% 30%, rgba(231,138,60,.22) 0 1px, transparent 1.8px),
    radial-gradient(circle at 46% 74%, rgba(188,165,142,.20) 0 1px, transparent 1.4px),
    linear-gradient(115deg, transparent, rgba(255,255,255,.06), transparent);
  background-size: 37px 41px, 53px 47px, 29px 31px, 210px 210px;
  animation: grain-drift 7s steps(8) infinite;
}

.cursor-ring {
  position: fixed;
  width: 42px;
  height: 42px;
  margin: -21px 0 0 -21px;
  z-index: 50;
  pointer-events: none;
  border: 1px solid rgba(231,138,60,.64);
  border-radius: 999px;
  box-shadow: 0 0 30px rgba(231,138,60,.18), inset 0 0 18px rgba(231,138,60,.10);
  transform: translate3d(-100px,-100px,0) scale(.82);
  transition: width .35s ease, height .35s ease, margin .35s ease, opacity .35s ease;
  opacity: .78;
}

.cursor-ring.active {
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  opacity: 1;
}

.progress-rail {
  position: fixed;
  top: 50%;
  right: 3vw;
  z-index: 45;
  width: 2px;
  height: 34vh;
  transform: translateY(-50%) rotate(12deg);
  background: rgba(188,165,142,.18);
}

.progress-rail span {
  position: absolute;
  left: -8px;
  width: 18px;
  height: 2px;
  background: var(--pale-carbonate);
  opacity: .35;
  transition: opacity .45s ease, background .45s ease, box-shadow .45s ease;
}

.progress-rail span:nth-child(1) { top: 0; }
.progress-rail span:nth-child(2) { top: 33%; }
.progress-rail span:nth-child(3) { top: 66%; }
.progress-rail span:nth-child(4) { top: 100%; }
.progress-rail span.active { opacity: 1; background: var(--molten-ochre); box-shadow: 0 0 20px var(--molten-ochre); }

.strata { position: relative; }

.scene {
  position: relative;
  min-height: 112vh;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 5rem);
  clip-path: polygon(0 7vw, 100% 0, 100% calc(100% - 7vw), 0 100%);
  margin-top: -8vh;
}

.scene:first-child { margin-top: 0; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9vw), 0 100%); }
.scene::before,
.scene::after {
  content: "";
  position: absolute;
  left: -8vw;
  right: -8vw;
  height: clamp(70px, 10vw, 160px);
  z-index: 1;
  pointer-events: none;
  filter: blur(12px);
  opacity: .65;
}
.scene::before { top: -4vw; transform: rotate(-6deg); }
.scene::after { bottom: -4vw; transform: rotate(-6deg); }

.scene-rest {
  background:
    radial-gradient(circle at 73% 21%, rgba(201,85,27,.20), transparent 34%),
    radial-gradient(circle at 18% 86%, rgba(92,42,30,.42), transparent 42%),
    linear-gradient(155deg, var(--carbon-black), var(--graphite-dust) 58%, #100d0b);
}
.scene-rest::after { background: rgba(43,39,34,.85); box-shadow: inset 0 20px 60px rgba(231,138,60,.12); }

.scene-pressure {
  background:
    radial-gradient(circle at 20% 30%, rgba(231,138,60,.08), transparent 28%),
    linear-gradient(166deg, #201b17 0%, var(--kiln-clay) 52%, var(--deep-ember) 100%);
}
.scene-pressure::before,
.scene-pressure::after { background: rgba(201,85,27,.45); }

.scene-yield {
  background:
    radial-gradient(circle at 50% 55%, rgba(243,225,200,.08), transparent 18%),
    linear-gradient(160deg, var(--graphite-dust), #120f0d 55%, var(--carbon-black));
}
.scene-yield::before,
.scene-yield::after { background: rgba(22,18,15,.88); box-shadow: 0 0 70px rgba(201,85,27,.16); }

.scene-glow {
  min-height: 105vh;
  background:
    radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(231,138,60,.28), transparent 18%),
    linear-gradient(152deg, var(--kiln-clay) 0%, var(--burnt-orange) 48%, var(--deep-ember) 100%);
}
.scene-glow::before { background: rgba(143,63,36,.62); }

.diagonal-guide {
  position: absolute;
  inset: 20vh -10vw auto -10vw;
  height: 1px;
  z-index: 3;
  transform: rotate(-11deg);
  background: linear-gradient(90deg, transparent, rgba(231,138,60,.78), rgba(243,225,200,.16), transparent);
  box-shadow: 0 0 22px rgba(231,138,60,.25);
}

.wordmark-block {
  position: absolute;
  left: clamp(1.4rem, 6vw, 7rem);
  bottom: clamp(7rem, 15vh, 11rem);
  z-index: 5;
  max-width: 72vw;
}

h1, h2 {
  margin: 0;
  font-family: var(--display);
  line-height: .88;
  letter-spacing: -0.045em;
  font-weight: 600;
}

h1 {
  font-size: clamp(4.4rem, 15vw, 16rem);
  text-shadow: 0 18px 54px rgba(0,0,0,.48);
}

h2 { font-size: clamp(3rem, 10vw, 10rem); }

p {
  margin: 0;
  font-size: clamp(1rem, 1.35vw, 1.35rem);
  line-height: 1.55;
  color: var(--pale-carbonate);
}

.fragment {
  margin-top: 1rem;
  color: var(--molten-ochre);
  font-size: clamp(1.5rem, 3vw, 3.2rem);
  letter-spacing: -.03em;
}

.micro,
.scene-label,
.diagonal-copy span {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(243,225,200,.64);
}

.top-label {
  position: absolute;
  top: 15vh;
  left: 8vw;
  z-index: 5;
  transform: rotate(-11deg);
}

.pod, .curve-bulge {
  position: absolute;
  z-index: 4;
  border-radius: 49% 51% 45% 55% / 54% 42% 58% 46%;
  background: radial-gradient(circle at 35% 30%, #E78A3C 0%, #C9551B 34%, #5C2A1E 70%, #16120F 100%);
  box-shadow:
    inset 24px 28px 54px rgba(243,225,200,.13),
    inset -38px -48px 78px rgba(22,18,15,.66),
    0 42px 110px rgba(0,0,0,.56),
    0 0 96px rgba(231,138,60,.20);
  transform-style: preserve-3d;
  transition: filter .5s ease, transform .7s cubic-bezier(.2,.8,.2,1);
}

.pod::before, .curve-bulge::before {
  content: "";
  position: absolute;
  inset: 12% 14% auto 18%;
  height: 26%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(243,225,200,.24), transparent 68%);
  filter: blur(7px);
  transform: rotate(-15deg);
}

.pod-ember {
  width: clamp(220px, 30vw, 520px);
  height: clamp(170px, 23vw, 400px);
  right: clamp(1rem, 8vw, 10rem);
  top: clamp(4rem, 10vh, 8rem);
  animation: breathe 7.5s ease-in-out infinite;
}

.pod-dimple {
  position: absolute;
  right: 23%;
  bottom: 28%;
  width: 22%;
  height: 18%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(22,18,15,.58), rgba(92,42,30,.12) 58%, transparent 70%);
  filter: blur(3px);
}

.flow-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  opacity: .38;
  transform: rotate(-5deg) scale(1.1);
}
.flow-lines path {
  fill: none;
  stroke: rgba(188,165,142,.42);
  stroke-width: 1.4;
  stroke-dasharray: 7 13;
  animation: flow 18s linear infinite;
}

.soft-seam {
  position: absolute;
  z-index: 3;
  width: 145vw;
  height: 90px;
  left: -20vw;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(243,225,200,.08), rgba(22,18,15,.32), transparent);
  transform: rotate(-12deg);
  filter: blur(9px);
}
.seam-a { top: 29vh; }
.seam-b { top: 63vh; }

.corridor {
  position: absolute;
  top: 35vh;
  left: 7vw;
  right: 10vw;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: clamp(1rem, 3vw, 3rem);
  transform: rotate(-12deg);
}
.corridor span { color: var(--ash-cream); }

.material-note {
  position: absolute;
  z-index: 5;
  right: 9vw;
  bottom: 15vh;
  width: min(520px, 72vw);
  transform: rotate(-4deg);
}
.material-note p:last-child, .yield-text p:last-child, .stamp-label p { margin-top: 1.4rem; }

.left-bulge {
  width: clamp(390px, 45vw, 760px);
  height: clamp(520px, 66vh, 820px);
  left: -24vw;
  top: 7vh;
  background: radial-gradient(circle at 62% 32%, #BCA58E 0%, #2B2722 22%, #16120F 62%, #0d0a08 100%);
  transform: perspective(900px) rotateY(18deg) rotateZ(-7deg);
}
.right-bulge {
  width: clamp(360px, 43vw, 700px);
  height: clamp(480px, 60vh, 780px);
  right: -22vw;
  bottom: 0;
  background: radial-gradient(circle at 34% 28%, #E78A3C 0%, #8F3F24 27%, #5C2A1E 59%, #16120F 100%);
  transform: perspective(900px) rotateY(-18deg) rotateZ(-9deg);
}

.tunnel-shadow {
  position: absolute;
  inset: 18vh 18vw 12vh 18vw;
  z-index: 3;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(22,18,15,.16), rgba(0,0,0,.44) 70%, transparent 72%);
  filter: blur(20px);
}

.yield-text {
  position: absolute;
  z-index: 6;
  width: min(670px, 78vw);
  left: 28vw;
  top: 33vh;
  transform: rotate(-8deg);
}

.glow-plane {
  position: absolute;
  inset: 9vh 8vw;
  z-index: 2;
  border-radius: 52% 48% 45% 55% / 46% 48% 52% 54%;
  background: radial-gradient(circle at 45% 38%, rgba(243,225,200,.18), rgba(231,138,60,.14) 24%, rgba(92,42,30,.15) 55%, transparent 72%);
  box-shadow: inset 0 0 90px rgba(243,225,200,.08), 0 0 100px rgba(92,42,30,.24);
  filter: blur(1px);
}

.stamp-label {
  position: absolute;
  z-index: 6;
  left: 10vw;
  bottom: 17vh;
  max-width: 760px;
  transform: rotate(-6deg);
}

.material-stamp {
  display: inline-block;
  margin-top: 2rem;
  padding: .85rem 1.2rem;
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ash-cream);
  border: 1px solid rgba(243,225,200,.38);
  border-radius: 999px;
  background: rgba(22,18,15,.18);
  box-shadow: inset 0 0 22px rgba(243,225,200,.07), 0 18px 48px rgba(22,18,15,.22);
}

.ripple-field {
  position: absolute;
  left: calc(var(--rx, 50) * 1%);
  top: calc(var(--ry, 50) * 1%);
  z-index: 1;
  width: 2px;
  height: 2px;
  pointer-events: none;
}
.ripple-field::before, .ripple-field::after {
  content: "";
  position: absolute;
  width: 58vw;
  height: 58vw;
  min-width: 360px;
  min-height: 360px;
  border-radius: 49% 51% 47% 53%;
  border: 1px solid rgba(231,138,60,.28);
  transform: translate(-50%, -50%) rotate(-12deg) scale(.1);
  opacity: 0;
}
.scene.in-view .ripple-field::before { animation: slow-ripple 5.8s ease-out .25s forwards; }
.scene.in-view .ripple-field::after { animation: slow-ripple 6.8s ease-out 1.1s forwards; border-color: rgba(243,225,200,.18); }

.is-drifting {
  opacity: 0;
  transform: translate3d(-4vw, 4vw, 0) rotate(-12deg);
  transition: opacity 1.2s ease, transform 1.4s cubic-bezier(.17,.67,.22,1);
}
.scene.in-view .is-drifting { opacity: 1; transform: translate3d(0,0,0) rotate(var(--drift-rotate, -12deg)); }

@keyframes grain-drift {
  0% { transform: translate(0,0); }
  25% { transform: translate(-2%,1%); }
  50% { transform: translate(1%,-2%); }
  75% { transform: translate(2%,2%); }
  100% { transform: translate(0,0); }
}
@keyframes breathe {
  0%, 100% { transform: perspective(900px) rotateX(7deg) rotateY(-12deg) scale(1); }
  50% { transform: perspective(900px) rotateX(3deg) rotateY(-7deg) scale(1.035); }
}
@keyframes flow { to { stroke-dashoffset: -160; } }
@keyframes slow-ripple {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(-12deg) scale(.08); filter: blur(0); }
  16% { opacity: .8; }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(-12deg) scale(1.35); filter: blur(5px); }
}

@media (max-width: 760px) {
  body { cursor: auto; }
  .cursor-ring { display: none; }
  .scene { min-height: 105vh; padding: 2rem; }
  .corridor { grid-template-columns: 1fr; top: 22vh; transform: rotate(-8deg); }
  .material-note { left: 10vw; right: auto; bottom: 12vh; }
  .yield-text { left: 12vw; top: 35vh; }
  .left-bulge { left: -55vw; }
  .right-bulge { right: -55vw; }
  .progress-rail { right: 1.2rem; }
}
