/* ==========================================================================
   Julia & Diego — Design System
   Camadas: 1. primitivos → 2. semânticos → 3. escalas → 4. componentes
   ========================================================================== */

/* 1. Primitivos — paleta do casamento (Sazonômetro) ----------------------- */
:root {
  --choc-1: #CC9C80; --choc-2: #B4876A; --choc-3: #A0745A; --choc-4: #866249;
  --choc-5: #7E5340; --choc-6: #6B4430; --choc-7: #64432F;
  --cafe-1: #CBA898; --cafe-2: #B38B76; --cafe-3: #997160; --cafe-4: #846650;
  --cafe-5: #7D5D50; --cafe-6: #6A4F43; --cafe-7: #4E3D33;

  --sand-0: #F6EDE3; --sand-50: #E9DACA; --sand-100: #DFCCBA; --sand-200: #D4BEA9; --sand-300: #C5AC95; /* tema café com leite */
  --espresso-700: #3A2C25; --espresso-800: #261C17; --espresso-900: #17110E;

/* 2. Semânticos ------------------------------------------------------------ */
  --surface: var(--sand-50);
  --surface-raised: var(--sand-0);
  --surface-sunken: var(--sand-100);
  --surface-inverse: var(--espresso-900);
  --text: #1D1410;
  --text-secondary: #5A463B;
  --text-tertiary: #6B5646;
  --text-inverse: #F5EFE8;
  --text-inverse-secondary: #A8958A;
  --accent: var(--choc-5);
  --accent-hover: var(--choc-6);
  --accent-soft: rgba(126, 83, 64, .14);
  --hairline: rgba(60, 40, 30, .14);
  --hairline-inverse: rgba(245, 239, 232, .12);
  --success: #5E7A4E;
  --danger: #A4553F;
  --gradient-brand: linear-gradient(100deg, var(--cafe-7) 0%, var(--choc-5) 45%, var(--choc-2) 100%);
  --gradient-warm: linear-gradient(100deg, #F3E6DA 0%, var(--choc-1) 55%, var(--choc-3) 100%);

/* 3. Escalas -------------------------------------------------------------- */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", system-ui, sans-serif;
  --font-serif: "Instrument Serif", "Cormorant Garamond", Georgia, serif;

  --fs-display: clamp(3.6rem, 12.5vw, 9.5rem);
  --fs-h1: clamp(2.75rem, 7.5vw, 5.5rem);
  --fs-h2: clamp(2rem, 5vw, 3.5rem);
  --fs-h3: clamp(1.35rem, 2.4vw, 1.75rem);
  --fs-lead: clamp(1.2rem, 2.2vw, 1.6rem);
  --fs-body: 1.0625rem;
  --fs-small: .9375rem;
  --fs-caption: .8125rem;

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;
  --sp-7: 48px; --sp-8: 64px; --sp-9: 96px; --sp-10: 144px;

  --r-sm: 12px; --r-md: 18px; --r-lg: 28px; --r-xl: 36px; --r-pill: 999px;

  --e-1: 0 1px 2px rgba(29, 20, 16, .06), 0 2px 8px rgba(29, 20, 16, .04);
  --e-2: 0 2px 6px rgba(29, 20, 16, .05), 0 12px 32px -8px rgba(29, 20, 16, .14);
  --e-3: 0 30px 80px -20px rgba(29, 20, 16, .35);

  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
  --t-fast: .18s; --t-base: .35s; --t-slow: .9s;

  --content: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --nav-h: 52px;

  /* aliases usados pelo painel admin */
  --bg: var(--surface); --bg-2: var(--surface-sunken); --card: var(--surface-raised);
  --ink: var(--text); --ink-soft: var(--text-secondary); --line: var(--sand-200);
  --ok: var(--success); --shadow: var(--e-2); --radius: var(--r-lg);
}

/* Base -------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0; background: var(--surface); color: var(--text);
  font: 400 var(--fs-body)/1.5 var(--font-sans); letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a, button, .card, input, textarea { touch-action: manipulation; -webkit-tap-highlight-color: rgba(126, 83, 64, .12); }
h1, h2, h3, .display, .h1, .h2, .h3 { text-wrap: balance; }
.lead, p { text-wrap: pretty; }
.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: var(--r-pill);
  background: var(--text); color: #fff; font-size: var(--fs-small); font-weight: 600; transition: top var(--t-fast) var(--ease-out);
}
.skip:focus-visible { top: 12px; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
::selection { background: var(--choc-1); color: #fff; }
:focus-visible { outline: 2px solid var(--choc-3); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: var(--content); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Tipografia -------------------------------------------------------------- */
.eyebrow { font-size: var(--fs-caption); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-tertiary); margin: 0; }
.display { font-size: var(--fs-display); font-weight: 700; letter-spacing: -.055em; line-height: .92; margin: 0; }
.h1 { font-size: var(--fs-h1); font-weight: 700; letter-spacing: -.045em; line-height: 1; margin: 0; }
.h2 { font-size: var(--fs-h2); font-weight: 700; letter-spacing: -.035em; line-height: 1.05; margin: 0; }
.h3 { font-size: var(--fs-h3); font-weight: 650; letter-spacing: -.02em; line-height: 1.15; margin: 0; }
.lead { font-size: var(--fs-lead); line-height: 1.35; letter-spacing: -.02em; color: var(--text-secondary); font-weight: 500; margin: 0; }
.serif { font-family: var(--font-serif); font-weight: 400; font-style: italic; letter-spacing: -.01em; }
.gradient-text { background: var(--gradient-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.script { font-family: var(--font-serif); font-style: italic; font-weight: 400; }

/* Botões ------------------------------------------------------------------ */
.btn {
  --btn-bg: var(--accent); --btn-fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 44px; padding: 0 22px; border: 0; border-radius: var(--r-pill);
  background: var(--btn-bg); color: var(--btn-fg); font-size: var(--fs-small); font-weight: 600; letter-spacing: -.01em;
  cursor: pointer; text-decoration: none !important; white-space: nowrap;
  transition: background var(--t-fast) ease, transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast) ease, opacity var(--t-fast);
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.lg { min-height: 52px; padding: 0 30px; font-size: 1.0625rem; }
.btn.small { min-height: 34px; padding: 0 14px; font-size: var(--fs-caption); }
.btn.ghost, .btn.secondary { --btn-bg: var(--accent-soft); --btn-fg: var(--accent); }
.btn.ghost:hover, .btn.secondary:hover { background: rgba(126, 83, 64, .17); }
.btn.danger { --btn-bg: var(--danger); }
.btn.inverse { --btn-bg: var(--text-inverse); --btn-fg: var(--espresso-900); }
.btn.inverse:hover { background: #fff; }
.link-arrow { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; color: var(--accent); font-size: var(--fs-body); background: none; border: 0; cursor: pointer; padding: 0; }
.link-arrow::after { content: "›"; font-size: 1.3em; line-height: 0; transform: translateY(-1px); transition: transform var(--t-fast) var(--ease-out); }
.link-arrow:hover { text-decoration: underline; text-underline-offset: 3px; }
.link-arrow:hover::after { transform: translate(3px, -1px); }

/* Navegação translúcida ---------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 40; height: var(--nav-h);
  background: rgba(233, 218, 202, .72); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent; transition: border-color var(--t-base), background var(--t-base);
}
.nav.scrolled { border-bottom-color: var(--hairline); }
.nav .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); }
.nav .brand { font-weight: 700; letter-spacing: -.03em; color: var(--text); font-size: 1.05rem; text-decoration: none; }
.nav .brand em { font-family: var(--font-serif); font-weight: 400; color: var(--choc-3); padding: 0 1px; }
.nav .links { display: flex; align-items: center; gap: var(--sp-5); font-size: var(--fs-caption); }
.nav .links a { color: var(--text-secondary); }
.nav .links a:hover { color: var(--text); text-decoration: none; }
.nav .links a.btn, .nav .links a.btn:hover { color: #fff; }
@media (max-width: 560px) { .nav .links a:not(.btn) { display: none; } }

/* Controle segmentado ----------------------------------------------------- */
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-pill); background: var(--sand-200); position: relative; }
.segmented button {
  position: relative; z-index: 1; border: 0; background: none; padding: 8px 16px; border-radius: var(--r-pill);
  font-size: var(--fs-caption); font-weight: 600; color: var(--text-secondary); cursor: pointer; transition: color var(--t-fast);
}
.segmented button[aria-pressed="true"] { color: var(--text); background: var(--surface-raised); box-shadow: var(--e-1); }

/* Revelação no scroll ------------------------------------------------------ */
[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out); transition-delay: var(--d, 0s); }
[data-reveal].in { opacity: 1; transform: none; }

