/* === Custom Properties === */
:root {
  --brushed-chrome: #E0E0E8;
  --deep-chrome: #3A3A44;
  --liquid-mercury: #B8B8C4;
  --charcoal-depth: #2C2C34;
  --petal-silver: #D4D4DC;
  --muted-rose: #9E7B82;
  --watercolor-blush: #C4A0A8;
  --greenhouse-blue: #8898AC;
  --ink-wash: #3E3E48;
}

/* === Reset === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-snap-type: y proximity;
  font-size: 16px;
}

body {
  background: var(--brushed-chrome);
  color: var(--ink-wash);
  font-family: 'Crimson Pro', Georgia, serif;
  font-weight: 300;
  font-size: clamp(1rem, 1.2vw, 1.25rem);
  line-height: 1.75;
  overflow-x: hidden;
}

/* === Typography === */
.section-heading {
  font-family: 'Abril Fatface', Georgia, serif;
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 4rem);
  letter-spacing: 0.05em;
  line-height: 1.15;
  color: var(--deep-chrome);
  margin-bottom: 1.5rem;
}

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }
em { font-style: italic; }

/* === Rooms === */
.room {
  position: relative;
  scroll-snap-align: start;
}

/* === THE ATRIUM === */
.atrium {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: var(--brushed-chrome);
  overflow: hidden;
}

.pomegranate {
  width: clamp(280px, 60vw, 600px);
  height: auto;
  position: relative;
  z-index: 1;
}

.draw-path {
  stroke-dasharray: 800;
  stroke-dashoffset: 800;
  animation: drawIn 3s ease-out forwards;
}

.seed {
  animation-delay: 1.5s;
}

@keyframes drawIn {
  to { stroke-dashoffset: 0; }
}

.atrium-title {
  font-family: 'Abril Fatface', Georgia, serif;
  font-weight: 400;
  font-size: clamp(3rem, 8vw, 8rem);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--deep-chrome);
  mix-blend-mode: multiply;
  text-shadow: 0 2px 8px rgba(184, 184, 196, 0.5);
  position: relative;
  z-index: 2;
  margin-top: -2rem;
}

/* === THE LEDGER GARDEN === */
.ledger-garden {
  min-height: 150vh;
  background: linear-gradient(180deg, var(--brushed-chrome) 0%, var(--liquid-mercury) 100%);
  padding: clamp(4rem, 8vw, 8rem) clamp(2rem, 5vw, 6rem);
  position: relative;
  overflow: hidden;
}

.parallax-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.bg-botanical {
  position: absolute;
  width: 400px;
  height: 600px;
  top: 10%;
  left: 10%;
  opacity: 0.3;
}

.garden-panels {
  max-width: 680px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.glass-panel {
  background: rgba(224, 224, 232, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 2px solid var(--liquid-mercury);
  border-radius: 4px;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.glass-panel.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Floating specimens */
.floating-specimen {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  animation: floatDrift 20s ease-in-out infinite;
}

.spec-1 {
  width: 120px;
  top: 20%;
  right: 8%;
  animation-delay: -5s;
}

.spec-2 {
  width: 100px;
  top: 55%;
  left: 5%;
  animation-delay: -12s;
}

@keyframes floatDrift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(15px, -10px) rotate(0.5deg); }
  50% { transform: translate(-10px, 5px) rotate(-0.3deg); }
  75% { transform: translate(8px, 12px) rotate(0.4deg); }
}

/* === THE EXCHANGE FLOOR === */
.exchange-floor {
  min-height: 120vh;
  background: linear-gradient(180deg, var(--liquid-mercury) 0%, var(--brushed-chrome) 100%);
  padding: clamp(4rem, 8vw, 8rem) clamp(2rem, 5vw, 6rem);
}

.exchange-heading {
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.exchange-heading.revealed {
  opacity: 1;
  transform: translateY(0);
}

.chrome-panels {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(1.5rem, 3vw, 3rem);
  margin-top: 3rem;
}

.chrome-panel {
  width: clamp(260px, 30%, 340px);
  background: var(--brushed-chrome);
  border: 1px solid var(--liquid-mercury);
  border-radius: 4px;
  padding: clamp(1.2rem, 2vw, 2rem);
  box-shadow: 0 4px 24px rgba(44, 44, 52, 0.15);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms ease, transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chrome-panel.revealed {
  opacity: 1;
  transform: translateY(0);
}

.tilt-right { transform: rotate(2deg) translateY(20px); }
.tilt-left { transform: rotate(-2deg) translateY(20px); }
.tilt-right.revealed { transform: rotate(2deg) translateY(0); }
.tilt-left.revealed { transform: rotate(-2deg) translateY(0); }

.chrome-panel:hover {
  transform: rotate(0deg) translateY(-4px);
  box-shadow: 0 8px 32px rgba(44, 44, 52, 0.2);
}

.panel-botanical {
  width: 100%;
  max-width: 200px;
  height: auto;
  display: block;
  margin: 0 auto 1rem;
}

.panel-label {
  font-family: 'Noto Serif Display', Georgia, serif;
  font-style: italic;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-rose);
  margin-bottom: 0.5rem;
}

.panel-text {
  font-size: 0.95rem;
  color: var(--ink-wash);
}

/* Ripple on click */
.chrome-panel { position: relative; overflow: hidden; cursor: default; }
.chrome-panel .ripple {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, var(--watercolor-blush), transparent 70%);
  width: 10px;
  height: 10px;
  opacity: 0.6;
  transform: scale(0);
  animation: rippleExpand 0.8s ease-out forwards;
  pointer-events: none;
}

@keyframes rippleExpand {
  to { transform: scale(8); opacity: 0; }
}

/* === THE ARCHIVE === */
.archive {
  min-height: 120vh;
  background: var(--brushed-chrome);
  /* Paper grain */
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(62, 62, 72, 0.015) 3px,
    rgba(62, 62, 72, 0.015) 4px
  );
  padding: clamp(4rem, 8vw, 8rem) clamp(2rem, 5vw, 4rem);
  position: relative;
}

