/* ═══════════════════════════════════════════════════════════════
   THE DEN — Amazon Rainforest Descent
   Layers: Sky → Canopy → Branches → Floor → Waterline → River → Roots
   ═══════════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties ──────────────────────────────────── */
:root {
  /* Sky */
  --sky-top: #0b1628;
  --sky-mid: #132848;
  --sky-glow: #1e3a5a;

  /* Canopy Greens */
  --canopy-darkest: #081a0c;
  --canopy-dark: #0c2410;
  --canopy-deep: #0f2e16;
  --canopy-mid: #163a20;
  --canopy-base: #1e4a2a;
  --canopy-light: #2a6438;
  --canopy-bright: #3a8a4e;
  --canopy-glow: #5cb870;
  --canopy-pale: #8cd4a0;
  --canopy-mist: #b8e8c4;

  /* Forest Floor / Earth */
  --floor-dark: #1a1408;
  --floor-mid: #2a2010;
  --floor-base: #3a2e18;
  --floor-moss: #2a3a18;

  /* Water */
  --water-surface: #1a3830;
  --water-murky: #102820;
  --water-deep: #0a1e18;
  --water-abyss: #061410;
  --water-teal: #1a5a48;
  --water-glow: #30aa80;

  /* Earth / Roots */
  --earth-top: #1a1008;
  --earth-mid: #120c04;
  --earth-deep: #0a0804;

  /* Accents */
  --amber: #c4a060;
  --amber-light: #d8b878;
  --amber-glow: #e8cc90;
  --bark: #6a5030;
  --bark-dark: #4a3820;

  /* Bioluminescence */
  --bio-green: #44ff88;
  --bio-blue: #44aaff;
  --bio-purple: #aa77ff;
  --bio-cyan: #22ffdd;

  /* Text */
  --text-primary: #e0ece4;
  --text-secondary: #a8c0b0;
  --text-muted: #6e8a78;
  --text-accent: #6ec48a;
  --text-warm: #d4be9c;

  /* Surfaces */
  --surface-card: rgba(12, 36, 16, 0.6);
  --surface-card-hover: rgba(18, 48, 24, 0.75);
  --surface-glass: rgba(14, 40, 20, 0.4);
  --surface-overlay: rgba(8, 20, 10, 0.88);

  /* Layout */
  --max-width: 1200px;
  --section-pad: clamp(5rem, 12vh, 10rem);
  --gap: 1.5rem;

  /* Fonts */
  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-pixel: 'Silkscreen', monospace;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--canopy-base) var(--canopy-darkest);
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--earth-deep);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--canopy-base);
  color: var(--canopy-pale);
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--canopy-darkest); }
::-webkit-scrollbar-thumb { background: var(--canopy-base); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--canopy-light); }

a {
  color: var(--text-accent);
  text-decoration: none;
  transition: color 0.3s ease;
}
a:hover { color: var(--canopy-pale); }

img { max-width: 100%; display: block; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 4vw, 3rem);
}

/* ── Fireflies ──────────────────────────────────────────────── */
.fireflies {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  overflow: hidden;
}

.firefly {
  position: absolute;
  width: var(--size, 4px);
  height: var(--size, 4px);
  border-radius: 50%;
  background: var(--bio-green);
  box-shadow:
    0 0 6px 2px rgba(68, 255, 136, 0.4),
    0 0 20px 4px rgba(68, 255, 136, 0.15);
  animation: fireflyFloat var(--duration, 12s) var(--delay, 0s) infinite ease-in-out;
  opacity: 0;
}

@keyframes fireflyFloat {
  0%, 100% {
    opacity: 0;
    transform: translate(0, 0) scale(0.5);
  }
  10% { opacity: 0.8; }
  50% {
    opacity: 0.3;
    transform: translate(var(--dx, 50px), var(--dy, -80px)) scale(1);
  }
  90% { opacity: 0.7; }
}

