/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black:   #000000;
  --dark:    #0d0d0d;
  --mid:     #1a1a1a;
  --border:  rgba(255,255,255,0.12);
  --cream:   #f5f0e8;
  --white:   #ffffff;
  --muted:   rgba(245,240,232,0.5);
  --accent:  #c8a96e;

  --font-title: 'Cormorant Garamond', Georgia, serif;
  --font-body:  'Montserrat', system-ui, sans-serif;

  --nav-h: 64px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--black);
  color: var(--cream);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 48px;
  transition: background 0.4s var(--ease);
}
.nav.scrolled { background: rgba(0,0,0,0.85); backdrop-filter: blur(12px); }

.nav-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--cream);
  transition: opacity 0.2s;
}
.nav-logo:hover { opacity: 0.7; }

.nav-links {
  display: flex;
  gap: 40px;
  list-style: none;
}
.nav-links a {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream);
  opacity: 0.75;
  transition: opacity 0.2s;
}
.nav-links a:hover { opacity: 1; }

/* ============================================================
   HERO (index.html)
   ============================================================ */
/* Hero com zoom controlado pelo scroll */
.scroll-hero {
  position: relative;
  height: 260vh;            /* comprimento do "palco" de rolagem */
}
.scroll-hero-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scroll-hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.scroll-hero-media {
  background: var(--black);   /* começa preto, antes do fade-in */
}
/* fade a partir do preto quando a página carrega — fica por cima das imagens,
   mas dentro da mídia, então não cobre o nome/textos (que estão acima) */
.scroll-hero-media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  background: var(--black);
  opacity: 1;
  transition: opacity 1.4s var(--ease);
  pointer-events: none;
}
.scroll-hero.revealed .scroll-hero-media::before { opacity: 0; }

/* camadas do zoom contínuo: 3 imagens empilhadas; o JS controla escala + crossfade */
.scroll-hero-media .zoom-layer {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  filter: brightness(0.5);
  transform: scale(1.05);
  transform-origin: center center;
  will-change: transform, opacity;
}
/* a 1ª começa visível; as demais entram por crossfade (via JS) */
.scroll-hero-media .zoom-layer[data-zoom="1"],
.scroll-hero-media .zoom-layer[data-zoom="2"] { opacity: 0; }
.scroll-hero-tint {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(ellipse at center, transparent 28%, rgba(0,0,0,0.62) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px;
  animation: fadeUp 1.2s var(--ease) 0.3s both;
  will-change: opacity, transform;
}

/* Botão "Ver Galeria" que surge no fim do zoom */
.hero-cta-end {
  position: absolute;
  left: 50%;
  bottom: 14%;
  transform: translateX(-50%);
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  will-change: opacity, transform;
}

.hero-eyebrow {
  font-size: 0.65rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
  opacity: 0.9;
}

.hero-title {
  font-family: var(--font-title);
  font-size: clamp(3.5rem, 10vw, 9rem);
  font-weight: 300;
  line-height: 0.95;
  letter-spacing: -0.01em;
  color: var(--white);
  margin-bottom: 24px;
}
.hero-title em {
  font-style: italic;
  font-weight: 300;
  color: var(--cream);
}

.hero-subtitle {
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 48px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 14px 36px;
  border: 1px solid rgba(245,240,232,0.35);
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cream);
  transition: background 0.25s, border-color 0.25s, color 0.25s;
}
.hero-cta:hover {
  background: var(--cream);
  border-color: var(--cream);
  color: var(--black);
}
.hero-cta svg { transition: transform 0.25s; }
.hero-cta:hover svg { transform: translateX(4px); }

