/* ============================================
   Gabriel & Kamilly — Wedding Gift List
   Identidade do PDF: papel #F8F7F4, tinta #231F20,
   oliva #61663C, bronze #B89068
   ============================================ */

@font-face {
  font-family: "Simple Serenity Script";
  src: url("assets/fonts/simple-serenity-script.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #F8F7F4;
  --white: #FFFFFF;
  --soft: #EFEDE6;
  --ink: #231F20;
  --ink-soft: #3D3B3A;
  --ink-faded: #85817B;
  --olive: #61663C;
  --olive-deep: #4E5230;
  --bronze: #B89068;
  --bronze-light: #E1DBC9;
  --danger: #A44A3F;

  --line: rgba(35, 31, 32, 0.18);
  --line-mid: rgba(35, 31, 32, 0.12);
  --line-soft: rgba(35, 31, 32, 0.08);
  --line-light: rgba(255, 255, 255, 0.18);

  /* Textura de papel das superfícies claras (o papel de algodão do convite).
     Fibra fina vertical, contraste ~2 níveis: some de perto, lê como papel no
     conjunto. Para usar uma foto real de papel, troque SÓ a linha abaixo por
     url("assets/paper.jpg") e ajuste --paper-texture-size ao tile da imagem. */
  --paper-texture: url("assets/paper-texture.svg");
  --paper-texture-size: 400px 400px;

  --script: "Simple Serenity Script", cursive;
  --display: "Cinzel", Georgia, serif;
  --body: "Crimson Pro", Georgia, serif;
  --numeral: "EB Garamond", Georgia, serif;
  --mono: "JetBrains Mono", "SF Mono", monospace;
}

* { box-sizing: border-box; }

/* JS controla scroll suave — CSS scroll-behavior:smooth conflita com RAF e causa travamento */
html { scroll-behavior: auto; }

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* base de papel — a textura é pintada uma vez só, no body; o html fica com a
   cor chapada para o overscroll (e como fallback se o SVG não carregar) */
body {
  background-image: var(--paper-texture);
  background-repeat: repeat;
  background-size: var(--paper-texture-size);
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--olive); }
a:hover { color: var(--ink); }

/* ============ shared atoms ============ */
.eyebrow {
  font-family: var(--body);
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--olive);
  font-weight: 500;
}
.eyebrow.light { color: rgba(255, 255, 255, 0.75); }

.section-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(32px, 4.4vw, 56px);
  line-height: 1.12;
  letter-spacing: 0.01em;
  margin: 14px 0 8px;
  color: var(--ink);
}
.section-title.light { color: var(--paper); }

.ornament {
  display: block;
  width: 200px;
  max-width: 60%;
  height: 24px;
  color: var(--olive);
  margin: 18px auto 24px;
}
.ornament.light { color: rgba(255, 255, 255, 0.55); }

.btn-ghost, .btn-solid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-family: var(--body);
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
  border-radius: 0;
  border: 1px solid currentColor;
  text-decoration: none;
  transition: all 220ms ease;
  cursor: pointer;
  background: transparent;
}
.btn-ghost { color: var(--paper); }
.btn-ghost:hover { background: var(--paper); color: var(--ink); }
.btn-ghost.light { color: var(--paper); }
.btn-ghost.light:hover { background: rgba(255, 255, 255, 0.1); color: var(--paper); }
.btn-ghost.dark { color: var(--ink); border-color: var(--ink); }
.btn-ghost.dark:hover { background: var(--ink); color: var(--paper); }
.btn-solid {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  font-size: 12px;
}
/* o botão sólido acende em dourado no hover. O texto vira tinta de
   propósito: papel sobre bronze dá 2,7:1 (ilegível em 12px), tinta sobre
   bronze dá 5,6:1 */
.btn-solid:hover {
  background: var(--bronze);
  border-color: var(--bronze);
  color: var(--ink);
}
.hero-cta .btn-ghost, .hero-cta .btn-solid { font-size: 13px; }

