/* ============================================
   FROGECOIN — style.css
   The swamp is alive.
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Dela+Gothic+One&family=Fira+Code:wght@400;500&family=Lora:ital@1&display=swap');

/* --- TOKENS --- */
:root {
  --deep: #0B1A0E;
  --neon: #39FF14;
  --violet: #7B2D8E;
  --text: #E4F5D4;
  --moss: #3A5A3A;
  --abyss: #070F08;
  --neon-04: rgba(57,255,20,0.04);
  --neon-06: rgba(57,255,20,0.06);
  --neon-08: rgba(57,255,20,0.08);
  --neon-10: rgba(57,255,20,0.1);
  --neon-30: rgba(57,255,20,0.3);
  --violet-15: rgba(123,45,142,0.15);
}

/* --- RESET --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  background: var(--deep);
  color: var(--text);
  font-family: 'Lora', serif;
  font-style: italic;
  line-height: 1.6;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

/* --- FONT UTILITIES --- */
.font-display, .section-title, .hero-ticker, .army-title, .army-unite, .lore-tagline, .epoch-name-final, .step-num {
  font-family: 'Dela Gothic One', sans-serif;
  font-style: normal;
}
.font-mono, .prophecy-label, .prophecy-attr, .footer-ca, .toast {
  font-family: 'Fira Code', monospace;
  font-style: normal;
}

/* ============================================
   VISUAL LAYER — fixed, decorative
   ============================================ */

.visual-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* Water caustics */
.caustics {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 400px at 20% 30%, rgba(57,255,20,0.04), transparent),
    radial-gradient(ellipse 500px 350px at 70% 60%, rgba(57,255,20,0.03), transparent),
    radial-gradient(ellipse 400px 300px at 50% 80%, rgba(57,255,20,0.025), transparent);
  background-size: 200% 200%;
  animation: caustics 18s ease-in-out infinite;
  opacity: 0.8;
}

/* Duckweed */
.duckweed {
  position: absolute;
  inset: 0;
  opacity: 0.02;
}