/* ═══════════════════════════════════════════════════════════════
   HEADER / NAVIGATION
   ═══════════════════════════════════════════════════════════════ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 0;
  transition: all 0.5s var(--ease-out);
}

.site-header.scrolled {
  background: var(--surface-overlay);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid rgba(94, 184, 112, 0.08);
  padding: 0.6rem 0;
}

.nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 4vw, 3rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-primary);
  font-family: var(--font-pixel);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  transition: transform 0.3s var(--ease-spring);
}
.nav-logo:hover {
  color: var(--text-primary);
  transform: scale(1.05);
}

.logo-icon {
  image-rendering: pixelated;
}
.logo-text {
  position: relative;
}

.nav-links {
  display: flex;
  gap: 0.3rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  color: var(--text-secondary);
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 6px;
  transition: all 0.3s ease;
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--canopy-glow);
  box-shadow: 0 0 8px var(--bio-green);
  transition: all 0.3s var(--ease-out);
  transform: translateX(-50%);
}
.nav-link:hover {
  color: var(--text-primary);
  background: rgba(94, 184, 112, 0.06);
}
.nav-link:hover::after { width: 60%; }
.nav-link.active {
  color: var(--text-accent);
}
.nav-link.active::after { width: 60%; }

/* Mobile Toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ═══════════════════════════════════════════════════════════════
   ENVIRONMENT LAYER — Base Layout
   ═══════════════════════════════════════════════════════════════ */
.env-layer {
  position: relative;
  overflow: hidden;
}

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

.env-content {
  position: relative;
  z-index: 5;
  padding: var(--section-pad) 0;
}

/* ═══════════════════════════════════════════════════════════════
   LAYER 1: SKY — Hero Section
   ═══════════════════════════════════════════════════════════════ */
.layer-sky {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg,
    var(--sky-top) 0%,
    var(--sky-mid) 25%,
    var(--sky-glow) 45%,
    #1e4848 60%,
    #163828 75%,
    var(--canopy-dark) 100%
  );
}

.layer-sky .env-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

/* Clouds */
.cloud {
  position: absolute;
  border-radius: 50%;
  background: rgba(180, 200, 220, 0.04);
  filter: blur(30px);
}
.cloud-1 {
  width: 400px;
  height: 80px;
  top: 8%;
  left: 5%;
  animation: cloudDrift 60s linear infinite;
}
.cloud-2 {
  width: 300px;
  height: 60px;
  top: 15%;
  right: 10%;
  animation: cloudDrift 80s linear infinite reverse;
  animation-delay: -20s;
}
.cloud-3 {
  width: 250px;
  height: 50px;
  top: 22%;
  left: 40%;
  animation: cloudDrift 70s linear infinite;
  animation-delay: -35s;
  opacity: 0.6;
}

@keyframes cloudDrift {
  0% { transform: translateX(-200px); }
  100% { transform: translateX(200px); }
}

/* ── Hero Content ──────────────────────────────────────────── */
.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1;
  margin-bottom: 1rem;
}

.hero-title-line {
  display: block;
  font-size: clamp(3rem, 8vw, 6rem);
  color: var(--text-primary);
  text-shadow: 0 0 40px rgba(94, 184, 112, 0.12);
  opacity: 0;
  animation: titleReveal 1.2s var(--ease-out) forwards;
}

.hero-title-line.accent {
  font-size: clamp(3.5rem, 10vw, 7.5rem);
  font-weight: 600;
  background: linear-gradient(135deg, var(--canopy-glow), var(--water-glow), var(--canopy-pale));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 30px rgba(94, 184, 112, 0.2));
  animation-delay: 0.3s;
}

@keyframes titleReveal {
  from {
    opacity: 0;
    transform: translateY(30px);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.hero-subtitle {
  font-family: var(--font-pixel);
  font-size: clamp(0.7rem, 1.5vw, 0.9rem);
  color: var(--text-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fadeUp 1s 0.8s var(--ease-out) forwards;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 1s 1.1s var(--ease-out) forwards;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 2rem;
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.4s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--canopy-base), var(--water-teal));
  color: var(--text-primary);
  box-shadow:
    0 4px 15px rgba(30, 74, 42, 0.3),
    inset 0 1px 0 rgba(255,255,255,0.1);
}
.btn-primary:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow:
    0 8px 30px rgba(30, 74, 42, 0.4),
    0 0 20px rgba(94, 184, 112, 0.15),
    inset 0 1px 0 rgba(255,255,255,0.15);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid rgba(94, 184, 112, 0.2);
}
.btn-ghost:hover {
  color: var(--text-primary);
  border-color: rgba(94, 184, 112, 0.4);
  background: rgba(94, 184, 112, 0.05);
  transform: translateY(-2px);
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  z-index: 10;
  opacity: 0;
  animation: fadeUp 1s 1.5s var(--ease-out) forwards;
}

