:root {
  --ink: #1c2541;
  --ink-soft: #4d5476;
  --deep: #10152a;
  --paper: #faf5ea;
  --paper-alt: #f1e8d6;
  --card: #fffdf8;
  --gold: #d6a13c;
  --gold-dark: #b9832a;
  --ember: #c85a3f;
  --line: rgba(28, 37, 65, 0.14);
  --line-strong: rgba(28, 37, 65, 0.34);
  --shadow: 0 14px 34px rgba(16, 21, 42, 0.12);
  --radius: 18px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "Fira Code", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: var(--serif);
  margin: 0;
}

.about h2, .members h2, .journey h2, .gallery h2,
.timeline-item h3 {
  color: var(--ink);
}

img { max-width: 100%; display: block; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Ambient notes (hero) ---------- */

.hero-notes {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-notes .drift {
  position: absolute;
  color: rgba(250, 245, 234, 0.16);
  font-size: 2.6rem;
  line-height: 1;
}

.n1 { top: 12%; left: 8%; font-size: 2.1rem; }
.n2 { top: 22%; left: 88%; font-size: 3.2rem; }
.n3 { top: 55%; left: 4%; font-size: 1.8rem; }
.n4 { top: 8%; left: 68%; font-size: 2.4rem; }

@media (prefers-reduced-motion: no-preference) {
  .hero-notes .drift { animation: drift 14s ease-in-out infinite; }
  .n2 { animation-duration: 17s; animation-delay: -3s; }
  .n3 { animation-duration: 12s; animation-delay: -6s; }
  .n4 { animation-duration: 19s; animation-delay: -9s; }
}

@keyframes drift {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-22px) rotate(4deg); }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

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

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(16, 21, 42, 0.42) 0%,
    rgba(16, 21, 42, 0.38) 35%,
    rgba(16, 21, 42, 0.82) 82%,
    rgba(16, 21, 42, 0.95) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  color: #fdf8ee;
  padding: clamp(28px, 6vw, 64px) clamp(20px, 6vw, 64px) 28px;
  max-width: 900px;
}

.eyebrow {
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--gold);
  margin: 0 0 14px;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.01em;
}

.staff-flourish {
  margin: 18px 0 0;
  max-width: 220px;
  opacity: 0.7;
}

.staff-flourish svg { width: 100%; height: 18px; display: block; }
.staff-flourish line { stroke: var(--gold); stroke-width: 1; vector-effect: non-scaling-stroke; }

.tagline {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: #ece2cd;
  max-width: 46ch;
  margin: 18px 0 0;
}

/* ---------- Player dock (staff + note) ---------- */

.player-dock {
  position: relative;
  z-index: 1;
  margin: 22px clamp(20px, 6vw, 64px) clamp(28px, 5vw, 48px);
  background: rgba(253, 248, 238, 0.96);
  backdrop-filter: blur(6px);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  max-width: 640px;
}

.play-btn {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--ink);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.play-btn:hover { background: var(--deep); transform: scale(1.04); }
.play-btn:active { transform: scale(0.97); }

.player-body { flex: 1; min-width: 0; }

.player-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 10px;
  gap: 10px;
}

.player-label span:first-child {
  font-weight: 600;
  color: var(--ink);
}

