:root {
  --bg: #0c0a09;
  --bg-soft: #14110e;
  --paper: #f3ead8;
  --paper-shadow: rgba(8, 6, 4, 0.55);
  --ink: #2c2218;
  --ink-soft: #5a4b3c;
  --gold: #c9a36a;
  --gold-soft: #e4c894;
  --rose: #c9b0a2;
  --muted: #8d8074;
  --line: rgba(201, 163, 106, 0.28);
  --glass: rgba(20, 16, 12, 0.55);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--paper);
  font-family: Outfit, sans-serif;
  font-weight: 300;
  letter-spacing: 0.01em;
}

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.grain,
#dust,
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.grain {
  z-index: 40;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

#dust {
  z-index: 1;
}

.vignette {
  z-index: 30;
  background:
    radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.42) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.28));
}

#app {
  position: relative;
  z-index: 2;
}

.hidden {
  display: none !important;
}

/* ——— Entry ——— */

.entry,
.gate {
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.entry.is-leaving,
.gate.is-leaving {
  opacity: 0;
  transform: scale(0.98);
}

.entry {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px 24px calc(40px + env(safe-area-inset-bottom));
  text-align: center;
}

.entry-inner {
  max-width: 28rem;
}

.ember {
  width: 7px;
  height: 7px;
  margin: 0 auto 28px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 18px 6px rgba(201, 163, 106, 0.35);
  animation: pulse 3.4s var(--ease) infinite;
}

.eyebrow,
.section-kicker,
.nav a,
.enter,
.music-btn span,
.photo-fallback span,
.days {
  font-size: 0.72rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold);
}

.eyebrow {
  letter-spacing: 0.22em;
}

.days {
  letter-spacing: 0.04em;
  line-height: 1.6;
  text-transform: none;
  text-wrap: balance;
}

.her-name {
  margin: 18px 0 12px;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(3.2rem, 13vw, 6.2rem);
  font-weight: 500;
  line-height: 0.9;
}

.her-name.names {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.08em;
  font-size: clamp(2.8rem, 12vw, 5.2rem);
  line-height: 0.95;
}

.her-name.names i {
  font-size: 0.36em;
  font-style: italic;
  font-weight: 400;
  color: var(--gold);
}

.tagline {
  margin: 0 0 40px;
  color: var(--rose);
  font-family: "Cormorant Garamond", serif;
  font-size: 1.25rem;
  font-style: italic;
  word-spacing: 0.12em;
}

.enter {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 8px;
  color: var(--gold-soft);
}

.enter::after {
  content: "";
  width: 42px;
  height: 1px;
  background: var(--gold);
  transform-origin: left;
  transition: width 0.4s var(--ease);
}

.enter:hover::after {
  width: 64px;
}

.fade-up {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 1.1s var(--ease) forwards;
}

.d1 { animation-delay: 0.1s; }
.d2 { animation-delay: 0.35s; }
.d3 { animation-delay: 0.6s; }
.d4 { animation-delay: 0.9s; }

/* ——— Gate ——— */

.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px 24px;
  text-align: center;
}

.gate p {
  max-width: 22rem;
  margin: 0 auto 28px;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.7rem;
  line-height: 1.35;
}

.gate form {
  display: grid;
  gap: 16px;
  justify-items: center;
}

.gate input {
  width: min(280px, 80vw);
  padding: 12px 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--paper);
  text-align: center;
  letter-spacing: 0.12em;
  outline: none;
}

.gate input:focus {
  border-bottom-color: var(--gold);
}

.gate .hint,
.gate .error {
  min-height: 1.2em;
  margin: 0;
  font-family: Outfit, sans-serif;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--muted);
}

.gate .error {
  color: #d7a08f;
}

/* ——— Space ——— */

.space {
  padding-bottom: 120px;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: calc(16px + env(safe-area-inset-top)) 16px 14px;
  background: linear-gradient(180deg, rgba(12, 10, 9, 0.96), rgba(12, 10, 9, 0.72) 64%, transparent);
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.16em;
}

.nav a:hover,
.nav a.is-active {
  color: var(--gold-soft);
}

.section {
  width: min(720px, calc(100% - 32px));
  margin: 0 auto;
  padding: 88px 0 24px;
}

.section-kicker {
  display: block;
  margin-bottom: 16px;
}