.scroll-text {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(180deg, var(--text-muted), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ═══════════════════════════════════════════════════════════════
   LAYER 2: CANOPY — About Section
   ═══════════════════════════════════════════════════════════════ */
.layer-canopy {
  background: linear-gradient(180deg,
    var(--canopy-dark) 0%,
    var(--canopy-darkest) 15%,
    #0a1e0e 40%,
    #0c200e 60%,
    var(--canopy-dark) 85%,
    #0e2410 100%
  );
}

/* Dense canopy leaves — organic blobs */
.canopy-leaves {
  position: absolute;
  width: 300px;
  height: 200px;
  border-radius: 40% 60% 50% 50%;
  filter: blur(15px);
}
.canopy-left {
  top: -40px;
  left: -60px;
  background: radial-gradient(ellipse, rgba(30, 74, 42, 0.5), transparent 70%);
  animation: canopyWave 12s ease-in-out infinite;
}
.canopy-right {
  top: -30px;
  right: -80px;
  background: radial-gradient(ellipse, rgba(22, 58, 32, 0.5), transparent 70%);
  animation: canopyWave 15s ease-in-out 3s infinite reverse;
}
.canopy-center {
  top: -20px;
  left: 30%;
  width: 400px;
  background: radial-gradient(ellipse, rgba(26, 64, 36, 0.3), transparent 70%);
  animation: canopyWave 18s ease-in-out 6s infinite;
}

@keyframes canopyWave {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(8px) scale(1.03); }
}

/* Light rays filtering through canopy */
.light-ray {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg,
    rgba(180, 220, 160, 0.08) 0%,
    rgba(180, 220, 160, 0.02) 40%,
    transparent 70%
  );
  transform: rotate(2deg);
}
.ray-1 { left: 20%; opacity: 0.7; animation: rayFlicker 8s ease-in-out infinite; }
.ray-2 { left: 55%; opacity: 0.5; width: 3px; animation: rayFlicker 10s ease-in-out 2s infinite; }
.ray-3 { left: 78%; opacity: 0.4; animation: rayFlicker 12s ease-in-out 5s infinite; }

