:root {
  /* IBM Plex Mono` for tiny coordinates marginalia in weight 500. */
  --orchid: #E84BFF;
  --marigold: #FFB23E;
  --coral: #FF6B4A;
  --paper: #E8C98F;
  --plum: #311225;
  --night: #100B13;
  --rose: #C98278;
  --botanical: #1F5E43;
  --progress: 0;
  --grain-x: 50%;
  --grain-y: 50%;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: #100B13;
  color: #E8C98F;
  font-family: "Quicksand", sans-serif;
  overflow-x: hidden;
}

.fixed-sky {
  position: fixed;
  inset: 0;
  z-index: -4;
  background:
    radial-gradient(circle at 50% 105%, rgba(255, 107, 74, 0.48), transparent 42%),
    radial-gradient(circle at 0% 18%, rgba(232, 75, 255, 0.2), transparent 32%),
    radial-gradient(circle at 100% 62%, rgba(255, 178, 62, 0.12), transparent 30%),
    linear-gradient(150deg, #100B13 0%, #311225 46%, #100B13 100%);
}

.scan-haze, .grain-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scan-haze {
  background: repeating-linear-gradient(0deg, transparent 0 22px, rgba(255, 178, 62, 0.035) 23px, transparent 25px);
  animation: scanDrift 18s linear infinite;
}

.grain-field {
  opacity: 0.35;
  background:
    radial-gradient(circle at var(--grain-x) var(--grain-y), rgba(232, 201, 143, 0.14), transparent 4px),
    radial-gradient(circle at 30% 70%, rgba(201, 130, 120, 0.16), transparent 2px),
    repeating-radial-gradient(circle at 35% 25%, rgba(232, 201, 143, 0.045) 0 1px, transparent 1px 7px);
  mix-blend-mode: screen;
}

.marginal-tabs {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: grid;
  gap: 10px;
}

.marginal-tabs a {
  color: #E8C98F;
  text-decoration: none;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  writing-mode: vertical-rl;
  padding: 8px 5px;
  border: 1px solid rgba(255, 178, 62, 0.25);
  background: rgba(16, 11, 19, 0.46);
  transition: color 400ms ease, border-color 400ms ease, box-shadow 400ms ease;
}

.marginal-tabs a:hover { color: #FFB23E; border-color: #FF6B4A; box-shadow: 0 0 18px rgba(232, 75, 255, 0.24); }

.trellis-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 400vh;
  z-index: -1;
  pointer-events: none;
  opacity: 0.72;
}

.vine, .trace {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.vine {
  stroke: #1F5E43;
  stroke-width: 8;
  opacity: 0.55;
}

.trace {
  stroke: #FF6B4A;
  stroke-width: 3;
  stroke-dasharray: 24 900;
  stroke-dashoffset: calc(700px - (var(--progress) * 700px));
  filter: url(#softGlow);
}

.nodes circle {
  fill: #FFB23E;
  opacity: calc(0.35 + (var(--progress) * 0.65));
  filter: url(#softGlow);
}

.section {
  min-height: 100vh;
  position: relative;
  display: grid;
  place-items: center;
  padding: 8vh clamp(22px, 5vw, 80px);
  perspective: 1100px;
}

.paper-panel {
  position: relative;
  width: min(980px, 88vw);
  min-height: 62vh;
  padding: clamp(34px, 6vw, 76px);
  background:
    radial-gradient(circle at 16% 24%, rgba(201, 130, 120, 0.34), transparent 19%),
    radial-gradient(circle at 82% 72%, rgba(31, 94, 67, 0.18), transparent 22%),
    repeating-linear-gradient(92deg, rgba(49, 18, 37, 0.05) 0 1px, transparent 1px 18px),
    #E8C98F;
  color: #311225;
  clip-path: polygon(2% 4%, 96% 0%, 100% 92%, 92% 99%, 4% 96%, 0% 16%);
  box-shadow: 0 38px 80px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(255, 178, 62, 0.24), 0 0 42px rgba(232, 75, 255, 0.13);
  transform-style: preserve-3d;
  transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) translateZ(0);
  transition: transform 850ms cubic-bezier(.18,.9,.22,1), box-shadow 600ms ease, opacity 700ms ease;
  overflow: hidden;
}

.paper-panel::before, .paper-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.paper-panel::before {
  background:
    radial-gradient(circle at 24% 60%, rgba(49, 18, 37, 0.12), transparent 3px),
    radial-gradient(circle at 70% 20%, rgba(49, 18, 37, 0.09), transparent 5px),
    repeating-radial-gradient(circle at 60% 50%, rgba(16, 11, 19, 0.04) 0 1px, transparent 1px 9px);
  mix-blend-mode: multiply;
}

.paper-panel::after {
  border: 1px solid rgba(255, 107, 74, 0.5);
  clip-path: inherit;
  box-shadow: inset 0 0 30px rgba(255, 107, 74, 0.22), inset 0 0 90px rgba(16, 11, 19, 0.17);
}

.paper-panel.is-visible { animation: paperLift 950ms cubic-bezier(.2,.95,.18,1) both; }

.gate-panel { width: min(1120px, 92vw); min-height: 70vh; display: flex; flex-direction: column; justify-content: center; }

.eyebrow, .coord, .mono {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.eyebrow { color: #1F5E43; font-size: clamp(11px, 1.2vw, 14px); margin: 0 0 18px; }

h1, h2 {
  font-family: "Nunito Sans", sans-serif;
  font-weight: 900;
  line-height: 0.9;
  margin: 0;
  letter-spacing: 0.025em;
}

h1 {
  font-size: clamp(58px, 14vw, 176px);
  color: #311225;
  text-shadow: 2px 2px 0 rgba(255, 107, 74, 0.22), -2px 0 0 rgba(232, 75, 255, 0.16);
  transform: translateZ(42px);
}

h2 { font-size: clamp(42px, 8vw, 108px); color: #311225; max-width: 760px; }

.thin-line, .fragment {
  font-size: clamp(19px, 2.5vw, 31px);
  line-height: 1.35;
  max-width: 680px;
  color: rgba(49, 18, 37, 0.82);
  margin: 30px 0 0;
  font-weight: 500;
}

.fragment.large { font-size: clamp(26px, 4.6vw, 58px); max-width: 840px; }

.coord {
  position: absolute;
  font-size: 10px;
  color: #311225;
  background: rgba(255, 178, 62, 0.35);
  padding: 7px 9px;
  z-index: 3;
  animation: coordFlicker 5s steps(2, end) infinite;
}

.top-left { left: 24px; top: 22px; }
.top-right { right: 24px; top: 22px; }
.bottom-right { right: 28px; bottom: 28px; }

.registration {
  position: absolute;
  width: 42px;
  height: 42px;
  border-color: #E84BFF;
  opacity: 0.75;
  filter: drop-shadow(0 0 9px rgba(232,75,255,.55));
}

.reg-a { right: 58px; top: 58px; border-top: 2px solid; border-right: 2px solid; }
.reg-b { left: 58px; bottom: 58px; border-left: 2px solid; border-bottom: 2px solid; }

.petal {
  position: absolute;
  background: rgba(201, 130, 120, 0.35);
  border: 1px solid rgba(255, 107, 74, 0.25);
  clip-path: ellipse(38% 50% at 50% 50%);
  mix-blend-mode: multiply;
  animation: petalDrift 9s ease-in-out infinite alternate;
}

.petal-a { width: 190px; height: 68px; left: 18%; top: 31%; transform: rotate(-24deg); }
.petal-b { width: 250px; height: 86px; right: 10%; top: 43%; transform: rotate(18deg); animation-delay: -2s; }
.petal-c { width: 150px; height: 58px; left: 54%; bottom: 19%; transform: rotate(-8deg); animation-delay: -5s; }

.botanical-shadow {
  position: absolute;
  width: 42vw;
  height: 58vh;
  background: #1F5E43;
  opacity: 0.16;
  filter: blur(1px);
  clip-path: polygon(50% 0, 58% 28%, 78% 8%, 67% 38%, 100% 35%, 69% 52%, 88% 78%, 58% 63%, 50% 100%, 42% 63%, 12% 78%, 31% 52%, 0 35%, 33% 38%, 22% 8%, 42% 28%);
}

.leaf-one { left: -10vw; top: 18vh; transform: rotate(18deg); }
.leaf-two { right: -12vw; top: 12vh; transform: rotate(-22deg); }

.specimen-stack { margin-top: 44px; display: grid; gap: 22px; }

.strip {
  position: relative;
  width: min(760px, 100%);
  padding: 24px 28px;
  background: rgba(232, 201, 143, 0.78);
  border: 1px solid rgba(49, 18, 37, 0.15);
  box-shadow: 16px 18px 35px rgba(49, 18, 37, 0.22), 0 0 20px rgba(255, 107, 74, 0.12);
  transform-style: preserve-3d;
  transform: rotate(-2deg) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: transform 700ms cubic-bezier(.18,.9,.22,1);
  clip-path: polygon(0 12%, 96% 0, 100% 83%, 5% 100%);
}

.strip-offset { margin-left: clamp(20px, 8vw, 120px); transform: rotate(2deg) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)); }
.strip-deep { margin-left: clamp(6px, 4vw, 70px); transform: rotate(-1deg) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)); }
.strip p { margin: 8px 0 0; font-size: clamp(22px, 3.2vw, 42px); color: #311225; }
.mono { color: #1F5E43; font-size: 11px; }

.trellis-panel { margin-left: auto; width: min(820px, 88vw); }
.archive-panel { min-height: 66vh; background: radial-gradient(circle at 50% 100%, rgba(255,178,62,.32), transparent 44%), #E8C98F; }

.flower-circuit {
  position: relative;
  margin-top: 58px;
  width: min(460px, 85%);
  height: 150px;
  border-top: 2px solid rgba(255, 107, 74, 0.65);
  border-right: 2px solid rgba(232, 75, 255, 0.32);
}

.flower-circuit span {
  position: absolute;
  width: 34px;
  height: 34px;
  background: #C98278;
  border-radius: 50% 2% 50% 2%;
  box-shadow: 0 0 0 2px rgba(31, 94, 67, 0.2), 0 0 18px rgba(255, 107, 74, 0.28);
}

.flower-circuit span:nth-child(1){ left: 8%; top: -18px; }
.flower-circuit span:nth-child(2){ left: 28%; top: 54px; transform: rotate(45deg); }
.flower-circuit span:nth-child(3){ left: 50%; top: -18px; transform: rotate(90deg); }
.flower-circuit span:nth-child(4){ left: 72%; top: 88px; transform: rotate(135deg); }
.flower-circuit span:nth-child(5){ right: -16px; top: -18px; transform: rotate(180deg); }

.note-line {
  height: 2px;
  width: 72%;
  background: linear-gradient(90deg, #1F5E43, transparent);
  margin-top: 56px;
}
.note-line.short { width: 38%; margin-top: 18px; background: linear-gradient(90deg, #FF6B4A, transparent); }

@keyframes scanDrift { from { transform: translateY(-40px); } to { transform: translateY(40px); } }
@keyframes paperLift { from { opacity: 0; transform: translateY(52px) rotateX(8deg) rotateY(-4deg); } to { opacity: 1; transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)); } }
@keyframes coordFlicker { 0%, 87%, 100% { opacity: .95; } 88%, 91% { opacity: .35; } }
@keyframes petalDrift { from { translate: 0 0; } to { translate: 9px -7px; } }

@media (max-width: 720px) {
  .marginal-tabs { display: none; }
  .section { padding: 7vh 18px; }
  .paper-panel { width: 94vw; min-height: 70vh; padding: 46px 24px; }
  .coord { font-size: 8px; }
  .strip-offset, .strip-deep { margin-left: 0; }
}