.dot { color: var(--ink-faded); margin: 0 8px; }

.monogram {
  font-family: var(--script);
  font-size: 26px;
  color: var(--ink-faded);
  line-height: 1.4;
}

/* ============ Hero ============ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--paper);
}
.hero-image {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-image img {
  width: 110%;
  max-width: none;
  height: 100%;
  margin-left: -10%;
  object-fit: cover;
  object-position: 85% 30%;
  filter: brightness(0.8) saturate(0.9);
}
.hero-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(20,18,18,0.4) 0%, rgba(20,18,18,0.08) 30%, rgba(20,18,18,0.6) 100%),
    radial-gradient(ellipse at center, transparent 30%, rgba(20,18,18,0.25) 100%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 40px 24px 88px;
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--body);
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
  border-top: 1px solid rgba(255, 255, 255, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  padding: 10px 22px;
  margin-bottom: 20px;
  font-weight: 400;
}
.hero-tag .hero-date {
  font-family: var(--numeral);
  letter-spacing: 0.28em;
}
.hero-tag .dot { color: rgba(255, 255, 255, 0.6); }

.hero-title {
  margin: 0;
  font-weight: 400;
  color: var(--paper);
}
.script-names {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: center;
  font-family: var(--script);
  font-size: clamp(80px, 18vw, 236px);
  line-height: 0.8;
  font-weight: 400;
}
.script-names > span {
  transform: rotate(-8deg);
  transform-origin: center;
}
.script-names .conj {
  font-size: 0.85em;
  line-height: 0.26;
  align-self: flex-start;
  margin-left: 24%;
  position: relative;
  z-index: 1;
}

.hero-sub {
  font-family: var(--body);
  font-size: clamp(18px, 2vw, 22px);
  font-style: italic;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.92);
  max-width: 520px;
  margin: 0 auto 28px;
  line-height: 1.5;
}

/* referência do versículo — mesma pauta das eyebrows do site */
.hero-cite {
  display: block;
  margin-top: 16px;
  font-family: var(--body);
  font-style: normal;
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.hero .ornament { margin: 26px auto 18px; }

.hero-cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-scroll {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--body);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  z-index: 2;
  animation: scrollNudge 2.8s ease-in-out infinite;
}
@keyframes scrollNudge {
  0%, 100% { transform: translate(-50%, 0); opacity: 0.7; }
  50% { transform: translate(-50%, 6px); opacity: 1; }
}

/* ============ Story ============ */
.story {
  background-color: var(--paper);
  background-image: var(--paper-texture);
  background-repeat: repeat;
  background-size: var(--paper-texture-size);
  padding: 140px 24px 80px;
  text-align: center;
}
.story-inner {
  max-width: 720px;
  margin: 0 auto;
}
.story-lead {
  font-family: var(--display);
  font-size: clamp(16px, 1.8vw, 20px);
  line-height: 1.75;
  font-weight: 400;
  color: var(--ink-soft);
  text-wrap: pretty;
  margin: 0;
}

/* ============ Timeline ============ */
.timeline {
  background-color: var(--paper);
  background-image: var(--paper-texture);
  background-repeat: repeat;
  background-size: var(--paper-texture-size);
  padding: 80px 24px 140px;
  position: relative;
}
.tl-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 80px;
}
.tl-track {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
}
.tl-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: linear-gradient(180deg,
    transparent 0%,
    var(--line) 8%,
    var(--line) 92%,
    transparent 100%);
  transform: translateX(-0.5px);
}
.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 100px;
  min-height: 280px;
}
.tl-item:last-child { margin-bottom: 0; }
.tl-dot {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--olive);
  z-index: 2;
}
.tl-dot::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--olive);
}

.tl-card { display: contents; }
.tl-left .polaroid { grid-column: 1; justify-self: end; margin-right: 60px; }
.tl-left .tl-text { grid-column: 2; padding-left: 60px; padding-top: 40px; text-align: left; }
.tl-right .polaroid { grid-column: 2; justify-self: start; margin-left: 60px; order: 2; }
.tl-right .tl-text { grid-column: 1; padding-right: 60px; padding-top: 40px; text-align: right; }

