:root {
  --chrome-light: #D4D4D8;
  --chrome-mid: #A1A1AA;
  --gunmetal: #2A2A2E;
  --deep-black: #18181B;
  --paper-white: #FAFAF9;
  --dopamine-pink: #FF2D78;
  --dopamine-yellow: #FFD60A;
  --scholarly-blue: #3B82F6;
  --border-light: #E4E4E7;
  --border-dark: #8A8A90;
  --annotation-light: #7A7A80;
  --annotation-dark: #A8A8B0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Spectral', serif;
  background: var(--gunmetal);
  color: var(--deep-black);
  line-height: 1.75;
  overflow-x: hidden;
}

main {
  width: 100%;
}

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ================================
   NAVIGATION
   ================================ */
.nav-toggle {
  position: fixed;
  top: 2rem;
  right: 2rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #D4D4D8 0%, #A1A1AA 100%);
  border: 1px solid var(--border-light);
  border-bottom-color: var(--border-dark);
  cursor: pointer;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.nav-toggle:hover {
  transform: scale(1.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 0 16px rgba(255, 45, 120, 0.25);
}

.nav-toggle.active {
  background: linear-gradient(135deg, #E4E4E7 0%, #D4D4D8 100%);
}

.nav-toggle-dot {
  width: 6px;
  height: 6px;
  background: var(--deep-black);
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.nav-toggle.active .nav-toggle-dot {
  transform: scale(0.7);
  background: var(--dopamine-pink);
}

.nav-menu {
  position: fixed;
  top: 5.5rem;
  right: 2rem;
  background: var(--paper-white);
  border: 1px solid var(--chrome-mid);
  border-radius: 4px;
  padding: 0.5rem 0;
  display: flex;
  flex-direction: column;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.nav-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-link {
  padding: 0.6rem 1.2rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--deep-black);
  text-decoration: none;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.2s ease, color 0.2s ease;
  letter-spacing: 0.02em;
}

.nav-link:last-child {
  border-bottom: none;
}

.nav-link:hover {
  background: #f5f5f5;
  color: var(--dopamine-pink);
}

/* ================================
   SECTIONS (BASE)
   ================================ */
.section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 2rem;
  position: relative;
  overflow: hidden;
}

/* ================================
   DIAGONAL CONTAINERS
   ================================ */
.diagonal-container {
  width: 100%;
  max-width: 1000px;
  padding: 5rem 4rem;
  position: relative;
  background: var(--paper-white);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-dark);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.33, 1, 0.68, 1), transform 0.6s cubic-bezier(0.33, 1, 0.68, 1);
}

.diagonal-container.revealed {
  opacity: 1;
  transform: translateY(0);
}

.diagonal-right-to-left {
  clip-path: polygon(0% 0%, 100% 6%, 100% 100%, 0% 94%);
}

.diagonal-left-to-right {
  clip-path: polygon(0% 6%, 100% 0%, 100% 94%, 0% 100%);
}

.folio-corner {
  position: absolute;
  top: 2rem;
  right: 2.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--annotation-light);
  letter-spacing: 0.05em;
}

.folio-corner-light {
  color: var(--annotation-dark);
}

/* ================================
   SECTION 1: THE STAMP (HERO)
   ================================ */
