:root {
  --blush: #f7ede9;
  --blush-deep: #efd9d1;
  --rose: #c98b9b;
  --rose-deep: #b06f80;
  --sage: #8ba888;
  --sage-deep: #6f9070;
  --ink: #3d3436;
  --muted: #8a7d80;
  --card: #ffffff;
  --line: #ece0dc;
  --gold: #c9a86a;
  --shadow: 0 8px 30px rgba(80, 40, 50, 0.08);
  --radius: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Nunito Sans", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--blush) 0%, #fdf8f6 40%);
  min-height: 100vh;
}

h1, h2, h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin: 0;
}

.muted { color: var(--muted); font-size: 0.9rem; }
[hidden] { display: none !important; }

/* ---- Buttons ---- */
.btn {
  font: inherit;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--rose); color: #fff; box-shadow: 0 4px 14px rgba(176, 111, 128, 0.35); }
.btn-primary:hover { background: var(--rose-deep); }
.btn-ghost { background: rgba(255, 255, 255, 0.6); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: #fff; }
.btn.small { padding: 0.35rem 0.9rem; font-size: 0.85rem; }
.btn-danger { background: #e7d3d3; color: var(--rose-deep); }
.btn-danger:hover { background: #dcbcbc; }

.icon-btn {
  background: none; border: none; cursor: pointer; font-size: 1rem;
  color: var(--muted); padding: 0.25rem 0.5rem; border-radius: 8px;
}
.icon-btn:hover { background: var(--blush); color: var(--ink); }
.link-btn { background: none; border: none; color: var(--rose-deep); cursor: pointer; font: inherit; text-decoration: underline; }

/* ---- Login ---- */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
}
.login-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 2.5rem 2rem; width: 100%; max-width: 360px; text-align: center;
  display: flex; flex-direction: column; gap: 0.75rem;
}
.login-emoji { font-size: 3rem; }
.login-card h1 { font-size: 2rem; color: var(--rose-deep); }
.login-card input {
  padding: 0.75rem 1rem; border: 1px solid var(--line); border-radius: 12px;
  font: inherit; text-align: center;
}
.error { color: #b3403f; font-size: 0.85rem; margin: 0; }

/* ---- Hero ---- */
.hero {
  text-align: center; padding: 3rem 1.5rem 2rem;
  background: radial-gradient(circle at 50% -20%, var(--blush-deep), transparent 70%);
}
.eyebrow { text-transform: uppercase; letter-spacing: 3px; font-size: 0.7rem; color: var(--gold); margin: 0 0 0.5rem; font-weight: 700; }
.couple { font-size: clamp(2.2rem, 6vw, 3.5rem); color: var(--rose-deep); }
.countdown { margin-top: 1rem; display: flex; flex-direction: column; align-items: center; }
.cd-num { font-family: "Cormorant Garamond", serif; font-size: clamp(3rem, 12vw, 5rem); font-weight: 700; color: var(--sage-deep); line-height: 1; }
.cd-label { text-transform: uppercase; letter-spacing: 2px; font-size: 0.75rem; color: var(--muted); font-weight: 700; }
.date-label { margin: 0.5rem 0 1rem; }

/* ---- Tabs ---- */
.tabs {
  display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 10; padding: 0.75rem;
  background: rgba(253, 248, 246, 0.85); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.tab {
  font: inherit; font-weight: 700; border: none; background: none; cursor: pointer;
  padding: 0.5rem 1.1rem; border-radius: 999px; color: var(--muted);
}
.tab.active { background: var(--rose); color: #fff; }

/* ---- Layout ---- */
.container { max-width: 900px; margin: 0 auto; padding: 1.5rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.panel-head h2 { font-size: 1.9rem; color: var(--ink); }
.tab-panel { display: none; animation: fade 0.25s ease; }
.tab-panel.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---- Filters ---- */
.filters { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.chip {
  font: inherit; font-size: 0.82rem; font-weight: 600; border: 1px solid var(--line);
  background: #fff; color: var(--muted); border-radius: 999px; padding: 0.35rem 0.8rem; cursor: pointer;
}
.chip.active { background: var(--sage); color: #fff; border-color: var(--sage); }
.filters-sep { width: 1px; height: 20px; background: var(--line); margin: 0 0.3rem; }

/* ---- Task cards ---- */
.cards { display: grid; gap: 0.7rem; }
.task-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 0.9rem 1rem; display: flex; gap: 0.9rem; align-items: flex-start;
  box-shadow: 0 2px 8px rgba(80, 40, 50, 0.04);
}
.task-card.done { opacity: 0.6; }
.task-card.done .task-title { text-decoration: line-through; }
.task-check {
  appearance: none; width: 22px; height: 22px; border: 2px solid var(--sage);
  border-radius: 50%; cursor: pointer; flex-shrink: 0; margin-top: 2px; position: relative;
}
.task-check:checked { background: var(--sage); }
.task-check:checked::after { content: "✓"; color: #fff; font-size: 0.8rem; position: absolute; top: -1px; left: 4px; }
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 700; }
.task-notes { font-size: 0.85rem; color: var(--muted); margin-top: 0.15rem; }
.task-meta { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.5rem; }
.badge {
  font-size: 0.72rem; font-weight: 700; padding: 0.15rem 0.55rem; border-radius: 999px;
  background: var(--blush); color: var(--rose-deep);
}
.badge.cat { background: #eef3ee; color: var(--sage-deep); }
.badge.who { background: #f2ecf7; color: #7a5ca0; }
.badge.due { background: #fdf1e3; color: #b58435; }
.badge.due.overdue { background: #fbe3e1; color: #b3403f; }
.task-actions { display: flex; gap: 0.2rem; }

/* ---- Stat tiles ---- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.7rem; margin-bottom: 1.2rem; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 0.9rem 1rem; text-align: center;
}
.stat-num { font-family: "Cormorant Garamond", serif; font-size: 1.8rem; font-weight: 700; color: var(--rose-deep); }
.stat-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.data-table { width: 100%; border-collapse: collapse; min-width: 520px; }
.data-table th, .data-table td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.data-table th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.data-table tr:last-child td { border-bottom: none; }
.data-table .num { text-align: right; }
.rsvp-yes { color: var(--sage-deep); font-weight: 700; }
.rsvp-no { color: #b3403f; font-weight: 700; }
.rsvp-pending { color: var(--muted); }
.paid-yes { color: var(--sage-deep); }

/* ---- Empty / footer ---- */
.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }
.foot { text-align: center; padding: 2rem 1rem 3rem; display: flex; justify-content: center; gap: 1.5rem; align-items: center; }

/* ---- Modal ---- */
.modal-root { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1rem; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(60, 40, 45, 0.4); }
.modal {
  position: relative; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto;
  animation: pop 0.2s ease;
}
@keyframes pop { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 1.2rem 1.4rem 0; }
.modal-head h3 { font-size: 1.5rem; color: var(--rose-deep); }
.modal-body { padding: 1rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: 0.9rem; }
.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field label { font-size: 0.78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.field input, .field select, .field textarea {
  font: inherit; padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
.field textarea { resize: vertical; min-height: 60px; }
.field-row { display: flex; gap: 0.9rem; }
.field-row .field { flex: 1; }
.modal-actions { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 0.5rem; }

/* ---- Landing splash ---- */
.gold { color: var(--gold); }

.landing {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem 5rem;
  background: radial-gradient(circle at 50% 18%, var(--blush-deep), var(--blush) 52%, #fdf8f6);
  overflow: hidden;
}
.landing-content {
  position: relative;
  z-index: 1;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: rise 0.9s ease both;
}
/* Three-photo slanted collage */
.collage-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(0.9rem, 3vw, 2.4rem);
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
.landing-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: center;
}
.collage-photo {
  border-radius: 18px;
  overflow: hidden;
  background: var(--blush-deep);
  border: 7px solid #fff;
  box-shadow: 0 16px 40px rgba(80, 40, 50, 0.2);
}
.collage-photo[hidden] { display: none; }
.collage-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.collage-top {
  width: min(66vw, 340px);
  aspect-ratio: 3 / 2;
  margin: 0 auto;
  transform: rotate(-1.5deg);
}
.collage-left {
  width: min(66vw, 340px);
  aspect-ratio: 3 / 2;
  transform: rotate(4deg);
}
.collage-right {
  width: min(66vw, 340px);
  aspect-ratio: 3 / 2;
  transform: rotate(-4deg);
}

@media (max-width: 760px) {
  /* Center photo on top, the two side photos side-by-side, then the text. */
  .collage-row {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: center;
    gap: 1rem;
  }
  .collage-left,
  .collage-right { width: calc(50% - 0.5rem); }
  .landing-text { order: 3; flex-basis: 100%; margin-top: 1.2rem; }
}
.landing-title {
  font-size: clamp(2rem, 6.5vw, 4rem);
  line-height: 1.06;
  margin: 0 0 0.7rem;
  color: var(--rose-deep);
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .landing-title {
    background: linear-gradient(120deg, var(--rose-deep) 0%, #cf9a5f 55%, var(--sage-deep) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}
.landing-names {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.4rem, 4.5vw, 2.3rem);
  font-weight: 600;
  color: var(--rose-deep);
  margin: 0;
}
.landing-date {
  letter-spacing: 1px;
  margin-top: 0.35rem;
}
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

.scroll-cue {
  position: absolute;
  bottom: 1.6rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  font: inherit;
}
.scroll-word { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 2px; font-weight: 700; }
.chev { font-size: 1.8rem; line-height: 1; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* ---- Timeline ---- */
.timeline-section {
  min-height: 100vh;
  min-height: 100svh;
  padding: 4.5rem 1.5rem 5rem;
  background: linear-gradient(180deg, #fdf8f6 0%, var(--blush) 100%);
}
.timeline-head { text-align: center; margin-bottom: 3rem; }
.timeline-head h2 { font-size: clamp(2rem, 6vw, 3rem); color: var(--rose-deep); margin: 0.2rem 0 0.4rem; }

.timeline {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 0 0 3.25rem;
  list-style: none;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 1rem;
  top: 0.6rem;
  bottom: 0.6rem;
  width: 2px;
  background: linear-gradient(180deg, var(--rose) 0%, var(--gold) 55%, var(--sage) 100%);
}
.tl-item { position: relative; margin-bottom: 1.6rem; cursor: pointer; outline: none; }
.tl-item:last-child { margin-bottom: 0; }
.tl-item:focus-visible .tl-card { box-shadow: 0 0 0 3px var(--rose); }
.tl-marker {
  position: absolute;
  left: -3.25rem;
  top: 0.35rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--rose);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 4px var(--blush), 0 3px 10px rgba(176, 111, 128, 0.35);
}
.tl-item.is-big .tl-marker {
  background: var(--gold);
  width: 2.3rem;
  height: 2.3rem;
  left: -3.4rem;
  top: 0.2rem;
  font-size: 1.1rem;
}
.tl-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 1.1rem;
  box-shadow: 0 4px 14px rgba(80, 40, 50, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tl-card:hover { transform: translateX(3px); box-shadow: 0 6px 18px rgba(80, 40, 50, 0.1); }
.tl-item.is-big .tl-card { border-color: var(--blush-deep); background: #fffdf8; }
.tl-date {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold);
}
.tl-title {
  font-size: 1.35rem;
  color: var(--ink);
  margin-top: 0.15rem;
}
.tl-count {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sage-deep);
  background: #eef3ee;
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
}
.tl-count.photos { color: var(--rose-deep); background: #fdeef0; }
.tl-item.is-done .tl-marker { background: var(--sage); }
.timeline-hint {
  text-align: center;
  margin: 2rem auto 0;
  font-size: 0.85rem;
}

/* Event filter badge on task cards + banner */
.badge.evt { background: #fdeef0; color: var(--rose-deep); }
.event-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: #fdeef0;
  border: 1px solid var(--blush-deep);
  border-radius: 12px;
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.event-banner strong { color: var(--rose-deep); }

/* ---- Gateway ---- */
.gateway {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem;
  background: radial-gradient(circle at 50% 30%, var(--blush-deep), var(--blush) 55%, #fdf8f6);
}
.gateway-inner { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; }
.gateway-title { font-size: clamp(2.5rem, 9vw, 4.5rem); color: var(--rose-deep); margin: 0.2rem 0 0.6rem; }
.gateway-sub { margin-top: 0.4rem; }
.btn-big { font-size: 1.15rem; padding: 1rem 2.4rem; box-shadow: 0 8px 24px rgba(176, 111, 128, 0.4); }

/* ---- Gallery + lightbox ---- */
.gallery {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: linear-gradient(180deg, #fdf8f6, var(--blush));
  overflow-y: auto;
  padding: 1.5rem;
  animation: fade 0.25s ease;
}
.gallery-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 960px;
  margin: 0 auto 1.5rem;
}
.gallery-top h3 { font-size: 2rem; color: var(--rose-deep); margin: 0.1rem 0 0; }
.gallery-grid {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.8rem;
}
.gallery-thumb {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  box-shadow: 0 4px 14px rgba(80, 40, 50, 0.08);
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}
.gallery-thumb:hover img { transform: scale(1.05); }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(30, 15, 20, 0.9);
  display: grid;
  place-items: center;
  padding: 2rem;
  cursor: zoom-out;
  animation: fade 0.2s ease;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

@media (max-width: 480px) {
  .field-row { flex-direction: column; gap: 0.9rem; }
  .hero { padding-top: 2rem; }
}