.polaroid {
  background: var(--white);
  padding: 14px 14px 60px;
  box-shadow:
    0 1px 2px rgba(35, 31, 32, 0.06),
    0 18px 40px -12px rgba(35, 31, 32, 0.22);
  transform: rotate(var(--rot));
  width: 280px;
  position: relative;
  transition: transform 380ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.polaroid:hover { transform: rotate(0deg) scale(1.03); }
.polaroid-photo {
  width: 100%;
  aspect-ratio: 1;
  background: var(--soft);
  overflow: hidden;
}
.polaroid-photo svg { width: 100%; height: 100%; display: block; }
.polaroid-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.9) contrast(1.02);
}
.polaroid-caption {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--numeral);
  font-style: italic;
  font-size: 16px;
  color: var(--ink-soft);
}

.tl-num {
  font-family: var(--numeral);
  font-style: italic;
  font-size: 14px;
  color: var(--olive);
  letter-spacing: 0.1em;
}
.tl-text h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(24px, 2.8vw, 34px);
  line-height: 1.18;
  margin: 8px 0 14px;
  color: var(--ink);
}
.tl-text p {
  font-family: var(--display);
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink-soft);
  margin: 0;
  max-width: 380px;
  text-wrap: pretty;
}
.tl-right .tl-text p { margin-left: auto; }

/* ============ Countdown ============ */
.countdown {
  background:
    radial-gradient(ellipse at 30% 20%, rgba(184, 144, 104, 0.14), transparent 50%),
    var(--ink);
  color: var(--paper);
  padding: 120px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.countdown::before {
  content: "";
  position: absolute;
  top: 40px;
  left: 40px;
  right: 40px;
  bottom: 40px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
}
.cd-inner { max-width: 900px; margin: 0 auto; position: relative; }
.cd-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin: 40px 0 32px;
  border: 1px solid var(--line-light);
}
.cd-cell {
  padding: 36px 16px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.cd-num {
  font-family: var(--numeral);
  font-size: clamp(48px, 7vw, 90px);
  font-weight: 400;
  line-height: 1;
  color: var(--bronze);
  font-feature-settings: "tnum";
}
.cd-lbl {
  font-family: var(--body);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}
.cd-foot {
  font-family: var(--numeral);
  font-size: 18px;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}
.cd-foot em { color: var(--bronze); font-style: italic; }
.cd-foot br { display: none; }

/* ============ Gifts ============ */
.gifts {
  background-color: var(--paper);
  background-image: var(--paper-texture);
  background-repeat: repeat;
  background-size: var(--paper-texture-size);
  padding: 140px 24px 120px;
}
.gifts-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 60px;
}
.gifts-lead {
  font-family: var(--display);
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.75;
  color: var(--ink-soft);
  text-wrap: pretty;
}
.gifts-stats {
  margin-top: 24px;
  font-family: var(--body);
  font-size: 14px;
  letter-spacing: 0.05em;
  color: var(--ink-faded);
}
.gifts-stats strong {
  font-family: var(--numeral);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
}

.gifts-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  max-width: 1100px;
  margin: 0 auto 60px;
  padding: 12px;
  background: var(--white);
  border: 1px solid var(--line-soft);
}
.filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background: transparent;
  border: none;
  font-family: var(--body);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faded);
  transition: all 200ms ease;
  border-radius: 0;
}
.filter:hover { color: var(--ink); background: var(--soft); }
.filter.active {
  color: var(--paper);
  background: var(--ink);
}
.filter.active:hover { color: var(--paper); background: var(--ink); }
.filter-count {
  font-family: var(--numeral);
  font-size: 12px;
  font-style: italic;
  letter-spacing: 0.05em;
  color: inherit;
  opacity: 0.7;
}

.gifts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 32px;
  max-width: 1280px;
  margin: 0 auto;
}

