:root {
  --lilas: #e3d3f2;
  --lavanda: #b89cd9;
  --ameixa: #5b2a68;
  --ameixa-700: #3f1c4a;
  --navy: #10223f;
  --cinza: #8f8f96;
  --paper: #fbf8fd;
  --ink: #2a2333;
  --muted: #6b5f76;
  --line: rgba(91, 42, 104, 0.14);
  --shadow-lg: 0 30px 60px -20px rgba(54, 24, 82, 0.35);
  --shadow-md: 0 14px 32px -12px rgba(54, 24, 82, 0.22);
  --radius: 6px;
  --t-fast: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", sans-serif;
  font-weight: 400;
  color: var(--ink);
  background:
    radial-gradient(at 0% 0%, rgba(184, 156, 217, 0.25) 0%, transparent 40%),
    radial-gradient(at 100% 100%, rgba(227, 211, 242, 0.55) 0%, transparent 50%),
    linear-gradient(180deg, #f5eefa 0%, #efe3f6 100%);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Top bar ---------- */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(16, 34, 63, 0.92);
  color: #fff;
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
}

.top-bar-ornament {
  color: var(--lavanda);
  opacity: 0.9;
  font-size: 0.6rem;
}

.top-bar-text {
  font-family: "Inter", sans-serif;
  font-weight: 500;
}

/* ---------- Stage / Invitation card ---------- */
.stage {
  width: min(1140px, 94%);
  margin: clamp(1.5rem, 4vw, 3rem) auto;
  padding-bottom: 2rem;
}

.invitation {
  position: relative;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: riseIn 900ms var(--t-slow) both;
}

.invitation::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  pointer-events: none;
  z-index: 3;
}

/* ---------- Tabs header ---------- */
.tabs {
  position: relative;
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  z-index: 4;
}

.monogram {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.2rem;
  letter-spacing: 0.15em;
  color: var(--ameixa);
  font-weight: 600;
}

.tabs-list {
  position: relative;
  margin-left: auto;
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.tab {
  position: relative;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0.55rem 0.9rem;
  font-family: "Inter", sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color var(--t-fast);
}

.tab:hover {
  color: var(--ameixa);
}

.tab.active {
  color: var(--ameixa);
}

.tab::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%) scaleX(0);
  width: 18px;
  height: 1px;
  background: var(--ameixa);
  transition: transform var(--t-fast);
  transform-origin: center;
}

.tab.active::after {
  transform: translateX(-50%) scaleX(1);
}

/* ---------- Body layout ---------- */
.invitation-body {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: 560px;
}

.photo {
  position: relative;
  overflow: hidden;
  min-height: 320px;
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.02);
  animation: slowZoom 18s ease-in-out infinite alternate;
}

.photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(91, 42, 104, 0.18) 0%, transparent 45%),
    linear-gradient(0deg, rgba(16, 34, 63, 0.12) 0%, transparent 40%);
  pointer-events: none;
}

.photo-corner {
  position: absolute;
  width: 90px;
  height: 90px;
  color: #fff;
}

.photo-corner.top {
  top: 18px;
  left: 18px;
}

.photo-corner.bottom {
  bottom: 18px;
  right: 18px;
  transform: rotate(180deg);
}

/* ---------- Content panel ---------- */
.content {
  position: relative;
  padding: clamp(2rem, 5vw, 3.4rem);
  display: grid;
  align-content: center;
  text-align: center;
  background:
    radial-gradient(circle at top right, rgba(227, 211, 242, 0.35) 0, transparent 45%),
    var(--paper);
}

.pane {
  display: none;
  animation: fadeUp 500ms var(--t-slow) both;
}

.pane.active {
  display: block;
}

/* ---------- Typography ---------- */
.eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--lavanda);
  font-weight: 600;
  margin-bottom: 1.2rem;
}

.couple {
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1;
  color: var(--navy);
  letter-spacing: 0.01em;
}

.couple em {
  color: var(--ameixa);
  font-style: italic;
  font-weight: 400;
  padding: 0 0.15em;
}

.script {
  font-family: "Allura", cursive;
  font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  color: var(--ameixa);
  line-height: 1;
  margin-bottom: 0.3rem;
}

.section-title {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2rem, 5vw, 2.7rem);
  font-weight: 500;
  color: var(--navy);
  line-height: 1.1;
}

.date-line {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.15rem;
  color: var(--ink);
  letter-spacing: 0.06em;
  margin-top: 0.5rem;
}

.blurb {
  margin: 1.2rem auto 0;
  color: var(--muted);
  font-size: 0.93rem;
  max-width: 420px;
}

.blurb.small {
  font-size: 0.86rem;
  margin-top: 0.6rem;
}

/* ---------- Divider ornament ---------- */
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  color: var(--ameixa);
  margin: 1.3rem auto;
  max-width: 260px;
}

