/* main.css - the primary landing page.
   Layers on v1.css (poster theme tokens) + v4.css (timeline).
   Adds: an above-the-fold hero and a sticky RSVP+countdown bar. */

/* ================= ABOVE-THE-FOLD HERO ================= */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  padding: 12px 26px 16px;
}

.hero-scene {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 30px;
  overflow: hidden;
  border: 3px solid var(--berry-soft);
  box-shadow: 0 16px 40px rgba(214, 69, 112, 0.16);
  /* Fallback wash if the art hasn't loaded yet. */
  background:
    radial-gradient(120% 80% at 50% 0%, #fff 0%, #ffeaf1 45%, #fbe1ea 100%);
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.92;
  z-index: 0;
}

/* A soft veil so text/photo always read clearly over the art. */
.hero-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(75% 65% at 50% 46%, rgba(255, 250, 246, 0.82) 0%, rgba(255, 250, 246, 0.35) 55%, transparent 78%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1040px;
  padding: 30px 40px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(20px, 4vw, 56px);
}

.hero-col-text {
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.hero-col-photo { display: flex; justify-content: center; }

.hero-callout {
  font-family: var(--font-script);
  font-size: clamp(20px, 3.6vw, 27px);
  color: var(--leaf);
  margin: 0 0 2px;
  text-shadow: 0 1px 0 #fff;
}

.hero-title-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(6px, 2vw, 16px);
}

.hero-name {
  font-family: var(--font-script);
  font-size: clamp(74px, 17vw, 128px);
  line-height: 0.92;
  margin: 0;
  color: var(--berry);
  text-shadow: 2px 2px 0 #fff, 5px 6px 0 rgba(214, 69, 112, 0.25);
}

.hero-berry-num {
  position: relative;
  width: clamp(74px, 15vw, 104px);
  height: clamp(74px, 15vw, 104px);
  flex: 0 0 auto;
  transform: rotate(6deg);
}

.hero-berry-num img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(180, 40, 80, 0.3)); }

.hero-berry-num b {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-script);
  font-size: clamp(38px, 8vw, 52px);
  color: #fff;
  text-shadow: 0 2px 4px rgba(140, 20, 60, 0.75);
  padding-top: 12px;
}

.hero-turning {
  font-family: var(--font-script);
  font-size: clamp(22px, 4.4vw, 30px);
  color: var(--berry-deep);
  margin: 2px 0 0;
  text-shadow: 0 1px 0 #fff;
}
.hero-turning b { color: var(--leaf); }

.hero-photo {
  width: clamp(220px, 34vw, 340px);
  aspect-ratio: 1;
  margin: 0;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: radial-gradient(circle, #ffe4ec 0%, #fbd0dd 100%);
  border: 5px solid #fff;
  outline: 4px dashed var(--berry-soft);
  outline-offset: 5px;
  box-shadow: 0 12px 30px rgba(214, 69, 112, 0.28);
}
.hero-photo img { width: 94%; margin-top: 5%; }

/* ---------- Orbiting growing-up photos ---------- */
.hero-orbit {
  position: relative;
  width: min(88vw, 520px);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-orbit .hero-photo {
  position: relative;
  z-index: 3;
  width: 50%; /* portrait sits inside the orbit field */
}

/* faint dashed guide circles */
.orbit-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  border: 1.5px dashed rgba(214, 69, 112, 0.28);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 1;
}
.orbit-ring-1 { width: 78%; height: 78%; }
.orbit-ring-2 { width: 100%; height: 100%; }

/* the spinning layers that carry the thumbnails */
.orbit-spin {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  z-index: 2;
}
.orbit-spin-1 { animation: orbit-cw 44s linear infinite; }
.orbit-spin-2 { animation: orbit-ccw 60s linear infinite; }

@keyframes orbit-cw {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes orbit-ccw {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

/* each thumbnail is placed on the ring via a CSS var --a (angle) and --r (radius) */
.orbit-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--size, 64px);
  height: var(--size, 64px);
  margin: calc(var(--size, 64px) / -2);
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #fff;
  box-shadow: 0 5px 14px rgba(214, 69, 112, 0.3);
  background: var(--paper-deep);
  transform:
    rotate(var(--a)) translateX(var(--r)) rotate(calc(-1 * var(--a)));
}
/* counter-rotate the inner image against the ring spin so faces stay upright */
.orbit-spin-1 .orbit-thumb { animation: orbit-upright-ccw 44s linear infinite; }
.orbit-spin-2 .orbit-thumb { animation: orbit-upright-cw 60s linear infinite; }

@keyframes orbit-upright-ccw {
  from { transform: rotate(var(--a)) translateX(var(--r)) rotate(0deg); }
  to { transform: rotate(var(--a)) translateX(var(--r)) rotate(-360deg); }
}
@keyframes orbit-upright-cw {
  from { transform: rotate(var(--a)) translateX(var(--r)) rotate(0deg); }
  to { transform: rotate(var(--a)) translateX(var(--r)) rotate(360deg); }
}

.orbit-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* gentle floating bob for a little life */
.orbit-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6);
}

