/* ========================================
   THROUGH THE JUNGLE — v3
   Pinned scene architecture, z-depth traversal
   ======================================== */

:root {
  --purple-deep: #1a0033;
  --purple-dark: #2d004d;
  --purple-mid: #3b0066;
  --purple-royal: #4b0082;
  --green-dark: #0d2818;
  --green-deep: #1a4a2e;
  --green-mid: #2d6a4f;
  --green-bright: #52b788;
  --green-light: #74c69d;
  --gold: #d4a017;
  --gold-light: #f0c040;
  --amber: #ff8f00;
  --amber-glow: #ffab00;
  --black-deep: #060608;
  --black: #0a0a0f;
  --white-soft: #f0ede6;
  --white-muted: #c9c5bc;
  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --content-max: 1100px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { overflow-x: hidden; }

body {
  font-family: var(--font-body);
  background: var(--black-deep);
  color: var(--white-soft);
  overflow-x: hidden;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ========================================
   Fireflies
   ======================================== */
#fireflies {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

/* ========================================
   Navigation
   ======================================== */
#jungle-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.25rem 2rem;
  transition: background 0.4s, backdrop-filter 0.4s;
}
#jungle-nav.scrolled {
  background: rgba(6, 6, 8, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.nav-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.5rem; font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.05em;
}
.nav-logo:hover { opacity: 0.8; }
.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-link {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.85rem; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--white-muted);
  transition: color 0.3s;
}
.nav-link:hover, .nav-link.active { color: var(--green-bright); }
.nav-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--white-muted);
  transition: background 0.3s, transform 0.3s;
}
.nav-link.active .nav-dot { background: var(--green-bright); transform: scale(1.5); }
.nav-link:hover .nav-dot { background: var(--green-bright); }

/* ========================================
   SCENE BASE — Pinned full-viewport panels
   ======================================== */
.scene {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh; /* iOS Safari: excludes address bar from height */
  overflow: hidden;
  /* GSAP will pin these — they stay fixed while you scroll through */
}

.scene-content {
  position: relative;
  z-index: 20;
  max-width: var(--content-max);
  width: 100%;
  margin: 0 auto;
  padding: clamp(6rem, 12vh, 10rem) 2rem clamp(4rem, 8vh, 6rem);
}

/* ========================================
   HERO SCENE
   ======================================== */
.hero-scene {
  height: 100vh;
  height: 100svh; /* iOS Safari: use small viewport height */
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--black-deep);
}

/* Background photo */
.hero-bg {
  position: absolute; inset: 0; z-index: 1;
}
.hero-bg-img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.3) saturate(1.3);
}
.hero-bg-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(6,6,8,0.4) 0%,
    rgba(13,40,24,0.3) 40%,
    rgba(26,0,51,0.5) 80%,
    rgba(6,6,8,0.95) 100%
  );
}

/* Canopy layers — these scale past you on scroll */
.canopy-layers {
  position: absolute; inset: 0; z-index: 5;
  pointer-events: none;
}
.canopy-layer {
  position: absolute; inset: 0;
  will-change: transform, opacity;
}
.canopy-img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.25) saturate(1.5) hue-rotate(10deg);
}
.canopy-overlay {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 50%, transparent 20%, rgba(6,6,8,0.8) 100%);
}
.canopy-svg {
  width: 100%; height: 100%;
}
.canopy-1 { z-index: 1; }
.canopy-2 { z-index: 3; }
.canopy-3 { z-index: 5; }

/* Hero text */
.hero-content {
  position: relative; z-index: 10;
  text-align: center;
  will-change: transform, opacity;
}
.hero-greeting {
  display: block;
  font-family: var(--font-body);
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--green-bright);
  margin-bottom: 0.5rem;
}
.hero-name {
  display: block;
  font-family: var(--font-heading);
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 700; line-height: 1.05;
  color: var(--white-soft);
  text-shadow: 0 0 80px rgba(82,183,136,0.15);
}
.hero-subtitle {
  margin-top: 1.5rem;
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  color: var(--white-muted);
  letter-spacing: 0.1em;
}
.scroll-indicator { margin-top: 3rem; display: flex; justify-content: center; }
.scroll-arrow {
  width: 24px; height: 24px;
  border-right: 2px solid var(--green-bright);
  border-bottom: 2px solid var(--green-bright);
  transform: rotate(45deg);
  animation: scrollBounce 2s ease-in-out infinite;
  opacity: 0.6;
}
@keyframes scrollBounce {
  0%, 100% { transform: rotate(45deg) translate(0,0); opacity: 0.6; }
  50% { transform: rotate(45deg) translate(6px,6px); opacity: 1; }
}