/* ==========================================================================
   Página dos convidados
   ========================================================================== */

/* Hero */
.hero { position: relative; text-align: center; padding: clamp(40px, 8vh, 88px) 0 0; overflow: clip; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto; height: 120%; z-index: -1;
  background: radial-gradient(50% 45% at 50% 55%, rgba(204, 156, 128, .38), transparent 70%);
}
.hero .eyebrow { margin-bottom: var(--sp-4); }
.hero .display { margin-bottom: var(--sp-4); }
.hero .display .amp { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: 0; color: var(--choc-2); padding: 0 .04em; }
.hero .lead { max-width: 640px; margin: 0 auto var(--sp-6); }
.hero .ctas { display: flex; justify-content: center; align-items: center; gap: var(--sp-5); flex-wrap: wrap; }

.stage { position: relative; margin: clamp(32px, 6vh, 64px) auto 0; max-width: 560px; will-change: transform; }
.stage .couple { display: flex; justify-content: center; align-items: flex-end; }
.stage .couple img { width: 47%; max-width: 250px; filter: drop-shadow(0 24px 24px rgba(38, 28, 23, .22)); }
.stage .couple .left { animation: float 6s var(--ease-out) infinite; }
.stage .couple .right { animation: float 6s var(--ease-out) infinite 1.2s; margin-left: -4%; }
.stage .couple.single img { width: 90%; max-width: 520px; }
.stage .floor { height: 40px; margin: -18px auto 0; width: 70%; border-radius: 50%; background: radial-gradient(closest-side, rgba(38, 28, 23, .2), transparent); }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* Contagem — bento */
.bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3); margin-top: var(--sp-8); }
.tile {
  background: var(--surface-raised); border-radius: var(--r-lg); padding: clamp(18px, 3vw, 32px);
  box-shadow: var(--e-1); text-align: left; display: flex; flex-direction: column; justify-content: space-between; min-height: 150px;
}
.tile .num { font-size: clamp(2.6rem, 6vw, 4.6rem); font-weight: 700; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.tile .lbl { font-size: var(--fs-caption); color: var(--text-tertiary); font-weight: 600; }
.tile.feature { grid-column: span 2; grid-row: span 2; background: var(--surface-inverse); color: var(--text-inverse); position: relative; overflow: hidden; }
.tile.feature::after { content: ""; position: absolute; right: -30%; bottom: -40%; width: 90%; aspect-ratio: 1; background: radial-gradient(closest-side, rgba(204, 156, 128, .45), transparent); }
.tile.feature .num { font-size: clamp(4.5rem, 13vw, 9rem); background: var(--gradient-warm); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tile.feature .lbl { color: var(--text-inverse-secondary); font-size: var(--fs-small); }
.tile.feature .top { color: var(--text-inverse-secondary); font-size: var(--fs-small); font-weight: 500; }
.tile.date { grid-column: span 2; background: var(--gradient-warm); color: var(--espresso-900); }
.tile.date .big { font-size: clamp(1.6rem, 3.4vw, 2.4rem); font-weight: 700; letter-spacing: -.035em; line-height: 1.05; }
.tile.date .lbl { color: rgba(23, 17, 14, .6); }

/* Manifesto — texto que acende com o scroll */
.manifesto { height: 200vh; position: relative; }
.manifesto .sticky { position: sticky; top: 0; height: 100vh; display: grid; place-items: center; }
.manifesto p { font-size: clamp(1.8rem, 4.6vw, 3.6rem); font-weight: 700; letter-spacing: -.035em; line-height: 1.12; max-width: 980px; margin: 0; text-align: left; }
.manifesto .w { opacity: .14; transition: opacity .25s linear; }
.manifesto .w.on { opacity: 1; }
.manifesto .sign { margin-top: var(--sp-6); font-family: var(--font-serif); font-style: italic; font-size: clamp(1.4rem, 3vw, 2rem); color: var(--choc-3); }

/* História — seção escura com carrossel */
.story { background: var(--surface-inverse); color: var(--text-inverse); padding: var(--sp-10) 0 var(--sp-9); overflow: hidden; }
.story .head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--sp-5); flex-wrap: wrap; margin-bottom: var(--sp-7); }
.story .lead { color: var(--text-inverse-secondary); max-width: 560px; margin-top: var(--sp-4); }
.story .h1 span { background: var(--gradient-warm); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(380px, 82vw); gap: var(--sp-4);
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding: 4px max(var(--gutter), calc((100vw - var(--content)) / 2 + var(--gutter))) var(--sp-4);
  scroll-padding-inline: max(var(--gutter), calc((100vw - var(--content)) / 2 + var(--gutter)));
}
.rail::-webkit-scrollbar { display: none; }
.chapter {
  scroll-snap-align: start; background: var(--espresso-800); border: 1px solid var(--hairline-inverse);
  border-radius: var(--r-xl); padding: var(--sp-6); min-height: 340px; display: flex; flex-direction: column; gap: var(--sp-3);
  position: relative; overflow: hidden;
}
.chapter .when { font-size: var(--fs-caption); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--choc-1); }
.chapter .h3 { color: var(--text-inverse); font-size: clamp(1.5rem, 2.6vw, 2rem); }
.chapter p { margin: 0; color: var(--text-inverse-secondary); font-size: var(--fs-body); }
.chapter .idx { position: absolute; right: 22px; bottom: -18px; font-size: 7rem; font-weight: 800; letter-spacing: -.06em; color: rgba(245, 239, 232, .05); line-height: 1; }
.rail-ctrl { display: flex; gap: var(--sp-2); }
.rail-ctrl button {
  width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; font-size: 1.2rem;
  background: rgba(245, 239, 232, .12); color: var(--text-inverse); transition: background var(--t-fast);
}
.rail-ctrl button:hover { background: rgba(245, 239, 232, .22); }