.hero-facts {
  list-style: none;
  margin: 16px 0 22px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: 100%;
  max-width: 460px;
}

.hero-facts li {
  display: flex;
  align-items: center;
  gap: 13px;
  text-align: left;
  font-family: var(--font-serif);
  font-size: clamp(16px, 3.4vw, 20px);
  color: var(--berry-deep);
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(246, 191, 208, 0.7);
  border-radius: 16px;
  padding: 8px 14px;
  backdrop-filter: blur(2px);
}

.hero-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #fde3ea;
  border: 2px solid var(--berry-soft);
  font-size: 19px;
}

.hero-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.hero-cta .btn-primary { font-size: 22px; padding: 15px 42px; }

.hero-cd {
  margin: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-serif);
  color: var(--berry-deep);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(246, 191, 208, 0.7);
  border-radius: 999px;
  padding: 5px 16px;
  backdrop-filter: blur(2px);
}
.hero-cd-num {
  font-family: var(--font-script);
  font-size: 30px;
  color: var(--berry);
  line-height: 1;
}
.hero-cd-word { font-size: 16px; }

.hero-scroll {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  text-decoration: none;
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--berry-deep);
  opacity: 0.85;
}
.hero-scroll-arrow {
  font-size: 26px;
  line-height: 0.7;
  animation: nudge 1.8s ease-in-out infinite;
}
@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* ================= STICKY RSVP + COUNTDOWN BAR ================= */
.sticky-bar {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translate(-50%, 160%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  width: min(560px, calc(100vw - 32px));
  padding: 10px 12px 10px 20px;
  border-radius: 999px;
  background: rgba(255, 250, 246, 0.96);
  border: 2px solid var(--berry-soft);
  box-shadow: 0 12px 34px rgba(214, 69, 112, 0.3);
  backdrop-filter: blur(6px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
  opacity: 0;
}
.sticky-bar.show { transform: translate(-50%, 0); opacity: 1; }

.sticky-countdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.cd-units {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.cd-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}
.cd-unit b {
  font-family: var(--font-script);
  font-size: 22px;
  color: var(--berry);
}
.cd-unit small {
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #a1798a;
}
.cd-caption {
  font-family: var(--font-script);
  font-size: 20px;
  color: var(--berry-deep);
  text-align: center;
  white-space: nowrap;
  line-height: 1.1;
}

.sticky-rsvp {
  flex: 0 0 auto;
  font-size: 17px;
  padding: 11px 24px;
  box-shadow: 0 4px 0 var(--berry-deep);
}

/* ================= MOBILE ================= */
/* Stack the split hero on narrow / short screens. */
@media (max-width: 860px) {
  .hero-content {
    grid-template-columns: 1fr;
    justify-items: center;
    max-width: 560px;
  }
  .hero-col-text { text-align: center; align-items: center; }
  .hero-title-row { justify-content: center; }
  .hero-cta { align-items: center; }
  .hero-facts { margin: 4px auto 20px; }
  .hero-col-photo { order: -1; } /* photo above the text when stacked */
  .hero-photo { width: clamp(180px, 46vw, 240px); margin: 0 auto 4px; }
}

@media (max-width: 640px) {
  .hero { padding: 8px 10px 12px; }
  .hero-scene { border-radius: 24px; }
  .hero-content { padding: 24px 16px 70px; }
  .hero-scroll { font-size: 12px; }

  .sticky-bar {
    gap: 10px;
    padding: 8px 10px 8px 14px;
    bottom: 10px;
  }
  .cd-caption { font-size: 16px; }
  .cd-units { gap: 9px; }
  .cd-unit b { font-size: 19px; }
  .sticky-rsvp { font-size: 15px; padding: 10px 18px; }
}

/* Very small: drop seconds so the countdown never crowds the button. */
@media (max-width: 380px) {
  .cd-units .cd-unit:nth-child(4) { display: none; }
}

/* RSVP-by line on the main page */
.rsvp-by {
  font-family: var(--font-serif);
  color: var(--berry-deep);
  margin: 4px 0 0;
}
.rsvp-by b { color: var(--berry); }

@media (prefers-reduced-motion: reduce) {
  .hero-scroll-arrow { animation: none; }
  .sticky-bar { transition: opacity 0.3s ease; }
}