@keyframes rayFlicker {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

/* ═══════════════════════════════════════════════════════════════
   LAYER 3: BRANCHES — Writings Section
   ═══════════════════════════════════════════════════════════════ */
.layer-branches {
  background: linear-gradient(180deg,
    #0e2410 0%,
    #101c0e 20%,
    #121e10 50%,
    #161e10 80%,
    var(--floor-dark) 100%
  );
}

/* Tree trunks */
.tree-trunk {
  position: absolute;
  width: 40px;
  height: 100%;
  background: linear-gradient(90deg,
    rgba(60, 40, 20, 0.3),
    rgba(80, 55, 30, 0.25) 40%,
    rgba(60, 40, 20, 0.3)
  );
}
.trunk-left { left: 3%; }
.trunk-right { right: 5%; }

/* Branches */
.branch {
  position: absolute;
  height: 6px;
  background: linear-gradient(90deg,
    rgba(80, 55, 30, 0.3),
    rgba(60, 40, 20, 0.15),
    transparent
  );
  border-radius: 3px;
}
.branch-1 { top: 15%; left: 3%; width: 180px; transform: rotate(8deg); }
.branch-2 { top: 45%; right: 5%; width: 150px; transform: rotate(-5deg) scaleX(-1); }
.branch-3 { top: 75%; left: 3%; width: 120px; transform: rotate(12deg); }

/* Hanging vines */
.vine {
  position: absolute;
  top: 0;
  width: 2px;
  background: linear-gradient(180deg,
    rgba(42, 100, 56, 0.4),
    rgba(42, 100, 56, 0.2) 60%,
    rgba(42, 100, 56, 0.05)
  );
  border-radius: 1px;
  transform-origin: top center;
}
.vine-1 { left: 12%; height: 200px; animation: vineSway 8s ease-in-out infinite; }
.vine-2 { right: 18%; height: 280px; animation: vineSway 10s ease-in-out 2s infinite; }
.vine-3 { left: 65%; height: 160px; animation: vineSway 7s ease-in-out 4s infinite; }

@keyframes vineSway {
  0%, 100% { transform: rotate(-1.5deg); }
  50% { transform: rotate(1.5deg); }
}

/* ═══════════════════════════════════════════════════════════════
   LAYER 4: FOREST FLOOR — Projects Section
   ═══════════════════════════════════════════════════════════════ */
.layer-floor {
  background: linear-gradient(180deg,
    var(--floor-dark) 0%,
    #1a1608 15%,
    var(--floor-mid) 40%,
    #221a0c 70%,
    var(--water-surface) 95%,
    var(--water-murky) 100%
  );
}

/* Ferns */
.floor-fern {
  position: absolute;
  bottom: 10%;
  width: 120px;
  height: 80px;
  border-radius: 0 80% 0 80%;
  filter: blur(8px);
}
.fern-1 {
  left: 2%;
  background: radial-gradient(ellipse at bottom left, rgba(42, 100, 50, 0.2), transparent 70%);
  animation: fernSway 10s ease-in-out infinite;
}
.fern-2 {
  right: 3%;
  border-radius: 80% 0 80% 0;
  background: radial-gradient(ellipse at bottom right, rgba(42, 90, 40, 0.2), transparent 70%);
  animation: fernSway 12s ease-in-out 3s infinite reverse;
}

@keyframes fernSway {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}

/* Mushrooms */
.floor-mushroom {
  position: absolute;
  bottom: 8%;
}
.floor-mushroom::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 10px;
  background: #d8ccb0;
  border-radius: 2px;
}
.floor-mushroom::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 9px;
  background: radial-gradient(ellipse at top, #cc5530, #8a3020);
  border-radius: 50% 50% 20% 20%;
  box-shadow: 0 0 12px rgba(200, 80, 40, 0.15);
}

.mush-1 { left: 8%; }
.mush-2 { left: 45%; transform: scale(0.7); bottom: 6%; }
.mush-3 { right: 12%; transform: scale(0.85); }

/* ═══════════════════════════════════════════════════════════════
   LAYER 5: WATERLINE — Transition
   ═══════════════════════════════════════════════════════════════ */
.layer-waterline {
  height: 80px;
  background: linear-gradient(180deg,
    var(--water-murky) 0%,
    var(--water-surface) 40%,
    var(--water-deep) 100%
  );
  z-index: 2;
}

.water-surface {
  position: absolute;
  top: 30%;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(48, 170, 128, 0.3) 15%,
    rgba(48, 170, 128, 0.6) 50%,
    rgba(48, 170, 128, 0.3) 85%,
    transparent 100%
  );
  animation: waterShimmer 4s ease-in-out infinite;
}

.water-shimmer {
  position: absolute;
  top: 35%;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 10%,
    rgba(48, 170, 128, 0.15) 30%,
    rgba(48, 170, 128, 0.25) 50%,
    rgba(48, 170, 128, 0.15) 70%,
    transparent 90%
  );
  animation: waterShimmer 5s ease-in-out 1s infinite;
}

@keyframes waterShimmer {
  0%, 100% { opacity: 0.3; transform: scaleX(0.95); }
  50% { opacity: 1; transform: scaleX(1.02); }
}

/* ═══════════════════════════════════════════════════════════════
   LAYER 6: AMAZON RIVER — Contact Section
   ═══════════════════════════════════════════════════════════════ */
.layer-river {
  background: linear-gradient(180deg,
    var(--water-deep) 0%,
    #0c2018 20%,
    var(--water-abyss) 60%,
    #08120c 85%,
    var(--earth-top) 100%
  );
}