/* Lista */
.gifts { padding: var(--sp-10) 0 var(--sp-9); }
.gifts .head { text-align: center; margin-bottom: var(--sp-7); }
.gifts .head .lead { margin: var(--sp-4) auto 0; max-width: 620px; }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); margin-bottom: var(--sp-8); }
.how div { background: var(--surface-sunken); border-radius: var(--r-md); padding: var(--sp-5); }
.how b { display: block; font-size: var(--fs-body); letter-spacing: -.02em; margin-bottom: 2px; }
.how b::before { content: attr(data-n); display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; margin-right: 8px; transform: translateY(-1px); }
.how span { color: var(--text-secondary); font-size: var(--fs-small); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-5); }
.meter { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-caption); color: var(--text-secondary); font-weight: 600; }
.meter .track { width: 140px; height: 6px; border-radius: 99px; background: var(--sand-200); overflow: hidden; }
.meter .track span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--gradient-brand); transition: width 1.2s var(--ease-out); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--sp-4); }
.card {
  position: relative; display: flex; flex-direction: column; background: var(--surface-raised); border-radius: var(--r-lg);
  overflow: hidden; cursor: pointer; text-align: left; border: 0; padding: 0; box-shadow: var(--e-1);
  transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out);
}
.card:hover { transform: translateY(-4px) scale(1.01); box-shadow: var(--e-2); }
.card .media { aspect-ratio: 1; background: var(--surface-raised); overflow: hidden; }
/* foto inteira também nos cartões; o fundo branco das fotos de loja se funde ao creme */
.card .media img { width: 100%; height: 100%; object-fit: contain; padding: 10px; mix-blend-mode: multiply; transition: transform 1s var(--ease-out); }
.card:hover .media img { transform: scale(1.05); }
.card .info { padding: var(--sp-4) var(--sp-5) var(--sp-5); display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card .status { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--choc-3); }
.card .name { font-size: 1.15rem; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; }
.card .price { color: var(--text-secondary); font-size: var(--fs-small); margin-top: auto; padding-top: var(--sp-2); }
.card .go { position: absolute; right: 14px; bottom: 14px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 20px; line-height: 1; transition: transform var(--t-base) var(--ease-spring); }
.card:hover .go { transform: scale(1.12); }
.card.taken { cursor: default; }
.card.taken .media img { filter: grayscale(.85) contrast(.9); opacity: .55; }
.card.taken .status { color: var(--text-tertiary); }
.card.taken .name { color: var(--text-tertiary); }
.card.taken .go { display: none; }
.card.mine .status { color: var(--success); }
.card.mine { cursor: pointer; }
.empty { grid-column: 1 / -1; text-align: center; color: var(--text-secondary); padding: var(--sp-8) 0; }

/* Sheet (modal) */
.overlay {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: var(--sp-4);
  background: rgba(23, 17, 14, .38); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; pointer-events: none; transition: opacity var(--t-base) var(--ease-out);
}
.overlay.open { opacity: 1; pointer-events: auto; }
.sheet {
  width: 100%; max-width: 880px; max-height: min(90vh, 760px); overflow: auto; background: var(--surface-raised);
  border-radius: var(--r-xl); box-shadow: var(--e-3); display: grid; grid-template-columns: 1fr 1fr; overscroll-behavior: contain;
  transform: translateY(24px) scale(.98); transition: transform var(--t-base) var(--ease-out);
}
.overlay.open .sheet { transform: none; }
.sheet .media { position: relative; overflow: hidden; background: var(--surface-raised); min-height: 100%; }
/* foto inteira (sem cortes); o fundo branco das fotos de loja se funde ao creme do painel */
.sheet .media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: clamp(12px, 3vw, 28px); mix-blend-mode: multiply; }
.sheet .body { padding: var(--sp-7) var(--sp-6) var(--sp-6); display: flex; flex-direction: column; position: relative; }
.sheet .close {
  position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--surface-sunken); color: var(--text-secondary); font-size: 18px; line-height: 1;
}
.sheet .price { font-size: var(--fs-h3); font-weight: 600; letter-spacing: -.02em; margin: var(--sp-2) 0 var(--sp-3); }
.sheet .desc { color: var(--text-secondary); margin: 0 0 var(--sp-4); }
.sheet form { margin-top: auto; padding-top: var(--sp-4); border-top: 1px solid var(--hairline); }
.sheet .actions { display: flex; gap: var(--sp-3); margin-top: var(--sp-5); align-items: center; flex-wrap: wrap; }
.sheet .actions .btn { flex: 1; }
.sheet.thanks-mode { grid-template-columns: 1fr; max-width: 520px; text-align: center; }
.thanks { padding: var(--sp-7) var(--sp-6); }
.thanks .couple { display: flex; justify-content: center; margin-bottom: var(--sp-4); }
.thanks .couple img { width: 120px; }
.thanks .couple.single img { width: 260px; }
.thanks .h1 { margin-bottom: var(--sp-3); }
.thanks p { color: var(--text-secondary); margin: 0 auto var(--sp-6); max-width: 380px; }

/* Formulários */
label { display: block; font-size: var(--fs-caption); font-weight: 600; color: var(--text-secondary); margin: var(--sp-4) 0 6px; }
input[type=text], input[type=password], input[type=number], input[type=url], input[type=date], input[type=time], textarea, select {
  width: 100%; min-height: 48px; padding: 12px 16px; border-radius: var(--r-sm); background: var(--surface-sunken);
  border: 1px solid transparent; transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast); font-size: 1rem;
}
input:focus, textarea:focus, select:focus { outline: none; background: var(--surface-raised); border-color: var(--choc-2); box-shadow: 0 0 0 4px rgba(180, 135, 106, .18); }
textarea { resize: vertical; min-height: 96px; line-height: 1.45; }
.err { color: var(--danger); font-size: var(--fs-caption); margin: var(--sp-2) 0 0; min-height: 1.2em; }
.row { display: flex; gap: var(--sp-3); justify-content: flex-end; margin-top: var(--sp-5); flex-wrap: wrap; }

/* Confete */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 8px; height: 14px; border-radius: 2px; animation: drop 2.8s var(--ease-out) forwards; }
@keyframes drop { to { transform: translate(var(--x, 0), 105vh) rotate(var(--r, 540deg)); opacity: 0; } }

/* Rodapé */
footer { padding: var(--sp-9) 0 var(--sp-8); text-align: center; border-top: 1px solid var(--hairline); }
footer .h2 .amp { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--choc-2); }
footer p { color: var(--text-tertiary); font-size: var(--fs-caption); margin: var(--sp-3) 0 0; }

/* Toast + demo */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 80; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: rgba(29, 20, 16, .9); backdrop-filter: blur(12px); color: #fff; padding: 12px 20px; border-radius: var(--r-pill);
  font-size: var(--fs-small); transition: opacity var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out); max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.demo-banner { background: var(--espresso-900); color: var(--text-inverse-secondary); text-align: center; font-size: var(--fs-caption); padding: 6px 12px; }

