:root {
  --green: #10b981; /* Precise clean corporate green */
  --bg: #e6e4df; /* Unified consistent base background */
  --text: #1a1a1a;
  --font-main: 'Plus Jakarta Sans', sans-serif;
}

/* Home Hero Landing Style: 3D World Illusion */
.home-hero {
  position: relative;
  width: 100%;
  height: 100vh;
  z-index: 1000;
  overflow: hidden;
  perspective: 1200px; /* Depth of the 3D 'window' */
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e6e4df; /* Updated to signature site off-white */
}

/* Cinematic Iris (Dynamic Portal Reveal) */
#hero-iris-wrapper {
  clip-path: ellipse(0% 0% at 50% 50%);
  will-change: clip-path;
}

/* Base Image Layer (Cinematic Lens Focus) */
.hero-bg {
  position: absolute;
  top: -5%;
  left: -5%;
  width: 110%;
  height: 110%;
  background: url('assets/home_hero.png') center/cover no-repeat;
  z-index: 1;
  transform: translateZ(0) scale(1.15); 
  filter: blur(25px) brightness(0.6);
  opacity: 0;
  backface-visibility: hidden;
  will-change: transform, filter, opacity;
}

/* Atmosphere Layer (Floating Particles) */
.hero-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
  transform: translateZ(150px); /* Deep spatial offset */
}

.p-item {
  position: absolute;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  filter: blur(2px);
  will-change: transform;
}

.p1 { width: 15px; height: 15px; top: 20%; left: 30%; opacity: 0.3; }
.p2 { width: 8px; height: 8px; top: 60%; left: 70%; opacity: 0.5; }
.p3 { width: 12px; height: 12px; top: 40%; left: 10%; opacity: 0.2; }
.p4 { width: 5px; height: 5px; top: 80%; left: 40%; opacity: 0.6; }
.p5 { width: 20px; height: 20px; top: 10%; left: 80%; opacity: 0.1; }

/* Dynamic Lighting Vignette */
.hero-vignette {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(circle at var(--vignette-x, 50%) var(--vignette-y, 50%), transparent 0%, rgba(0,0,0,0.4) 100%);
  mix-blend-mode: multiply;
  opacity: 0.8;
}

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

html {
  /* Hide Scrollbar while maintaining scroll functionality */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE / Edge */
}

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: color 0.5s ease;
  
  /* Hide Scrollbar while maintaining scroll functionality */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE / Edge */
}

body.dark-backdrop {
  color: #fff;
}

html::-webkit-scrollbar, body::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

#canvas3d {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
}

/* Dynamic Game Backdrop */
#dynamic-bg-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
}

.dyn-bg-layer {
  position: absolute;
  top: -20%;
  left: -10%;
  width: 120%;
  height: 140%;
  background-size: cover;
  background-position: center;
  filter: blur(4px) brightness(0.65) saturate(1.2);
  opacity: 0;
  transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity;
}

/* White tint overlay for subtle lighting effect */
.dyn-bg-tint {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.25);
  pointer-events: none;
  z-index: 2;
}

.dyn-bg-layer.is-active {
  opacity: 1;
}

/* Subtle Load Animation */
@keyframes subtleLogoLoad {
  0% {
    opacity: 0;
    transform: scale(0.7) translateY(15px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0) rotate(10deg);
  }
}

/* Hexagon Logo (Top Left) */
.hex-logo-btn {
  position: fixed;
  top: 2.5rem;
  left: 2.5rem;
  width: 44px;
  height: 52px;
  cursor: pointer;
  z-index: 2000; /* Over hero (1000) */
  opacity: 0; /* Fade in via JS */
  /* Premium easing for the swoop to center */
  transition: top 0.7s cubic-bezier(0.77, 0, 0.175, 1), 
              left 0.7s cubic-bezier(0.77, 0, 0.175, 1), 
              transform 0.8s cubic-bezier(0.77, 0, 0.175, 1),
              opacity 0.5s ease;
  transform: rotate(10deg);
}

.hex-logo-btn:hover:not(.is-expanded) {
  transform: scale(1.05) rotate(10deg);
}

.hex-logo-btn.is-expanded {
  top: 50%;
  left: 25%; /* Fix to the left side */
  /* Scale it, tilt it slightly, and center its origin point */
  transform: translate(-50%, -50%) scale(10) rotate(10deg);
  pointer-events: auto; /* Allow clicking the big logo again to close */
}

.hex-path {
  fill: transparent;
  stroke: #F2613F; /* Vibrant orange from logo */
  stroke-width: 24;
  stroke-linejoin: round;
  transition: stroke 0.3s ease;
}

.hex-logo-btn:hover:not(.is-expanded) .hex-path {
  stroke: #ff8558;
}

/* Base image state: completely hidden when logo is small */
.member-img {
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s ease;
  transform: scale(1.1);
}

.hex-logo-btn.is-expanded .member-img {
  opacity: 1;
  transform: scale(1);
}