/* Underwater plants (river weeds) */
.river-weed {
  position: absolute;
  bottom: 0;
  width: 6px;
  background: linear-gradient(0deg, #1a4a38, #2a6a50 60%, transparent);
  border-radius: 3px 3px 0 0;
  transform-origin: bottom center;
}
.rw-1 { left: 6%; height: 100px; animation: vineSway 6s ease-in-out infinite; }
.rw-2 { left: 25%; height: 70px; width: 4px; animation: vineSway 7s ease-in-out 1s infinite; }
.rw-3 { right: 20%; height: 90px; animation: vineSway 8s ease-in-out 2s infinite; }
.rw-4 { right: 8%; height: 60px; width: 4px; animation: vineSway 5s ease-in-out 3s infinite; }

/* Bubbles */
.river-bubble {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(48, 170, 128, 0.25), rgba(48, 170, 128, 0.05));
  border: 1px solid rgba(48, 170, 128, 0.12);
}
.rb-1 { width: 10px; height: 10px; left: 15%; bottom: 20%; animation: bubbleRise 10s 0s infinite ease-in; }
.rb-2 { width: 7px; height: 7px; left: 40%; bottom: 30%; animation: bubbleRise 12s 2s infinite ease-in; }
.rb-3 { width: 12px; height: 12px; right: 25%; bottom: 15%; animation: bubbleRise 9s 4s infinite ease-in; }
.rb-4 { width: 5px; height: 5px; right: 35%; bottom: 40%; animation: bubbleRise 14s 1s infinite ease-in; }

@keyframes bubbleRise {
  0% { transform: translateY(0) scale(1); opacity: 0.5; }
  50% { transform: translateY(-80px) scale(1.1); opacity: 0.3; }
  100% { transform: translateY(-200px) scale(0.7); opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════════
   LAYER 7: UNDERGROUND ROOTS — Footer
   ═══════════════════════════════════════════════════════════════ */
.layer-roots {
  background: linear-gradient(180deg,
    var(--earth-top) 0%,
    var(--earth-mid) 40%,
    var(--earth-deep) 100%
  );
}

.layer-roots .env-content {
  padding: 3rem 0 2rem;
}

/* Root tendrils */
.root {
  position: absolute;
  top: 0;
  height: 60%;
  width: 3px;
  background: linear-gradient(180deg,
    rgba(90, 60, 30, 0.4),
    rgba(90, 60, 30, 0.1) 70%,
    transparent
  );
  border-radius: 0 0 2px 2px;
}
.root-1 { left: 10%; transform: rotate(5deg); }
.root-2 { left: 30%; height: 45%; transform: rotate(-3deg); width: 2px; }
.root-3 { right: 25%; height: 55%; transform: rotate(4deg); }
.root-4 { right: 8%; height: 40%; transform: rotate(-6deg); width: 2px; }

/* Earth layers (horizontal bands) */
.earth-layers {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg,
      transparent 0%,
      rgba(80, 50, 20, 0.06) 20%,
      rgba(60, 35, 15, 0.08) 50%,
      rgba(40, 25, 10, 0.1) 80%,
      rgba(20, 12, 5, 0.12) 100%
    );
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-logo {
  font-family: var(--font-pixel);
  font-size: 0.85rem;
  color: var(--text-accent);
  letter-spacing: 0.05em;
}

.footer-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   ANIMALS — Vintage Naturalist Illustration Positioning + 3D Tilt
   ═══════════════════════════════════════════════════════════════ */
.animal {
  position: absolute;
  z-index: 3;
  perspective: 800px;
  will-change: transform;
}

.animal-img {
  display: block;
  width: 100%;
  height: auto;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.1s linear, filter 0.4s ease, opacity 0.4s ease;
  /* Transparent PNGs — no blend mode needed */
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.35))
         saturate(1.15) contrast(1.05);
  opacity: 0.82;
}

/* On hover / mouse proximity — bring the illustration forward */
.animal:hover .animal-img,
.animal.mouse-near .animal-img {
  opacity: 1;
  filter: drop-shadow(0 6px 24px rgba(0, 0, 0, 0.5))
         drop-shadow(0 0 20px rgba(94, 184, 112, 0.15))
         saturate(1.25) contrast(1.1);
}

/* Macaw — flying in the sky */
.macaw {
  top: 14%;
  left: 10%;
  width: 150px;
  animation: macawFly 14s ease-in-out infinite;
}