.hero-scroll {
  position: absolute;
  bottom: 36px; left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0.4;
  animation: fadeIn 1s var(--ease) 1.5s both;
}
.hero-scroll span {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.scroll-line {
  width: 1px;
  height: 40px;
  background: var(--cream);
  animation: scrollPulse 2s ease-in-out infinite;
}

/* ============================================================
   STATEMENT (manifesto / CTA da home)
   ============================================================ */
.statement {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 48px;
  background: var(--black);
  text-align: center;
}
.statement-cta { min-height: 50vh; }
.statement-text {
  font-family: var(--font-title);
  font-size: clamp(1.9rem, 4.5vw, 3.8rem);
  font-weight: 300;
  line-height: 1.3;
  color: var(--white);
  max-width: 820px;
}
.statement-text em {
  font-style: italic;
  color: var(--accent);
}

@media (max-width: 700px) {
  .statement { padding: 80px 24px; }
}

/* ============================================================
   GALERIA — fileira de cards; a seção pina e o scroll vertical
   desliza os cards horizontalmente (GSAP). Mobile: rolagem nativa.
   Card = só a foto; hover cresce, dá blur na foto inteira e sobe o nome.
   ============================================================ */
.hgallery { position: relative; background: var(--black); }

.hgallery-pin {
  position: relative;
  height: calc(28vh + 230px);
  overflow: hidden;
}
.hgallery-head {
  position: absolute;
  top: 44px; left: 48px;
  z-index: 3;
}
.strip-label {
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.hgallery-head h2 {
  font-family: var(--font-title);
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-weight: 300;
  color: var(--white);
}
.strip-hint {
  margin-top: 12px;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.hgallery-track {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
  gap: 22px;
  padding: 0 48px 30px;
  will-change: transform;
}

.hgallery-card {
  flex: 0 0 auto;
  height: 28vh;
  min-height: 150px;
  aspect-ratio: 3 / 4;
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  background: var(--mid);
  transition: transform 0.45s var(--ease), opacity 0.45s var(--ease), filter 0.45s var(--ease), box-shadow 0.4s var(--ease);
}
.hgallery-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  transition: transform 0.6s var(--ease);
}

.sc-cap {                       /* nome sobre a foto (nítida), no rodapé */
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px 18px;
  background: linear-gradient(to top, rgba(8,8,8,0.82), rgba(8,8,8,0.12) 46%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.hgallery-card:hover .sc-cap { opacity: 1; }

/* Foco no hover (igual à galeria do luhen): ao passar o mouse na faixa, as
   OUTRAS fotos encolhem, desfocam e somem; a foto sob o cursor dá zoom,
   fica nítida e vem pra frente — o nome continua igual. */
.hgallery-track:has(.hgallery-card:hover) .hgallery-card {
  opacity: 0.38;
  transform: scale(0.9);
  filter: blur(5px);
}
.hgallery-track:has(.hgallery-card:hover) .hgallery-card:hover {
  opacity: 1;
  transform: scale(1.06);
  filter: blur(0);
  z-index: 2;
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
}
.hgallery-track:has(.hgallery-card:hover) .hgallery-card:hover img { transform: scale(1.08); }
.sc-name {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--white);
  line-height: 1.12;
  transform: translateY(12px);
  transition: transform 0.45s var(--ease);
}
.sc-name.ital { font-style: italic; }
.sc-common {
  margin-top: 5px;
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  transform: translateY(12px);
  transition: transform 0.45s var(--ease) 0.04s;
}
.hgallery-card:hover .sc-name,
.hgallery-card:hover .sc-common { transform: translateY(0); }

/* Mobile / sem hover: rolagem horizontal nativa + nome sempre visível */
@media (max-width: 900px) {
  .hgallery-head { position: static; padding: 56px 24px 6px; }
  .hgallery-pin { height: auto; overflow: visible; }
  .hgallery-track {
    position: static;
    height: 30vh;
    min-height: 180px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 14px;
    padding: 8px 24px 24px;
  }
  .hgallery-card {
    height: 100%;
    min-height: 0;
    scroll-snap-align: center;
  }
  .sc-cap {
    opacity: 1;
    background: linear-gradient(to top, rgba(0,0,0,0.72), transparent 55%);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .sc-name, .sc-common { transform: none; }
  .hgallery-track:has(.hgallery-card:hover) .hgallery-card,
  .hgallery-card:hover { opacity: 1; transform: none; filter: none; }
}

/* ============================================================
   VIEWER PAGE (viewer.html)
   ============================================================ */
.page-viewer {
  background: var(--black);
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
}

#osd-viewer {
  width: 100%;
  height: 100%;
  background: var(--black) !important;
}

/* Vinheta leve sobre a imagem — controlada por JS conforme o zoom */
.viewer-vignette {
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
  opacity: 1;
  background: radial-gradient(ellipse at center, transparent 42%, rgba(0,0,0,0.55) 100%);
  transition: opacity 0.35s var(--ease);
}

/* Viewer nav bar */
.viewer-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
  transition: opacity 0.4s;
}
.viewer-bar.hidden { opacity: 0; pointer-events: none; }

.viewer-back {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream);
  opacity: 0.8;
  transition: opacity 0.2s;
}
.viewer-back:hover { opacity: 1; }

.viewer-title-wrap {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}
.viewer-photo-name {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--white);
}
.viewer-photo-counter {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}

