:root {
  --velvet: #000;
  --porcelain: #f6eee9;
  --blush: #e9a59c;
  --garnet: #8e2c2f;
  --bordeaux: #4f1417;
  --champagne: #e9cfa3;
  --smoke: #8d8792;
  --ink: #24191b;
  --paper-text: #f4efed;
  --serif: "Bodoni Moda", "Bodoni 72", Didot, Georgia, serif;
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --gutter: clamp(20px, 5vw, 72px);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--velvet); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--velvet);
  color: var(--paper-text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, p { margin: 0; font-weight: inherit; }
img { display: block; }

/* ---------- abertura: o nome vazado que vira foto ---------- */

.hero { position: relative; height: 320vh; }
.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--velvet);
}
.photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 16%;
  will-change: transform;
}
.scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .72) 0%, rgba(0, 0, 0, .25) 38%, rgba(0, 0, 0, 0) 62%);
  opacity: 0;
}
.knock { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cut-word { font-family: var(--serif); font-weight: 900; }

.intro-date, .intro-hint {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--smoke);
  opacity: 0;
}
.intro-date {
  top: calc(var(--name-top, 30vh) - clamp(40px, 6vh, 64px));
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(18px, 1.6vw, 24px);
  color: var(--champagne);
}
.intro-hint {
  bottom: max(28px, env(safe-area-inset-bottom));
  font-size: 14px;
  letter-spacing: .01em;
}

.caption {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: max(clamp(36px, 9svh, 104px), env(safe-area-inset-bottom));
  opacity: 0;
}
.caption h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(34px, 7.2vw, 116px);
  line-height: 1;
  letter-spacing: -.02em;
  color: #fff;
  text-wrap: balance;
}
.caption h1 span { display: block; }

/* sem JS ou com movimento reduzido: foto e título direto, sem a rolagem guiada */
.no-js .hero, .hero.still { height: auto; }
.no-js .stage, .hero.still .stage { position: relative; }
.no-js .knock, .hero.still .knock,
.no-js .intro-date, .hero.still .intro-date,
.no-js .intro-hint, .hero.still .intro-hint { display: none; }
.no-js .caption, .hero.still .caption, .no-js .scrim, .hero.still .scrim { opacity: 1; }

/* ---------- frase que acende com a rolagem ---------- */

.statement { padding: clamp(120px, 24vh, 260px) var(--gutter); }
.statement p {
  max-width: 17em;
  margin: 0 auto;
  font-weight: 600;
  font-size: clamp(30px, 4.6vw, 68px);
  line-height: 1.1;
  letter-spacing: -.028em;
  color: var(--paper-text);
}
.statement .w { opacity: .16; transition: opacity .2s linear; }

/* ---------- peça única: retrato e ficha técnica ---------- */

.unique {
  background: var(--bordeaux);
  color: var(--porcelain);
  padding: clamp(96px, 16vh, 180px) var(--gutter);
}
.unique-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}
.frame {
  margin: 0;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 2px;
  background: #2a0b0d;
}
.frame-img {
  width: 100%;
  height: 118%;
  object-fit: cover;
  object-position: 50% 18%;
  will-change: transform;
}
.unique h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(48px, 7vw, 112px);
  line-height: .95;
  letter-spacing: -.025em;
}
.unique-lede {
  max-width: 22em;
  margin-top: 20px;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(20px, 1.7vw, 26px);
  line-height: 1.4;
  color: var(--champagne);
}
.spec { margin: clamp(40px, 6vh, 64px) 0 0; }
.spec div {
  display: grid;
  grid-template-columns: minmax(8em, 2fr) 3fr;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid rgba(246, 238, 233, .18);
}
.spec div:last-child { border-bottom: 1px solid rgba(246, 238, 233, .18); }
.spec dt { font-size: 15px; color: rgba(246, 238, 233, .62); padding-top: .2em; }
.spec dd { margin: 0; font-size: 18px; line-height: 1.35; }
@media (min-width: 900px) {
  .unique-grid { grid-template-columns: 5fr 6fr; }
}

/* ---------- carta ---------- */

.letter {
  background: var(--porcelain);
  color: var(--ink);
  padding: clamp(96px, 18vh, 200px) var(--gutter);
}
.letter-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  gap: 40px;
}
.letter h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(44px, 6.4vw, 96px);
  line-height: .98;
  letter-spacing: -.02em;
  color: var(--garnet);
  text-wrap: balance;
}
.letter-body {
  max-width: 30em;
  font-family: var(--serif);
  font-size: clamp(19px, 1.45vw, 23px);
  line-height: 1.62;
}
.letter-body p + p { margin-top: 1.1em; }
.letter-body .sign {
  margin-top: 1.8em;
  font-style: italic;
  font-size: 1.45em;
  line-height: 1.2;
  color: var(--garnet);
}
@media (min-width: 900px) {
  .letter-grid { grid-template-columns: 5fr 6fr; gap: 6vw; }
  .letter h2 { position: sticky; top: 18vh; align-self: start; }
}

/* ---------- a vela ---------- */