.gift-card {
  background: var(--white);
  border: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  transition: all 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
}
.gift-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -20px rgba(35, 31, 32, 0.18);
}
.gift-card.reserved { opacity: 0.7; }
.gift-card.reserved:hover { transform: none; box-shadow: none; }

.gift-image {
  position: relative;
  aspect-ratio: 5/4;
  overflow: hidden;
  background: var(--soft);
}
.gift-svg { width: 100%; height: 100%; }

.gift-stamp {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-12deg);
  border: 2px solid var(--olive);
  color: var(--olive);
  font-family: var(--numeral);
  font-style: italic;
  font-size: 22px;
  padding: 8px 26px;
  background: rgba(255, 255, 255, 0.88);
  letter-spacing: 0.08em;
}

.gift-meta {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
}
.gift-cat {
  font-family: var(--body);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faded);
}
.gift-name {
  font-family: var(--display);
  font-weight: 400;
  font-size: 19px;
  line-height: 1.25;
  color: var(--ink);
  margin: 4px 0 2px;
}
.gift-brand {
  font-family: var(--numeral);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-faded);
  margin-bottom: 14px;
}
.gift-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.gift-price {
  font-family: var(--numeral);
  font-size: 24px;
  color: var(--ink);
  font-weight: 500;
  font-feature-settings: "tnum";
}
.gift-price .cur {
  font-family: var(--body);
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-faded);
  margin-right: 4px;
  letter-spacing: 0.08em;
}

.gift-btn {
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
  padding: 10px 16px;
  font-family: var(--body);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: all 200ms;
}
.gift-btn:hover:not(:disabled) {
  background: var(--ink);
  color: var(--paper);
}
.gift-btn:disabled {
  border-color: var(--line);
  color: var(--ink-faded);
  cursor: not-allowed;
}

.gifts-empty {
  text-align: center;
  font-family: var(--body);
  font-style: italic;
  color: var(--ink-soft);
  padding: 60px 20px;
  font-size: 1.2rem;
}