/* Bubbles container */
.bubbles {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.bubble {
  position: absolute;
  border-radius: 50%;
  background: var(--neon-04);
  border: 1px solid rgba(57,255,20,0.06);
  pointer-events: none;
  will-change: transform;
  animation: bubble-rise var(--rise-dur, 16s) linear infinite, bubble-wobble var(--wobble-dur, 6s) ease-in-out infinite;
  animation-delay: var(--bubble-delay, 0s);
  bottom: -80px;
}

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */

@keyframes bubble-rise {
  0% { transform: translateY(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 0.6; }
  100% { transform: translateY(calc(-100vh - 100px)); opacity: 0; }
}

@keyframes bubble-wobble {
  0%, 100% { margin-left: 0; }
  25% { margin-left: 15px; }
  75% { margin-left: -15px; }
}

@keyframes caustics {
  0% { background-position: 0% 0%; }
  33% { background-position: 100% 50%; }
  66% { background-position: 50% 100%; }
  100% { background-position: 0% 0%; }
}

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

@keyframes pulse-glow {
  0%, 100% { text-shadow: 0 0 20px rgba(57,255,20,0.3), 0 0 40px rgba(57,255,20,0.15); }
  50% { text-shadow: 0 0 30px rgba(57,255,20,0.6), 0 0 60px rgba(57,255,20,0.3), 0 0 80px rgba(57,255,20,0.1); }
}

@keyframes prophecy-emerge {
  0% { opacity: 0; transform: scale(0.92); filter: blur(8px); }
  100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes pulse-opacity {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@keyframes scroll-hint-bubble {
  0% { transform: translateY(0) scale(1); opacity: 0.6; }
  100% { transform: translateY(-40px) scale(0.5); opacity: 0; }
}

@keyframes timeline-fill {
  0% { transform: scaleY(0); }
  100% { transform: scaleY(1); }
}

/* ============================================
   SCROLL REVEAL SYSTEM
   ============================================ */

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  transition-delay: var(--delay, 0s);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Side-slide variants */
.rally-left {
  transform: translateX(-60px) translateY(0);
}
.rally-right {
  transform: translateX(60px) translateY(0);
}
.rally-left.visible,
.rally-right.visible {
  transform: translateX(0) translateY(0);
}

/* ============================================
   LILY PAD NAV
   ============================================ */

.lily-nav {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 100;
}

.lily-pad {
  position: relative;
  width: 56px;
  height: 38px;
  background: linear-gradient(135deg, #1a4a1a, #0d2e0d);
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4), 0 0 12px rgba(57,255,20,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: lily-rock 4s ease-in-out infinite;
  cursor: pointer;
  transition: width 0.4s ease, height 0.4s ease, border-radius 0.4s ease;
  overflow: hidden;
}

.lily-icon {
  font-size: 18px;
  transition: opacity 0.3s;
  flex-shrink: 0;
  position: absolute;
}

.lily-menu {
  opacity: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 16px;
  transition: opacity 0.3s ease 0.15s;
  width: max-content;
}

.lily-pad:hover {
  width: 240px;
  height: auto;
  min-height: 120px;
  border-radius: 16px;
  animation: none;
  background: rgba(57,255,20,0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(57,255,20,0.12);
}

.lily-pad:hover .lily-icon {
  opacity: 0;
  pointer-events: none;
}

.lily-pad:hover .lily-menu {
  opacity: 1;
  pointer-events: auto;
}

.lily-link {
  font-family: 'Fira Code', monospace;
  font-style: normal;
  font-size: 12px;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
  text-align: left;
  display: block;
}

.lily-link:hover {
  background: var(--neon-10);
  color: var(--neon);
}

/* ============================================
   TOAST
   ============================================ */

.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  font-size: 13px;
  padding: 10px 24px;
  background: rgba(57,255,20,0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(57,255,20,0.15);
  border-radius: 8px;
  color: var(--neon);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 200;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* ============================================
   LAYERS — SHARED
   ============================================ */

.layer {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
}

.section-title {
  font-size: clamp(28px, 5vw, 52px);
  color: var(--neon);
  text-align: center;
  letter-spacing: 2px;
  margin-bottom: 16px;
}

.section-sub {
  font-size: clamp(14px, 2.5vw, 18px);
  color: var(--moss);
  text-align: center;
  margin-bottom: 48px;
}

/* ============================================
   BLOCK 1 — HERO
   ============================================ */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--abyss);
  padding: 60px 24px;
}

.hero-banner {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.35;
}

.hero-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(7,15,8,0.2) 0%, rgba(7,15,8,0.9) 100%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  animation: prophecy-emerge 2s ease-out both;
}

.hero-ticker {
  font-family: 'Dela Gothic One', sans-serif;
  font-style: normal;
  font-size: clamp(48px, 12vw, 120px);
  color: var(--neon);
  text-shadow: 0 0 40px rgba(57,255,20,0.4), 0 0 80px rgba(57,255,20,0.15);
  line-height: 1;
  letter-spacing: 4px;
}

.hero-name {
  font-size: clamp(16px, 3vw, 22px);
  color: var(--text);
  opacity: 0.7;
  margin-top: -8px;
}

.hero-links {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-links .ca-copy {
  word-break: break-all;
  font-family: 'Fira Code', monospace;
  font-style: normal;
  font-size: 11px;
}

/* ============================================
   BLOCK 2 — THE LORE
   ============================================ */

.lore {
  background: var(--deep);
}

.lore-narrative {
  font-size: clamp(16px, 2.5vw, 20px);
  color: var(--text);
  text-align: center;
  max-width: 580px;
  line-height: 1.7;
  margin-bottom: 32px;
}

.prophecy-embed {
  max-width: 550px;
  width: 100%;
  margin-bottom: 24px;
}

.lore-tagline {
  font-family: 'Dela Gothic One', sans-serif;
  font-style: normal;
  font-size: clamp(14px, 2.5vw, 18px);
  color: var(--neon);
  letter-spacing: 8px;
  text-transform: uppercase;
}

/* ============================================
   BLOCK 3 — GROK CHAT
   ============================================ */

.grok-chat {
  background: var(--abyss);
}

.chat-container {
  max-width: 640px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 24px;
}

.chat-msg {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.05);
}

.chat-bubble {
  padding: 16px 20px;
  border-radius: 12px;
  font-style: normal;
  font-size: 14px;
  line-height: 1.7;
  max-width: 100%;
}

.chat-bubble p {
  margin-bottom: 10px;
}

.chat-bubble p:last-child {
  margin-bottom: 0;
}

.chat-sender {
  font-family: 'Fira Code', monospace;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 8px;
  opacity: 0.5;
}

.chat-human .chat-bubble {
  background: rgba(57,255,20,0.06);
  border: 1px solid rgba(57,255,20,0.1);
  border-radius: 12px 12px 12px 0;
  color: var(--text);
}

.chat-grok .chat-bubble {
  background: rgba(123,45,142,0.08);
  border: 1px solid rgba(123,45,142,0.15);
  border-radius: 12px 12px 0 12px;
  color: var(--text);
}

.chat-full {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(123,45,142,0.15);
}

.chat-full.open {
  display: block;
}

.chat-expand {
  display: inline-block;
  font-family: 'Fira Code', monospace;
  font-style: normal;
  font-size: 13px;
  padding: 12px 28px;
  border: 1px solid var(--neon-30);
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s, color 0.3s;
  letter-spacing: 1px;
  text-decoration: none;
}

.chat-expand:hover {
  background: var(--neon-10);
  border-color: var(--neon);
  color: var(--neon);
}

/* ============================================
   LAYER 2 — THE LINEAGE
   ============================================ */

.layer-2 {
  background: var(--deep);
}

.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 48px;
  padding: 40px 0;
  max-width: 480px;
  width: 100%;
  margin-top: 32px;
}

.timeline-line {
  position: absolute;
  left: 5px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--neon-30);
  transform-origin: top;
  transform: scaleY(0);
  transition: transform 1.5s ease-out;
}

.timeline-line.visible {
  transform: scaleY(1);
}

.epoch {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding-left: 0;
}

.epoch-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid var(--neon-30);
  background: transparent;
  flex-shrink: 0;
  margin-top: 6px;
  transition: background 0.5s, border-color 0.5s, box-shadow 0.5s;
}

.epoch.visible .epoch-dot {
  background: var(--neon);
  border-color: var(--neon);
  box-shadow: 0 0 8px rgba(57,255,20,0.4);
}

.epoch-dot-final {
  width: 18px;
  height: 18px;
  margin-top: 3px;
}

.epoch.visible .epoch-dot-final {
  animation: pulse-glow-dot 2s ease-in-out infinite;
  box-shadow: 0 0 12px rgba(57,255,20,0.5), 0 0 24px rgba(123,45,142,0.3);
}

@keyframes pulse-glow-dot {
  0%, 100% { box-shadow: 0 0 8px rgba(57,255,20,0.4), 0 0 16px rgba(123,45,142,0.2); }
  50% { box-shadow: 0 0 16px rgba(57,255,20,0.7), 0 0 32px rgba(123,45,142,0.4); }
}

.epoch-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.epoch-year {
  font-family: 'Fira Code', monospace;
  font-style: normal;
  font-size: 12px;
  color: var(--moss);
  letter-spacing: 2px;
}

.epoch-name {
  font-size: 20px;
  color: var(--text);
}

.epoch-name-final {
  font-size: 36px;
  color: var(--neon);
  line-height: 1.1;
}

.epoch-sub {
  font-size: 14px;
  color: var(--moss);
}

.epoch-sub-final {
  color: var(--violet);
}

.cta-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 16px;
}

