/* ─────────────────────────────────────────
   modern.css — Tab shell, marquee, cursor,
   audio toggle, orbs, depth & progress
   Fazenda dos Pinheiros
───────────────────────────────────────── */

/* ── Scroll progress bar ── */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  z-index: 300;
  background: linear-gradient(
    90deg,
    var(--gold),
    var(--lavender-dim),
    var(--lavender)
  );
  box-shadow: 0 0 12px rgba(200, 152, 42, 0.55);
  pointer-events: none;
}

/* ── Site nav (glass tab bar) ── */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: rgba(13, 8, 24, 0.72);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border-bottom: 1px solid var(--border-gold);
}

.nav-inner {
  max-width: 1280px;
  margin: auto;
  padding: 10px var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--parchment);
  white-space: nowrap;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.nav-brand small {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
  font-weight: 400;
}

/* Tab pills */
.nav-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border-white);
  border-radius: var(--radius-pill);
  background: rgba(25, 15, 45, 0.55);
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
}
.nav-tabs::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  transition:
    color var(--duration) ease,
    background var(--duration) ease,
    border-color var(--duration) ease,
    box-shadow var(--duration) ease;
}

.nav-tab:hover {
  color: var(--parchment);
  background: rgba(160, 100, 240, 0.12);
}

.nav-tab.active {
  color: var(--ink);
  background: linear-gradient(120deg, var(--amber), var(--gold));
  border-color: var(--border-gold-strong);
  box-shadow:
    0 0 18px rgba(200, 152, 42, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  font-weight: 500;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

/* ── Audio toggle (equalizer) ── */
.audio-toggle {
  appearance: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-gold-mid);
  background: rgba(200, 152, 42, 0.08);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    border-color var(--duration) ease,
    background var(--duration) ease,
    box-shadow var(--duration) ease;
}

.audio-toggle:hover {
  border-color: var(--border-gold-strong);
  background: rgba(200, 152, 42, 0.16);
}

.audio-toggle.playing {
  border-color: var(--border-gold-strong);
  box-shadow: 0 0 16px rgba(200, 152, 42, 0.35);
}

.audio-toggle .eq {
  display: flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 14px;
}

.audio-toggle .eq i {
  width: 2.5px;
  height: 4px;
  border-radius: 2px;
  background: var(--amber);
  transition: height 0.3s ease;
}

.audio-toggle .eq i:nth-child(1) {
  height: 6px;
}
.audio-toggle .eq i:nth-child(2) {
  height: 11px;
}
.audio-toggle .eq i:nth-child(3) {
  height: 8px;
}
.audio-toggle .eq i:nth-child(4) {
  height: 12px;
}

.audio-toggle.playing .eq i {
  animation: eq-bounce 0.9s ease-in-out infinite;
}
.audio-toggle.playing .eq i:nth-child(1) {
  animation-delay: 0s;
  animation-duration: 0.82s;
}
.audio-toggle.playing .eq i:nth-child(2) {
  animation-delay: 0.18s;
  animation-duration: 0.66s;
}
.audio-toggle.playing .eq i:nth-child(3) {
  animation-delay: 0.36s;
  animation-duration: 0.94s;
}
.audio-toggle.playing .eq i:nth-child(4) {
  animation-delay: 0.09s;
  animation-duration: 0.72s;
}

@keyframes eq-bounce {
  0%,
  100% {
    height: 4px;
  }
  50% {
    height: 14px;
  }
}

/* ── Panels (tab content) ── */
main {
  position: relative;
  z-index: 1;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
  animation: panel-in 0.65s var(--ease-out);
  transform-origin: 50% 12%;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: perspective(1400px) rotateX(5deg) translateY(34px) scale(0.988);
    filter: blur(3px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

/* Non-hero panels need breathing room under the fixed nav */
.panel:not(#panel-inicio):not(#panel-home) {
  padding-top: 40px;
}

/* ── Marquee strip ── */
.marquee {
  overflow: hidden;
  padding: 26px 0;
  border-top: 1px solid var(--border-gold);
  border-bottom: 1px solid var(--border-gold);
  background: rgba(20, 12, 38, 0.4);
  position: relative;
  z-index: 1;
}

.marquee-track {
  display: flex;
  align-items: baseline;
  gap: 56px;
  width: max-content;
  animation: marquee-scroll 36s linear infinite;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-track span {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-style: italic;
  white-space: nowrap;
  color: var(--parchment);
  opacity: 0.85;
}

.marquee-track span:nth-child(4n + 3) {
  color: transparent;
  -webkit-text-stroke: 1px var(--lavender-dim);
  opacity: 0.75;
}

.marquee-track .marq-glyph {
  font-style: normal;
  font-size: 1rem;
  color: var(--amber);
  -webkit-text-stroke: 0;
  align-self: center;
}

@keyframes marquee-scroll {
  to {
    transform: translateX(-50%);
  }
}

/* ── Hero floating orbs (mouse parallax via data-depth) ── */
.hero-orbs {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(3px);
  opacity: 0.55;
  animation: orb-float 14s ease-in-out infinite alternate;
  will-change: transform;
}

.orb-1 {
  width: 130px;
  height: 130px;
  top: 14%;
  right: 8%;
  background: radial-gradient(
    circle at 32% 30%,
    rgba(208, 184, 245, 0.5),
    rgba(140, 80, 220, 0.12) 62%,
    transparent 75%
  );
}

.orb-2 {
  width: 70px;
  height: 70px;
  bottom: 20%;
  left: 5%;
  background: radial-gradient(
    circle at 35% 32%,
    rgba(232, 192, 74, 0.55),
    rgba(200, 152, 42, 0.12) 60%,
    transparent 75%
  );
  animation-delay: -5s;
  animation-duration: 11s;
}

.orb-3 {
  width: 44px;
  height: 44px;
  top: 30%;
  left: 42%;
  background: radial-gradient(
    circle at 35% 32%,
    rgba(208, 184, 245, 0.6),
    transparent 70%
  );
  animation-delay: -9s;
  animation-duration: 17s;
}

@keyframes orb-float {
  from {
    translate: 0 -14px;
  }
  to {
    translate: 0 18px;
  }
}

/* ── Cursor glow (augments, never replaces, the cursor) ── */
#cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 4;
  background: radial-gradient(
    circle,
    rgba(160, 100, 240, 0.14) 0%,
    rgba(200, 152, 42, 0.05) 40%,
    transparent 65%
  );
  mix-blend-mode: screen;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.5s ease;
  will-change: transform;
}

#cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(232, 192, 74, 0.55);
  pointer-events: none;
  z-index: 2001;
  transform: translate(-50%, -50%) scale(1);
  transition:
    opacity 0.4s ease,
    scale 0.25s var(--ease-out),
    border-color 0.25s ease;
  opacity: 0;
  will-change: transform;
}

body.cursor-active #cursor-glow,
body.cursor-active #cursor-ring {
  opacity: 1;
}

#cursor-ring.hovering {
  scale: 1.7;
  border-color: rgba(208, 184, 245, 0.85);
}