.section h2 {
  margin: 0 0 28px;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2.2rem, 8vw, 3.6rem);
  font-weight: 500;
}

.days {
  margin: -12px 0 28px;
  color: var(--muted);
}

/* ——— Letter ——— */

.letter {
  position: relative;
  padding: 42px 26px 48px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 26%),
    var(--paper);
  color: var(--ink);
  box-shadow:
    0 24px 60px var(--paper-shadow),
    0 0 0 1px rgba(255, 255, 255, 0.04);
  transform: rotate(-0.35deg);
}

.letter::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(44, 34, 24, 0.08);
  pointer-events: none;
}

.letter .greeting,
.letter p,
.letter .closing,
.letter .signature {
  font-family: "Cormorant Garamond", serif;
}

.letter .greeting {
  margin: 0 0 22px;
  font-size: 1.8rem;
}

.letter p {
  margin: 0 0 18px;
  font-size: 1.22rem;
  line-height: 1.75;
  letter-spacing: 0.01em;
  word-spacing: 0.14em;
  color: var(--ink-soft);
}

.letter .closing {
  margin: 28px 0 0;
  font-style: italic;
}

.letter .signature {
  margin: 4px 0 0;
  font-family: "Great Vibes", cursive;
  font-size: 2.3rem;
  color: var(--ink);
}

/* ——— Timeline ——— */

.timeline {
  position: relative;
  display: grid;
  gap: 28px;
  padding-left: 22px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, var(--gold), transparent);
}

.memory {
  position: relative;
  padding-left: 18px;
}

.memory::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--gold);
}

.memory time {
  display: block;
  margin-bottom: 6px;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
}

.memory h3 {
  margin: 0 0 8px;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.7rem;
  font-weight: 500;
}

.memory p {
  margin: 0;
  color: var(--rose);
  line-height: 1.65;
}

/* ——— Photos ——— */

.moments {
  width: min(1100px, calc(100% - 24px));
}

.album {
  margin-top: 56px;
}

.album .section-kicker {
  margin-bottom: 10px;
}

.album-text {
  margin: 0 0 14px;
  max-width: 34rem;
  color: var(--rose);
  font-family: "Cormorant Garamond", serif;
  font-size: 1.25rem;
  font-style: italic;
  line-height: 1.55;
}