@keyframes macawFly {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(40px, -15px) rotate(3deg); }
  50% { transform: translate(20px, 5px) rotate(-2deg); }
  75% { transform: translate(-20px, -10px) rotate(1deg); }
}

/* Toucan — perched in canopy */
.toucan {
  top: 8%;
  right: 8%;
  width: 160px;
  animation: animalBreathe 5s ease-in-out infinite;
}

/* Sloth — hanging in canopy */
.sloth {
  bottom: 8%;
  left: 4%;
  width: 100px;
  animation: slothSway 10s ease-in-out infinite;
}

@keyframes slothSway {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(2deg); }
}

/* Tree Frog — on a branch */
.treefrog {
  top: 15%;
  right: 6%;
  width: 100px;
  animation: frogBounce 6s ease-in-out infinite;
}

@keyframes frogBounce {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(0); }
  45% { transform: translateY(-8px); }
  50% { transform: translateY(0); }
  55% { transform: translateY(-4px); }
  60% { transform: translateY(0); }
}

/* Jaguar — prowling on forest floor */
.jaguar {
  bottom: 12%;
  left: 3%;
  width: 240px;
  animation: jaguarProwl 16s ease-in-out infinite;
}

@keyframes jaguarProwl {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(20px); }
}

/* Dolphin — swimming in the river */
.dolphin {
  top: 18%;
  left: 6%;
  width: 200px;
  animation: dolphinSwim 12s ease-in-out infinite;
}

@keyframes dolphinSwim {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(30px, -10px) rotate(-3deg); }
  50% { transform: translate(15px, 8px) rotate(2deg); }
  75% { transform: translate(-15px, -5px) rotate(-1deg); }
}

/* Piranha — darting in river */
.piranha {
  bottom: 18%;
  right: 12%;
  width: 110px;
  animation: piranhaDart 8s ease-in-out infinite;
}

@keyframes piranhaDart {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-15px, 3px); }
  40% { transform: translate(5px, -5px); }
  60% { transform: translate(-8px, 2px); }
  80% { transform: translate(10px, -3px); }
}

/* Breathe for generic animals */
@keyframes animalBreathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* ═══════════════════════════════════════════════════════════════
   SECTION CONTENT STYLES
   ═══════════════════════════════════════════════════════════════ */
.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.8rem;
  text-shadow: 0 0 30px rgba(94, 184, 112, 0.08);
}

.section-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
}

.section-cta {
  text-align: center;
  margin-top: 3rem;
}

/* ── About Section ──────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 4rem;
  align-items: start;
}

.portrait-frame {
  position: relative;
  padding: 8px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(94, 184, 112, 0.15), rgba(48, 170, 128, 0.1));
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(94, 184, 112, 0.1);
}

.portrait-placeholder {
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--canopy-dark);
}
.portrait-placeholder svg,
.portrait-silhouette {
  width: 100%;
  height: 100%;
}

.about-text {
  padding-top: 0.5rem;
}

.about-lead {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-style: italic;
  color: var(--text-accent);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 1.2rem;
  font-size: 0.95rem;
}

.about-details {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--surface-card);
  border-radius: 12px;
  border: 1px solid rgba(94, 184, 112, 0.08);
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.detail-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}

/* ── Writings Section ──────────────────────────────────────── */
.writings-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.writing-card {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1.5rem;
  padding: 1.8rem;
  background: var(--surface-card);
  border-radius: 16px;
  border: 1px solid rgba(94, 184, 112, 0.06);
  transition: all 0.4s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.writing-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(94, 184, 112, 0.03), transparent 40%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.writing-card:hover {
  border-color: rgba(94, 184, 112, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}
.writing-card:hover::before { opacity: 1; }

.card-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.8rem;
  background: rgba(94, 184, 112, 0.06);
  border-radius: 10px;
  align-self: start;
}

.date-month {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.date-day {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-accent);
  line-height: 1;
}

.date-year {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--text-muted);
}

.card-content {
  position: relative;
  z-index: 1;
}