.cta-btn {
  font-family: 'Fira Code', monospace;
  font-style: normal;
  font-size: 13px;
  padding: 12px 28px;
  border: 1px solid var(--neon-30);
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  transition: background 0.3s, border-color 0.3s, color 0.3s, box-shadow 0.3s;
  letter-spacing: 1px;
}

.cta-btn:hover {
  background: var(--neon-10);
  border-color: var(--neon);
  color: var(--neon);
  box-shadow: 0 0 16px rgba(57,255,20,0.15);
}

/* ============================================
   LAYER 4 — IT'S EVERYWHERE
   ============================================ */

.layer-4 {
  background: var(--deep);
  padding-bottom: 100px;
}

.proof-grid {
  display: flex;
  gap: 20px;
  max-width: 1100px;
  width: 100%;
  margin-top: 8px;
  justify-content: center;
  align-items: stretch;
}

.proof-item {
  flex: 1;
  min-width: 0;
  aspect-ratio: 1;
  border-radius: 12px;
  border: 1px solid var(--neon-08);
  background: rgba(57,255,20,0.02);
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}

.proof-item:hover {
  border-color: var(--violet);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px var(--violet-15);
}

.proof-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Placeholder for missing proof images */
.proof-item img:not([complete]) {
  min-height: 180px;
  background: linear-gradient(135deg, rgba(57,255,20,0.04), rgba(57,255,20,0.01));
}