.archive-column {
  max-width: 38rem;
  margin: 0 auto;
  padding: 2rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.archive-column.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Margin specimens */
.margin-spec {
  position: absolute;
  opacity: 0;
  transition: opacity 600ms ease 200ms;
  text-align: center;
}

.margin-spec.revealed { opacity: 1; }

.margin-spec svg {
  display: block;
  margin: 0 auto;
}

.m-spec-1 {
  top: 20%;
  right: clamp(2rem, 8vw, 10rem);
  width: 80px;
}

.m-spec-2 {
  top: 55%;
  left: clamp(2rem, 8vw, 10rem);
  width: 60px;
}

.spec-label {
  font-family: 'Noto Serif Display', Georgia, serif;
  font-style: italic;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-rose);
  display: block;
  margin-top: 0.5rem;
}

/* === THE ROOT SYSTEM === */
.root-system {
  min-height: 100vh;
  background: linear-gradient(180deg, var(--brushed-chrome) 0%, var(--charcoal-depth) 30%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: clamp(3rem, 6vw, 6rem);
  position: relative;
  overflow: hidden;
}

.mycelium {
  position: absolute;
  bottom: 0;
  width: 100%;
  max-width: 800px;
  height: auto;
  z-index: 0;
}

.root-path {
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  transition: stroke-dashoffset 2500ms ease-out;
}

.root-system.active .root-path {
  stroke-dashoffset: 0;
}

.specimen-label {
  position: relative;
  z-index: 2;
  text-align: center;
  border: 1px solid var(--liquid-mercury);
  padding: 1rem 2rem;
  background: rgba(44, 44, 52, 0.6);
}

.label-text {
  font-family: 'Noto Serif Display', Georgia, serif;
  font-style: italic;
  font-size: clamp(1rem, 2vw, 1.4rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-rose);
  display: block;
}

.label-sub {
  font-family: 'Crimson Pro', serif;
  font-size: 0.85rem;
  color: var(--petal-silver);
  display: block;
  margin-top: 0.5rem;
  letter-spacing: 0.05em;
}

/* Chrome scanlines */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(184, 184, 196, 0.03) 3px,
    rgba(184, 184, 196, 0.03) 4px
  );
  animation: scanPulse 8s ease-in-out infinite;
}

@keyframes scanPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

/* === Responsive === */
@media (max-width: 768px) {
  .chrome-panels {
    flex-direction: column;
    align-items: center;
  }

  .chrome-panel {
    width: 100%;
    max-width: 400px;
  }

  .tilt-right, .tilt-left,
  .tilt-right.revealed, .tilt-left.revealed {
    transform: rotate(0deg) translateY(0);
  }

  .floating-specimen { display: none; }
  .margin-spec { display: none; }

  html { scroll-snap-type: none; }
}