/* ========================================
   ABOUT SCENE — Dense foliage + eyes
   ======================================== */
.about-scene {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--purple-deep);
}

.about-bg {
  position: absolute; inset: 0; z-index: 1;
}
.about-bg-img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.15) saturate(1.5) hue-rotate(-20deg);
}
.about-bg-overlay {
  position: absolute; inset: 0;
  background: radial-gradient(
    ellipse 55% 45% at 50% 50%,
    rgba(26,0,51,0.6) 0%,
    rgba(6,6,8,0.95) 100%
  );
}

/* Foliage edges — botanical plant system */
.foliage-edges {
  position: absolute; inset: 0; z-index: 10;
  pointer-events: none;
}

/* Base plant container — use for SVGs or swap with <img class="plant-img"> PNGs */
.plant {
  position: absolute;
  will-change: transform, opacity;
  filter: drop-shadow(0 0 30px rgba(0,0,0,0.5));
}
.plant svg { width: 100%; height: 100%; }

/* If swapping in PNG images: */
.plant-img {
  width: 100%; height: 100%;
  object-fit: contain;
}

/* Plant positions */
.plant-tl {
  top: -8%; left: -8%;
  width: 42%; max-width: 500px;
  z-index: 12;
}
.plant-tr {
  top: -5%; right: -5%;
  width: 42%; max-width: 500px;
  z-index: 11;
}
.plant-bl {
  bottom: -5%; left: -5%;
  width: 35%; max-width: 420px;
  z-index: 13;
}
.plant-br {
  bottom: -8%; right: -6%;
  width: 40%; max-width: 480px;
  z-index: 12;
}

/* Hanging vines */
.plant-vine-l {
  top: 0; left: 12%;
  width: 50px; height: 55%;
  z-index: 14;
}
.plant-vine-r {
  top: 0; right: 18%;
  width: 50px; height: 45%;
  z-index: 14;
}
.plant-fern-top {
  top: -2%; left: 35%;
  width: 20%; max-width: 250px;
  z-index: 11;
}