/* Responsivo */
@media (max-width: 860px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .tile.feature { grid-row: auto; }
  .sheet { grid-template-columns: 1fr; }
  .sheet .media { aspect-ratio: 4 / 3; min-height: 0; }
  .how { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .overlay { place-items: end center; padding: 0; }
  .sheet { border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 92vh; transform: translateY(100%); }
  .sheet .body { padding: var(--sp-6) var(--sp-5) calc(var(--sp-6) + env(safe-area-inset-bottom)); }
  .grid { grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
  .card .info { padding: var(--sp-3) var(--sp-4) var(--sp-4); }
  .card .name { font-size: 1rem; }
  .card .go { width: 28px; height: 28px; font-size: 17px; right: 10px; bottom: 10px; }
  .tile { min-height: 120px; }
  .manifesto { height: 170vh; }
  .toolbar { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
  .manifesto { height: auto; } .manifesto .sticky { position: static; height: auto; padding: var(--sp-9) 0; }
  .manifesto .w { opacity: 1; }
}

/* ==========================================================================
   Camada imersiva — abertura em envelope, pétalas, profundidade
   ========================================================================== */

/* Abertura */
.intro {
  position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-6);
  padding: var(--sp-6) var(--sp-4) calc(var(--sp-6) + env(safe-area-inset-bottom));
  background:
    radial-gradient(60% 50% at 50% 45%, rgba(204, 156, 128, .35), transparent 70%),
    radial-gradient(120% 80% at 50% 120%, #E9D8C6, transparent 60%),
    var(--sand-50);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out), visibility 0s linear .8s;
}
.intro.leaving { opacity: 0; transform: scale(1.06); visibility: hidden; pointer-events: none; }
.intro-kicker { animation: rise .9s var(--ease-out) both; }
.intro-hint { margin: 0; color: var(--text-tertiary); font-size: var(--fs-caption); font-weight: 600; letter-spacing: .04em; animation: breathe 2.4s ease-in-out infinite; }
.intro.opened .intro-hint, .intro.opened .intro-kicker { opacity: 0; transition: opacity .3s; animation: none; }
.intro-skip {
  position: absolute; top: calc(16px + env(safe-area-inset-top)); right: 16px; border: 0; background: rgba(29, 20, 16, .06);
  color: var(--text-secondary); border-radius: var(--r-pill); padding: 8px 16px; font-size: var(--fs-caption); font-weight: 600; cursor: pointer;
}
.intro-skip:hover { background: rgba(29, 20, 16, .1); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes breathe { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

/* Convite de papelaria fina: papel de algodão com grão e fibras, dobras com luz e sombra,
   forro estampado, selo de cera em relevo e nomes em dourado metalizado. */
.intro {
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .36 0 0 0 0 .25 0 0 0 0 .16 .6 0 0 0 -.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --fibers: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012 .55' numOctaves='2' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .33 0 0 0 0 .24 .55 0 0 0 -.34'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  perspective: 1300px;
  background:
    var(--grain),
    radial-gradient(60% 50% at 50% 45%, rgba(204, 156, 128, .32), transparent 70%),
    radial-gradient(120% 80% at 50% 120%, #E9D8C6, transparent 60%),
    radial-gradient(140% 100% at 50% 50%, transparent 55%, rgba(120, 84, 60, .12) 100%),
    var(--sand-50);
}
.intro .defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.envelope {
  position: relative; width: min(86vw, 460px); aspect-ratio: 1.42; border: 0; padding: 0; background: none; cursor: pointer;
  perspective: 1400px; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .5s var(--ease-out);
  animation: env-in 1.1s var(--ease-out) .15s both;
  filter: drop-shadow(0 2px 2px rgba(60, 36, 22, .16)) drop-shadow(0 26px 34px rgba(60, 36, 22, .24));
}
@keyframes env-in { from { opacity: 0; transform: translateY(40px) rotate(-4deg) scale(.94); } }
.envelope:hover .seal { transform: translate(-50%, -50%) scale(1.05) rotate(-2deg); }
.envelope:focus-visible { outline-offset: 10px; border-radius: 12px; }
.env-back, .env-front, .flap, .flap-shadow, .letter, .seal { position: absolute; display: block; }
.env-back svg, .env-front svg, .flap-face svg, .flap-shadow svg { display: block; width: 100%; height: 100%; }

/* interior com forro estampado */
.env-back { inset: 0; border-radius: 8px; overflow: hidden; background: #E8D2C2; }
.env-back::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(62, 36, 24, .28), rgba(62, 36, 24, .04) 45%, transparent 70%); }

/* bolso da frente: papel com grão e fibras + dobras desenhadas por cima */
.env-front {
  inset: 0; z-index: 3; border-radius: 8px;
  clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 100%, 0 100%);
  background: var(--grain), var(--fibers), linear-gradient(168deg, #F4E8DA 0%, #EBDACA 55%, #E3CEB9 100%);
}
.env-front::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 90% at 20% 10%, rgba(255, 255, 255, .35), transparent 50%); }

/* aba: frente em papel, verso com o forro (aparece ao abrir) */
.flap-shadow { left: 0; right: 0; top: 0; height: 61.5%; z-index: 4; transition: opacity .25s; }
.intro.opened .flap-shadow { opacity: 0; }
.flap { left: 0; right: 0; top: 0; height: 60%; z-index: 5; transform-origin: top center; transform-style: preserve-3d; transition: transform .8s var(--ease-out) .25s; }
.flap-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  clip-path: polygon(0 0, 100% 0, 55% 94%, 53% 97.6%, 50% 99.4%, 47% 97.6%, 45% 94%);
}
.flap-face.outer { background: var(--grain), var(--fibers), linear-gradient(180deg, #EEDFCF 0%, #E6D3C0 60%, #DCC5AE 100%); }
.flap-face.outer::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255, 255, 255, .4), transparent 18%), radial-gradient(60% 40% at 50% 95%, rgba(90, 58, 40, .14), transparent 70%); }
.flap-face.inner { transform: rotateX(180deg); background: #E8D2C2; }
.intro.opened .flap { transform: rotateX(180deg); }
.intro.flap-back .flap { z-index: 1; }

/* O convite impresso (A5, 148 × 210 mm) recriado na tela.
   Medidas em em: o JS define font-size = 1 mm do cartão no tamanho final (--mm),
   e o cartão fica reduzido (--s0) dentro do envelope — assim o texto continua nítido quando cresce. */
.letter.pc {
  --ink: #4E3D33; --ink-soft: #6A4F43; --acc: #A0745A; --rule: #B4876A;
  left: 50%; top: 50%; z-index: 2; width: calc(var(--mm, 2px) * 148); height: calc(var(--mm, 2px) * 210);
  font-size: var(--mm, 2px); border-radius: calc(var(--mm, 2px) * .8); color: var(--ink); text-align: center;
  background:
    linear-gradient(rgba(252, 248, 242, .55), rgba(252, 248, 242, .55)),
    var(--grain), var(--fibers), linear-gradient(180deg, #FDF9F3 0%, #F8F0E6 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 0 0 1px rgba(120, 85, 60, .08), 0 6px 16px rgba(38, 28, 23, .14);
  transform: translate(-50%, -50%) scale(var(--s0, .4));
  transition: transform 1s var(--ease-out) .85s;
  line-height: 1.2; -webkit-font-smoothing: antialiased; text-rendering: geometricPrecision;
}
.pc-frame { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pc-in { position: absolute; inset: 13em 14em 13em; display: flex; flex-direction: column; align-items: center; }
.pc-in > span { display: block; }
.pc-sprig { width: 42em; height: auto; margin-top: 3em; display: block; }
.pc-caps { font-family: "Inter", var(--font-sans); font-weight: 400; text-transform: uppercase; letter-spacing: .2em; font-size: 3em; color: var(--ink-soft); line-height: 1.7; }
.pc-fam { margin-top: 5em; }
.pc-names { margin-top: 5em; font-family: "Cormorant Garamond", Georgia, serif; }
.pc-names .n { display: block; font-size: 11.64em; line-height: 1; letter-spacing: .1em; padding-left: .1em; text-transform: uppercase; }
.pc-names .and { display: flex; align-items: center; justify-content: center; gap: .14em; font-style: italic; font-size: 7.76em; color: var(--acc); line-height: 1; margin: .07em 0 .11em; }
.pc-names .and::before, .pc-names .and::after { content: ""; width: 2.06em; height: 1px; background: var(--rule); opacity: .7; }
.pc-inv { margin-top: 1.97em; }
.pc-date { margin-top: 6em; width: 100%; display: grid !important; grid-template-columns: 1fr auto 1fr; align-items: center; column-gap: 4em; }
.pc-date .side { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: .8em 0; font-size: 2.8em; }
.pc-date .mid { font-family: "Cormorant Garamond", Georgia, serif; line-height: 1; }
.pc-date .mid > span { display: block; }
.pc-date .day { font-size: 12em; font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1; }
.pc-date .month { margin-top: .38em; font-family: "Inter", var(--font-sans); font-size: 3em; letter-spacing: .26em; text-transform: uppercase; }
.pc-date .year { margin-top: .44em; font-family: "Inter", var(--font-sans); font-size: 2.6em; letter-spacing: .26em; color: var(--ink-soft); }
.pc-place { margin-top: 6em; }
.pc-place .st { display: block; color: var(--ink); letter-spacing: .2em; }
.pc-place .addr { display: block; margin-top: .32em; font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: 4.9em; line-height: 1.3; color: var(--ink-soft); }
.pc-div { margin-top: 5em; display: flex !important; align-items: center; gap: 2.5em; }
.pc-div i { width: 18em; height: 1px; background: var(--rule); opacity: .8; }
.pc-div svg { width: 7em; height: 4em; }
.pc-rec { margin-top: .53em; font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: 4.94em; color: var(--acc); }
.pc-gift { margin-top: auto; display: flex !important; flex-direction: column; align-items: center; gap: .6em; }
.pc-gift .pc-caps { font-size: 2.7em; }
.pc-tap { font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: 4.4em; color: var(--acc); }
.intro.reveal .pc-tap { animation: breathe 2.4s ease-in-out 1.6s infinite; }

/* selo de cera em relevo com ramos secos */
.seal {
  left: 50%; top: 57%; z-index: 6; width: clamp(136px, 42vw, 180px); transform: translate(-50%, -50%);
  filter: drop-shadow(0 2px 1.5px rgba(40, 20, 10, .35)) drop-shadow(0 8px 10px rgba(40, 20, 10, .22));
  transition: transform .35s var(--ease-spring), opacity .35s;
}
.seal svg { display: block; width: 100%; height: auto; }
.intro.opened .seal { opacity: 0; transform: translate(-50%, -50%) scale(.5) rotate(-8deg); }
.intro.opened .letter { transform: translate(-50%, -50%) translateY(var(--lift, -60px)) scale(var(--s0, .4)); }

/* ---------- Imersão 3D: luz que segue o dedo/mouse, envelope flutuando,
   convite saindo do envelope e vindo para a frente ---------- */
@property --rx { syntax: "<angle>"; inherits: true; initial-value: 0deg; }
@property --ry { syntax: "<angle>"; inherits: true; initial-value: 0deg; }

/* luz ambiente que acompanha o ponteiro + poeira dourada flutuando */
.intro::before {
  content: ""; position: absolute; inset: -10%; pointer-events: none; z-index: 0;
  background: radial-gradient(38% 32% at var(--lx, 50%) var(--ly, 42%), rgba(255, 244, 228, .55), transparent 70%);
  transition: background-position .2s;
}
.intro::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0; opacity: .7;
  background-image:
    radial-gradient(1.6px 1.6px at 12% 22%, rgba(214, 170, 112, .9), transparent 60%),
    radial-gradient(1.2px 1.2px at 78% 18%, rgba(214, 170, 112, .8), transparent 60%),
    radial-gradient(2px 2px at 64% 72%, rgba(214, 170, 112, .7), transparent 60%),
    radial-gradient(1.4px 1.4px at 28% 80%, rgba(214, 170, 112, .8), transparent 60%),
    radial-gradient(1.8px 1.8px at 88% 54%, rgba(214, 170, 112, .6), transparent 60%),
    radial-gradient(1.2px 1.2px at 40% 36%, rgba(214, 170, 112, .7), transparent 60%),
    radial-gradient(1.6px 1.6px at 6% 60%, rgba(214, 170, 112, .6), transparent 60%);
  animation: dust 14s ease-in-out infinite alternate;
}
@keyframes dust { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-14px, -26px, 0); } }
.intro > * { position: relative; z-index: 1; }
.intro > .intro-skip { position: absolute; z-index: 3; }