/* ============================================
   LAYER 5 — THE ARMY
   ============================================ */

.layer-5 {
  background: linear-gradient(to top, #142A18, #1A3A1F);
  padding-bottom: 100px;
}

.army-title {
  font-size: clamp(48px, 10vw, 96px);
  color: var(--neon);
  text-align: center;
  animation: pulse-glow 2s ease-in-out infinite;
  letter-spacing: 4px;
}

.army-unite {
  font-size: 24px;
  color: var(--violet);
  letter-spacing: 8px;
  margin-bottom: 48px;
  text-align: center;
}

.rally-lines {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  max-width: 800px;
  width: 100%;
}

.rally-line {
  font-size: clamp(18px, 3vw, 28px);
  color: var(--text);
  text-align: center;
  width: 100%;
  padding: 0 24px;
}

.rally-divider {
  display: flex;
  justify-content: center;
  opacity: 0.4;
}

/* ============================================
   LAYER 6 — JOIN THE POND
   ============================================ */

.layer-6 {
  background: var(--deep);
  padding-bottom: 100px;
}

.pond-steps {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
  max-width: 500px;
  width: 100%;
  margin-top: 48px;
  padding: 0 24px;
}

.pond-path {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 100%;
  pointer-events: none;
}

.pond-step {
  width: 100%;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.pond-step:nth-child(odd) { align-self: flex-start; }
.pond-step:nth-child(even) { align-self: flex-end; }

.lily-pad-step {
  background: linear-gradient(135deg, #1a4a1a, #0d2e0d);
  border-radius: 50%;
  width: clamp(200px, 50vw, 260px);
  height: clamp(130px, 32vw, 170px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 28px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3), 0 0 12px rgba(57,255,20,0.06);
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
}

.lily-pad-step:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4), 0 0 20px rgba(57,255,20,0.1);
}

.pond-step-1 .lily-pad-step { transform: rotate(-3deg); }
.pond-step-2 .lily-pad-step { transform: rotate(2deg); }
.pond-step-3 .lily-pad-step { transform: rotate(-1deg); }
.pond-step-4 .lily-pad-step { transform: rotate(3deg); }

.step-num {
  font-size: 20px;
  color: var(--neon);
  margin-bottom: 8px;
}

.step-text {
  font-size: clamp(12px, 2vw, 14px);
  color: var(--text);
  line-height: 1.5;
}

/* ============================================
   FOOTER
   ============================================ */

.swamp-footer {
  position: relative;
  z-index: 1;
  background: linear-gradient(to top, #1A3A1F, #223D26);
  padding: 60px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.footer-frog {
  opacity: 0.5;
}

.footer-prophecy {
  font-size: 14px;
  color: var(--text);
  animation: pulse-opacity 4s ease-in-out infinite;
}

.footer-ca {
  font-size: 10px;
  color: var(--moss);
  padding: 8px 16px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  word-break: break-all;
  max-width: 400px;
  text-align: center;
}

.footer-ca:hover {
  color: var(--neon);
  background: var(--neon-06);
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Tablet */
@media (min-width: 768px) {
  .timeline {
    max-width: 520px;
    padding-left: 40px;
  }
  .timeline-line {
    left: 45px;
  }
  .epoch {
    padding-left: 40px;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .pond-steps {
    max-width: 600px;
  }

  .pond-step:nth-child(3) { /* step 2 — shifted right */
    margin-left: 120px;
  }
  .pond-step:nth-child(4) { /* step 3 — shifted left */
    margin-right: 120px;
  }
  .pond-step:nth-child(5) { /* step 4 — shifted right */
    margin-left: 120px;
  }
}

/* Mobile — small tweaks */
@media (max-width: 480px) {
  .proof-grid {
    flex-direction: column;
    max-width: 400px;
  }

  .lily-nav {
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
  }

  .lily-pad:hover {
    width: calc(100vw - 48px);
  }

  .cta-row {
    flex-direction: column;
    align-items: center;
  }

  .cta-btn {
    width: 100%;
    max-width: 260px;
    text-align: center;
  }

  .rally-left,
  .rally-right {
    transform: translateY(40px);
  }
  .rally-left.visible,
  .rally-right.visible {
    transform: translateY(0);
  }

  .lily-pad-step {
    width: 220px;
    height: 145px;
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  .bubble {
    display: none;
  }
}
