:root {
  --bg: #fff6fa;
  --bg-soft: #fde8f1;
  --pink-200: #f8c8dc;
  --rose: #e8628f;
  --rose-deep: #c43d6c;
  --blue-100: #e4f1fc;
  --blue-200: #a9d6f5;
  --blue-500: #5a8fd0;
  --navy: #2f4a80;
  --ink: #3b3552;
  --muted: #7a7291;
  --card: rgba(255, 255, 255, 0.78);
  --card-border: rgba(232, 98, 143, 0.18);
  --leaf: #6fae8a;
  --leaf-dark: #4d8a69;
  --shadow: 0 10px 30px rgba(196, 61, 108, 0.12);
  --radius: 22px;
  --script: "Great Vibes", "Brush Script MT", cursive;
  --sans: "Quicksand", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, var(--bg-soft), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, var(--blue-100), transparent 60%),
    var(--bg);
  overflow-x: hidden;
  animation: page-in 0.35s ease-out;
}
@keyframes page-in { from { opacity: 0; } }

.script { font-family: var(--script); font-weight: 400; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 20px;
  background: rgba(255, 246, 250, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--card-border);
}
.brand {
  font-family: var(--script);
  font-size: 1.8rem;
  color: var(--navy);
  text-decoration: none;
  white-space: nowrap;
}
.brand span { color: var(--rose); }
.nav { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--navy);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  white-space: nowrap;
}
.nav a { transition: background 0.2s ease; }
.nav a:hover { background: rgba(248, 200, 220, 0.5); }
.nav a[aria-current="page"] { background: var(--pink-200); }
.nav a:focus-visible { outline: 2px solid var(--navy); outline-offset: 1px; }
.lock { font-size: 0.7em; opacity: 0.8; }
.signed-in .lock, .signed-in .corner-lock { display: none; }
.topbar .ed-account { margin-left: 8px; }

/* Phones: the top bar keeps just the logo (+ sign out); pages are reached from the tab bar. */
.tabbar { display: none; }
@media (max-width: 760px) {
  .topbar { min-height: 56px; padding: 8px 16px; }
  .topbar .nav { display: none; }
  .topbar .ed-account { margin-left: auto; }
  .has-tabbar { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 250, 252, 0.94);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--card-border);
    box-shadow: 0 -6px 20px rgba(196, 61, 108, 0.08);
  }
  .tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 2px;
    border-radius: 14px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a[aria-current="page"] { color: var(--rose-deep); background: rgba(248, 200, 220, 0.45); }
  .tabbar a:active { transform: scale(0.95); }
  .has-tabbar .ed-toast { bottom: calc(80px + env(safe-area-inset-bottom)); top: auto; }
}

/* ---------- hero ---------- */
main { position: relative; z-index: 1; }

.hero {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 16px 8px;
  text-align: center;
}
.jump { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 22px; }
.jump a {
  padding: 8px 16px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--navy);
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}
.jump a:hover { background: #fff; transform: translateY(-1px); }

/* ---------- sections ---------- */
.section { max-width: 920px; margin: 0 auto; padding: 48px 16px 8px; scroll-margin-top: 64px; }
.section-head { text-align: center; }
.section-head h2 { margin: 2px 0 0; font-size: clamp(2.6rem, 8vw, 3.6rem); color: var(--navy); line-height: 1.1; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.shown-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } body { animation: none; } }

.time-grid { display: grid; gap: 18px; margin-top: 22px; }
.time-grid .card { margin: 0; text-align: center; }
@media (min-width: 900px) {
  .time-grid { grid-template-columns: 1.55fr 1fr; align-items: stretch; }
  .time-grid .card.next { display: flex; flex-direction: column; justify-content: center; }
  .time-grid .units.compact { grid-template-columns: repeat(2, 1fr); width: 100%; max-width: 280px; gap: 10px; }
}