/* palco 3D: o envelope fica "sobre a mesa" com sombra de contato */
.envelope { transform-style: preserve-3d; filter: none; }
.envelope::before {
  content: ""; position: absolute; left: 6%; right: 6%; bottom: -9%; height: 16%; z-index: -1; pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%, rgba(60, 36, 22, .38), transparent 70%);
  filter: blur(6px);
  transform: translateX(var(--shx, 0px));
  transition: opacity .6s var(--ease-out), transform .5s var(--ease-out);
}
.env-back, .env-front, .flap-face.outer { box-shadow: 0 1px 1px rgba(60, 36, 22, .12), 0 22px 40px -14px rgba(60, 36, 22, .34); }
.env-front { box-shadow: none; }
.env-back { box-shadow: 0 2px 3px rgba(60, 36, 22, .16), 0 30px 46px -18px rgba(60, 36, 22, .38); }

/* brilho especular do papel que muda com a inclinação */
.env-front::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; mix-blend-mode: soft-light;
  background: linear-gradient(calc(110deg + var(--ry) * 3), transparent 25%, rgba(255, 255, 255, .55) 45%, transparent 65%);
  background-size: 200% 100%; background-position: var(--sx, 50%) 0;
}

/* em celular/tablet o envelope "respira" sozinho no ar */
@media (hover: none) {
  .envelope { animation: env-in 1.1s var(--ease-out) .15s both, sway 7s ease-in-out 1.3s infinite; }
  .intro.opened .envelope { animation: none; }
}
@keyframes sway {
  0%, 100% { --rx: 3deg; --ry: -5deg; }
  50% { --rx: -2deg; --ry: 5deg; }
}

/* sombra que a aba projeta enquanto gira */
.flap-face.outer::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0;
  background: linear-gradient(180deg, rgba(60, 36, 22, .35), rgba(60, 36, 22, .1));
  transition: opacity .8s var(--ease-out) .25s;
}
.intro.opened .flap-face.outer::before { opacity: 1; }

/* selo: pulsa ao toque e “estala” */
.intro.opened .seal { animation: seal-pop .45s var(--ease-out) both; }
@keyframes seal-pop {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  35% { transform: translate(-50%, -50%) scale(1.14) rotate(3deg); opacity: 1; }
  100% { transform: translate(-50%, -60%) scale(.4) rotate(-14deg); opacity: 0; }
}