.wish {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(96px, 16vh, 160px) var(--gutter);
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}
.candle {
  position: relative;
  width: 26px;
  height: clamp(150px, 22vh, 210px);
  margin: 90px 0 clamp(48px, 7vh, 72px);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.stick {
  position: absolute;
  inset: 0;
  border-radius: 5px 5px 3px 3px;
  background: linear-gradient(90deg, #b9a6a0 0%, #efe4de 22%, #fbf6f2 40%, #ebddd7 68%, #a8948e 100%);
}
.stick::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 0;
  right: 0;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, #fffaf6, #e2d2cb);
}
.wick {
  position: absolute;
  left: 50%;
  top: -13px;
  width: 2px;
  height: 14px;
  margin-left: -1px;
  border-radius: 1px;
  background: linear-gradient(#120c0a, #4a3a33);
  z-index: 1;
}
.flame {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 7px);
  width: 20px;
  height: 54px;
  margin-left: -10px;
  border-radius: 50% 50% 50% 50% / 66% 66% 34% 34%;
  background: radial-gradient(ellipse 58% 52% at 50% 74%, #fff 0 24%, #fff0cc 36%, #ffcd78 54%, #ff9b3e 72%, rgba(255, 128, 48, 0) 88%);
  filter: drop-shadow(0 0 8px rgba(255, 196, 120, .8)) drop-shadow(0 0 26px rgba(255, 160, 80, .45));
  transform-origin: 50% 100%;
  animation: flicker 3.2s ease-in-out infinite;
  z-index: 2;
}
.flame::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 1px;
  width: 9px;
  height: 11px;
  margin-left: -4.5px;
  border-radius: 50%;
  background: radial-gradient(rgba(110, 140, 255, .75), rgba(110, 140, 255, 0) 70%);
}
.glow {
  position: absolute;
  left: 50%;
  top: -30px;
  width: min(1000px, 170vw);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(233, 207, 163, .22), rgba(233, 165, 156, .07) 42%, rgba(0, 0, 0, 0) 72%);
  pointer-events: none;
  transition: opacity 1.6s ease;
  z-index: -1;
}
.smoke {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  width: 60px;
  height: 160px;
  margin-left: -30px;
  overflow: visible;
  pointer-events: none;
}
.smoke path {
  fill: none;
  stroke: rgba(240, 234, 231, .5);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 260;
  stroke-dashoffset: 260;
  opacity: 0;
  filter: blur(1.5px);
}

.wish.out .flame {
  animation: none;
  transform: scale(.15, 0);
  opacity: 0;
  transition: transform .45s cubic-bezier(.5, 0, .75, 0), opacity .35s ease-in;
}
.wish.out .glow { opacity: 0; }
.wish.out .smoke path { animation: smoke 2.8s ease-out .15s forwards; }
.wish.out .smoke path + path { animation-delay: .35s; }
.wish.relit .flame { animation: ignite .7s cubic-bezier(.2, .8, .2, 1), flicker 3.2s ease-in-out .7s infinite; }

@keyframes flicker {
  0%, 100% { transform: scale(1, 1) skewX(0deg); }
  22% { transform: scale(.96, 1.05) skewX(1.6deg); }
  48% { transform: scale(1.03, .96) skewX(-1.2deg); }
  74% { transform: scale(.98, 1.03) skewX(.9deg); }
}
@keyframes ignite {
  from { transform: scale(.2, .1); opacity: 0; }
  to { transform: scale(1, 1); opacity: 1; }
}
@keyframes smoke {
  0% { stroke-dashoffset: 260; opacity: .9; transform: translateY(0); }
  100% { stroke-dashoffset: 0; opacity: 0; transform: translateY(-36px); }
}

.wish-copy h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(42px, 5.6vw, 84px);
  line-height: 1;
  letter-spacing: -.02em;
  color: #fff;
}
.wish.out .wish-copy h2 {
  background: linear-gradient(100deg, var(--blush) 10%, var(--champagne) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.wish-text {
  max-width: 26em;
  margin: 18px auto 0;
  font-size: clamp(17px, 1.35vw, 20px);
  color: var(--smoke);
}
.wish-copy h2, .wish-text { transition: opacity .22s ease; }
.wish-copy .fading { opacity: 0; }

.pill {
  margin-top: 36px;
  padding: 15px 28px;
  border: 0;
  border-radius: 999px;
  background: var(--porcelain);
  color: #000;
  font: 500 16px/1 var(--sans);
  cursor: pointer;
  transition: background-color .2s ease, transform .2s ease;
}
.pill:hover { background: #fff; }
.pill:active { transform: scale(.97); }
.pill:focus-visible { outline: 2px solid var(--champagne); outline-offset: 4px; }

/* ---------- rodapé e confete ---------- */

.foot {
  padding: 40px var(--gutter) max(48px, env(safe-area-inset-bottom));
  text-align: center;
  font-size: 14px;
  color: var(--smoke);
}
/* ---------- entrada com ou sem música ---------- */

.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px var(--gutter);
  text-align: center;
  background: var(--velvet);
  transition: opacity .9s ease, visibility 0s linear .9s;
}
.gate h2 {
  max-width: 12em;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(36px, 5vw, 72px);
  line-height: 1.02;
  letter-spacing: -.02em;
  text-wrap: balance;
  transition: transform .9s cubic-bezier(.2, .7, .2, 1);
}
.gate-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 20px;
  margin-top: 40px;
}
.gate-actions .pill { margin-top: 0; }
.ghost {
  padding: 15px 8px;
  border: 0;
  background: none;
  color: var(--smoke);
  font: 500 16px/1 var(--sans);
  cursor: pointer;
  transition: color .2s ease;
}
.ghost:hover { color: var(--paper-text); }
.ghost:focus-visible { outline: 2px solid var(--champagne); outline-offset: 4px; border-radius: 6px; }
.gate-note {
  margin-top: 28px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--champagne);
}
.gate.gone { opacity: 0; visibility: hidden; }
.gate.gone h2 { transform: scale(.96); }
.no-js .gate { display: none; }
html.gated, html.gated body { overflow: hidden; }