.divider span {
  flex: 1;
  height: 1px;
  background: linear-gradient(to var(--to, right), transparent, var(--ameixa), transparent);
}

.divider span:last-child {
  --to: left;
}

.divider.short {
  max-width: 180px;
  margin: 0.9rem auto 1.3rem;
}

/* ---------- Countdown ---------- */
.countdown {
  margin-top: 1.6rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
}

.cd-cell {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.7rem 0.3rem 0.6rem;
  box-shadow: 0 4px 12px -6px rgba(91, 42, 104, 0.18);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.cd-cell:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -6px rgba(91, 42, 104, 0.24);
}

.cd-cell span {
  display: block;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--ameixa);
  line-height: 1;
}

.cd-cell small {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Events (Agenda) ---------- */
.events {
  margin-top: 1.2rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.event {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem 1.1rem;
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.event:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px -18px rgba(54, 24, 82, 0.35);
}

.event-time {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  color: var(--lavanda);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
}

.event-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.7rem;
  font-weight: 500;
  color: var(--navy);
  margin: 0.2rem 0 0.4rem;
}

.event-place {
  color: var(--muted);
  font-size: 0.9rem;
}

.link {
  display: inline-block;
  margin-top: 0.9rem;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ameixa);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-fast);
}

.link:hover {
  border-color: var(--ameixa);
}

/* ---------- Palette ---------- */
.palette {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.7rem;
}

.swatch {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 0.6rem;
  transition: transform var(--t-fast);
}

.swatch:hover {
  transform: translateY(-2px);
}

.swatch p {
  margin-top: 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.dot {
  display: block;
  width: 46px;
  height: 46px;
  margin: 0 auto;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px rgba(91, 42, 104, 0.15);
}

.dot-lilas { background: var(--lilas); }
.dot-lavanda { background: var(--lavanda); }
.dot-ameixa { background: var(--ameixa); }
.dot-cinza { background: var(--cinza); }

/* ---------- Gallery placeholder ---------- */
.gallery {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.7rem;
}

.slot {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(91, 42, 104, 0.35);
  color: var(--muted);
  font-family: "Cormorant Garamond", serif;
  font-size: 1.1rem;
  background:
    linear-gradient(135deg, rgba(227, 211, 242, 0.3), rgba(184, 156, 217, 0.08));
  border-radius: var(--radius);
  transition: transform var(--t-fast), border-color var(--t-fast);
}

.slot:hover {
  transform: translateY(-2px);
  border-color: var(--ameixa);
}

/* ---------- Gifts ---------- */
.gifts {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.gifts-status {
  grid-column: 1 / -1;
  margin: 0.6rem 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-style: italic;
}

.gift-card {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(91, 42, 104, 0.15);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.gift-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.gift-media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(227, 211, 242, 0.4), rgba(184, 156, 217, 0.1));
}

.gift-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--t-fast);
}

.gift-card:hover .gift-media img {
  transform: scale(1.03);
}

.gift-body {
  padding: 0.85rem 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
}

.gift-name {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
}

.gift-price {
  margin: 0;
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ameixa);
  letter-spacing: 0.02em;
}

.gift-card .gift-buy {
  margin-top: auto;
  padding: 0.6rem 0.9rem;
  font-size: 0.7rem;
}

/* ---------- Buttons ---------- */
.btn {
  margin-top: 1.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.4rem;
  background: var(--ameixa);
  color: #fff;
  border: 1px solid var(--ameixa);
  border-radius: 2px;
  font-family: "Inter", sans-serif;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}

.btn:hover {
  background: var(--ameixa-700);
  border-color: var(--ameixa-700);
  transform: translateY(-1px);
}

.btn.ghost {
  background: transparent;
  color: var(--ameixa);
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ---------- Sign ---------- */
.sign {
  margin-top: 1.4rem;
  text-align: center;
  font-family: "Allura", cursive;
  font-size: 1.6rem;
  color: var(--ameixa);
  opacity: 0.85;
}

/* ---------- Animations ---------- */
@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slowZoom {
  from {
    transform: scale(1.02);
  }
  to {
    transform: scale(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .invitation-body {
    grid-template-columns: 1fr;
    min-height: unset;
  }

  .photo {
    aspect-ratio: 4 / 3;
    min-height: unset;
  }

  .tabs {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    padding: 1rem;
  }

  .tabs-list {
    margin-left: 0;
    justify-content: center;
  }

  .monogram {
    text-align: center;
  }
}

@media (max-width: 520px) {
  .top-bar {
    font-size: 0.64rem;
    letter-spacing: 0.18em;
  }

  .countdown {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem;
  }

  .cd-cell {
    padding: 0.55rem 0.2rem 0.45rem;
  }

  .cd-cell span {
    font-size: 1.45rem;
  }

  .tab {
    padding: 0.5rem 0.55rem;
    font-size: 0.66rem;
    letter-spacing: 0.14em;
  }
}