/* convite: sobe do envelope e depois vem para a frente, em 3D */
.letter { transform-style: preserve-3d; }
.letter::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 248, 232, .85) 48%, transparent 66%);
  background-size: 260% 100%; background-position: 120% 0; mix-blend-mode: soft-light;
}
.intro.reveal .letter {
  z-index: 8;
  animation: letter-forward 1.5s cubic-bezier(.2, .8, .2, 1) both;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 0 0 1px rgba(120, 85, 60, .08), 0 40px 70px -20px rgba(38, 28, 23, .45), 0 10px 24px rgba(38, 28, 23, .16);
  transition: box-shadow 1.2s var(--ease-out);
}
.intro.reveal .letter::after { animation: sheen 1.6s ease .7s both; }
@keyframes letter-forward {
  0%   { transform: translate(-50%, -50%) translateY(var(--lift)) translateZ(0) rotateX(0) scale(var(--s0)); }
  45%  { transform: translate(-50%, -50%) translateY(var(--mid-y)) translateZ(120px) rotateX(14deg) rotateZ(-1.5deg) scale(var(--s-mid)); }
  100% { transform: translate(-50%, -50%) translateY(var(--ty)) translateZ(0) rotateX(0) rotateZ(0) scale(1); }
}
@keyframes sheen { 0% { opacity: 1; background-position: 120% 0; } 100% { opacity: 1; background-position: -40% 0; } }

/* o envelope afunda e some, deixando só o convite */
.env-back, .env-front { transition: transform .9s var(--ease-out), opacity .7s var(--ease-out); }
.intro.reveal .flap { transition: transform .9s var(--ease-out), opacity .7s var(--ease-out); }
.intro.reveal .env-back, .intro.reveal .env-front, .intro.reveal .flap { transform: translateY(26%) translateZ(-120px) rotateX(18deg); opacity: 0; }
.intro.reveal .flap { transform: translateY(26%) translateZ(-120px) rotateX(198deg); }
.intro.reveal .envelope::before { opacity: 0; }
.intro.reveal { --lx: 50%; --ly: 46%; }

/* saída: o convite se aproxima e a página aparece por trás, sem “vazar” */
/* parado na tela: sai do contexto 3D e fica em pixel inteiro, para o texto ficar nítido */
.intro.settled .envelope { transform: none; transition: none; }
.intro.settled .letter { animation: none; transition: none; transform: translate(var(--fx), var(--fy)); }

.intro.leaving .letter { animation: letter-away .8s var(--ease-out) both; }
@keyframes letter-away {
  from { transform: translate(var(--fx, -50%), var(--fy, -50%)) translateZ(0); opacity: 1; }
  to   { transform: translate(var(--fx, -50%), var(--fy, -50%)) translateZ(180px); opacity: 0; }
}

/* Pétalas e saudação */
.hero .petals { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.greet {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 var(--sp-5); padding: 6px 14px 6px 8px; border-radius: var(--r-pill);
  background: var(--surface-raised); box-shadow: var(--e-1); font-size: var(--fs-caption); font-weight: 600; color: var(--text-secondary);
  animation: rise .8s var(--ease-out) both;
}
.greet::before { content: "🤎"; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-sunken); font-size: 12px; }

/* Contagem ao vivo */
.tile .live { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-size: var(--fs-caption); color: var(--text-inverse-secondary); font-variant-numeric: tabular-nums; font-weight: 600; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--choc-1); box-shadow: 0 0 0 0 rgba(204, 156, 128, .6); animation: ping 2s ease-out infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(204, 156, 128, 0); } 100% { box-shadow: 0 0 0 0 rgba(204, 156, 128, 0); } }

/* Barra de progresso de leitura na navegação */
.nav::after { content: ""; position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; transform-origin: left; transform: scaleX(var(--p, 0)); background: var(--gradient-brand); }

/* Cartões com profundidade (somente mouse/trackpad) */
@media (hover: hover) and (pointer: fine) {
  .grid { perspective: 1200px; }
  .card:not(.taken) { transform-style: preserve-3d; }
  .card:not(.taken):hover { transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-6px); transition: transform .12s linear, box-shadow var(--t-base) var(--ease-out); }
  .card::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity var(--t-base);
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .35), transparent 45%);
  }
  .card:not(.taken):hover::after { opacity: 1; }
}

/* Revelação dos cartões em cascata */
.card { animation: card-in .7s var(--ease-out) backwards; animation-delay: var(--i, 0s); }
@keyframes card-in { from { opacity: 0; transform: translateY(22px) scale(.98); } }

/* Seção escura: o fundo "escurece" ao chegar */
.story .chapter { transition: transform var(--t-base) var(--ease-out), border-color var(--t-base); }
.story .chapter:hover { transform: translateY(-4px); border-color: rgba(204, 156, 128, .35); }

@media (prefers-reduced-motion: reduce) {
  .intro { display: none !important; }
  .hero .petals { display: none; }
}

/* ---------- Bonecos em 3D (Three.js) ---------- */
.stage .funko3d { display: block; width: 100%; aspect-ratio: 5 / 4; touch-action: pan-y; cursor: grab; opacity: 0; transition: opacity .8s var(--ease-out); }
.stage .funko3d:active { cursor: grabbing; }
.stage .funko3d.ready { opacity: 1; }
.stage .funko3d.ready + .floor { display: none; }
@media (max-width: 600px) { .stage .funko3d { aspect-ratio: 6 / 5; } }
.stage .funko3d[hidden], .stage .couple[hidden] { display: none; }
.stage .couple.single img { width: 100%; max-width: 640px; animation: float 6s var(--ease-out) infinite; filter: drop-shadow(0 22px 26px rgba(38, 28, 23, .16)); }
@media (prefers-reduced-motion: reduce) { .stage .couple.single img { animation: none; } }

/* ==========================================================================
   Botões em vidro (estilo iPhone / Liquid Glass) — mesmas cores de antes.
   Camadas: cor do botão levemente translúcida + desfoque do que está atrás,
   brilho especular no topo (::before) e borda de luz em degradê (::after).
   ========================================================================== */