/* ---------- our corner ---------- */
.corner-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 22px; }
.corner-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 18px 18px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--muted);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.corner-card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(196, 61, 108, 0.16); }
.corner-card:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }
.corner-card strong { color: var(--navy); font-size: 1.1rem; }
.corner-card span:not(.corner-icon) { font-size: 0.9rem; line-height: 1.4; }
.corner-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 6px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--bg-soft), var(--blue-100));
  font-size: 1.4rem;
}
.corner-lock { margin-top: 6px; color: var(--rose-deep); font-style: normal; font-size: 0.78rem; font-weight: 700; }
.corner-card.open .corner-lock { color: #2f8a5a; }
@media (max-width: 560px) {
  .corner-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .corner-card { padding: 16px 14px 14px; }
  .corner-card span:not(.corner-icon) { font-size: 0.82rem; }
  .section { padding-top: 40px; }
}
.eyebrow {
  margin: 0;
  color: var(--blue-500);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
}
.hero h1 {
  margin: 8px 0 0;
  font-size: clamp(2.8rem, 10vw, 5.2rem);
  line-height: 1.05;
  color: var(--rose-deep);
  text-wrap: balance;
}
.amp { color: var(--blue-500); padding: 0 0.1em; }
.full-names { margin: 6px 0 0; color: var(--muted); font-weight: 500; }

.celebrate {
  display: inline-block;
  margin: 20px 0 0;
  padding: 10px 20px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--rose), var(--blue-500));
  color: #fff;
  font-weight: 700;
  box-shadow: var(--shadow);
  animation: pulse 2.4s ease-in-out infinite;
}

.card {
  margin: 0 auto;
  padding: 22px 18px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}
.card.next { border-color: rgba(90, 143, 208, 0.25); background: rgba(236, 246, 255, 0.8); }
.card-label { margin: 0 0 14px; color: var(--navy); font-weight: 600; }

.units { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.units.compact { grid-template-columns: repeat(4, 1fr); max-width: 420px; margin: 0 auto; }
.unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 4px;
  border-radius: 16px;
  background: #fff;
}
.unit span {
  font-size: clamp(1.4rem, 5vw, 2.2rem);
  font-weight: 700;
  color: var(--rose-deep);
  font-variant-numeric: tabular-nums;
}
.card.next .unit span, .unit.tick span { color: var(--navy); }
.unit small { color: var(--muted); font-weight: 600; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }
.total { margin: 16px 0 0; color: var(--muted); }
.total strong { color: var(--rose-deep); font-size: 1.1rem; }