/* ---------- música ao fundo: barra compacta; o player do YouTube fica invisível ---------- */

.player {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 60;
  width: 236px;
  padding: 6px 6px 6px 16px;
  border-radius: 28px;
  background: rgba(24, 18, 20, .72);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  backdrop-filter: blur(22px) saturate(1.4);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 18px 50px rgba(0, 0, 0, .45);
  color: var(--paper-text);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity .5s ease, transform .5s cubic-bezier(.2, .7, .2, 1), visibility 0s linear .5s;
}
.player.open {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .5s ease, transform .5s cubic-bezier(.2, .7, .2, 1);
}
.player-video {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 240px;
  height: 135px;
  opacity: 0;
  pointer-events: none;
}
.player-video iframe { display: block; width: 100%; height: 100%; border: 0; }
/* só quando o navegador barra o som (iPhone): o vídeo aparece para receber um toque e some ao tocar */
.player.reveal { padding: 8px; border-radius: 18px; }
.player.reveal .player-video {
  position: static;
  width: auto;
  height: auto;
  aspect-ratio: 16 / 9;
  margin-bottom: 8px;
  overflow: hidden;
  border-radius: 11px;
  opacity: 1;
  pointer-events: auto;
}
.player-bar { display: flex; align-items: center; gap: 4px; }
.eq {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  width: 15px;
  height: 14px;
  margin-right: 8px;
}
.eq i {
  flex: 1;
  height: 100%;
  border-radius: 1px;
  background: var(--champagne);
  transform-origin: 50% 100%;
  animation: eq 1.1s ease-in-out infinite;
}
.eq i:nth-child(2) { animation-delay: -.45s; }
.eq i:nth-child(3) { animation-delay: -.8s; }
.eq i:nth-child(4) { animation-delay: -.2s; }
.player.paused .eq i { animation-play-state: paused; }
@keyframes eq {
  0%, 100% { transform: scaleY(.3); }
  50% { transform: scaleY(1); }
}
.player-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 500;
}
.player-title span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.player-sub { font-size: 12px; font-weight: 400; color: var(--smoke); }
.player-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--paper-text);
  cursor: pointer;
  transition: background-color .2s ease;
}
.player-btn:hover { background: rgba(255, 255, 255, .1); }
.player-btn:focus-visible { outline: 2px solid var(--champagne); outline-offset: 1px; }
.player-btn svg { width: 18px; height: 18px; fill: currentColor; }
.player-close svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.player-toggle .i-play { display: none; }
.player.paused .player-toggle .i-play { display: block; }
.player.paused .player-toggle .i-pause { display: none; }

.sound-pill {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 60;
  padding: 11px 18px;
  border: 0;
  border-radius: 999px;
  background: rgba(24, 18, 20, .72);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  backdrop-filter: blur(22px) saturate(1.4);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .1);
  color: var(--paper-text);
  font: 500 14px/1 var(--sans);
  cursor: pointer;
}
.sound-pill[hidden] { display: none; }

/* no celular o player ocupa o canto de baixo: legenda, dica e rodapé abrem espaço para ele */
@media (max-width: 700px) {
  .intro-hint { left: var(--gutter); text-align: left; }
  .caption { transition: bottom .5s cubic-bezier(.2, .7, .2, 1); }
  .music-open .caption { bottom: calc(max(16px, env(safe-area-inset-bottom)) + 84px); }
  .music-open .foot { padding-bottom: 110px; }
  .music-reveal .caption { bottom: calc(max(16px, env(safe-area-inset-bottom)) + 216px); }
}
.sound-pill:focus-visible { outline: 2px solid var(--champagne); outline-offset: 3px; }

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 3 0 0 0 -1.6'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

.confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

@media (prefers-reduced-motion: reduce) {
  .flame, .wish.relit .flame { animation: none; }
  .wish.out .smoke path { animation: none; }
  .statement .w { transition: none; }
  .eq i { animation: none; transform: scaleY(.6); }
}
