:root {
  --ivory: #f4efe8;
  --paper: #fbf7f2;
  --ink: #241f1c;
  --ink-soft: #5c534c;
  --line: rgba(36, 31, 28, 0.14);
  --gold: #8d6b3f;
  --gold-deep: #6d522c;
  --clay: #8a3e32;
  --header: 4.25rem;
  --shadow: 0 24px 60px rgba(36, 31, 28, 0.16);
  color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html.is-gated,
html.is-locked { overflow: hidden; }

body {
  margin: 0;
  background:
    radial-gradient(ellipse at 8% -10%, rgba(198, 174, 134, 0.28), transparent 46%),
    radial-gradient(ellipse at 100% 0%, rgba(141, 90, 69, 0.08), transparent 38%),
    var(--ivory);
  color: var(--ink);
  font-family: "Cormorant Garamond", "Iowan Old Style", Palatino, Georgia, serif;
  font-size: 1.2rem;
  line-height: 1.6;
  overflow-x: clip;
}

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

button, input, textarea, select { font: inherit; color: inherit; }

button { cursor: pointer; }

button:disabled { cursor: not-allowed; opacity: 0.6; }

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

::selection { background: #e4d3c2; color: var(--ink); }

a { color: inherit; }

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 90;
  background: var(--ink);
  color: var(--ivory);
  padding: 0.65rem 1rem;
  font-family: Outfit, "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.85rem;
  text-decoration: none;
}

.skip:focus { top: 1rem; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.eyebrow,
.section-kicker,
.when,
.countdown-kicker,
.frame-caption,
.shot-caption {
  font-family: Outfit, "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.eyebrow { margin: 0 0 0.8rem; }

.text-button,
.nav-toggle,
.lightbox-bar button,
.nav a,
.hero-links a,
.text-link,
.logo,
.player button,
.footer-note,
.gate-hint {
  font-family: Outfit, "Avenir Next", "Segoe UI", sans-serif;
}

.text-button,
.text-link {
  color: var(--gold-deep);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.text-button {
  background: none;
  border: 0;
  padding: 0.4rem 0.2rem;
  text-decoration: underline;
  text-underline-offset: 0.28em;
}

.text-link { text-underline-offset: 0.28em; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header);
  padding: 0.75rem clamp(1rem, 3vw, 2rem);
  background: rgba(244, 239, 232, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled { border-bottom-color: var(--line); }

.logo {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.logo em,
.footer-names em,
.amp,
.gate-title em { font-style: italic; color: var(--gold); }

.nav { display: flex; gap: 1.35rem; }

.nav a {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
}

.nav a:hover { color: var(--ink); }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  min-height: 2.5rem;
  padding: 0.4rem 0.8rem;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  width: min(1240px, calc(100% - 2rem));
  min-height: calc(100svh - var(--header));
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) 0 clamp(2.5rem, 6vw, 4rem);
}

.hero h1 {
  margin: 0;
  font-weight: 500;
  font-size: clamp(4.4rem, 8vw, 7.4rem);
  line-height: 0.8;
  letter-spacing: -0.035em;
}

.hero h1 span { display: block; }

.amp {
  font-size: 0.52em;
  line-height: 1;
  padding: 0.12em 0 0.05em 0.04em;
}

.hero-date {
  margin: 0.85rem 0 0.7rem;
  font-style: italic;
  font-size: clamp(1.55rem, 2.5vw, 2.15rem);
  color: var(--gold);
}

.parents,
.lede,
.section-lead,
.chapter-copy p,
.info-card p {
  color: var(--ink-soft);
}

.parents {
  max-width: 28rem;
  margin: 0;
  font-size: 1.15rem;
}

.lede {
  max-width: 26rem;
  margin: 0.9rem 0 0;
  font-size: 1.4rem;
  line-height: 1.4;
  color: var(--ink);
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.2rem;
  margin: 1.5rem 0 0;
}

.hero-links a {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--gold-deep);
  border-bottom: 1px solid rgba(109, 82, 44, 0.4);
  padding-bottom: 0.15rem;
}

.hero-photo {
  margin: 0;
  height: min(78vh, 820px);
}

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

html.is-gated .hero-copy,
html.is-gated .hero-photo { opacity: 0; }

.band {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1.4rem 0 1.5rem;
}

.countdown-kicker {
  margin: 0 0 0.35rem;
  text-align: center;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(880px, calc(100% - 1.5rem));
  margin: 0 auto;
}

.countdown div { text-align: center; padding: 0.35rem 0.4rem 0; }

.countdown div + div { border-left: 1px solid var(--line); }

.countdown strong {
  display: block;
  font-size: clamp(2.3rem, 5vw, 3.7rem);
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.countdown span {
  display: block;
  margin-top: 0.35rem;
  font-family: Outfit, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.section { padding: clamp(4.2rem, 8vw, 7rem) 0; }

.wrap { width: min(1120px, calc(100% - 2.4rem)); margin-inline: auto; }

.section-intro { max-width: 40rem; margin-bottom: clamp(2rem, 4vw, 3.2rem); }

.section-title {
  margin: 0;
  font-size: clamp(2.8rem, 6vw, 4.6rem);
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: -0.03em;
}

.section-lead {
  margin: 1rem 0 0;
  font-size: 1.35rem;
  line-height: 1.45;
}

.chapter {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(1.4rem, 4vw, 4rem);
  align-items: center;
  margin-top: clamp(2.8rem, 6vw, 5rem);
}

.chapter:nth-of-type(even) { grid-template-columns: 1.1fr 0.9fr; }

.chapter:nth-of-type(even) .chapter-copy { order: 2; }

.chapter h3 {
  margin: 0.3rem 0 1rem;
  font-size: clamp(2.3rem, 4vw, 3.3rem);
  font-weight: 500;
  line-height: 0.95;
}

.chapter-copy p { margin: 0; font-size: 1.32rem; line-height: 1.5; }

.chapter-copy p + p { margin-top: 0.95rem; }

.frame,
.day-photo,
.shot {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: zoom-in;
}

.frame { display: block; width: 100%; }

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

.frame-port img { aspect-ratio: 3 / 4; }

.frame-caption {
  display: block;
  margin-top: 0.7rem;
  color: var(--ink-soft);
}

.pull {
  margin: clamp(3.2rem, 7vw, 5.5rem) 0 0;
  padding: 0;
  border: 0;
  text-align: center;
}

.pull p {
  max-width: 14em;
  margin: 0 auto;
  font-style: italic;
  font-size: clamp(2rem, 4vw, 2.9rem);
  line-height: 1.15;
  color: var(--ink);
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr 0.95fr;
  grid-template-areas:
    "jardim chuva aliancas"
    "jardim domingos sim"
    "caminho caminho sim"
    "capela capela capela";
  grid-template-rows: 250px 250px 310px 400px;
  gap: 0.75rem;
}

.shot {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  min-width: 0;
}

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

.shot-caption {
  position: absolute;
  left: 0.85rem;
  bottom: 0.75rem;
  color: #fbf7f2;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}

.shot-jardim { grid-area: jardim; }
.shot-chuva { grid-area: chuva; }
.shot-aliancas { grid-area: aliancas; }
.shot-domingos { grid-area: domingos; }
.shot-sim { grid-area: sim; }
.shot-caminho { grid-area: caminho; }
.shot-capela { grid-area: capela; }

.shot-jardim img,
.shot-sim img { object-position: center 20%; }

.day-photo { display: block; width: 100%; margin: 0 0 1rem; }

.day-photo img {
  width: 100%;
  height: min(54vh, 500px);
  object-fit: cover;
  object-position: center 62%;
}

.day-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  margin-top: 0.4rem;
}

.info-card {
  background: rgba(255, 253, 251, 0.55);
  border: 1px solid var(--line);
}

.info-card { padding: 1.45rem 1.35rem 1.4rem; }

.info-card-wide { grid-column: 1 / -1; }

.info-card h3 {
  margin: 0.25rem 0 0.75rem;
  font-size: clamp(1.9rem, 3vw, 2.35rem);
  font-weight: 500;
  line-height: 1;
}

.info-card p { margin: 0.6rem 0 0; font-size: 1.2rem; line-height: 1.45; }

.address { margin-top: 1rem !important; color: var(--ink) !important; }

.info-card .text-link { display: inline-block; margin-top: 1rem; }

.site-footer {
  padding: 1rem 0 6.5rem;
  border-top: 1px solid var(--line);
}

.footer-inner { text-align: center; }

.footer-names {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 3rem);
  line-height: 1;
}

.footer-inner p { margin: 0.55rem 0; }

.footer-note {
  max-width: 36rem;
  margin: 0.8rem auto 1rem !important;
  color: var(--ink-soft);
  font-size: 0.85rem;
  line-height: 1.5;
}

.player {
  position: fixed;
  right: calc(1rem + env(safe-area-inset-right));
  bottom: calc(1rem + env(safe-area-inset-bottom));
  z-index: 40;
  display: none;
}

.player.is-on { display: block; }

.player button {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 3.1rem;
  padding: 0.4rem 1rem 0.4rem 0.45rem;
  border: 1px solid rgba(141, 107, 63, 0.5);
  border-radius: 999px;
  background: rgba(251, 247, 242, 0.94);
  box-shadow: 0 12px 36px rgba(36, 31, 28, 0.1);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.68rem;
}

.disc {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, var(--ivory) 0 16%, transparent 17% 27%, rgba(36, 31, 28, 0.18) 28% 30%, transparent 31%),
    conic-gradient(from 30deg, #e6d3b4, var(--gold), #f3eadc, #b8925d, #e6d3b4);
}

#gate {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: var(--ivory);
}

#gate::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(255, 252, 247, 0.2), rgba(214, 196, 170, 0.45));
  transition: opacity 0.7s ease;
}

.envelope-scene {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(36rem, 100%);
  text-align: center;
}

.envelope {
  position: relative;
  width: min(29rem, 90vw);
  aspect-ratio: 1.62 / 1;
  margin-top: 0.35rem;
  perspective: 1400px;
}

.envelope-back,
.liner,
.letter,
.pocket,
.flap {
  position: absolute;
}

.envelope-back {
  inset: 0;
  z-index: 0;
  background: #e7d6c2;
  box-shadow: 0 22px 44px rgba(70, 46, 24, 0.16);
}

.liner {
  left: 0;
  right: 0;
  top: 0;
  height: 52%;
  z-index: 1;
  background:
    repeating-linear-gradient(135deg, rgba(141, 107, 63, 0.09) 0 1px, transparent 1px 8px),
    #f6ecdf;
}

.letter {
  left: 7%;
  right: 7%;
  bottom: 0;
  height: 84%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 1.35rem 1rem 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.65), transparent 28%),
    #fffcf8;
  border: 1px solid rgba(141, 107, 63, 0.35);
  box-shadow: 0 14px 28px rgba(70, 46, 24, 0.12);
  transform: translateY(16%);
  transition: transform 1.05s cubic-bezier(0.22, 0.72, 0.2, 1) 0.62s;
}