.card-tag {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--water-glow);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 0.2rem 0.6rem;
  background: rgba(48, 170, 128, 0.1);
  border-radius: 4px;
  margin-bottom: 0.6rem;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.card-title a {
  color: var(--text-primary);
  transition: color 0.3s ease;
}
.card-title a:hover { color: var(--canopy-glow); }

.card-excerpt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.card-read-time {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

/* ── Projects Section ──────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  padding: 2rem;
  background: var(--surface-card);
  border-radius: 16px;
  border: 1px solid rgba(48, 170, 128, 0.08);
  transition: all 0.4s var(--ease-out);
  color: var(--text-secondary);
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--canopy-base), var(--water-teal), var(--water-glow));
  opacity: 0;
  transition: opacity 0.4s ease;
}

.project-card:hover {
  color: var(--text-primary);
  border-color: rgba(48, 170, 128, 0.2);
  transform: translateY(-4px);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.25),
    0 0 30px rgba(48, 170, 128, 0.05);
}
.project-card:hover::before { opacity: 1; }

.project-icon {
  margin-bottom: 1.5rem;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}
.project-card:hover .project-icon { opacity: 1; }

.project-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
}

.project-desc {
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1.2rem;
  flex: 1;
}

.project-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}

.ptag {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  padding: 0.25rem 0.6rem;
  background: rgba(48, 170, 128, 0.1);
  color: var(--water-glow);
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.project-link-text {
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  color: var(--text-accent);
  letter-spacing: 0.1em;
  transition: all 0.3s ease;
}
.project-card:hover .project-link-text {
  color: var(--canopy-pale);
  letter-spacing: 0.15em;
}

/* ── Contact / Socials ─────────────────────────────────────── */
.socials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  max-width: 900px;
  margin: 0 auto;
}

.social-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  padding: 2rem 1.5rem;
  background: var(--surface-card);
  border-radius: 16px;
  border: 1px solid rgba(48, 170, 128, 0.06);
  transition: all 0.4s var(--ease-out);
  text-align: center;
  color: var(--text-secondary);
}

.social-card:hover {
  border-color: rgba(48, 170, 128, 0.2);
  transform: translateY(-4px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
  color: var(--text-primary);
  background: var(--surface-card-hover);
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(94, 184, 112, 0.06);
  transition: all 0.3s ease;
  color: var(--text-accent);
}
.social-card:hover .social-icon {
  background: rgba(94, 184, 112, 0.12);
  box-shadow: 0 0 20px rgba(94, 184, 112, 0.1);
  transform: scale(1.1);
}

.social-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-primary);
}

.social-handle {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.contact-message {
  text-align: center;
  margin-top: 3rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   REVEAL ANIMATIONS (JS-activated)
   ═══════════════════════════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .about-portrait {
    max-width: 250px;
    margin: 0 auto;
  }
  .writing-card {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .card-date {
    flex-direction: row;
    gap: 0.5rem;
    align-self: auto;
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    flex-direction: column;
    background: var(--surface-overlay);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    padding: 5rem 2rem 2rem;
    gap: 0.5rem;
    transition: right 0.4s var(--ease-out);
    z-index: 99;
  }
  .nav-links.open { right: 0; }
  .nav-toggle { display: flex; z-index: 101; }

  .nav-link {
    font-size: 0.8rem;
    padding: 0.8rem 1rem;
  }

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

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

  /* Simplify animals on mobile */
  .sloth { display: none; }
  .piranha { display: none; }
  .jaguar { width: 160px; }
  .toucan { width: 120px; }
  .dolphin { width: 150px; }

  .hero-title-line { font-size: clamp(2.5rem, 12vw, 4rem); }
  .hero-title-line.accent { font-size: clamp(3rem, 14vw, 5rem); }

  /* Reduce decorations */
  .trunk-right { display: none; }
  .vine-3 { display: none; }
  .cloud-3 { display: none; }
}

@media (max-width: 480px) {
  .socials-grid { grid-template-columns: 1fr; }

  .layer-sky {
    min-height: 100svh;
  }

  .macaw { width: 100px; left: 5%; }
  .treefrog { width: 70px; }
  .jaguar { width: 130px; }
  .dolphin { width: 120px; }
}

/* ═══════════════════════════════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--canopy-glow);
  outline-offset: 3px;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