.times { font-family: var(--mono); font-size: 0.78rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

.staff-track {
  position: relative;
  height: 26px;
  cursor: pointer;
  touch-action: none;
}

.staff-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.staff-lines line {
  stroke: var(--line-strong);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.staff-fill {
  position: absolute;
  left: 0;
  top: 50%;
  height: 2px;
  width: 0%;
  background: var(--gold);
  transform: translateY(-50%);
  border-radius: 2px;
}

.staff-note {
  position: absolute;
  left: 0%;
  top: 50%;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--gold-dark);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 4px var(--paper), 0 2px 6px rgba(16, 21, 42, 0.25);
  transition: background 0.15s ease;
}

.staff-note::before {
  content: "";
  position: absolute;
  right: 1px;
  bottom: 5px;
  width: 2px;
  height: 20px;
  background: var(--gold-dark);
  border-radius: 1px;
}

.staff-track:hover .staff-note,
.staff-track:focus-visible .staff-note { background: var(--ember); }
.staff-track:hover .staff-note::before,
.staff-track:focus-visible .staff-note::before { background: var(--ember); }

/* ---------- Sections ---------- */

main { max-width: 980px; margin: 0 auto; padding: 0 clamp(20px, 6vw, 40px); }

section { padding: clamp(48px, 8vw, 88px) 0; border-bottom: 1px solid var(--line); }

section:last-of-type { border-bottom: none; }

.about .lead {
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  line-height: 1.55;
  color: var(--ink);
  max-width: 62ch;
  margin: 0 auto;
  text-align: center;
}

.stat-ember { color: var(--ember); font-style: italic; }

h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 600;
  margin-bottom: 6px;
}

.section-intro { color: var(--ink-soft); margin: 0 0 32px; font-size: 0.95rem; }

/* Members */

.members h2, .members .section-intro { text-align: center; }

.member-grid {
  position: relative;
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 16px;
}

.member-grid::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 38px;
  height: 24px;
  background-image:
    linear-gradient(var(--line-strong), var(--line-strong)),
    linear-gradient(var(--line-strong), var(--line-strong)),
    linear-gradient(var(--line-strong), var(--line-strong));
  background-size: 100% 1px;
  background-position: 0 0, 0 12px, 0 24px;
  background-repeat: no-repeat;
  opacity: 0.5;
  pointer-events: none;
}

.member-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 12px;
  text-align: center;
  box-shadow: var(--shadow);
}

.member-note {
  display: block;
  font-size: 1.3rem;
  color: var(--gold-dark);
  margin-bottom: 10px;
  transform: translateY(0);
}

.member-card:nth-child(1) .member-note { transform: translateY(6px); }
.member-card:nth-child(2) .member-note { transform: translateY(-4px); color: var(--ember); }
.member-card:nth-child(3) .member-note { transform: translateY(2px); }
.member-card:nth-child(4) .member-note { transform: translateY(-8px); }
.member-card:nth-child(5) .member-note { transform: translateY(4px); color: var(--ember); }

.member-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.1rem;
}

/* Journey / timeline */

.timeline {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 4px 0 4px 34px;
  display: grid;
  gap: 26px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--line-strong);
}

.timeline-item {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--shadow);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -29px;
  top: 28px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px var(--paper);
}

.timeline-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--deep);
  background: var(--gold);
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.timeline-item h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.timeline-item p {
  margin: 0;
  color: var(--ink-soft);
  max-width: 65ch;
}

/* Voo (do chão ao céu) */

.flight {
  position: relative;
  padding: 0;
  background-color: var(--flight-bg, var(--paper-alt));
  transition: background-color 0.4s ease;
}

.flight-heading-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(48px, 8vw, 88px) clamp(20px, 6vw, 40px) clamp(24px, 5vw, 36px);
  text-align: center;
}

.flight-heading { color: var(--ink); }

.flight-intro { max-width: 46ch; margin: 8px auto 0; }

.flight-track {
  display: grid;
  grid-template-rows: 78vh 78vh;
}

.flight-panel {
  position: relative;
  margin: 0;
  overflow: hidden;
}

.flight-panel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flight-ground img { object-position: center 32%; }
.flight-sky img { object-position: center 60%; }

.flight-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.flight-ground .flight-overlay {
  background: linear-gradient(180deg, rgba(28, 18, 8, 0.05) 0%, rgba(38, 22, 8, 0.6) 100%);
}

.flight-sky .flight-overlay {
  background: linear-gradient(0deg, rgba(8, 18, 38, 0.08) 0%, rgba(8, 22, 44, 0.5) 100%);
}