@media (max-width: 520px) {
  .units { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- garden ---------- */
.garden-section { text-align: center; }
.lead { margin: 4px 0 0; color: var(--muted); }
.lead strong { color: var(--rose-deep); }

.garden-wrap {
  position: relative;
  margin-top: 22px;
  padding: 24px 12px 8px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(228, 241, 252, 0.9), rgba(253, 232, 241, 0.7));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.year-title { margin: 0; color: var(--navy); font-size: 0.95rem; }
.year-title strong { color: var(--rose-deep); }
.year-sub { margin: 2px 0 4px; color: var(--muted); font-size: 0.82rem; }

/* Swipeable bouquets: native scroll-snap on touch, drag / arrows / keys with a mouse. */
.bouquet-track {
  position: relative;
  display: flex;
  align-items: center;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  cursor: grab;
  outline: none;
  touch-action: pan-x pan-y;
}
.bouquet-track::-webkit-scrollbar { display: none; }
.bouquet-track.single { cursor: default; }
.bouquet-track.dragging { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.bouquet-track:focus-visible { box-shadow: inset 0 0 0 2px var(--blue-500); border-radius: 16px; }
.bouquet-slide {
  flex: 0 0 100%;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0 16px;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}
.bouquet-slide:not(.shown) .bouquet { visibility: hidden; }
.year-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 1px solid var(--card-border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--navy);
  font: inherit;
  font-size: 1.6rem;
  line-height: 1;
  box-shadow: var(--shadow);
  cursor: pointer;
  translate: 0 -50%;
}
.year-arrow.prev { left: 10px; }
.year-arrow.next { right: 10px; }
.year-arrow[hidden] { display: none; }
.year-arrow:disabled { opacity: 0.3; cursor: default; }
.year-arrow:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
@media (max-width: 520px) {
  .bouquet-slide:not(.shown) .bouquet { visibility: hidden; }
.year-arrow { width: 34px; height: 34px; font-size: 1.3rem; }
  .year-arrow.prev { left: 4px; }
  .year-arrow.next { right: 4px; }
}
.year-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; margin-top: 10px; }
.year-dot {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.year-dot::before {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  margin: auto;
  border-radius: 999px;
  background: var(--pink-200);
  transition: width 0.25s ease, background 0.25s ease;
}
.year-dot[aria-current="true"]::before { width: 20px; background: var(--rose); }
.year-dot:focus-visible { outline: 2px solid var(--navy); outline-offset: -2px; border-radius: 999px; }
.bouquet { display: block; height: auto; margin: 0 auto; overflow: visible; }

.paper.back { fill: var(--back); }
.paper.inner { fill: var(--inner); }
.paper.front { fill: var(--front); stroke: var(--edge); stroke-width: 1.2; stroke-linejoin: round; }
.paper.handle { fill: none; stroke: var(--woodDark); stroke-width: 7; stroke-linecap: round; }
.stitch { fill: none; stroke: var(--edge); stroke-width: 1.2; stroke-dasharray: 3 3; stroke-linecap: round; }
.basket .wood { fill: var(--wood); stroke: var(--woodDark); stroke-width: 1.5; stroke-linejoin: round; }
.basket .weave { stroke: var(--woodDark); stroke-width: 1.2; opacity: 0.55; }
.basket .rim { fill: var(--woodDark); }
.leaf { fill: var(--leaf); }
.greens .leaf:nth-child(even), .tulip-leaf { fill: var(--leaf-dark); }
.breath { fill: #fff; stroke: #f6d3e1; stroke-width: 0.8; }
.filler circle { fill: #fff; stroke: #f0dbe5; stroke-width: 0.5; }
.filler.forget-me-not circle { fill: var(--blue-200); stroke: none; }
.filler .eye, .filler.forget-me-not .eye { fill: #f4c542; }
.stem { fill: none; stroke: var(--leaf-dark); stroke-width: 2.4; stroke-linecap: round; }
.bud { fill: var(--rose); }
.ribbon .loop { fill: var(--ribbon); }
.ribbon .tail, .ribbon .knot, .ribbon .strap { fill: var(--knot); }
.ribbon .strap { fill: var(--ribbon); }
.ribbon .buckle { fill: none; stroke: var(--knot); stroke-width: 2.5; }

.tulip {
  --petal-dark: var(--s0d);
  --petal: var(--s0m);
  --petal-light: var(--s0l);
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.tulip.shade-1 { --petal-dark: var(--s1d); --petal: var(--s1m); --petal-light: var(--s1l); }
.tulip.shade-2 { --petal-dark: var(--s2d); --petal: var(--s2m); --petal-light: var(--s2l); }
.tulip.blue { --petal-dark: var(--navy); --petal: #6fa3e0; --petal-light: var(--blue-200); }
.petal.outer { fill: var(--petal-dark); }
.petal.mid { fill: var(--petal); }
.petal.inner { fill: var(--petal-light); }
.shine { fill: none; stroke: #fff; stroke-width: 1.2; stroke-linecap: round; opacity: 0.55; }
.stripe { fill: none; stroke: var(--petal-dark); stroke-width: 1.3; stroke-linecap: round; opacity: 0.85; }

.bloom { transform-box: fill-box; transform-origin: 50% 100%; transition: transform 0.25s ease; }
.tulip:hover .bloom, .tulip.selected .bloom { transform: scale(1.18); }
.tulip.selected .petal.outer { filter: drop-shadow(0 0 3px #fff); }
.tulip:focus-visible .petal.outer { stroke: var(--navy); stroke-width: 2.5; }

/* Blooming: the first time each year's bouquet is shown, once the section is in view. */
.bouquet .paper, .bouquet .greens, .bouquet .basket, .bouquet .stitch, .bouquet .ribbon { opacity: 0; }
.bouquet .stem { stroke-dasharray: 1; stroke-dashoffset: 1; }
.bouquet .bloom, .bouquet .tulip-bud { scale: 0; transform-box: fill-box; transform-origin: 50% 100%; }
.in-view .shown .bouquet .paper, .in-view .shown .bouquet .greens, .in-view .shown .bouquet .basket,
.in-view .shown .bouquet .stitch { animation: fade 0.6s ease-out forwards; }
.in-view .shown .bouquet .ribbon { animation: fade 0.5s ease-out forwards 0.8s; }
.in-view .shown .bouquet .stem { animation: grow 0.8s ease-out forwards var(--delay, 0s); }
.in-view .shown .bouquet .tulip-bud { animation: bloom 0.9s cubic-bezier(0.2, 1.4, 0.4, 1) forwards 0.6s; }
.in-view .shown .bouquet .bloom { animation: bloom 0.9s cubic-bezier(0.2, 1.4, 0.4, 1) forwards var(--delay, 0s); }
.in-view .shown .bouquet .tulip.newest .bloom {
  animation:
    bloom 0.9s cubic-bezier(0.2, 1.4, 0.4, 1) forwards var(--delay, 0s),
    sway 3.5s ease-in-out infinite calc(var(--delay, 0s) + 1s);
}

.rose-info { min-height: 1.5em; margin: 16px 0 0; color: var(--navy); }
.rose-info strong { color: var(--rose-deep); }
.legend { margin: 8px 0 0; color: var(--muted); font-size: 0.9rem; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 4px 0 12px; vertical-align: middle; }
.dot.pink { background: var(--rose); }
.dot.blue { background: #6fa3e0; }

/* ---------- petals ---------- */
.petals { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.petal-fall {
  position: absolute;
  top: -20px;
  width: 12px;
  height: 10px;
  border-radius: 12px 0 12px 0;
  background: var(--pink-200);
  opacity: 0.75;
  animation: fall linear infinite;
}
.petal-fall.blue { background: var(--blue-200); }

/* ---------- footer ---------- */
.footer { position: relative; z-index: 1; margin-top: 56px; padding: 28px 16px 40px; border-top: 1px solid var(--card-border); text-align: center; color: var(--muted); }
.footer p { margin: 0; }
.footer-brand { color: var(--navy); font-size: 2rem; }
.footer-brand span { color: var(--rose); }

/* ---------- animations ---------- */
@keyframes grow { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@keyframes bloom { from { scale: 0; } to { scale: 1; } }
@keyframes sway { 0%, 100% { rotate: -4deg; } 50% { rotate: 4deg; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes fall {
  from { transform: translate(0, 0) rotate(0deg); }
  to { transform: translate(var(--drift, 0px), 110vh) rotate(540deg); }
}

@media (prefers-reduced-motion: reduce) {
  .bouquet .paper, .bouquet .greens, .bouquet .basket, .bouquet .stitch, .bouquet .ribbon { opacity: 1; }
  .bouquet .stem { stroke-dashoffset: 0; }
  .bouquet .bloom, .bouquet .tulip-bud { scale: 1; }
  .in-view .bouquet *, .celebrate { animation: none !important; }
}

/* ---------- buttons ---------- */
.btn {
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--rose), var(--blue-500));
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.btn:not(:disabled):hover { box-shadow: 0 6px 16px rgba(196, 61, 108, 0.25); }
.btn:not(:disabled):active { transform: scale(0.97); }
.btn.ghost { background: #fff; color: var(--navy); border-color: var(--pink-200); }
.btn.ghost:not(:disabled):hover { box-shadow: none; background: var(--bg-soft); }
.btn:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.tulip-letters { color: var(--rose-deep); font-weight: 700; text-decoration: none; white-space: nowrap; }
.tulip-letters:hover { text-decoration: underline; }

/* ---------- live viewers ---------- */
.live-viewers {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  padding: 5px 14px;
  border: 1px solid rgba(63, 185, 122, 0.3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: #2f6b4b;
  font-size: 0.85rem;
  font-weight: 700;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #3fb97a; box-shadow: 0 0 0 0 rgba(63, 185, 122, 0.6); animation: live 2s ease-out infinite; }
@keyframes live { to { box-shadow: 0 0 0 8px rgba(63, 185, 122, 0); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 3D bouquet ---------- */
.bouquet-track.three { display: block; overflow: visible; scroll-snap-type: none; cursor: grab; touch-action: pan-y; }
.bouquet-track.three:active { cursor: grabbing; }
.bouquet3d { display: block; width: 100%; outline: none; -webkit-tap-highlight-color: transparent; }
.b3d-hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  margin: 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--navy);
  font-size: 0.8rem;
  font-weight: 700;
  pointer-events: none;
  white-space: nowrap;
  translate: -50% 0;
  transition: opacity 0.5s ease;
  box-shadow: var(--shadow);
}
.b3d-hint.gone { opacity: 0; }
.bouquet-track.loading3d {
  min-height: 360px;
  border-radius: 20px;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%) 0 0 / 250% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -250% 0; } }
@media (prefers-reduced-motion: reduce) { .bouquet-track.loading3d { animation: none; } }