.hex-logo-btn.is-expanded .hex-path {
  /* Give the images a subtle border instead of the massive thick lines */
  stroke-width: 3; 
  stroke: #fdfaf0; /* Blend borders slightly with background */
}

.hex-logo-btn.is-expanded .empty-hex {
  /* The center empty hexagon keeps the branding orange */
  stroke: #F2613F;
  stroke-width: 6;
}

.hex-logo-btn.is-expanded .team-member {
  cursor: pointer;
}

/* Hover effect on individual team members */
.hex-logo-btn.is-expanded .team-member:hover .member-img {
  transform: scale(1.1); /* Subtle zoom */
  opacity: 0.8;
}

.hex-logo-btn.is-expanded .team-member:hover .hex-path {
  stroke: #F2613F;
  stroke-width: 8;
  transition: all 0.2s ease;
}

/* Team Background Overlay - Expands like a ripple */
.team-bg-overlay {
  position: fixed;
  top: 3.5rem;
  left: 3.5rem;
  width: 52px;
  height: 52px;
  background-color: #e6e4df; /* Matches main scene exactly */
  border-radius: 50%;
  z-index: 1500; /* Over hero (1000) */
  transform: scale(0);
  transform-origin: center center;
  transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
  pointer-events: none;
}

.team-bg-overlay.is-expanded {
  transform: scale(100); /* Expand massively to cover screen */
}

/* Team Info Space on Right */
.team-content {
  position: fixed;
  top: 0;
  right: 0;
  width: 50vw; /* Take the right half of the screen */
  height: 100vh;
  z-index: 1600; /* Over team-bg-overlay (1500) */
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.team-content.is-expanded {
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0.4s; /* Fade in after background expands */
}

.team-info-placeholder {
  max-width: 500px;
  color: #1a1a1a;
}

.team-info-placeholder h1 {
  font-size: 4.5rem;
  font-weight: 800;
  letter-spacing: -2px;
  margin-bottom: 1.5rem;
  line-height: 1;
}

.team-info-placeholder p {
  font-size: 1.2rem;
  line-height: 1.6;
  color: #555;
}

/* Bold Clean Black Logos (Top Right) */
.brand-logos {
  position: fixed;
  top: 2.5rem;
  right: 2.5rem;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  z-index: 2000; /* Over hero (1000) */
  opacity: 0; /* Fade in via JS */
  user-select: none;
  cursor: pointer;
  color: inherit;
  transition: color 0.5s ease, opacity 0.2s;
}

.brand-logos:hover {
  opacity: 0.6;
}

.logo-main { letter-spacing: -1px; }
.logo-sub { font-weight: 900; letter-spacing: 1px; }

/* Tiny Scroll Down Arrow (Bottom Left) */
.scroll-arrow {
  position: fixed;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: inherit;
  z-index: 2000; /* Must be higher than .home-hero (1000) */
  opacity: 0; /* Initially hidden, animate loop takes over */
  transition: color 0.5s ease, opacity 0.5s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), left 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-arrow.is-up {
  transform: rotate(180deg);
}

.scroll-arrow.is-left {
  /* Rotate 90deg to point the down-arrow to the left */
  /* Force position to the corner when acting as a back button */
  left: 2.5rem !important;
  transform: translateX(0) rotate(90deg) !important;
  opacity: 1 !important; /* Ensure it stays visible */
}

.scroll-arrow-inner {
  animation: slightBounce 2s infinite ease-in-out;
}

@keyframes slightBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

@media (max-width: 768px) {
  .hex-logo-btn { top: 2rem; left: 2rem; width: 36px; height: 42px; }
  .brand-logos { top: 2.5rem; right: 2rem; font-size: 1rem; }
  .scroll-arrow { bottom: 2rem; left: 2.5rem; }
}

/* --- DYNAMIC INFO CARDS --- */
#ui-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 10;
}

.info-card {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  max-width: 400px;
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 2.5rem;
  color: #1a1a1a;
  pointer-events: auto; /* Allow interaction if needed */
}

.left-side {
  left: 8%;
  text-align: left;
}

.right-side {
  right: 8%;
  text-align: right;
}

.card-tag {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.25rem;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 1rem;
}

.info-card h2 {
  font-size: 4rem;
  font-weight: 800;
  margin: 0 0 1.5rem 0;
  line-height: 1.0;
  color: #fff;
  letter-spacing: -2px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.4);
}

.info-card p {
  font-size: 1.15rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.8);
  margin: 0;
  font-weight: 500;
  text-shadow: 0 1px 10px rgba(0,0,0,0.3);
}

@media (max-width: 1024px) {
    .info-card { max-width: 300px; }
    .info-card h2 { font-size: 2.5rem; }
}

/* --- FINALE SECTION --- */

/* Finale Typography Style */
.finale-text {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -100%); /* Position in the sky */
  text-align: center;
  z-index: 100; /* Behind contact but above sea */
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.finale-text h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #fff;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  margin: 0;
}