.flight-caption {
  position: absolute;
  left: clamp(20px, 6vw, 48px);
  bottom: clamp(20px, 6vw, 40px);
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.25rem, 3.4vw, 1.9rem);
  color: #fdf8ee;
  padding: 8px 20px;
  border-radius: 999px;
  background: var(--flight-chip, rgba(184, 108, 46, 0.55));
  backdrop-filter: blur(3px);
  transition: background-color 0.4s ease;
}

@media (max-width: 640px) {
  .flight-track { grid-template-rows: 58vh 58vh; }
}

/* Gallery */

.gallery-grid {
  margin-top: 4px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.gallery-item {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--card);
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.gallery-item figcaption {
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.gallery-note {
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-style: italic;
}

/* Footer */

.site-footer {
  background: var(--deep);
  color: #ece2cd;
  text-align: center;
  padding: 0 20px 40px;
}

.staff-flourish.closing {
  max-width: 220px;
  margin: 0 auto;
  padding-top: 40px;
  opacity: 0.6;
  position: relative;
}

.staff-flourish.closing .barline {
  position: absolute;
  right: -14px;
  top: 0;
  bottom: 6px;
  width: 3px;
  background: var(--gold);
}

.footer-title {
  font-family: var(--serif);
  font-size: 1.3rem;
  margin: 28px 0 8px;
}

.site-footer p { margin: 4px 0; color: #cabfa9; }

.footer-meta {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--gold);
}

@media (max-width: 560px) {
  .player-dock { flex-wrap: wrap; }
  .timeline { padding-left: 28px; }
  .timeline-item::before { left: -23px; }
  .timeline::before { left: 7px; }
  .hero-notes .drift { font-size: 1.6rem !important; }
}

/* Intro, estágio 1: vídeo em tela cheia */

.intro-curtain {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.9s cubic-bezier(.76, 0, .24, 1);
  animation: introAutoWipe 0.9s cubic-bezier(.76, 0, .24, 1) forwards;
  animation-delay: 4s;
}

.intro-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.intro-curtain.is-wiping {
  animation: none;
  transform: translateX(-100%);
}

@keyframes introAutoWipe {
  to {
    transform: translateX(-100%);
    visibility: hidden;
    pointer-events: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro-curtain { display: none; }
  html.force-intro .intro-curtain { display: flex; }
}

/* Intro, estágio 2-3: cena "3D" em CSS puro (monograma girando + glow) */

.intro-3d {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  opacity: 0;
  pointer-events: none;
  perspective: 900px;
  overflow: hidden;
  transition: opacity 0.4s ease;
}

.intro-3d.is-in {
  opacity: 1;
  pointer-events: auto;
}

.spin-card {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(4rem, 20vw, 11rem);
  color: var(--gold);
  transform-style: preserve-3d;
  filter: drop-shadow(0 0 28px rgba(214, 161, 60, 0.55)) drop-shadow(0 0 70px rgba(214, 161, 60, 0.25));
  animation: spin3dIn 2.2s cubic-bezier(.22, 1, .36, 1) forwards,
             spin3dIdle 9s linear 2.2s infinite;
}

@keyframes spin3dIn {
  from { transform: rotateY(0deg) scale(0.6); }
  to { transform: rotateY(1080deg) scale(1); }
}

@keyframes spin3dIdle {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(360deg); }
}

.spark {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px 2px rgba(214, 161, 60, 0.8);
  opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .spark { animation: sparkDrift 3.4s ease-in-out infinite; }
}

@keyframes sparkDrift {
  0%, 100% { opacity: 0; transform: translate(0, 0) scale(0.6); }
  50% { opacity: 1; transform: translate(var(--dx, 20px), var(--dy, -30px)) scale(1); }
}

/* Intro, estágio 4: a cena 3D vira o fundo permanente do hero */

.hero.has-3d-bg .intro-3d {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero.has-3d-bg .hero-image { display: none; }

@media (prefers-reduced-motion: reduce) {
  .spin-card { animation: none; }
  .spark { display: none; }
  .intro-3d { transition: none; }
}