.btn, .segmented, .segmented button[aria-pressed="true"], .rail-ctrl button { position: relative; }
.btn, .segmented, .segmented button[aria-pressed="true"], .rail-ctrl button, .sheet .close, .intro-skip, .card .go { isolation: isolate; }
.btn {
  background: color-mix(in srgb, var(--btn-bg) 90%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(170%); backdrop-filter: blur(14px) saturate(170%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .42),
    inset 0 -1px 0 rgba(0, 0, 0, .1),
    0 1px 2px rgba(38, 28, 23, .08),
    0 8px 20px -8px color-mix(in srgb, var(--btn-bg) 70%, transparent);
}
.btn::before, .segmented button[aria-pressed="true"]::before, .rail-ctrl button::before, .sheet .close::before, .intro-skip::before, .card .go::before {
  content: ""; position: absolute; inset: 1px; z-index: -1; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .34) 0%, rgba(255, 255, 255, .08) 46%, rgba(255, 255, 255, 0) 54%, rgba(255, 255, 255, .06) 100%);
  transition: opacity var(--t-fast) ease;
}
.btn::after, .segmented::after, .segmented button[aria-pressed="true"]::after, .rail-ctrl button::after, .sheet .close::after, .intro-skip::after, .card .go::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(160deg, rgba(255, 255, 255, .7), rgba(255, 255, 255, .12) 38%, rgba(255, 255, 255, .04) 62%, rgba(255, 255, 255, .35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.btn:hover { background: color-mix(in srgb, var(--accent-hover) 90%, transparent); }
.btn.ghost:hover, .btn.secondary:hover { background: rgba(126, 83, 64, .17); }
.btn.inverse:hover { background: #fff; }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 90%, transparent); }
.btn:hover::before { opacity: 1.0; }
.btn:active { transform: scale(.97); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), inset 0 2px 6px rgba(0, 0, 0, .14), 0 1px 2px rgba(38, 28, 23, .08); }
.btn:active::before { opacity: .6; }
.btn:disabled { box-shadow: none; }
/* botão claro (secundário): vidro fosco com a mesma tinta café */
.btn.ghost, .btn.secondary {
  background: var(--btn-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -1px 0 rgba(126, 83, 64, .06), 0 1px 2px rgba(38, 28, 23, .05);
}

/* controle segmentado: trilho de vidro + "pílula" de vidro claro */
.segmented {
  background: color-mix(in srgb, var(--sand-200) 78%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
  box-shadow: inset 0 1px 2px rgba(38, 28, 23, .08), inset 0 -1px 0 rgba(255, 255, 255, .5);
}
.segmented::after { opacity: .55; }
.segmented button[aria-pressed="true"] {
  background: color-mix(in srgb, var(--surface-raised) 82%, transparent);
  box-shadow: 0 1px 2px rgba(38, 28, 23, .08), 0 6px 14px -6px rgba(38, 28, 23, .22), inset 0 1px 0 rgba(255, 255, 255, .9);
}
.segmented button { transition: color var(--t-fast), transform var(--t-fast) var(--ease-out); }
.segmented button:active { transform: scale(.96); }

/* setas da história (fundo escuro), fechar do painel, "Pular" da abertura */
.rail-ctrl button, .sheet .close, .intro-skip {
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  transition: background var(--t-fast), transform var(--t-fast) var(--ease-out);
}
.rail-ctrl button { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 6px 16px -8px rgba(0, 0, 0, .5); }
.rail-ctrl button::after { opacity: .6; }
.sheet .close { background: color-mix(in srgb, var(--surface-sunken) 78%, transparent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 2px 8px -2px rgba(38, 28, 23, .18); }
.intro-skip { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 2px 8px -3px rgba(38, 28, 23, .2); }
.rail-ctrl button:active, .sheet .close:active, .intro-skip:active { transform: scale(.94); }

/* seta dos cartões: mesmo vidro, sem desfoque (são muitos na tela) */
.card .go { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), inset 0 -1px 0 rgba(0, 0, 0, .12), 0 6px 14px -6px rgba(126, 83, 64, .7); }

/* acessibilidade: quem pediu menos transparência recebe as cores sólidas */
@media (prefers-reduced-transparency: reduce) {
  .btn { background: var(--btn-bg); }
  .btn:hover { background: var(--accent-hover); }
  .btn.ghost:hover, .btn.secondary:hover { background: rgba(126, 83, 64, .17); }
  .segmented { background: var(--sand-200); }
  .segmented button[aria-pressed="true"] { background: var(--surface-raised); }
  .sheet .close { background: var(--surface-sunken); }
  .btn, .segmented, .rail-ctrl button, .sheet .close, .intro-skip { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (forced-colors: active) {
  .btn::before, .btn::after, .segmented::after, .segmented button::before, .segmented button::after { display: none; }
}

/* Contagem: Horas · Minutos · Segundos lado a lado */
.bento { grid-template-columns: repeat(6, 1fr); }
.tile.feature, .tile.date { grid-column: span 3; }
.tile.unit { grid-column: span 1; }
.tile.unit .num { font-size: clamp(2rem, 7.5vw, 4.2rem); }
@media (max-width: 860px) {
  .tile.feature, .tile.date { grid-column: span 6; }
  .tile.unit { grid-column: span 2; padding: 16px 14px; }
}
.tile.feature .total { display: block; margin-top: 4px; font-size: var(--fs-small); color: var(--text-inverse-secondary); font-variant-numeric: tabular-nums; }
.tile.feature .total b { font-weight: 700; color: var(--choc-1); }


/* Barras em vidro (mesmas cores): navegação do topo e aviso flutuante */
.nav {
  background: rgba(233, 218, 202, .66);
  -webkit-backdrop-filter: saturate(190%) blur(24px); backdrop-filter: saturate(190%) blur(24px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -1px 0 rgba(255, 255, 255, .35);
}
.nav.scrolled { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -1px 0 rgba(255, 255, 255, .35), 0 8px 24px -16px rgba(38, 28, 23, .35); }
.toast {
  isolation: isolate;
  -webkit-backdrop-filter: blur(16px) saturate(170%); backdrop-filter: blur(16px) saturate(170%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 10px 26px -10px rgba(23, 17, 14, .5);
}
.toast::before {
  content: ""; position: absolute; inset: 1px; z-index: -1; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 55%);
}
.toast::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(160deg, rgba(255, 255, 255, .45), rgba(255, 255, 255, .06) 45%, rgba(255, 255, 255, .2));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
@media (prefers-reduced-transparency: reduce) {
  .nav { background: rgba(233, 218, 202, .97); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .toast { background: rgb(29, 20, 16); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.toast { width: max-content; } /* aviso numa linha só quando cabe */

/* Hub de endereço de entrega (aparece depois de escolher o presente) */
.ship {
  display: grid; grid-template-columns: 112px 1fr; gap: var(--sp-4); align-items: center; text-align: left;
  margin: 0 0 var(--sp-5); padding: 12px; border-radius: var(--r-md);
  background: var(--surface-sunken); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 1px 2px rgba(38, 28, 23, .06);
}
.ship:empty { display: none; }
.ship-photo { width: 112px; height: 118px; object-fit: cover; border-radius: 12px; box-shadow: 0 6px 14px -8px rgba(38, 28, 23, .45); }
.ship-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ship-kicker { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--choc-3); }
.ship-to { font-size: 1rem; font-weight: 650; color: var(--text); letter-spacing: -.01em; }
.ship-addr { font-style: normal; color: var(--text-secondary); font-size: var(--fs-small); line-height: 1.45; }
.ship-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
#s-mine .ship { margin-top: var(--sp-3); }
@media (max-width: 480px) {
  .ship { grid-template-columns: 92px 1fr; gap: 12px; }
  .ship-photo { width: 92px; height: 104px; }
  .ship-addr { font-size: .875rem; }
}
@media (max-width: 330px) { .ship { grid-template-columns: 1fr; } .ship-photo { width: 100%; height: 140px; } }

/* ==========================================================================
   Chá de panela — mesmo design system, em branco gelo
   (o projeto do chá carrega site.js com SITE = "cha", que marca <html data-site="cha">)
   ========================================================================== */
:root[data-site="cha"] {
  --sand-0: #FCFDFD; --sand-50: #F2F5F7; --sand-100: #E7ECEF; --sand-200: #DAE1E6; --sand-300: #C6D0D7;
  --hairline: rgba(40, 52, 60, .12);
  --gradient-warm: linear-gradient(100deg, #EEF2F4 0%, var(--choc-1) 55%, var(--choc-3) 100%);
}
[data-site="cha"] .nav { background: rgba(242, 245, 247, .7); }
@media (prefers-reduced-transparency: reduce) { [data-site="cha"] .nav { background: rgba(242, 245, 247, .97); } }
[data-site="cha"] .intro {
  background:
    var(--grain),
    radial-gradient(60% 50% at 50% 45%, rgba(190, 205, 214, .35), transparent 70%),
    radial-gradient(120% 80% at 50% 120%, #E6ECEF, transparent 60%),
    radial-gradient(140% 100% at 50% 50%, transparent 55%, rgba(70, 90, 105, .1) 100%),
    var(--sand-50);
}
[data-site="cha"] .intro::before { background: radial-gradient(38% 32% at var(--lx, 50%) var(--ly, 42%), rgba(255, 255, 255, .7), transparent 70%); }
[data-site="cha"] .env-back, [data-site="cha"] .flap-face.inner { background: #E6ECEF; }
[data-site="cha"] #liner rect { fill: #E6ECEF; }
[data-site="cha"] .env-front { background: var(--grain), var(--fibers), linear-gradient(168deg, #FBFCFD 0%, #F0F3F5 55%, #E4E9EC 100%); }
[data-site="cha"] .flap-face.outer { background: var(--grain), var(--fibers), linear-gradient(180deg, #F7F9FA 0%, #EDF1F3 60%, #E1E7EA 100%); }
[data-site="cha"] .letter.pc {
  background:
    linear-gradient(rgba(253, 254, 254, .6), rgba(253, 254, 254, .6)),
    var(--grain), var(--fibers), linear-gradient(180deg, #FFFFFF 0%, #F5F8F9 100%);
}

/* cartão do chá: título “Chá de Panela” em itálico e nomes um pouco menores */
.pc-title { display: block; margin-top: .25em; font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: 15em; line-height: 1; color: var(--acc); }
.pc-names.small { margin-top: 3.5em; }
.pc-names.small .n { font-size: 8.4em; }
.pc-names.small .and { font-size: 5.6em; }
.pc-tbd { font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: 5em; color: var(--ink-soft); }
[data-site="cha"] #bottomG stop:nth-child(1) { stop-color: #FFFFFF; }
[data-site="cha"] #bottomG stop:nth-child(2) { stop-color: #EEF2F4; }
[data-site="cha"] #bottomG stop:nth-child(3) { stop-color: #DDE4E8; }

/* ---------- Chá de panela: contagem em “gelo” (vidro fosco, vapor e brilho) ---------- */
.tea { display: none; }
[data-site="cha"] .bento { perspective: 1200px; }
[data-site="cha"] .tile {
  position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(160deg, rgba(255, 255, 255, .92) 0%, rgba(240, 244, 247, .78) 100%);
  -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(150, 170, 185, .18), 0 1px 2px rgba(40, 60, 75, .05), 0 18px 40px -22px rgba(40, 60, 75, .28);
  transform: rotateX(var(--trx, 0deg)) rotateY(var(--try, 0deg));
  transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out);
}
/* reflexo de luz que segue o mouse */
[data-site="cha"] .tile::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .9;
  background: radial-gradient(360px circle at var(--gx, 30%) var(--gy, 0%), rgba(255, 255, 255, .95), transparent 55%);
}
/* faixa de luz passando pelo vidro, de tempos em tempos */
[data-site="cha"] .tile::after {
  content: ""; position: absolute; inset: -40% -60%; z-index: 2; pointer-events: none;
  background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, .7) 50%, transparent 58%);
  transform: translateX(-60%); animation: ice-sheen 7s ease-in-out infinite;
  animation-delay: calc(var(--sheen-d, 0) * 1s);
}
@keyframes ice-sheen { 0%, 62% { transform: translateX(-60%); } 100% { transform: translateX(60%); } }
[data-site="cha"] .tile .lbl { color: #5F7380; }

/* tile grande: gelo com a xícara fumegante */
[data-site="cha"] .tile.feature {
  color: var(--cafe-7);
  background:
    radial-gradient(70% 90% at 100% 100%, rgba(204, 156, 128, .2), transparent 60%),
    linear-gradient(165deg, #FFFFFF 0%, #EEF3F6 50%, #DDE6EC 100%);
}
[data-site="cha"] .tile.feature .top, [data-site="cha"] .tile.feature .lbl, [data-site="cha"] .tile.feature .total, [data-site="cha"] .tile .live { color: #5F7380; }
[data-site="cha"] .tile.feature .total b { color: var(--choc-4); }
[data-site="cha"] .tile.feature .num { background: linear-gradient(100deg, var(--cafe-7) 0%, var(--choc-5) 45%, var(--choc-2) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-site="cha"] .tile.feature > div, [data-site="cha"] .tile.feature .top { position: relative; z-index: 1; }

[data-site="cha"] .tea { display: block; position: absolute; right: clamp(-10px, 1vw, 16px); bottom: clamp(-6px, 1vw, 12px); width: clamp(140px, 32%, 240px); z-index: 0; pointer-events: none; animation: cup-float 6s ease-in-out infinite; }
@keyframes cup-float { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-6px) rotate(1deg); } }
.tea .cup { fill: #FFFFFF; stroke: #C7D3DB; stroke-width: 1.5; }
.tea .rim { fill: #F4F7F9; stroke: #C7D3DB; stroke-width: 1.5; }
.tea .liquid { fill: #9C6B4E; }
.tea .handle { stroke: #C7D3DB; stroke-width: 9; stroke-linecap: round; }
.tea .saucer { fill: #FFFFFF; stroke: #C7D3DB; stroke-width: 1.5; }
.tea .saucer-well { fill: #EEF2F5; }
.tea .saucer-shadow { fill: rgba(60, 85, 100, .14); filter: blur(4px); }
.tea .cup-shine { stroke: rgba(255, 255, 255, .95); stroke-width: 5; stroke-linecap: round; }
.tea .steam path { stroke: rgba(150, 170, 185, .55); stroke-width: 5; stroke-dasharray: 60 140; animation: steam 3.6s ease-in-out infinite; }
.tea .steam path:nth-child(2) { animation-delay: -1.2s; }
.tea .steam path:nth-child(3) { animation-delay: -2.4s; }
@keyframes steam {
  0% { stroke-dashoffset: 120; opacity: 0; transform: translateY(12px); }
  30% { opacity: .9; }
  100% { stroke-dashoffset: -60; opacity: 0; transform: translateY(-14px); }
}

/* tile da data: gelo azulado com um toque café */
[data-site="cha"] .tile.date {
  color: var(--cafe-7);
  background:
    radial-gradient(60% 120% at 100% 0%, rgba(204, 156, 128, .28), transparent 65%),
    linear-gradient(110deg, #FFFFFF 0%, #ECF1F4 55%, #D7E2E9 100%);
}
[data-site="cha"] .tile.date .lbl { color: #5F7380; }

/* números: café e com um “pulo” quando mudam */
[data-site="cha"] .tile.unit .num { color: var(--cafe-7); }
.num.bump { animation: num-bump .45s var(--ease-spring); }
@keyframes num-bump { 0% { transform: translateY(-.18em) scale(.96); opacity: .3; } 100% { transform: none; opacity: 1; } }

/* enquanto a data do chá não foi definida */
.bento.pending .tile.feature .num { font-size: clamp(2.4rem, 5.6vw, 4.2rem); letter-spacing: -.04em; padding-bottom: .08em; }
.bento.pending .tile.feature .live { display: flex; }
[data-site="cha"] .tile.feature > div { max-width: 68%; }
.bento.pending .total { display: none !important; }
.bento.pending .tile.unit .num { color: var(--sand-300); letter-spacing: .1em; }
.bento.pending .tile.unit .num::after { content: ""; }
.bento.pending .pulse { animation-duration: 3.2s; }

@media (prefers-reduced-motion: reduce) {
  [data-site="cha"] .tile::after, .tea, .tea .steam path, .num.bump { animation: none !important; }
}