.letter-kicker {
  margin: 0;
  font-family: Outfit, "Avenir Next", sans-serif;
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.letter-names,
.envelope-names {
  margin: 0.25rem 0 0;
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: -0.03em;
}

.letter-names {
  font-size: clamp(2.1rem, 5vw, 3.15rem);
}

.letter-names em,
.envelope-names em {
  font-style: italic;
  color: var(--gold);
}

.letter-date,
.letter-place {
  margin: 0.35rem 0 0;
  font-style: italic;
  color: var(--gold);
}

.letter-date { font-size: clamp(1.05rem, 2.4vw, 1.35rem); }

.letter-place {
  margin-top: 0.15rem;
  font-size: 1.05rem;
  color: var(--ink-soft);
}

.pocket {
  left: 0;
  right: 0;
  bottom: 0;
  height: 58%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0 1rem 0.85rem;
  background: linear-gradient(180deg, #f8f1e6 0%, #f1e4d2 55%, #e9d9c4 100%);
  box-shadow: inset 0 12px 16px rgba(90, 58, 28, 0.06);
}

.pocket::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 18px;
  background: linear-gradient(180deg, rgba(70, 46, 24, 0.16), transparent);
}

.envelope-names {
  position: relative;
  font-size: clamp(1.7rem, 4vw, 2.35rem);
}

.envelope-meta {
  position: relative;
  margin: 0.35rem 0 0;
  font-family: Outfit, "Avenir Next", sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.flap {
  left: 0;
  right: 0;
  top: 0;
  height: 64%;
  z-index: 4;
  transform-origin: top center;
  transform-style: preserve-3d;
  transition: transform 0.9s cubic-bezier(0.45, 0.05, 0.2, 1) 0.28s;
}

.flap-face {
  position: absolute;
  inset: 0;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  backface-visibility: hidden;
}

.flap-front {
  background: linear-gradient(180deg, #fbf6ee 0%, #f0e3d0 78%);
}

.flap-back {
  background: linear-gradient(#e5d3ba, #d9c4a6);
  transform: rotateX(180deg);
}

.seal {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 60%;
  display: grid;
  place-items: center;
  width: 4.6rem;
  height: 4.6rem;
  border: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle at 34% 30%, #c46a60 0%, #8d3d36 46%, #6d2b26 100%);
  color: #f8e7c4;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.85rem;
  font-style: italic;
  line-height: 1;
  box-shadow:
    0 10px 18px rgba(80, 28, 22, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  cursor: pointer;
}

.seal::before {
  content: "";
  position: absolute;
  inset: 0.42rem;
  border: 1px dashed rgba(248, 231, 196, 0.7);
  border-radius: 50%;
}

.envelope.is-opening .seal {
  animation: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.25) rotate(-18deg);
  transition: transform 0.4s ease, opacity 0.4s ease;
  pointer-events: none;
}

.envelope.is-opening .flap {
  z-index: 1;
  transform: rotateX(180deg);
  transition:
    transform 0.9s cubic-bezier(0.45, 0.05, 0.2, 1) 0.28s,
    z-index 0s linear 0.72s;
}

.envelope.is-opening .letter {
  transform: translateY(-78%);
}

.gate-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  margin-top: 1.35rem;
}

.gate-hint {
  max-width: 24rem;
  margin: 0.85rem auto 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.45;
}

#gate.is-revealing::before { opacity: 0; }

#gate.is-revealing .envelope-scene {
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.lightbox { display: none; }

.lightbox.is-open { display: grid; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 70;
  place-items: center;
  align-content: center;
  gap: 1rem;
  padding: 4.5rem 1rem 1.25rem;
  background: rgba(22, 18, 16, 0.94);
  color: var(--paper);
}

.lightbox-figure { margin: 0; width: min(1040px, 100%); }

.lightbox img {
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  background: #1a1614;
}

.lightbox figcaption {
  margin-top: 0.75rem;
  text-align: center;
  font-style: italic;
  font-size: 1.35rem;
}

.lightbox-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }

.lightbox-bar button {
  min-height: 2.7rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid rgba(251, 247, 242, 0.45);
  background: transparent;
  color: var(--paper);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lightbox-bar button:hover { background: rgba(251, 247, 242, 0.08); }

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .shot img { transition: transform 0.8s ease; }
  .shot:hover img { transform: scale(1.045); }
}

@media (prefers-reduced-motion: no-preference) {
  html.is-open .hero-copy { animation: rise 0.95s ease both; }
  html.is-open .hero-photo { animation: rise 1.05s ease 0.1s both; }
  .player.is-on:not(.is-paused) .disc { animation: spin 9s linear infinite; }
  .seal { animation: seal-pulse 2.8s ease-in-out infinite; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes seal-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.045); }
}

@media (max-width: 900px) {
  .hero,
  .chapter,
  .chapter:nth-of-type(even),
  .day-grid {
    grid-template-columns: 1fr;
  }

  .chapter:nth-of-type(even) .chapter-copy { order: 0; }

  .chapter .frame { order: -1; }

  .hero { min-height: 0; padding-top: 1rem; }

  .hero-photo { order: -1; height: min(68vh, 640px); }

  .info-card-wide { grid-column: auto; }
}

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }

  .site-header { flex-wrap: wrap; }

  .nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    gap: 0;
    padding-bottom: 0.4rem;
  }

  .nav.is-open { display: flex; }

  .nav a {
    padding: 0.85rem 0;
    border-top: 1px solid var(--line);
  }

  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "jardim jardim"
      "chuva sim"
      "domingos sim"
      "aliancas aliancas"
      "caminho caminho"
      "capela capela";
    grid-template-rows: 420px 190px 210px 250px 190px 200px;
  }
}

@media (max-width: 520px) {
  .countdown strong { font-size: 1.8rem; }

  .hero h1 { font-size: 4rem; }

  .envelope { width: min(29rem, 92vw); }
  .seal { width: 4rem; height: 4rem; }
}

@media print {
  #gate, .player, .nav-toggle, .lightbox { display: none !important; }
  .hero { min-height: auto; }
  .site-header { position: static; }
}