.viewer-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.viewer-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--cream);
  opacity: 0.75;
  transition: opacity 0.2s, background 0.2s;
}
.viewer-btn:hover { opacity: 1; background: rgba(255,255,255,0.1); }

/* Viewer nav arrows */
.viewer-nav {
  position: fixed;
  top: 50%; transform: translateY(-50%);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--cream);
  opacity: 0;
  transition: opacity 0.3s, background 0.2s, transform 0.3s;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
}
.viewer-nav.prev { left: 20px; }
.viewer-nav.next { right: 20px; }
.page-viewer:hover .viewer-nav { opacity: 0.6; }
.viewer-nav:hover { opacity: 1 !important; background: rgba(0,0,0,0.7); }
.viewer-nav.disabled { opacity: 0 !important; pointer-events: none; }

/* Info panel */
.info-panel {
  position: fixed;
  top: 0; right: 0;
  width: 340px;
  height: 100%;
  z-index: 300;
  background: rgba(10,10,10,0.96);
  backdrop-filter: blur(20px);
  border-left: 1px solid var(--border);
  padding: 80px 36px 48px;
  transform: translateX(100%);
  transition: transform 0.45s var(--ease);
  overflow-y: auto;
}
.info-panel.open { transform: translateX(0); }

.info-panel-title {
  font-family: var(--font-title);
  font-size: 2rem;
  font-weight: 300;
  line-height: 1.1;
  color: var(--white);
  margin-bottom: 8px;
}
.info-panel-sub {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 28px;
}
.info-divider {
  width: 40px; height: 1px;
  background: var(--border);
  margin-bottom: 28px;
}
.info-panel-desc {
  font-size: 0.82rem;
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 36px;
}
.info-meta {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.info-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 0.7rem;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.info-meta-label {
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}
.info-meta-value {
  color: var(--cream);
  text-align: right;
}

.info-panel-close {
  position: absolute;
  top: 20px; right: 24px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  transition: color 0.2s;
}
.info-panel-close:hover { color: var(--white); }

/* Curiosity panel (top-right) */
.curiosity-panel {
  position: fixed;
  top: 88px; right: 28px;
  width: 360px;
  max-width: calc(100vw - 56px);
  max-height: calc(100vh - 140px);
  z-index: 320;
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(22px);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 30px 32px 34px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.55);
  overflow-y: auto;
  opacity: 0;
  transform: translateY(-12px) scale(0.98);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.curiosity-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.curiosity-eyebrow {
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.curiosity-name {
  font-family: var(--font-title);
  font-size: 1.7rem;
  font-weight: 400;
  line-height: 1.15;
  color: var(--white);
  margin-bottom: 8px;
}
.curiosity-name.ital { font-style: italic; }
.curiosity-sub {
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}
.curiosity-sub:empty { display: none; }

/* Nome popular (legenda sob o nome científico) */
.curiosity-common {
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}
.curiosity-common:empty { display: none; }

/* Bloco de taxonomia (Ordem / Família / Gênero / Espécie) */
.curiosity-tax {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 22px;
}
.curiosity-tax:empty { display: none; }
.tax-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.tax-row dt {
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.tax-row dd {
  font-size: 0.82rem;
  color: var(--cream);
  text-align: right;
}
.tax-row dd.ital { font-style: italic; }

.curiosity-rule {
  width: 36px; height: 1px;
  background: var(--accent);
  margin-bottom: 18px;
}
.curiosity-desc {
  font-size: 0.83rem;
  line-height: 1.8;
  color: rgba(255,255,255,0.82);
  margin-bottom: 16px;
}
.curiosity-desc:empty { display: none; }
.curiosity-text {
  font-size: 0.84rem;
  line-height: 1.85;
  color: var(--muted);
}
.curiosity-meta {
  margin-top: 22px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.curiosity-meta:empty { display: none; }
.curiosity-close {
  position: absolute;
  top: 16px; right: 18px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  transition: color 0.2s;
}
.curiosity-close:hover { color: var(--white); }

/* OSD custom toolbar */
.viewer-zoom-controls {
  position: fixed;
  top: 50%; right: 92px;
  transform: translateY(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 14px;
  opacity: 0.45;
  transition: opacity 0.4s;
}
.page-viewer:hover .viewer-zoom-controls { opacity: 0.85; }
.viewer-zoom-controls:hover { opacity: 1 !important; }

.zoom-btn {
  width: 78px; height: 78px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20,20,20,0.45);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 50%;
  color: var(--cream);
  font-size: 2.1rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 18px rgba(0,0,0,0.35);
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.2s var(--ease);
}
.zoom-btn:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.4);
  transform: scale(1.08);
}
.zoom-btn:active { transform: scale(0.96); }

.zoom-hint {
  position: fixed;
  bottom: 120px; left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  animation: fadeIn 1s var(--ease) 1s both, fadeOut 1s var(--ease) 4s both;
}

/* ============================================================
   ABOUT SECTION (in index.html)
   ============================================================ */
.about-section {
  min-height: 80vh;
  display: flex;
  align-items: center;
  padding: 120px 48px;
  background: var(--dark);
  border-top: 1px solid var(--border);
}
.about-inner {
  max-width: 680px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 80px;
  align-items: center;
}
.about-label {
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
}
.about-title {
  font-family: var(--font-title);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 300;
  line-height: 1.15;
  color: var(--white);
  margin-bottom: 32px;
}
.about-text {
  font-size: 0.85rem;
  line-height: 1.9;
  color: var(--muted);
  margin-bottom: 20px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  padding: 40px 48px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--black);
}
.footer-name {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: var(--cream);
  opacity: 0.5;
}
.footer-links {
  display: flex;
  gap: 28px;
  list-style: none;
}
.footer-links a {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--cream); }