/* ============ Modal ============ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(35, 31, 32, 0.55);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 240ms ease;
  overflow: auto;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background-color: var(--paper);
  background-image: var(--paper-texture);
  background-repeat: repeat;
  background-size: var(--paper-texture-size);
  max-width: 520px;
  width: 100%;
  padding: 40px 40px 36px;
  position: relative;
  text-align: center;
  border: 1px solid var(--line);
  animation: modalIn 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
  margin: auto;
}
@keyframes modalIn {
  from { transform: translateY(20px) scale(0.97); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: transparent;
  border: none;
  font-size: 28px;
  color: var(--ink-faded);
  line-height: 1;
  width: 32px;
  height: 32px;
}
.modal-close:hover { color: var(--ink); }

.modal-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.2;
  margin: 12px 0 0;
  color: var(--ink);
}
.modal-text {
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 0 24px;
  text-wrap: pretty;
}
.modal-form { text-align: left; }
.modal-form label { display: block; margin-bottom: 16px; }
.modal-form label > span {
  display: block;
  font-family: var(--body);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faded);
  margin-bottom: 6px;
}
.modal-form input {
  width: 100%;
  padding: 12px 0;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  font-family: var(--numeral);
  font-size: 18px;
  color: var(--ink);
  outline: none;
  transition: border-color 180ms;
}
.modal-form input:focus { border-bottom-color: var(--olive); }
.modal-form input::placeholder { color: var(--ink-faded); font-style: italic; }
.modal-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--white);
  padding: 10px 14px;
  font-family: var(--body);
  font-size: 0.95rem;
  border-radius: 0;
  resize: vertical;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
}
.modal-form textarea:focus { border-color: var(--olive); }
.modal-form textarea::placeholder { color: var(--ink-faded); font-style: italic; }

.modal-summary {
  margin: 20px 0 24px;
  padding: 16px 18px;
  background: var(--soft);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.modal-summary > div { display: flex; flex-direction: column; gap: 2px; }
.modal-summary > div:last-child { text-align: right; }
.ms-lbl {
  font-family: var(--body);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-faded);
}
.ms-val { font-family: var(--numeral); font-size: 16px; color: var(--ink); }
.ms-val.mono { font-family: var(--mono); font-size: 0.9rem; letter-spacing: 0.02em; }

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.modal-error {
  color: var(--danger);
  background: rgba(164, 74, 63, 0.08);
  padding: 10px 14px;
  font-family: var(--body);
  font-size: 0.9rem;
  margin: 0 0 16px;
}
.modal-tip {
  font-family: var(--body);
  font-size: 14px;
  color: var(--ink-faded);
  margin: 20px 0 0;
}

.reserve-pix {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line-mid);
  padding: 20px;
  margin-top: 16px;
  text-align: left;
}
.reserve-pix-info { display: flex; flex-direction: column; }
.reserve-pix-info .ms-val.mono { word-break: break-all; }
.reserve-pix-info .btn-ghost.dark {
  margin-top: 0.6rem;
  align-self: flex-start;
  padding: 10px 18px;
  font-size: 12px;
}
.reserve-pix-info .modal-tip { margin: 0.8rem 0 0; }
.reserve-pix-qr img { width: 160px; height: 160px; display: block; }

/* ============ PIX ============ */
.pix {
  /* mesma família da contagem regressiva, com o brilho de bronze espelhado
     para as duas seções escuras não ficarem idênticas */
  background:
    radial-gradient(ellipse at 70% 80%, rgba(184, 144, 104, 0.12), transparent 55%),
    var(--ink);
  color: var(--paper);
  padding: 140px 24px;
  position: relative;
  overflow: hidden;
}
.pix::before {
  content: "";
  position: absolute;
  inset: 36px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  pointer-events: none;
}
.pix-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 80px;
  row-gap: 0;
  align-items: center;
  position: relative;
}
.pix-col { display: contents; }
.pix-text { grid-column: 1; grid-row: 1; align-self: end; }
.pix-aside { grid-column: 1; grid-row: 2; align-self: start; }
.pix-qr { grid-column: 2; grid-row: 1 / span 2; }
.pix-text .ornament { margin: 18px 0 24px; }
.pix-text p {
  font-family: var(--display);
  font-size: clamp(14px, 1.3vw, 17px);
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.88);
  max-width: 480px;
  text-wrap: pretty;
  margin: 0;
}
.pix-hint {
  font-family: var(--body) !important;
  font-style: italic;
  font-size: 16px !important;
  color: rgba(255, 255, 255, 0.7) !important;
  margin-top: 24px !important;
}

.pix-key {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line-light);
}
.pix-key > div { display: flex; flex-direction: column; gap: 2px; }
.pix-key .ms-lbl { color: rgba(255, 255, 255, 0.6); }
.pix-key .ms-val { color: var(--paper); }
.pix-key .ms-val.mono { font-size: 13px; }
.pix-key .btn-ghost { padding: 10px 18px; font-size: 12px; }

