/* ===== Custom Properties ===== */
:root {
  --c-deep: #0B3D2E;
  --c-mid: #1A5C3A;
  --c-light: #7FDCB4;
  --c-glow: #00E5A0;
  --c-surface: #0F2E20;
  --c-text: #C8E6D8;
  --c-display: #E8F5EE;
  --c-warm: #FF7E6B;
}

/* ===== Reset ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', 'Inter', system-ui, sans-serif;
  background: var(--c-deep);
  color: var(--c-text);
  overflow-x: hidden;
  line-height: 1.75;
  font-size: clamp(1rem, 1.1vw, 1.2rem);
  transition: background-color 1.5s ease;
}
body[data-section="hero"] { background-color: var(--c-deep); }
body[data-section="rewind"] { background-color: var(--c-deep); }
body[data-section="restore"] { background-color: var(--c-mid); }
body[data-section="replay"] { background-color: var(--c-surface); }

/* ===== Scroll Progress (right-to-left) ===== */
.scroll-progress {
  position: fixed;
  top: 0;
  right: 0;
  height: 3px;
  width: 0%;
  background: var(--c-glow);
  z-index: 200;
  transition: width 0.1s linear;
  /* fills from right to left */
  transform-origin: right;
}

/* ===== Ambient Bubbles ===== */
.bubble-field {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.ambient-bubble {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(127, 220, 180, 0.3);
  background: radial-gradient(circle at 30% 30%, rgba(0, 229, 160, 0.15), transparent);
  will-change: transform;
  animation: bubbleRise var(--dur) linear infinite, bubbleWobble var(--wobble) ease-in-out infinite;
  animation-delay: var(--delay);
  bottom: -20px;
  left: var(--x);
}
@keyframes bubbleRise {
  0% { transform: translateY(0); opacity: 0.6; }
  100% { transform: translateY(calc(-100vh - 40px)); opacity: 0; }
}
@keyframes bubbleWobble {
  0%, 100% { margin-left: 0; }
  50% { margin-left: 15px; }
}

/* ===== Cursor Trail ===== */
.cursor-trail {
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
}
.trail-dot {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--c-glow);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.trail-dot.active { opacity: 0.5; transform: scale(1); }
.trail-dot.fading { opacity: 0; transform: scale(0.3); }

/* ===== Hero ===== */
.hero {
  min-height: 120vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 2rem;
}
.hero-title {
  font-family: 'Bebas Neue', cursive;
  font-size: clamp(3rem, 14vw, 12rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 0.95;
  color: var(--c-display);
  text-transform: uppercase;
  text-shadow: 0 0 40px rgba(0, 229, 160, 0.15), 0 0 80px rgba(0, 229, 160, 0.05);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: default;
}
.hero-title:hover { transform: scale(1.08); }
.hero-sub {
  margin-top: 2rem;
  animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.5; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-6px); }
}

/* ===== Content Sections ===== */
.content-section {
  position: relative;
  z-index: 10;
  min-height: 85vh;
  display: flex;
  align-items: center;
  padding: 6rem 2rem;
}
.section-inner {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}
.section-inner.offset-left {
  margin-left: 8%;
  margin-right: auto;
}
.section-heading {
  font-family: 'Bebas Neue', cursive;
  font-size: clamp(2rem, 5vw, 4.5rem);
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 0.95;
  color: var(--c-display);
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: default;
}
.section-heading:hover { transform: scale(1.08); }

.content-section p {
  margin-bottom: 1.25rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.content-section.visible p {
  opacity: 1;
  transform: translateY(0);
}
.content-section p:nth-child(3) { transition-delay: 0.15s; }
.content-section p:nth-child(4) { transition-delay: 0.3s; }

.glow-text {
  color: var(--c-glow);
  text-shadow: 0 0 8px rgba(0, 229, 160, 0.4);
}

/* ===== Two-Panel Layout ===== */
.two-panel {
  max-width: 960px;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 3rem;
  align-items: center;
}
.panel-wide { }
.panel-narrow {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

/* ===== Bubble Cluster ===== */
.bubble-cluster {
  position: relative;
  width: 200px;
  height: 200px;
}
.cluster-bubble {
  position: absolute;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  border: 1px solid rgba(127, 220, 180, 0.4);
  background: radial-gradient(circle at 30% 30%, rgba(0, 229, 160, 0.2), transparent);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: transform 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}
.cluster-bubble:hover {
  background: radial-gradient(circle at 30% 30%, rgba(255, 126, 107, 0.3), transparent);
  border-color: var(--c-warm);
  transform: translate(-50%, -50%) scale(1.15);
}
.bubble-cluster.scattered .cluster-bubble {
  transform: translate(
    calc(-50% + cos(var(--angle)) * var(--dist)),
    calc(-50% + sin(var(--angle)) * var(--dist))
  );
}

/* ===== Replay Banner ===== */
.section-replay {
  min-height: 80vh;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.replay-banner {
  text-align: center;
  max-width: 800px;
  padding: 4rem 2rem;
}
.banner-heading {
  font-size: clamp(3rem, 8vw, 7rem);
  margin-bottom: 2rem;
}
.banner-heading span {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.banner-heading span:hover { transform: scale(1.2); }
.banner-text {
  font-size: 1.15rem;
  color: var(--c-light);
  max-width: 600px;
  margin: 0 auto;
}

/* ===== Footer ===== */
.site-footer {
  position: relative;
  z-index: 10;
  padding: 3rem 2rem;
  text-align: center;
  background: var(--c-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.footer-domain {
  font-family: 'Bebas Neue', cursive;
  font-size: 1.4rem;
  letter-spacing: 0.08em;
  color: var(--c-display);
  text-transform: uppercase;
}

/* ===== Nav Bubble ===== */
.nav-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 500;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--c-mid);
  border: 1px solid var(--c-light);
  color: var(--c-glow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: bobFloat 3s ease-in-out infinite;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s;
}
.nav-bubble:hover {
  transform: scale(1.25);
  background: var(--c-glow);
  color: var(--c-deep);
}
@keyframes bobFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.nav-panel {
  position: fixed;
  bottom: 80px;
  right: 24px;
  z-index: 499;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--c-surface);
  border: 1px solid rgba(127, 220, 180, 0.2);
  border-radius: 12px;
  padding: 1rem;
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.nav-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.nav-panel a {
  color: var(--c-text);
  text-decoration: none;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}
.nav-panel a:hover {
  background: rgba(0, 229, 160, 0.15);
  color: var(--c-glow);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .two-panel {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .section-inner.offset-left {
    margin-left: auto;
    padding: 0 1rem;
  }
  .content-section { padding: 4rem 1.5rem; }
  .hero { min-height: 100vh; }
  .panel-narrow { min-height: 200px; }
}
@media (max-width: 480px) {
  .content-section { padding: 3rem 1rem; }
  .nav-bubble { width: 40px; height: 40px; bottom: 16px; right: 16px; }
  .nav-panel { bottom: 64px; right: 16px; }
}
