:root {
  --bg: #FBF7F4;
  --surface: #FFFFFF;
  --blush: #F4E8E7;
  --line: #EADCDA;
  --ink: #2B1B1C;
  --muted: #806A6B;
  --wine: #722A2C;
  --wine-deep: #561C1E;
  --rose: #AF7D86;
  --rose-soft: #D9B7BC;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 14px;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1400px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.icon {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px;
  font-weight: 500; font-size: 15px; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--wine); color: #fff; }
.btn-primary:hover { background: var(--wine-deep); }
.btn-primary:disabled { opacity: .6; cursor: progress; }
.btn-ghost { border-color: var(--rose-soft); color: var(--wine); }
.btn-ghost:hover { background: var(--blush); }
:focus-visible { outline: 2px solid var(--wine); outline-offset: 3px; }

/* ---------- Hero ---------- */
.hero {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(40px, 8vw, 96px) var(--gutter) clamp(32px, 6vw, 72px);
  display: grid; grid-template-columns: 1.05fr .95fr; align-items: center;
  gap: clamp(32px, 6vw, 96px);
}
.eyebrow {
  margin: 0 0 18px; font-size: 13px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--rose);
}
.hero h1 { margin: 0; font-weight: 400; line-height: .9; }
.hero-name {
  display: block; font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(72px, 13vw, 168px); color: var(--wine); letter-spacing: -.02em;
}
.hero-age { display: flex; align-items: flex-end; gap: 10px; margin-top: 4px; }
.hero-age svg { width: clamp(76px, 10vw, 122px); height: auto; overflow: visible; }
.hero-age text {
  font-family: var(--serif); font-weight: 500; font-size: 140px;
  fill: none; stroke: var(--rose); stroke-width: 2.2; stroke-linejoin: round;
}
.hero-anos {
  font-family: var(--serif); font-style: italic; font-size: clamp(28px, 4vw, 44px);
  color: var(--muted); padding-bottom: .35em;
}
.lede { max-width: 30em; margin: 28px 0 32px; font-size: 18px; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-photo {
  margin: 0; justify-self: center; width: min(100%, 460px);
  aspect-ratio: 4 / 5; overflow: hidden;
  border-radius: 999px 999px var(--radius) var(--radius);
  background: var(--blush);
  box-shadow: 0 30px 60px -30px rgba(86, 28, 30, .35);
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 44% 30%; }

/* ---------- Barra fixa ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter);
  height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.topbar-brand {
  font-family: var(--serif); font-style: italic; font-size: 24px;
  color: var(--wine); text-decoration: none;
}
.topbar-brand em { color: var(--rose); }
.topbar-links { display: flex; align-items: center; gap: clamp(12px, 3vw, 28px); font-size: 15px; }
.topbar-links a { text-decoration: none; color: var(--muted); transition: color .2s; }
.topbar-links a:hover { color: var(--wine); }
.topbar-links .topbar-zip {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--wine); font-weight: 500;
  padding: 7px 14px; border-radius: 999px; background: var(--blush);
}

/* ---------- Seções ---------- */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(40px, 6vw, 72px) var(--gutter); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 28px; }
.section-head h2 {
  margin: 0; font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(40px, 6vw, 60px); line-height: 1; color: var(--wine);
}
.section-head p { margin: 0; }

/* ---------- Categorias ---------- */
.cat-bar {
  position: sticky; top: 60px; z-index: 10;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(var(--gutter) * -1) 28px; padding: 12px var(--gutter);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.cat-bar::-webkit-scrollbar { display: none; }
.cat-bar[hidden] { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: baseline; gap: 7px;
  padding: 8px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: 14px; white-space: nowrap; transition: background .2s, border-color .2s, color .2s;
}
.chip small { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--rose-soft); }
.chip.on { background: var(--wine); border-color: var(--wine); color: #fff; }
.chip.on small { color: rgba(255, 255, 255, .7); }

.cat-section + .cat-section { margin-top: clamp(40px, 6vw, 64px); }
.cat-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 16px; flex-wrap: wrap; }
.cat-title {
  margin: 0; padding: 0; border: 0; background: none; cursor: pointer; text-align: left;
  font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(28px, 4vw, 38px);
  line-height: 1.1; color: var(--wine);
}
h3.cat-title { cursor: default; }
button.cat-title:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }
.cat-meta { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.cat-zip {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font-size: 14px; color: var(--wine); text-decoration: none;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--rose-soft);
  transition: background .2s;
}
.cat-zip:hover { background: var(--blush); }
.cat-zip .icon { width: 16px; height: 16px; }

