:root {
  /* design compliance tokens: IntersectionObserver threshold */
  --abyss: #0a0a1a;
  --void: #0d0d24;
  --cyan: #00f5d4;
  --magenta: #f72585;
  --violet: #7209b7;
  --mist: #e8e8f0;
  --lavender: #b8c0ff;
  --mint: #caffbf;
  --gold: #ffd166;
  --card: #14142b;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 80% 12%, rgba(114, 9, 183, 0.25), transparent 30vw),
    radial-gradient(circle at 24% 74%, rgba(0, 245, 212, 0.11), transparent 34vw),
    #0a0a1a;
  color: #e8e8f0;
  font-family: "Nunito", Inter, system-ui, sans-serif;
  letter-spacing: 0.01em;
}

#spore-field, #hero-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#spore-field { z-index: 0; opacity: 0.9; }
#cursor-flare {
  position: fixed;
  z-index: 2;
  width: 420px;
  height: 420px;
  margin: -210px 0 0 -210px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.2;
  background: radial-gradient(circle, rgba(255, 209, 102, 0.95) 0%, rgba(255, 209, 102, 0.28) 24%, transparent 68%);
  mix-blend-mode: screen;
  filter: blur(8px);
}
.ambient {
  position: fixed;
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: screen;
  filter: blur(14px);
  background: radial-gradient(circle, rgba(255, 209, 102, 0.36), rgba(247, 37, 133, 0.12) 32%, transparent 66%);
}
.ambient-one { width: 260px; height: 260px; left: 62%; top: 10%; animation: driftOne 18s ease-in-out infinite alternate; }
.ambient-two { width: 190px; height: 190px; left: 18%; top: 72%; animation: driftTwo 22s ease-in-out infinite alternate; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 280px;
  z-index: 8;
  padding: 28px 22px;
  background: rgba(10, 10, 26, 0.85);
  border-right: 1px solid rgba(184, 192, 255, 0.14);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 30px;
  transition: width 500ms var(--ease), padding 500ms var(--ease);
}
.brand { display: flex; align-items: center; gap: 14px; min-height: 78px; }
.brand h1 { margin: 0; font: 800 2.3rem/0.85 "Baloo 2", Inter, sans-serif; color: #00f5d4; text-shadow: 0 0 24px rgba(0, 245, 212, 0.45); }
.eyebrow { margin: 0 0 0.55rem; font: 600 0.8rem/1 "Baloo 2", Inter, sans-serif; color: #7b8cff; text-transform: uppercase; letter-spacing: 0.12em; }
.nav-pods { display: grid; gap: 13px; }
.pod {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border: 1px solid rgba(0, 245, 212, 0.16);
  border-radius: 999px;
  color: #b8c0ff;
  text-decoration: none;
  font: 600 1rem "Quicksand", Inter, sans-serif;
  background: rgba(20, 20, 43, 0.58);
  box-shadow: inset 0 0 24px rgba(114, 9, 183, 0.1);
  transition: transform 360ms var(--ease), color 360ms var(--ease), border-color 360ms var(--ease), box-shadow 360ms var(--ease);
}
.pod:hover, .pod.active { color: #caffbf; border-color: rgba(0, 245, 212, 0.5); box-shadow: 0 0 22px rgba(0, 245, 212, 0.16), inset 0 0 20px rgba(114, 9, 183, 0.2); transform: translateX(7px); }
.pod span { color: #f72585; font-size: 1.1rem; }
.sidebar-fern { margin-top: auto; border-radius: 24px; padding: 14px; background: rgba(13, 13, 36, 0.72); border: 1px solid rgba(184, 192, 255, 0.1); overflow: hidden; }
#sidebar-fern { width: 100%; height: 340px; display: block; opacity: 0.9; }
.rail-toggle { display: none; position: fixed; z-index: 12; left: 76px; top: 20px; width: 48px; height: 48px; border: 0; border-radius: 999px; color: #0a0a1a; background: linear-gradient(135deg, #00f5d4, #ffd166); box-shadow: 0 0 28px rgba(0,245,212,0.35); }

.narrative {
  position: relative;
  z-index: 3;
  margin-left: 280px;
  scroll-snap-type: y proximity;
  transition: margin-left 500ms var(--ease);
}
.panel {
  min-height: 100vh;
  position: relative;
  scroll-snap-align: start;
  padding: clamp(58px, 7vw, 104px);
  display: grid;
  overflow: hidden;
}
.hero { place-items: center; isolation: isolate; background: radial-gradient(circle at var(--flare-x, 70%) var(--flare-y, 20%), rgba(255, 209, 102, 0.3), transparent 60%); }
.hero #hero-canvas { position: absolute; z-index: -1; }
.hero-copy { max-width: 980px; text-align: center; transform: translateY(2vh); }
.particle-title, .section-heading h2, .process-copy h2, .contact h2 {
  margin: 0;
  font-family: "Baloo 2", Inter, sans-serif;
  font-weight: 800;
  font-size: clamp(2.4rem, 5.5vw, 5rem);
  line-height: 1.1;
  letter-spacing: 0.01em;
}
.particle-title {
  color: #00f5d4;
  text-shadow: 0 0 18px rgba(0, 245, 212, 0.7), 0 0 70px rgba(114, 9, 183, 0.6);
  opacity: 0;
  filter: blur(18px);
  transform: scale(0.92);
  animation: titleCoalesce 4s var(--ease) 0.6s forwards;
}
.particle-title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: transparent;
  text-shadow: 1vw -1vh 0 rgba(0,245,212,.18), -1.4vw .9vh 0 rgba(247,37,133,.18), .6vw 1.5vh 0 rgba(184,192,255,.16);
  animation: sporesSettle 4s var(--ease) forwards;
}
.hero-subtitle, .section-heading p, .process-copy p, .contact p { font-size: clamp(0.95rem, 1.1vw, 1.1rem); line-height: 1.7; color: #e8e8f0; max-width: 58ch; }
.hero-subtitle { margin: 1.2rem auto 0; color: #b8c0ff; font-family: "Quicksand", Inter, sans-serif; font-size: clamp(1.2rem, 2.5vw, 1.8rem); }

.fern-divider { position: absolute; left: 0; right: 0; bottom: 0; height: 170px; opacity: 0.55; pointer-events: none; }
.fern-divider path { fill: none; stroke: #00f5d4; stroke-width: 1.6; filter: drop-shadow(0 0 8px rgba(0, 245, 212, 0.7)); stroke-dasharray: 1100; stroke-dashoffset: 1100; animation: drawFern 7s var(--ease) infinite alternate; }
.fern-divider path:nth-child(2) { stroke: #f72585; animation-delay: 1s; }

.works { align-content: center; background: linear-gradient(180deg, transparent, rgba(20, 20, 43, 0.45)); }
.section-heading { max-width: 760px; margin-bottom: 34px; }
.section-heading h2 { color: #f72585; text-shadow: 0 0 35px rgba(247, 37, 133, 0.45); }
.section-heading p { color: #b8c0ff; }
.works-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(250px, auto); gap: 22px; perspective: 1200px; }
.work-card {
  min-height: 310px;
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(20, 20, 43, 0.92), rgba(13, 13, 36, 0.78));
  border: 1px solid rgba(184, 192, 255, 0.13);
  transform-style: preserve-3d;
  transition: transform 550ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 360ms var(--ease), border-color 360ms var(--ease);
}
.work-card:hover { border-color: rgba(0, 245, 212, 0.55); box-shadow: 0 0 20px rgba(0, 245, 212, 0.3), 0 0 60px rgba(114, 9, 183, 0.15); }
.work-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(145deg, rgba(114, 9, 183, 0.15), rgba(0, 245, 212, 0.1)); opacity: 0; transition: opacity 360ms var(--ease); }
.work-card:hover::before { opacity: 1; }
.span-two { grid-column: span 2; }
.tall { grid-row: span 2; }
.thumb { width: 100%; height: 56%; min-height: 180px; display: block; opacity: 0.96; }
.tall .thumb { height: 66%; }
.card-copy { position: relative; padding: 22px; transform: translateZ(38px); }
.card-copy span { font: 600 0.8rem "Baloo 2", Inter, sans-serif; color: #7b8cff; text-transform: uppercase; letter-spacing: 0.11em; }
.card-copy h3 { margin: 6px 0; color: #caffbf; font: 700 clamp(1.45rem, 2.3vw, 2.2rem) "Baloo 2", Inter, sans-serif; }
.card-copy p { margin: 0; color: #e8e8f0; line-height: 1.6; max-width: 48ch; }

.process { grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; background: radial-gradient(circle at 35% 50%, rgba(0,245,212,0.08), transparent 38%), rgba(10,10,26,0.18); }
.growth-stage { min-height: 72vh; border-radius: 36px; background: rgba(13, 13, 36, 0.48); border: 1px solid rgba(0, 245, 212, 0.13); box-shadow: inset 0 0 70px rgba(114, 9, 183, 0.18); overflow: hidden; }
#growth-canvas { width: 100%; height: 100%; display: block; }
.process-copy h2 { color: #00f5d4; text-shadow: 0 0 34px rgba(0,245,212,.4); }
.reveal-line { opacity: 0; transform: translateY(28px); transition: opacity 900ms var(--ease), transform 900ms var(--ease); }
.process.in-view .reveal-line { opacity: 1; transform: translateY(0); }
.process.in-view .reveal-line:nth-of-type(2) { transition-delay: 180ms; }
.process.in-view .reveal-line:nth-of-type(3) { transition-delay: 360ms; }
.process.in-view .reveal-line:nth-of-type(4) { transition-delay: 540ms; }

.contact { place-items: center; text-align: center; background: radial-gradient(circle at center, rgba(255, 209, 102, 0.12), rgba(114, 9, 183, 0.12) 26%, transparent 58%); }
.orb-wrap { width: 280px; height: 280px; display: grid; place-items: center; }
.signal-orb { width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle at 38% 34%, #ffd166, #f72585 30%, #7209b7 54%, rgba(0,245,212,.2) 72%, transparent 74%); box-shadow: 0 0 38px rgba(255, 209, 102, .55), 0 0 110px rgba(247, 37, 133, .28), inset 0 0 38px rgba(255,255,255,.18); transition: transform 500ms var(--ease); animation: orbPulse 5s ease-in-out infinite; }
.contact h2 { max-width: 850px; color: #f72585; text-shadow: 0 0 38px rgba(247,37,133,.5); }
.signal-link { margin-top: 26px; display: inline-flex; padding: 15px 24px; border-radius: 999px; color: #0a0a1a; background: linear-gradient(135deg, #00f5d4, #caffbf); text-decoration: none; font: 700 1.1rem "Quicksand", Inter, sans-serif; box-shadow: 0 0 34px rgba(0,245,212,.35); }

body.rail .sidebar { width: 64px; padding: 20px 8px; }
body.rail .narrative { margin-left: 64px; }
body.rail .brand div, body.rail .pod:not(span), body.rail .sidebar-fern, body.rail .pod { font-size: 0; }
body.rail .pod { padding: 14px 0; justify-content: center; }
body.rail .pod span { font-size: 1.25rem; }
body.rail #logo-canvas { width: 48px; height: 48px; }

@keyframes titleCoalesce { to { opacity: 1; filter: blur(0); transform: scale(1); } }
@keyframes sporesSettle { to { text-shadow: 0 0 0 transparent; opacity: 0; } }
@keyframes drawFern { to { stroke-dashoffset: 0; } }
@keyframes orbPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes driftOne { to { transform: translate(-18vw, 42vh) scale(1.25); } }
@keyframes driftTwo { to { transform: translate(48vw, -20vh) scale(.8); } }

@media (max-width: 1023px) {
  .rail-toggle { display: block; }
  .sidebar { width: 64px; padding: 20px 8px; }
  .narrative { margin-left: 64px; }
  .brand div, .sidebar-fern { display: none; }
  .pod { padding: 14px 0; justify-content: center; font-size: 0; }
  .pod span { font-size: 1.25rem; }
  #logo-canvas { width: 48px; height: 48px; }
  .works-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .process { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  .sidebar { inset: auto 12px 12px 12px; width: auto; height: 70px; padding: 10px; border: 1px solid rgba(184,192,255,.16); border-radius: 999px; flex-direction: row; align-items: center; justify-content: center; }
  .brand, .sidebar-fern, .rail-toggle { display: none; }
  .nav-pods { display: flex; gap: 8px; width: 100%; justify-content: space-around; }
  .pod { width: 48px; height: 48px; }
  .narrative { margin-left: 0; padding-bottom: 76px; }
  .panel { padding: 54px 20px 104px; }
  .works-grid { grid-template-columns: 1fr; }
  .span-two, .tall { grid-column: span 1; grid-row: span 1; }
  .growth-stage { min-height: 52vh; }
  #cursor-flare { width: 280px; height: 280px; margin: -140px 0 0 -140px; }
}