/* Amber Eyes */
.amber-eyes {
  position: absolute; inset: 0;
  z-index: 8;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.eye-pair {
  position: absolute;
  display: flex;
  gap: 30px;
  align-items: center;
}
.ep-main { top: 40%; left: 50%; transform: translate(-50%, -50%); }
.ep-left { top: 58%; left: 22%; transform: translate(-50%, -50%); }
.ep-right { top: 48%; left: 80%; transform: translate(-50%, -50%); }
.ep-top-left { top: 18%; left: 12%; transform: translate(-50%, -50%); }
.ep-top-right { top: 22%; left: 88%; transform: translate(-50%, -50%); }
.ep-low-left { top: 78%; left: 35%; transform: translate(-50%, -50%); }
.ep-low-right { top: 72%; left: 72%; transform: translate(-50%, -50%); }

.eye {
  width: 36px; height: 18px;
  background: radial-gradient(ellipse, var(--amber-glow) 0%, var(--amber) 45%, #b36200 85%, transparent 100%);
  border-radius: 50%;
  position: relative;
  box-shadow:
    0 0 15px rgba(255,171,0,0.6),
    0 0 40px rgba(255,143,0,0.25),
    0 0 80px rgba(255,143,0,0.1);
  animation: eyeBlink 5s ease-in-out infinite;
}
.eye.sm { width: 22px; height: 11px; box-shadow: 0 0 10px rgba(255,171,0,0.4), 0 0 25px rgba(255,143,0,0.15); }
.eye.xs { width: 14px; height: 7px; box-shadow: 0 0 6px rgba(255,171,0,0.3); }

.iris {
  position: absolute;
  top: 50%; left: 50%;
  width: 7px; height: 12px;
  background: var(--purple-deep);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.eye.sm .iris { width: 5px; height: 8px; }
.eye.xs .iris { width: 3px; height: 5px; }

@keyframes eyeBlink {
  0%, 100% { opacity: 0.85; transform: scaleY(1); }
  35% { opacity: 1; transform: scaleY(1); }
  38% { opacity: 0; transform: scaleY(0.05); }
  42% { opacity: 1; transform: scaleY(1); }
  80% { opacity: 0.9; transform: scaleY(1); }
}

/* About content */
.about-content {
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  will-change: transform, opacity, filter;
}
.about-content .content-card { text-align: left; }

/* ========================================
   SCENE BACKGROUNDS & FOLIAGE FRAMES
   for Projects, Interests, Contact
   ======================================== */
.scene-bg {
  position: absolute; inset: 0; z-index: 1;
}
.scene-bg-gradient {
  width: 100%; height: 100%;
}
.projects-gradient {
  background: linear-gradient(180deg, var(--black-deep) 0%, var(--purple-deep) 40%, var(--purple-dark) 60%, var(--black-deep) 100%);
}
.interests-gradient {
  background: linear-gradient(180deg, var(--black-deep) 0%, rgba(13,40,24,0.5) 40%, rgba(26,74,46,0.3) 60%, var(--black-deep) 100%);
}
.contact-gradient {
  background: linear-gradient(180deg, var(--black-deep) 0%, rgba(26,0,51,0.5) 40%, rgba(45,0,77,0.3) 60%, var(--black-deep) 100%);
}

/* Foliage frame around clearing sections */
.scene-foliage-frame {
  position: absolute; inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}
.frame-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 120px;
  background: linear-gradient(180deg, var(--green-dark) 0%, transparent 100%);
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 1440 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,0 Q80,80 160,30 Q240,100 360,20 Q480,90 600,10 Q720,70 840,0 Q960,60 1080,10 Q1200,80 1320,20 Q1400,60 1440,0 L1440,120 L0,120Z' fill='white'/%3E%3C/svg%3E");
  mask-size: 100% 100%;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 1440 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,0 Q80,80 160,30 Q240,100 360,20 Q480,90 600,10 Q720,70 840,0 Q960,60 1080,10 Q1200,80 1320,20 Q1400,60 1440,0 L1440,120 L0,120Z' fill='white'/%3E%3C/svg%3E");
  -webkit-mask-size: 100% 100%;
  will-change: transform, opacity;
}
.frame-left {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 100px;
  background: linear-gradient(90deg, rgba(13,40,24,0.5) 0%, transparent 100%);
  will-change: transform, opacity;
}
.frame-right {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 100px;
  background: linear-gradient(-90deg, rgba(13,40,24,0.5) 0%, transparent 100%);
  will-change: transform, opacity;
}

/* Projects/Interests/Contact scenes */
.projects-scene,
.interests-scene,
.contact-scene {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========================================
   Typography & Content
   ======================================== */
.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  margin-bottom: 2.5rem;
}
.title-accent {
  display: block;
  font-family: var(--font-body);
  font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--green-bright);
  margin-bottom: 0.5rem;
}
.content-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(82,183,136,0.12);
  border-radius: 16px;
  padding: 2.5rem;
  backdrop-filter: blur(10px);
  max-width: 700px;
}
.lead-text {
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  font-style: italic;
  color: var(--green-light);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}