/* ---------- Galeria (linhas justificadas) ---------- */
.gallery { --gap: 6px; }
.rows { display: flex; flex-direction: column; gap: var(--gap); }
.row { display: flex; gap: var(--gap); }
.tile {
  position: relative; flex: none; padding: 0; border: 0; cursor: zoom-in;
  overflow: hidden; border-radius: 4px; background: var(--tile, var(--blush));
}
.tile::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(86, 28, 30, .18), transparent 40%);
  opacity: 0; transition: opacity .3s;
}
.tile img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.01);
  transition: opacity .5s ease, transform .6s cubic-bezier(.2, .7, .2, 1);
}
.tile img.loaded { opacity: 1; }
.tile:hover img { transform: scale(1.04); }
.tile:hover::after { opacity: 1; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto 1fr;
  background: rgba(30, 14, 15, .9);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  color: #fff; opacity: 0; transition: opacity .25s ease;
  padding-bottom: env(safe-area-inset-bottom);
}
.lightbox[hidden] { display: none; }
.lightbox.open { opacity: 1; }
.lb-bar {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px clamp(12px, 3vw, 24px);
  padding-top: max(14px, env(safe-area-inset-top));
}
.lb-count { font-size: 14px; color: rgba(255, 255, 255, .7); font-variant-numeric: tabular-nums; }
.lb-actions { display: flex; align-items: center; gap: 8px; }
.lb-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .08); color: #fff; font-size: 14px;
  text-decoration: none; cursor: pointer; transition: background .2s;
}
.lb-btn:hover { background: rgba(255, 255, 255, .16); }
.lb-btn[hidden] { display: none; }
.lb-btn-primary { background: var(--wine); border-color: var(--wine); }
.lb-btn-primary:hover { background: #8a3437; }
.lb-close { width: 40px; padding: 0; justify-content: center; }
.lb-stage {
  margin: 0; min-width: 0; min-height: 0; display: grid; place-items: center;
  padding: 0 0 clamp(12px, 3vw, 28px); touch-action: pan-y;
}
.lb-stage img {
  max-width: 100%; max-height: calc(100dvh - 100px); width: auto; height: auto;
  object-fit: contain; border-radius: 4px; user-select: none;
  box-shadow: 0 20px 80px rgba(0, 0, 0, .45);
  transition: opacity .2s ease, transform .25s ease;
}
.lb-stage img.swap { opacity: .25; }
.lb-nav {
  align-self: center; width: 52px; height: 52px; margin: 0 clamp(4px, 2vw, 20px);
  display: grid; place-items: center; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .15); background: rgba(255, 255, 255, .06);
  color: #fff; cursor: pointer; transition: background .2s;
}
.lb-nav:hover { background: rgba(255, 255, 255, .16); }
.lb-nav .icon { width: 22px; height: 22px; }

/* ---------- Mural ---------- */
.mural { border-top: 1px solid var(--line); }
.note-form {
  max-width: 720px; padding: clamp(20px, 3vw, 32px); margin-bottom: 40px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 18px 40px -28px rgba(86, 28, 30, .25);
}
.field { display: block; margin-bottom: 18px; }
.field span { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: .02em; }
.field input, .field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink); font: inherit; resize: vertical;
  transition: border-color .2s, background .2s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--rose); background: #fff; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.form-status { margin: 12px 0 0; min-height: 1.4em; font-size: 14px; color: var(--wine); }
.form-status:empty { display: none; }

.form-private { display: flex; align-items: center; gap: 8px; margin: 16px 0 0; }
.form-private .icon { width: 15px; height: 15px; color: var(--rose); }
.form-status.ok { color: var(--wine); font-family: var(--serif); font-style: italic; font-size: 20px; }
.private-head { display: flex; align-items: baseline; gap: 16px; margin: 8px 0 20px; }
.private-head[hidden], .notes[hidden] { display: none; }
.private-head h3 { margin: 0; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 32px; color: var(--wine); }
.private-head p { margin: 0; }
.notes { columns: 3 300px; column-gap: 20px; }
.note {
  break-inside: avoid; margin: 0 0 20px; padding: 22px 24px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  position: relative;
}
.note:nth-child(3n+2) { background: var(--blush); border-color: transparent; }
.note.fresh { animation: pop .5s cubic-bezier(.2, .8, .2, 1); }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }
.note-body { margin: 0 0 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.note-name { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--wine); line-height: 1.2; }
.note-date { font-size: 12px; color: var(--muted); white-space: nowrap; }
.note-del {
  position: absolute; top: 8px; right: 8px; width: 28px; height: 28px;
  border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer;
}
.note-del:hover { background: var(--line); color: var(--wine); }
.notes-empty { color: var(--muted); font-style: italic; font-family: var(--serif); font-size: 22px; }

.footer {
  text-align: center; padding: 40px var(--gutter) 56px;
  font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--muted);
}

.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 10px 18px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14px;
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsivo ---------- */
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding-top: 36px; }
  .hero-photo { width: min(100%, 360px); }
  .lede { margin: 20px 0 24px; font-size: 17px; }
}
@media (max-width: 640px) {
  .gallery { --gap: 4px; }
  .topbar-links .topbar-zip span { display: none; }
  .topbar-links .topbar-zip { padding: 7px 9px; }
  .lightbox { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
  .lb-stage { grid-row: 2; grid-column: 1; padding: 0; }
  .lb-stage img { max-height: calc(100dvh - 150px); border-radius: 0; }
  .lb-nav { display: none; }
  .lb-btn span { display: none; }
  .lb-btn { width: 40px; padding: 0; justify-content: center; }
  .lb-btn-primary { width: auto; padding: 0 16px; }
  .lb-btn-primary span { display: inline; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