.stamp-section {
  background: linear-gradient(135deg, #D4D4D8 0%, #A1A1AA 40%, #D4D4D8 60%, #E4E4E7 100%);
  perspective: 1200px;
  min-height: 100vh;
  position: relative;
}

.noise-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  filter: url(#noise);
  opacity: 0.04;
  pointer-events: none;
  z-index: 1;
}

.reflection-gradient {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at 30% 30%, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
  pointer-events: none;
  z-index: 2;
}

.stamp-container {
  text-align: center;
  transform: perspective(1200px) rotateX(1.5deg);
  position: relative;
  z-index: 3;
}

.skeleton-shimmer {
  position: absolute;
  top: -20px;
  left: -40px;
  right: -40px;
  bottom: -20px;
  background: linear-gradient(90deg, #C0C0C0 0%, #E8E8E8 50%, #C0C0C0 100%);
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out forwards;
  border-radius: 4px;
  z-index: 10;
  pointer-events: none;
}

@keyframes shimmer {
  0% {
    opacity: 1;
    background-position: -200% 0;
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    background-position: 200% 0;
  }
}

.stamp-content {
  position: relative;
  z-index: 5;
}

.stamp-title {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(4rem, 12vw, 12rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--deep-black);
  margin: 0 0 1.5rem 0;
  line-height: 0.95;
  text-shadow:
    1px 1px 0 rgba(255, 255, 255, 0.3),
    -1px -1px 0 rgba(0, 0, 0, 0.08);
}

.stamp-subtitle {
  font-family: 'Spectral', serif;
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  font-style: italic;
  color: #4A4A52;
  margin: 0;
  letter-spacing: 0.01em;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.stamp-diagonal-cut {
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 80px;
  background: var(--gunmetal);
  clip-path: polygon(0% 60%, 100% 0%, 100% 100%, 0% 100%);
  z-index: 4;
}

/* ================================
   SUBSTRATE STRIPS
   ================================ */
.substrate-strip {
  background: var(--gunmetal);
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  border-top: 1px solid #1A1A1F;
  border-bottom: 1px solid #3A3A3E;
  position: relative;
  gap: 2rem;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 20px 20px;
}

.folio-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--annotation-light);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.strip-annotation {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: #555560;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.bar-fragment-strip {
  margin-left: auto;
  width: 200px;
  height: 20px;
  flex-shrink: 0;
}

.bar-fragment-strip svg {
  width: 100%;
  height: 100%;
}

/* ================================
   SECTION 2: THE INDEX
   ================================ */
.index-section {
  background: linear-gradient(135deg, #D4D4D8 0%, #A1A1AA 40%, #D4D4D8 60%, #E4E4E7 100%);
  margin-top: -10vh;
  padding-top: 14vh;
}

.section-heading {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.6rem, 4vw, 3.5rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 2.5rem;
}

.section-heading-dark {
  color: var(--deep-black);
}

.section-heading-light {
  color: var(--paper-white);
}

.specimen-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}

.specimen-card {
  background: var(--paper-white);
  border: 1px solid var(--chrome-mid);
  border-radius: 4px;
  padding: 2rem 1.5rem;
  text-align: center;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.specimen-card.card-visible {
  opacity: 1;
  transform: translateY(0);
}

.specimen-visual {
  width: 140px;
  height: 130px;
  margin: 0 auto 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.specimen-visual svg {
  width: 100%;
  height: 100%;
}

.specimen-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--deep-black);
  margin-bottom: 0.4rem;
}

.specimen-desc {
  font-family: 'Spectral', serif;
  font-size: 0.9rem;
  color: #5A5A64;
  line-height: 1.6;
  margin-bottom: 0.8rem;
}

.specimen-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--annotation-light);
  letter-spacing: 0.04em;
  display: block;
}

/* ================================
   SECTION 3: THE ANNOTATION
   ================================ */
.annotation-section {
  background: linear-gradient(135deg, #D4D4D8 0%, #A1A1AA 40%, #D4D4D8 60%, #E4E4E7 100%);
  margin-top: -10vh;
  padding-top: 14vh;
}

.annotation-container {
  background: var(--paper-white);
}

.annotation-layout {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
}

.margin-annotations {
  flex-shrink: 0;
  width: 180px;
  display: flex;
  flex-direction: column;
  gap: 3rem;
  padding-top: 1rem;
}

.margin-note {
  font-family: 'Spectral', serif;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--dopamine-pink);
  line-height: 1.5;
  transform: rotate(-2deg);
  border-bottom: 1px solid rgba(255, 45, 120, 0.3);
  padding-bottom: 0.3rem;
  display: block;
}

.text-block-wide {
  flex: 1;
  max-width: 600px;
}

.text-block-wide p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  color: var(--deep-black);
}

.pull-quote {
  border-left: 4px solid var(--dopamine-pink);
  padding-left: 2rem;
  margin: 2.5rem 0;
}

.pull-quote p {
  font-size: clamp(1.3rem, 2.5vw, 2rem);
  font-style: italic;
  color: var(--deep-black);
  line-height: 1.55;
  margin-bottom: 0.8rem;
}

.pull-quote-attribution {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--annotation-light);
  font-style: normal;
  display: block;
}

/* ================================
   SECTION 4: THE NETWORK
   ================================ */
.network-section {
  background: var(--gunmetal);
  margin-top: -10vh;
  padding-top: 14vh;
}

