/* === Custom Properties === */
:root {
  --cream-silk: #FFF5F0;
  --blush-mist: #FAE6EB;
  --warm-ivory: #FEF3E2;
  --deep-plum: #2E1A2B;
  --rose-charcoal: #4A3342;
  --hot-pink: #E894A8;
  --chrome-champagne: #D4AF37;
  --lilac-frost: #C8A8D4;
  --midnight-amethyst: #1E0A2E;
  --star-white: #FFFFFF;
  --ease-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

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

body {
  background: var(--cream-silk);
  color: var(--deep-plum);
  font-family: 'Outfit', -apple-system, Arial, sans-serif;
  font-weight: 400;
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  line-height: 1.7;
  overflow-x: hidden;
}

/* === Particle Canvas === */
#particles {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

/* === Scenes === */
.scene {
  scroll-snap-align: start;
  position: relative;
}

.scene-void {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 30% 40%, #FFF5F0 0%, #FAE6EB 40%, #FEF3E2 70%, #FAE6EB 100%);
}

.scene-light {
  background: var(--cream-silk);
}

.scene-dark {
  background: linear-gradient(180deg, #1E0A2E 0%, #2E1A2B 100%);
  color: var(--cream-silk);
}

.scene-mixed {
  background: var(--cream-silk);
}

.scene-signature {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #1E0A2E 0%, #2E1A2B 100%);
  color: var(--cream-silk);
}

/* === Hero === */
.hero-content {
  text-align: center;
}

.hero-title {
  font-family: 'Bungee Inline', cursive;
  font-size: clamp(2.5rem, 6vw, 5.5rem);
  color: var(--deep-plum);
  text-shadow: 2px 2px 0px rgba(232, 148, 168, 0.6), -1px -1px 0px rgba(255, 255, 255, 0.4);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.hero-title .char {
  display: inline-block;
  opacity: 0;
  transform: scale(0) rotate(-15deg);
  animation: charTumble 600ms var(--ease-back) forwards;
}

@keyframes charTumble {
  0% { opacity: 0; transform: scale(0) rotate(-15deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

.hero-sub {
  font-family: 'Righteous', cursive;
  font-size: clamp(1.2rem, 2.5vw, 2rem);
  color: var(--hot-pink);
  opacity: 0;
  transform: translateY(20px);
  animation: slideUp 600ms ease-out 1.2s forwards;
}

@keyframes slideUp {
  to { opacity: 1; transform: translateY(0); }
}

/* === Shimmer Text === */
.shimmer-text {
  background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

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

/* === Modular Grid === */
.modular-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(280px, auto);
  gap: 0;
}

/* Module spans */
.mod-2 { grid-column: span 2; }
.mod-3 { grid-column: span 3; }
.mod-4 { grid-column: span 4; }
.mod-6 { grid-column: span 6; }
.mod-12 { grid-column: span 12; }
.mod-tall { min-height: 400px; }

/* Module base */
.mod {
  border: 1px solid rgba(232, 180, 188, 0.3);
  padding: clamp(1.2rem, 2.5vw, 2rem);
  position: relative;
  overflow: hidden;
  background: var(--cream-silk);
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 500ms var(--ease-back), transform 500ms var(--ease-back),
              border-width 200ms var(--ease-back), box-shadow 300ms ease;
}

.mod.revealed {
  opacity: 1;
  transform: scale(1);
}

.mod:hover {
  border-width: 2px;
  box-shadow: 0 0 20px rgba(232, 148, 168, 0.15), 0 0 40px rgba(212, 175, 55, 0.08);
}

/* Rhinestone dot border overlay */
.mod::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(212,175,55,0.4) 1.5px, transparent 1.5px);
  background-size: 12px 12px;
  background-position: 6px 6px;
  pointer-events: none;
  opacity: 0.3;
  mask-image: linear-gradient(to bottom, transparent 10%, black 10%, black 90%, transparent 90%),
              linear-gradient(to right, transparent 10%, black 10%, black 90%, transparent 90%);
  -webkit-mask-composite: destination-in;
  mask-composite: intersect;
}

.bg-blush { background: var(--blush-mist); }
.bg-ivory { background: var(--warm-ivory); }

/* === Module Types === */
/* Transaction Diagram */
.tx-diagram-mod {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tx-flow {
  width: 100%;
  max-width: 400px;
  height: auto;
}

.node { animation: nodePulse 2s ease-in-out infinite; }
@keyframes nodePulse {
  0%, 100% { transform-origin: center; r: inherit; }
  50% { filter: drop-shadow(0 0 6px rgba(232,148,168,0.4)); }
}

.node-text {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  fill: var(--hot-pink);
}

.flow-path {
  stroke-dasharray: 500;
  stroke-dashoffset: 500;
  transition: stroke-dashoffset 1500ms ease-out;
}

.mod.revealed .flow-path {
  stroke-dashoffset: 0;
}

.token {
  animation: tokenTravel 3s ease-in-out infinite;
}

.token-2 { animation-delay: 1.5s; }

@keyframes tokenTravel {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Concept Modules */
.concept-mod {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 280px;
}

.concept-word {
  font-family: 'Righteous', cursive;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  color: var(--deep-plum);
  display: block;
  margin-bottom: 0.5rem;
}

.concept-desc {
  font-weight: 300;
  color: var(--rose-charcoal);
}

/* Kinetic breathing */
.kinetic-breathe {
  animation: breathe 8s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { letter-spacing: 0.02em; }
  50% { letter-spacing: 0.08em; }
}

/* Quote Modules */
.quote-mod {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}

.pull-quote {
  font-family: 'Righteous', cursive;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  color: var(--deep-plum);
  text-align: center;
  font-style: normal;
  padding: 0 1rem;
}

/* Dark variants */
.dark-quote {
  background: var(--midnight-amethyst);
}

.dark-quote .pull-quote {
  color: var(--cream-silk);
}

.dark-diagram {
  background: var(--midnight-amethyst);
}

.dark-header {
  background: linear-gradient(180deg, #1E0A2E 0%, #2E1A2B 100%);
  min-height: auto;
  padding: clamp(2rem, 4vw, 4rem);
}

/* Accent Modules */
.accent-mod {
  min-height: 280px;
  overflow: hidden;
}

.gradient-mesh {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 40%, var(--hot-pink) 0%, transparent 50%),
              radial-gradient(circle at 70% 60%, var(--chrome-champagne) 0%, transparent 50%),
              radial-gradient(circle at 50% 50%, var(--lilac-frost) 0%, transparent 60%);
  opacity: 0.4;
  animation: meshDrift 12s ease-in-out infinite alternate;
}

.mesh-lilac {
  background: radial-gradient(circle at 40% 30%, var(--lilac-frost) 0%, transparent 50%),
              radial-gradient(circle at 60% 70%, var(--hot-pink) 0%, transparent 50%);
}

@keyframes meshDrift {
  0% { transform: scale(1) rotate(0deg); }
  100% { transform: scale(1.1) rotate(3deg); }
}

/* Duotone photo modules */
.duotone-mod {
  position: relative;
}

.duotone-img {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--hot-pink) 0%, var(--midnight-amethyst) 100%);
  opacity: 0.6;
}

.dark-duo .duotone-img {
  background: linear-gradient(135deg, var(--midnight-amethyst) 0%, var(--hot-pink) 100%);
}

/* ACID modules */
.acid-mod {
  background: rgba(30, 10, 46, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 300px;
}

.acid-letter {
  font-family: 'Bungee Inline', cursive;
  font-size: clamp(3rem, 6vw, 5rem);
  color: var(--hot-pink);
  text-shadow: 2px 2px 0px rgba(232, 148, 168, 0.3);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.acid-name {
  font-family: 'Righteous', cursive;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  color: var(--chrome-champagne);
  margin-bottom: 0.5rem;
}

.acid-desc {
  color: rgba(255, 245, 240, 0.8);
  font-weight: 300;
}

/* Era modules */
.era-mod {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 280px;
}

.era-title {
  font-family: 'Bungee Inline', cursive;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  color: var(--deep-plum);
  text-shadow: 1px 1px 0px rgba(232, 148, 168, 0.4);
  margin-bottom: 0.5rem;
}

.era-desc {
  color: var(--rose-charcoal);
  font-weight: 300;
  margin-bottom: 0.75rem;
}

.era-date {
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(0.8rem, 1vw, 0.95rem);
  color: var(--hot-pink);
}

/* Section titles */
.section-title {
  font-family: 'Bungee Inline', cursive;
  font-size: clamp(2rem, 5vw, 4rem);
  color: var(--hot-pink);
  text-shadow: 2px 2px 0px rgba(232, 148, 168, 0.4);
  text-align: center;
}

.section-header-mod {
  min-height: auto;
  padding: clamp(2rem, 4vw, 4rem);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mod-heading {
  font-family: 'Righteous', cursive;
  font-size: clamp(1.2rem, 2.5vw, 2rem);
  color: var(--deep-plum);
  text-align: center;
  margin-top: 1rem;
}

/* === Signature === */
.signature-content {
  text-align: center;
}

.signature-title {
  font-family: 'Bungee Inline', cursive;
  font-size: clamp(3rem, 8vw, 7rem);
  color: var(--cream-silk);
  text-shadow: 2px 2px 0px rgba(232, 148, 168, 0.6), -1px -1px 0px rgba(255, 255, 255, 0.2);
  letter-spacing: -0.02em;
}

.signature-sub {
  font-family: 'Righteous', cursive;
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  color: var(--hot-pink);
  margin-top: 0.5rem;
}

.signature-hash {
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(0.8rem, 1vw, 0.95rem);
  color: var(--lilac-frost);
  margin-top: 2rem;
  opacity: 0.6;
}

/* === Responsive === */
@media (max-width: 768px) {
  .modular-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  .mod-2, .mod-3, .mod-4, .mod-6, .mod-12 {
    grid-column: span 1;
  }

  .mod {
    min-height: 200px;
  }

  .section-header-mod,
  .dark-header {
    min-height: auto;
  }

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