.pix-recipient {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pix-recipient .ms-lbl { color: rgba(255, 255, 255, 0.55); }
.pix-recipient .ms-val { color: var(--paper); font-size: 17px; }

.pix-qr { display: flex; justify-content: center; }
.pix-qr-frame {
  background-color: var(--paper);
  background-image: var(--paper-texture);
  background-repeat: repeat;
  background-size: var(--paper-texture-size);
  padding: 32px 32px 26px;
  position: relative;
  box-shadow: 0 30px 60px -20px rgba(20, 18, 18, 0.4);
}
.pix-qr-frame img { width: 280px; height: 280px; display: block; }
.qr-corners span {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: var(--olive);
  border-style: solid;
}
.qr-corners span:nth-child(1) { top: 10px; left: 10px; border-width: 1px 0 0 1px; }
.qr-corners span:nth-child(2) { top: 10px; right: 10px; border-width: 1px 1px 0 0; }
.qr-corners span:nth-child(3) { bottom: 10px; left: 10px; border-width: 0 0 1px 1px; }
.qr-corners span:nth-child(4) { bottom: 10px; right: 10px; border-width: 0 1px 1px 0; }
.qr-foot {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.qr-foot > span:last-child {
  font-family: var(--body);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-faded);
}

/* ============ Thanks ============ */
.thanks {
  background-color: var(--paper);
  background-image: var(--paper-texture);
  background-repeat: repeat;
  background-size: var(--paper-texture-size);
  padding: 140px 24px 60px;
  text-align: center;
}
.thanks-inner { max-width: 720px; margin: 0 auto; }
.thanks-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(34px, 4.8vw, 64px);
  line-height: 1.12;
  margin: 14px 0 28px;
  color: var(--ink);
  text-wrap: balance;
}
.thanks-title em { font-style: normal; color: var(--olive); }
.thanks-text {
  font-family: var(--display);
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.75;
  color: var(--ink-soft);
  margin: 0 auto 50px;
  max-width: 540px;
  text-wrap: pretty;
}
.thanks-text em { color: var(--ink); font-style: italic; }
.thanks-sign {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.thanks-sign > span:first-child {
  font-family: var(--body);
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faded);
}
.thanks-names {
  font-family: var(--script);
  font-size: clamp(30px, 3.6vw, 48px);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.5;
}
.thanks-names .conj { font-size: 0.7em; }

.footer {
  margin-top: 100px;
  padding: 40px 24px 24px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.footer .monogram { font-size: 24px; }
.footer p {
  font-family: var(--body);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faded);
  margin: 0;
  text-align: center;
}
.footer br { display: none; }

/* ============ responsive — tablet ============ */
@media (max-width: 920px) {
  .pix-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    text-align: center;
  }
  .pix-text, .pix-aside, .pix-qr { grid-column: auto; grid-row: auto; }
  .pix-text { order: 1; }
  .pix-qr { order: 2; }
  .pix-aside { order: 3; width: 100%; }
  .pix-text p { margin-left: auto; margin-right: auto; }
  .pix-text .ornament { margin-left: auto; margin-right: auto; }
  .pix-key { margin-top: 0; flex-direction: column; align-items: stretch; text-align: left; }
  .tl-line { left: 24px; }
  .tl-item { grid-template-columns: 1fr; }
  .tl-dot { left: 24px; top: 60px; }
  .tl-left .polaroid, .tl-right .polaroid {
    grid-column: 1; justify-self: start; margin-left: 60px; margin-right: 0; order: 0;
  }
  .tl-left .tl-text, .tl-right .tl-text {
    grid-column: 1; padding-left: 60px; padding-right: 0; padding-top: 24px; text-align: left;
    order: 1;
  }
  .tl-right .tl-text p { margin-left: 0; }
  .polaroid { width: 240px; }
  .cd-grid { grid-template-columns: repeat(2, 1fr); }
  .countdown::before { top: 20px; left: 20px; right: 20px; bottom: 20px; }
  .pix::before { inset: 20px; }
}