.content-card p { margin-bottom: 1rem; color: var(--white-muted); font-size: 1.05rem; }
.card-accent-line {
  width: 60px; height: 2px;
  background: linear-gradient(90deg, var(--green-bright), var(--gold));
  margin-top: 1.5rem; border-radius: 2px;
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.project-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(82,183,136,0.08);
  border-radius: 16px;
  padding: 2rem;
  transition: transform 0.4s, border-color 0.4s, box-shadow 0.4s;
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(82,183,136,0.25);
  box-shadow: 0 12px 40px rgba(82,183,136,0.06);
}
.project-icon { width: 48px; height: 48px; color: var(--green-bright); margin-bottom: 1.25rem; }
.project-icon svg { width: 100%; height: 100%; }
.project-card h3 { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 600; margin-bottom: 0.75rem; }
.project-card p { color: var(--white-muted); font-size: 0.95rem; margin-bottom: 1.25rem; line-height: 1.6; }
.project-tag {
  display: inline-block;
  font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.3rem 0.8rem; border-radius: 20px;
  background: rgba(82,183,136,0.1);
  color: var(--green-bright);
  border: 1px solid rgba(82,183,136,0.15);
}

/* Interests */
.interests-mosaic {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.interest-tile {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(75,0,130,0.15);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.4s, border-color 0.4s;
  min-height: 160px;
}
.interest-tile:hover { transform: translateY(-3px); border-color: rgba(212,160,23,0.3); }
.tile-large { grid-row: span 2; }
.tile-wide { grid-column: span 2; }
.tile-inner { padding: 1.75rem; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.interest-tile h3 { font-family: var(--font-heading); font-size: 1.4rem; font-weight: 600; color: var(--gold-light); margin-bottom: 0.5rem; }
.interest-tile p { color: var(--white-muted); font-size: 0.9rem; line-height: 1.5; }

/* Contact */
.contact-wrapper { max-width: 600px; }
.contact-wrapper .lead-text { margin-bottom: 2rem; }
.contact-links { display: flex; flex-direction: column; gap: 1rem; }
.contact-link {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(82,183,136,0.08);
  border-radius: 12px;
  font-size: 1.05rem;
  color: var(--white-muted);
  transition: all 0.3s;
}
.contact-link:hover {
  border-color: rgba(82,183,136,0.3);
  background: rgba(82,183,136,0.05);
  color: var(--white-soft);
  transform: translateX(6px);
}
.contact-link svg { width: 24px; height: 24px; flex-shrink: 0; color: var(--green-bright); }

.jungle-footer {
  position: absolute; bottom: 0; left: 0; right: 0;
  text-align: center; padding: 2rem; z-index: 10;
}
.jungle-footer p { font-size: 0.8rem; color: var(--white-muted); opacity: 0.5; }

/* ========================================
   Hamburger button (hidden on desktop)
   ======================================== */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px; height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 110;
}
.nav-burger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--gold);
  border-radius: 2px;
  transform-origin: center;
  transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
}
/* Animate to X when open */
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; width: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ========================================
   Mobile full-screen menu overlay
   ======================================== */
.mobile-menu {
  display: none; /* JS shows this on mobile */
  position: fixed;
  inset: 0;
  z-index: 105;
  background: rgba(6, 6, 8, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.mobile-menu.open {
  opacity: 1;
  pointer-events: auto;
}
.mobile-link {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 10vw, 3.5rem);
  font-weight: 600;
  color: var(--white-soft);
  letter-spacing: 0.04em;
  transition: color 0.25s;
}
.mobile-link:hover { color: var(--green-bright); }

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
  /* Hide desktop links, show burger */
  .nav-links { display: none; }
  .nav-burger { display: flex; }
  .mobile-menu { display: flex; }

  /* Content layout */
  .interests-mosaic { grid-template-columns: 1fr; }
  .tile-large { grid-row: span 1; }
  .tile-wide { grid-column: span 1; }
  .projects-grid { grid-template-columns: 1fr; }
  .content-card { padding: 1.5rem; }
  .edge-leaf { width: 55%; height: 50%; }
  .monstera-overlay { width: 40%; }
  .frame-left, .frame-right { width: 50px; }
}
@media (max-width: 480px) {
  .scene-content { padding: clamp(5rem,10vh,8rem) 1.25rem 3rem; }
  .contact-link { padding: 1rem; }
}

/* Firefox scrollbar */
html { scrollbar-width: thin; scrollbar-color: var(--green-dark) var(--black-deep); }

/* Scrollbar */
::selection { background: rgba(82,183,136,0.3); color: var(--white-soft); }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--black-deep); }
::-webkit-scrollbar-thumb { background: var(--green-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--green-mid); }