.moments-count {
  margin: 0 0 16px;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.tile {
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  background: #1a1512;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s var(--ease);
}

.tile:hover img {
  transform: scale(1.04);
}

.more-photos {
  display: block;
  margin: 22px auto 0;
  padding: 10px 8px;
  color: var(--gold-soft);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.lightbox {
  --lightbox-dim: 0.92;
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 64px 16px 32px;
  background: rgba(8, 6, 4, var(--lightbox-dim));
  touch-action: none;
  user-select: none;
}

.lightbox.hidden {
  display: none;
}

.lightbox-stage {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.lightbox img {
  max-width: min(100%, 920px);
  max-height: calc(100dvh - 100px);
  object-fit: contain;
  pointer-events: none;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  z-index: 2;
  color: var(--gold-soft);
}

.lightbox-close {
  top: 16px;
  right: 12px;
  padding: 12px 16px;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.lightbox-nav {
  top: 50%;
  width: 56px;
  height: 88px;
  display: grid;
  place-items: center;
  font-size: 2.6rem;
  line-height: 1;
  transform: translateY(-50%);
}

.lightbox-nav.is-prev { left: 0; }
.lightbox-nav.is-next { right: 0; }

/* ——— Films ——— */

.films-intro,
.films-story {
  margin: 0 0 14px;
  color: var(--rose);
  font-family: "Cormorant Garamond", serif;
  font-size: 1.25rem;
  line-height: 1.75;
  text-wrap: pretty;
}

.films h2 + .films-story {
  margin-top: -8px;
}

.films-story strong {
  color: var(--gold-soft);
  font-weight: 500;
}

.films-story em {
  font-style: italic;
}

.featured-film {
  margin: 24px auto 36px;
  width: min(100%, 280px);
}

.film-stage {
  position: relative;
  overflow: hidden;
  background: #100d0b;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.42);
  border: 1px solid var(--line);
}

.film-stage video {
  display: block;
  width: 100%;
  max-height: 52dvh;
  background: #100d0b;
  object-fit: contain;
}

.film-stage.is-loading::after {
  content: "carregando";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-soft);
}

.film-error {
  position: absolute;
  inset: auto 12px 12px;
  margin: 0;
  color: var(--rose);
  font-family: "Cormorant Garamond", serif;
  font-size: 1rem;
  text-align: center;
}

.featured-film:not(.has-film) video {
  display: none;
}

.film-waiting {
  aspect-ratio: 9 / 16;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  background:
    radial-gradient(ellipse at center, rgba(201, 163, 106, 0.12), transparent 62%),
    #120f0c;
}

.film-waiting span {
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
}

.featured-film figcaption,
.clip figcaption {
  margin-top: 16px;
  text-align: center;
}

.featured-film strong {
  display: block;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.6rem;
  font-weight: 500;
}

.featured-film em {
  display: block;
  margin-top: 4px;
  color: var(--gold);
  font-size: 0.72rem;
  font-style: normal;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.reel .section-kicker {
  margin-bottom: 22px;
}

.reel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.clip {
  margin: 0;
  width: 100%;
}

.clip figcaption {
  margin-top: 8px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.film-stage.is-clip video {
  max-height: 200px;
}

/* ——— Closing ——— */

.closing {
  min-height: 90dvh;
  display: grid;
  place-items: center;
  text-align: center;
  padding-bottom: 64px;
}

.closing-inner {
  width: min(620px, 100%);
}

.closing h2 {
  margin-bottom: 32px;
}

.closing-text {
  margin: 0 0 14px;
  color: var(--rose);
  font-family: "Cormorant Garamond", serif;
  font-size: 1.28rem;
  line-height: 1.75;
  text-wrap: pretty;
}

.closing-text strong {
  color: var(--gold-soft);
  font-weight: 500;
}

.farewell {
  margin: 28px 0 8px;
  font-family: "Great Vibes", cursive;
  font-size: clamp(1.8rem, 6vw, 2.5rem);
  line-height: 1.25;
  color: var(--gold-soft);
}

.closing-sign {
  margin: 0 0 48px;
  font-family: "Great Vibes", cursive;
  font-size: 2.2rem;
  color: var(--gold-soft);
}

.checkin {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.checkin-kicker {
  margin: 28px 0 12px;
  font-size: 0.72rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold);
}

.checkin-text {
  margin: 0 0 28px;
  color: var(--rose);
  font-family: "Cormorant Garamond", serif;
  font-size: 1.2rem;
  line-height: 1.65;
}

.checkin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.checkin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--gold-soft);
  text-decoration: none;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}

.checkin-link:hover {
  border-color: var(--gold);
  background: rgba(201, 163, 106, 0.08);
}

.checkin-hint {
  margin: 16px 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ——— Music ——— */

.music-btn {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  color: var(--gold-soft);
  backdrop-filter: blur(10px);
}

.music-btn.is-playing .eq {
  animation: eq 0.8s ease-in-out infinite;
}

.eq {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.eq i {
  display: block;
  width: 2px;
  height: 4px;
  background: var(--gold);
}

.eq i:nth-child(2) { height: 9px; animation-delay: 0.12s; }
.eq i:nth-child(3) { height: 6px; animation-delay: 0.24s; }

/* ——— Reveal ——— */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pulse {
  0%,
  100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.35); }
}

@keyframes eq {
  0%,
  100% { transform: scaleY(0.45); }
  50% { transform: scaleY(1); }
}

@media (max-width: 719px) {
  .vignette,
  #dust {
    display: none;
  }

  .grain {
    opacity: 0.07;
  }

  .nav {
    background: rgba(12, 10, 9, 0.94);
  }
}

@media (min-width: 720px) {
  .nav {
    gap: 28px;
    backdrop-filter: blur(8px);
  }

  .lightbox {
    padding: 56px 48px 32px;
  }

  .lightbox-nav {
    width: 48px;
    height: 72px;
  }

  .nav a {
    letter-spacing: 0.28em;
  }

  .gallery {
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
  }

  .letter {
    padding: 56px 52px 60px;
  }

  .featured-film {
    width: min(100%, 320px);
  }

  .reel-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .fade-up,
  .reveal {
    opacity: 1;
    transform: none;
  }
}