@media (hover: none) {
  #cursor-glow,
  #cursor-ring {
    display: none;
  }
}

/* ── Extra depth while tilting ── */
.hero-visual {
  transform-style: preserve-3d;
}

.hero-visual.tilting .hero-img-frame {
  transform: translateZ(26px);
  transition: transform 0.3s var(--ease-out);
}

.hero-visual::before,
.hero-visual::after {
  transform: translateZ(60px);
}

.species-card.tilting,
.card.tilting {
  box-shadow:
    0 34px 70px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(160, 100, 240, 0.1);
  z-index: 5;
}

/* ── Shimmer on display italics ── */
h1 em,
.section-header h2 em {
  background: linear-gradient(
    110deg,
    var(--lavender) 20%,
    #f3e8ff 42%,
    var(--lavender) 60%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer-slide 7s ease-in-out infinite;
}

@keyframes shimmer-slide {
  0%,
  55%,
  100% {
    background-position: 110% 0;
  }
  25% {
    background-position: -20% 0;
  }
}

/* ── Magnetic elements get a soft transition back ── */
.magnetic {
  transition: translate 0.35s var(--ease-out);
  will-change: translate;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .panel.active {
    animation: none;
  }
  .marquee-track {
    animation: none;
  }
  .orb {
    animation: none;
  }
  .audio-toggle.playing .eq i {
    animation: none;
    height: 10px;
  }
  h1 em,
  .section-header h2 em {
    animation: none;
  }
  #cursor-glow,
  #cursor-ring {
    display: none;
  }
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .nav-brand small {
    display: none;
  }
}

@media (max-width: 700px) {
  .nav-inner {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 8px;
    padding: 8px 12px;
  }
  .nav-brand {
    font-size: 0.95rem;
  }
  .nav-tab {
    padding: 8px 10px;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
  }
  .nav-actions {
    position: absolute;
    top: 8px;
    right: 12px;
  }
  .nav-brand {
    margin-right: 56px;
  }
  .audio-toggle {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 374px) {
  .nav-tab {
    padding: 8px 7px;
    font-size: 0.62rem;
    letter-spacing: 0.06em;
  }
  .nav-tabs {
    gap: 2px;
  }
}