.network-diagonal {
  background: var(--gunmetal);
  border-top-color: #3A3A3E;
  border-bottom-color: #1A1A1F;
}

.network-viz-container {
  display: flex;
  justify-content: center;
  padding: 2rem 0;
}

.dendritic-large {
  width: 100%;
  max-width: 600px;
}

.draw-line {
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
}

.draw-line.animate {
  animation: drawLine 2s ease-in-out forwards;
}

.draw-line.animate[data-depth="0"] { animation-delay: 0s; }
.draw-line.animate[data-depth="1"] { animation-delay: 0.4s; }
.draw-line.animate[data-depth="2"] { animation-delay: 0.9s; }
.draw-line.animate[data-depth="3"] { animation-delay: 1.4s; }

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

.node-pulse {
  animation: nodePulse 2.5s ease-in-out infinite;
  animation-play-state: paused;
}

.node-pulse.animate {
  animation-play-state: running;
}

@keyframes nodePulse {
  0%, 100% {
    opacity: 1;
    r: 4;
  }
  50% {
    opacity: 0.5;
    r: 6;
  }
}

/* ================================
   SECTION 5: THE COLOPHON
   ================================ */
.colophon-section {
  background: linear-gradient(135deg, #D4D4D8 0%, #A1A1AA 40%, #D4D4D8 60%, #E4E4E7 100%);
  margin-top: -10vh;
  padding-top: 14vh;
  padding-bottom: 8vh;
}

.colophon-diagonal {
  background: var(--paper-white);
}

.colophon-text {
  text-align: center;
  max-width: 550px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.colophon-body {
  font-size: clamp(1rem, 1.15vw, 1.15rem);
  margin-bottom: 1.5rem;
  color: var(--deep-black);
  line-height: 1.8;
}

.colophon-mark {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--annotation-light);
  letter-spacing: 0.08em;
  margin-top: 2rem;
  display: block;
}

.background-scatter {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  height: 250px;
  opacity: 0.12;
  z-index: 1;
  pointer-events: none;
}

.scatter-bg {
  width: 100%;
  height: 100%;
}

/* ================================
   RESPONSIVE
   ================================ */
@media (max-width: 768px) {
  .section {
    padding: 4rem 1.5rem;
  }

  .diagonal-container {
    padding: 3.5rem 2rem;
  }

  .diagonal-right-to-left {
    clip-path: polygon(0% 0%, 100% 3%, 100% 100%, 0% 97%);
  }

  .diagonal-left-to-right {
    clip-path: polygon(0% 3%, 100% 0%, 100% 97%, 0% 100%);
  }

  .specimen-grid {
    grid-template-columns: 1fr;
  }

  .annotation-layout {
    flex-direction: column;
    gap: 1.5rem;
  }

  .margin-annotations {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .margin-note {
    transform: none;
    font-size: 0.78rem;
    padding: 0.5rem;
    background: rgba(255, 45, 120, 0.05);
    border-radius: 3px;
    border-bottom: none;
    border-left: 2px solid var(--dopamine-pink);
  }

  .text-block-wide {
    max-width: 100%;
  }

  .nav-menu {
    right: 1rem;
    top: 5rem;
  }

  .nav-toggle {
    top: 1rem;
    right: 1rem;
  }

  .bar-fragment-strip {
    display: none;
  }

  .strip-annotation {
    display: none;
  }

  .index-section,
  .annotation-section,
  .network-section,
  .colophon-section {
    margin-top: -5vh;
    padding-top: 9vh;
  }

  .stamp-diagonal-cut {
    height: 50px;
  }

  .dendritic-large {
    max-width: 320px;
  }
}

@media (max-width: 480px) {
  .section {
    padding: 3rem 1rem;
    min-height: auto;
  }

  .stamp-section {
    min-height: 100vh;
  }

  .stamp-title {
    font-size: clamp(2.5rem, 14vw, 5rem);
  }

  .diagonal-container {
    clip-path: none;
    border-left: none;
    border-right: none;
    padding: 2.5rem 1.5rem;
  }

  .diagonal-right-to-left,
  .diagonal-left-to-right {
    clip-path: none;
  }

  .dendritic-large {
    max-width: 260px;
  }

  .folio-corner {
    top: 1rem;
    right: 1.5rem;
  }
}