/* ============ responsive — mobile ============ */
@media (max-width: 640px) {
  /* Hero */
  .hero-image img {
    width: 100%;
    margin-left: 0;
    object-position: 45% 30%;
  }
  .hero-inner { padding: 32px 20px 84px; }
  .hero-tag {
    font-size: 10px;
    letter-spacing: 0.28em;
    padding: 8px 16px;
    margin-bottom: 18px;
  }
  .hero-tag .hero-date { letter-spacing: 0.24em; }
  .hero-tag .dot { margin: 0 6px; }
  .script-names { font-size: 108px; }
  .hero .ornament { width: 160px; max-width: 100%; margin: 22px auto 14px; }
  .hero-sub {
    font-family: var(--display);
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: 1.75;
    max-width: 320px;
    margin: 0 auto 24px;
  }
  .hero-cite { margin-top: 13px; font-size: 10px; letter-spacing: 0.28em; }
  .hero-cta { flex-direction: column; gap: 10px; width: 100%; max-width: 280px; }
  .hero-cta .btn-ghost, .hero-cta .btn-solid { padding: 14px 24px; font-size: 12px; }
  .hero-scroll { bottom: 20px; font-size: 10px; }

  /* Shared */
  .eyebrow { font-size: 11px; }
  .section-title { font-size: 30px; line-height: 1.15; }
  .ornament { width: 160px; max-width: 100%; margin: 14px auto 20px; }

  /* Story */
  .story { padding: 90px 24px 60px; }
  .story-lead { font-size: 15px; }

  /* Timeline */
  .timeline { padding: 50px 20px 90px; }
  .tl-header { margin-bottom: 50px; }
  .tl-header .ornament { margin: 14px auto 0; }
  .tl-line { left: 16px; }
  .tl-item { min-height: 0; }
  .tl-dot { left: 16px; top: 60px; }
  .tl-left .polaroid, .tl-right .polaroid { margin-left: 44px; }
  .tl-left .tl-text, .tl-right .tl-text { padding-left: 44px; padding-top: 20px; }
  .polaroid { width: 230px; padding: 12px 12px 52px; }
  .polaroid-caption { bottom: 14px; font-size: 15px; }
  .tl-num { font-size: 13px; }
  .tl-text h3 { font-size: 21px; line-height: 1.2; margin: 6px 0 10px; }
  .tl-text p { font-size: 13px; line-height: 1.75; }

  /* Countdown */
  .countdown { padding: 80px 20px; }
  .cd-grid { margin: 28px 0 24px; }
  .cd-cell { padding: 24px 12px; gap: 6px; }
  .cd-num { font-size: 52px; }
  .cd-lbl { font-size: 10px; }
  .cd-foot { font-size: 15px; line-height: 1.6; }
  .cd-foot br { display: inline; }
  .cd-foot .sep { display: none; }

  /* Gifts */
  .gifts { padding: 90px 16px 80px; }
  .gifts-header { margin-bottom: 32px; padding: 0 8px; }
  .gifts-lead { font-size: 13px; }
  .gifts-stats { margin-top: 18px; font-size: 13px; }
  .gifts-stats strong { font-size: 16px; }
  .gifts-stats .dot { margin: 0 6px; }

  .gifts-filters {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -16px 28px;
    padding: 10px 16px;
    border-left: none;
    border-right: none;
    border-top: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
  }
  .filter {
    flex: 0 0 auto;
    white-space: nowrap;
    gap: 6px;
    padding: 9px 14px;
    border: 1px solid var(--line-mid);
    font-size: 11px;
    letter-spacing: 0.14em;
  }
  .filter-count { font-size: 11px; }

  .gifts-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .gift-card:hover { transform: none; box-shadow: none; }
  .gift-image { aspect-ratio: 1; }
  .gift-stamp { border-width: 1.5px; font-size: 14px; padding: 4px 14px; white-space: nowrap; }
  .gift-meta { padding: 12px; gap: 3px; }
  .gift-cat { font-size: 9px; letter-spacing: 0.24em; }
  .gift-name { font-size: 13px; line-height: 1.3; margin: 2px 0 0; }
  .gift-brand { font-size: 12px; margin-bottom: 0; }
  .gift-foot { flex-direction: column; align-items: stretch; gap: 8px; padding-top: 10px; }
  .gift-price { font-size: 18px; }
  .gift-price .cur { font-size: 10px; margin-right: 3px; }
  .gift-btn { padding: 9px 8px; font-size: 10px; letter-spacing: 0.18em; width: 100%; }
  .gifts-empty { padding: 50px 20px; font-size: 1.1rem; }

  /* Modal */
  .modal-backdrop { padding: 16px; }
  .modal { max-width: 420px; padding: 32px 22px 28px; }
  .modal-close { top: 10px; right: 12px; font-size: 26px; }
  .modal .ornament { display: none; }
  .modal-title { font-size: 20px; line-height: 1.25; margin: 10px 0 0; }
  .modal-text { font-size: 15px; margin: 14px 0 20px; }
  .modal-form label { margin-bottom: 14px; }
  .modal-form label > span { font-size: 10px; margin-bottom: 5px; }
  .modal-form input { padding: 11px 0; font-size: 17px; }
  .modal-form textarea { padding: 10px 12px; font-size: 0.9rem; }
  .modal-summary { margin: 16px 0 20px; padding: 14px 16px; gap: 12px; }
  .modal-summary .ms-lbl { font-size: 10px; }
  .modal-summary .ms-val { font-size: 15px; }
  .modal-error { font-size: 0.85rem; margin: 0 0 14px; }
  .modal-actions { flex-direction: column-reverse; gap: 8px; }
  .modal-actions .btn-ghost, .modal-actions .btn-solid {
    width: 100%;
    padding: 14px 24px;
    font-size: 11px;
  }
  .modal-tip { font-size: 13px; margin: 16px 0 0; }

  .reserve-pix {
    grid-template-columns: 1fr;
    gap: 16px;
    justify-items: center;
    padding: 18px;
    text-align: center;
    margin-top: 0;
  }
  .reserve-pix-info { align-items: center; }
  .reserve-pix-info .ms-val.mono { font-size: 0.82rem; }
  .reserve-pix-info .btn-ghost.dark {
    align-self: center;
    margin-top: 6px;
    padding: 9px 16px;
    font-size: 11px;
    width: auto;
  }
  .reserve-pix-info .modal-tip { font-size: 13px; }
  .reserve-pix-qr { order: -1; }
  .reserve-pix-qr img { width: 150px; height: 150px; }

  /* PIX */
  .pix { padding: 90px 24px; text-align: center; }
  .pix::before { inset: 16px; }
  .pix-text p { font-size: 13px; }
  .pix-hint { font-size: 14px !important; margin: 18px auto 0 !important; }
  .pix-qr-frame { padding: 24px 24px 20px; }
  .pix-qr-frame img { width: 220px; height: 220px; }
  .qr-corners span { width: 16px; height: 16px; }
  .qr-corners span:nth-child(1) { top: 8px; left: 8px; }
  .qr-corners span:nth-child(2) { top: 8px; right: 8px; }
  .qr-corners span:nth-child(3) { bottom: 8px; left: 8px; }
  .qr-corners span:nth-child(4) { bottom: 8px; right: 8px; }
  .qr-foot { margin-top: 12px; gap: 2px; }
  .qr-foot .monogram { font-size: 24px; }
  .qr-foot > span:last-child { font-size: 10px; letter-spacing: 0.3em; }
  .pix-key { padding: 16px; gap: 10px; }
  .pix-key .ms-lbl { font-size: 10px; }
  .pix-key .ms-val.mono { font-size: 12px; word-break: break-all; }
  .pix-key .btn-ghost { padding: 11px 18px; font-size: 11px; }
  .pix-recipient { margin-top: 12px; }
  .pix-recipient .ms-lbl { font-size: 10px; }
  .pix-recipient .ms-val { font-size: 16px; }

  /* Thanks */
  .thanks { padding: 90px 24px 40px; }
  .thanks-inner > .ornament { margin: 0 auto 20px; }
  .thanks-title { font-size: 28px; line-height: 1.2; margin: 14px 0 20px; }
  .thanks-title br { display: none; }
  .thanks-text { font-size: 13px; margin: 0 auto 36px; }
  .thanks-sign { gap: 10px; }
  .thanks-sign > span:first-child { font-size: 11px; }
  .thanks-names { font-size: 34px; }
  .thanks-names .conj { font-size: 0.6em; }
  .footer { margin-top: 70px; padding: 32px 16px 16px; gap: 12px; }
  .footer .monogram { font-size: 22px; }
  .footer p { font-size: 10px; letter-spacing: 0.16em; line-height: 1.8; }
  .footer br { display: inline; }
  .footer .sep { display: none; }
}