/* ============================================================
   LOADING SCREEN
   ============================================================ */
.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--black);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  transition: opacity 0.6s var(--ease);
}
.loader.hidden { opacity: 0; pointer-events: none; }

.loader-name {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  color: var(--cream);
}
.loader-bar-wrap {
  width: 160px; height: 1px;
  background: var(--border);
  overflow: hidden;
}
.loader-bar {
  height: 1px;
  background: var(--cream);
  width: 0%;
  transition: width 0.8s var(--ease);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}
@keyframes scrollPulse {
  0%, 100% { transform: scaleY(1); opacity: 1; }
  50%       { transform: scaleY(0.6); opacity: 0.4; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .nav { padding: 0 24px; }
  .nav-links { gap: 20px; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .about-inner { gap: 40px; }
  .info-panel { width: 100%; }
  .curiosity-panel { left: 16px; right: 16px; width: auto; max-width: none; top: 76px; }
  .gallery-header { padding: 48px 24px 32px; }

  /* Controles do visualizador: barra horizontal na base (sem sobrepor as setas) */
  .viewer-zoom-controls {
    flex-direction: row;
    top: auto;
    right: auto;
    left: 50%;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
    transform: translateX(-50%);
    gap: 14px;
    opacity: 0.92;
  }
  .zoom-btn { width: 54px; height: 54px; font-size: 1.5rem; }
  .zoom-btn#zoomReset { font-size: 1.2rem !important; }
  #curiosityToggle svg { width: 24px; height: 24px; }

  /* Em tela estreita não dá pra contar com hover: setas sempre visíveis */
  .viewer-nav { width: 42px; height: 42px; opacity: 0.55; }
  .viewer-nav.prev { left: 12px; }
  .viewer-nav.next { right: 12px; }

  /* Dica de zoom acima da barra de controles (sobe junto com a safe-area) */
  .zoom-hint {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 96px);
    max-width: 78vw;
    text-align: center;
    line-height: 1.7;
  }
}

@media (max-width: 600px) {
  .nav-links { display: none; }
  .gallery-grid { grid-template-columns: 1fr; }
  .footer { flex-direction: column; gap: 20px; text-align: center; }

  .viewer-zoom-controls { gap: 11px; }
  .zoom-btn { width: 48px; height: 48px; font-size: 1.35rem; }
  .zoom-btn#zoomReset { font-size: 1.1rem !important; }
  #curiosityToggle svg { width: 21px; height: 21px; }
}

/* Em telas de toque não há hover: mantém setas e controles sempre visíveis */
@media (hover: none) {
  .viewer-nav { opacity: 0.55; }
  .viewer-zoom-controls { opacity: 0.92; }
}
