*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --cream: #ededea;
  --wine: #2a2a2a;
  --wine-light: #444;
  --gold: #999;
  --text: #3a3a3a;
  --line: #d0d0d0;
  /* Floor viewport units at 550px so nothing shrinks below that size */
  --vw: max(1vw, 5.5px);
  --vh: max(1vh, 5.5px);
}

html { overflow-x: clip; }
.landing { scroll-snap-align: start; }

body {
  background: var(--cream);
  color: var(--text);
  font-family: 'Cormorant', Georgia, serif;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

@keyframes wiggle {
  0%   { transform: rotate(0deg); }
  12%  { transform: rotate(1.44deg); }
  28%  { transform: rotate(-0.96deg); }
  42%  { transform: rotate(0.56deg); }
  58%  { transform: rotate(-0.32deg); }
  72%  { transform: rotate(0.16deg); }
  85%  { transform: rotate(-0.06deg); }
  100% { transform: rotate(0deg); }
}

/* ── POLAROID TIMELINE ── */
.polaroid-timeline {
  position: relative;
  margin-top: 30vh;
  overflow-anchor: none;
}

/* ── Vertical timeline (fixed left ledger) ── */
.vertical-timeline {
  position: fixed;
  left: 2.5rem;
  top: 50%;
  transform: translateY(-50%);
  height: 88vh;
  width: 150px;
  pointer-events: none;
  z-index: 20;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.vertical-timeline.visible {
  opacity: 1;
}

.vertical-timeline-header {
  position: absolute;
  top: -34px;
  left: 0;
  right: 0;
  font-family: 'Inter', sans-serif;
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(26,20,16,0.55);
  white-space: nowrap;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(26,20,16,0.22);
}

.vertical-timeline-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 4px;
  width: 1px;
  background: rgba(26,20,16,0.22);
}

.vertical-timeline-item {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translate(0, -50%);
  transition: transform 0.25s ease;
}
.vertical-timeline-item.in-active-year { transform: translate(10px, -50%); }

.vertical-timeline-tick {
  flex-shrink: 0;
  width: 9px;
  height: 1px;
  background: rgba(26,20,16,0.4);
  transition: width 0.25s ease, background 0.25s ease, transform 0.25s ease;
}
.vertical-timeline-item.in-active-year .vertical-timeline-tick {
  width: 18px;
  background: #8B2818;
  transform: translateX(-10px);
}

.vertical-timeline-year {
  font-family: 'Cormorant', 'EB Garamond', serif;
  font-size: 1.05rem;
  font-style: italic;
  color: rgba(26,20,16,0.6);
  min-width: 38px;
  transition: transform 0.25s ease;
}
.vertical-timeline-item.in-active-year .vertical-timeline-year {
  transform: translateX(-6px);
  color: #8B2818;
  font-size: 1.2rem;
}

.vertical-timeline-no {
  font-family: 'Inter', sans-serif;
  font-size: 0.52rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(26,20,16,0.45);
  transition: color 0.25s ease;
}
.vertical-timeline-item.active .vertical-timeline-no { color: #8B2818; }

.vertical-timeline-heart {
  width: 10px;
  height: 10px;
  margin-left: -6px;
  display: none;
  flex-shrink: 0;
}
.vertical-timeline-item.active .vertical-timeline-heart { display: inline-block; }

@media (max-width: 700px), (max-height: 670px) {
  .vertical-timeline { display: none; }
  .year-float { display: none; }
}

/* ── Horizontal timeline (mobile only — pinned to bottom) ── */
.horizontal-timeline { display: none; }

@media (max-width: 700px), (max-height: 670px) {
  .horizontal-timeline {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.7rem 1.2rem 1rem;
    background: none;
    z-index: 25;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
  }
  .horizontal-timeline.visible { opacity: 1; }
}

.horizontal-timeline-track {
  position: relative;
  height: 30px;
  margin: 0 0.4rem;
}

.horizontal-timeline-item {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
}

.horizontal-timeline-tick {
  width: 1px;
  height: 9px;
  background: rgba(26,20,16,0.4);
  margin-top: 4px;
  transition: height 0.25s ease, width 0.25s ease, background 0.25s ease;
}
.horizontal-timeline-item.in-active-year .horizontal-timeline-tick {
  height: 16px;
  width: 2px;
  background: #8B2818;
}

.horizontal-timeline-year {
  font-family: 'Cormorant', 'EB Garamond', serif;
  font-size: 0.95rem;
  font-style: italic;
  color: rgba(26,20,16,0.6);
  margin-top: 4px;
  white-space: nowrap;
  transition: color 0.25s ease, transform 0.25s ease;
}
.horizontal-timeline-item.in-active-year .horizontal-timeline-year {
  color: #8B2818;
  font-size: 1.15rem;
  transform: translateY(2px);
}


.polaroid-stack {
  position: relative;
  z-index: 30;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-left: 6rem;
}

.polaroid-card {
  position: sticky;
  top: 0;
  opacity: 1;
  width: min(calc(60 * var(--vw)), calc(70 * var(--vh)));
  margin: 0 0 60vh;
  transform: translate(var(--xoff, 0px), calc(50vh - 50% + var(--yoff, 0px))) rotate(var(--rot, 0deg));
  will-change: transform;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  pointer-events: auto;
}
.polaroid-card .polaroid-card-inner {
  filter: grayscale(1);
  transition: filter 0.6s ease;
}
.polaroid-card.landed .polaroid-card-inner {
  filter: grayscale(0);
}
.polaroid-comment {
  opacity: 0;
  transition: opacity 1s ease-out;
}

@media (max-width: 700px), (max-height: 670px) {
  .polaroid-stack {
    padding: 0;
  }
  .polaroid-card {
    top: 0;
    transform: translateY(calc(50vh - 50% - 30px)) rotate(var(--rot, 0deg));
    margin-bottom: 35vh;
  }
}

.pile-emblem {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.pile-emblem.visible { opacity: 0.05; }

.pile-emblem svg {
  width: 154px;
  height: 154px;
}

.polaroid-card-inner {
  position: relative;
  background: #ffffff;
  padding: 26px 26px 0;
  border-radius: 0;
  border: 0.5px solid rgba(26,20,16,0.08);
  transform-origin: center center;
}

.polaroid-card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #e0ddd8;
}
.polaroid-card-img-wrap::before {
  content: 'loading';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #b0aaa0;
  z-index: 0;
}
.polaroid-card-img-wrap.loaded::before {
  display: none;
}
.polaroid-card-img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  border-radius: 0;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.polaroid-tape {
  position: absolute;
  top: -10px;
  right: 36px;
  width: 84px;
  height: 22px;
  background: rgba(235, 225, 200, 0.72);
  transform: rotate(10deg);
  box-shadow: 0 1px 2px rgba(26,20,16,0.1);
  z-index: 4;
  pointer-events: none;
}

.polaroid-card-caption {
  padding: 30px 6px 50px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.3s ease;
}

.polaroid-card.landed .polaroid-card-caption {
  clip-path: inset(0 0% 0 0);
  transition: clip-path 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.3s;
}

.polaroid-card-caption .caption-kicker {
  font-family: 'Inter', ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(26,20,16,0.55);
  line-height: 1;
}

.polaroid-card-caption .caption-title {
  font-family: 'Cormorant', 'EB Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.8rem, calc(4.4 * var(--vh)), 2.9rem);
  line-height: 1;
  color: #1A1410;
  letter-spacing: -0.005em;
}

.polaroid-card-caption .caption-dot {
  color: #8B2818;
  font-style: normal;
  font-weight: 600;
}

.polaroid-comment {
  position: absolute;
  pointer-events: none;
  z-index: 9999;
  width: 208px;
  padding: 6px;
  filter: drop-shadow(0 4px 10px rgba(60,50,40,0.14));
  -webkit-mask:
    radial-gradient(circle 4px at 8px 50%, transparent 98%, #000 100%) 0 0 / 16px 16px repeat-y,
    radial-gradient(circle 4px at calc(100% - 8px) 50%, transparent 98%, #000 100%) 100% 0 / 16px 16px repeat-y,
    radial-gradient(circle 4px at 50% 8px, transparent 98%, #000 100%) 0 0 / 16px 16px repeat-x,
    radial-gradient(circle 4px at 50% calc(100% - 8px), transparent 98%, #000 100%) 0 100% / 16px 16px repeat-x,
    linear-gradient(#000,#000);
  mask:
    radial-gradient(circle 4px at 8px 50%, transparent 98%, #000 100%) 0 0 / 16px 16px repeat-y,
    radial-gradient(circle 4px at calc(100% - 8px) 50%, transparent 98%, #000 100%) 100% 0 / 16px 16px repeat-y,
    radial-gradient(circle 4px at 50% 8px, transparent 98%, #000 100%) 0 0 / 16px 16px repeat-x,
    radial-gradient(circle 4px at 50% calc(100% - 8px), transparent 98%, #000 100%) 0 100% / 16px 16px repeat-x,
    linear-gradient(#000,#000);
  will-change: transform;
}
.polaroid-comment-inner {
  padding: 18px;
  text-align: left;
  white-space: pre-wrap;
}
.polaroid-comment.blue { background: #E2E8EE; }
.polaroid-comment.blue .polaroid-comment-inner {
  font-family: 'Reenie Beanie', cursive;
  font-size: 1.9rem;
  line-height: 0.7;
  color: #2F5673;
  border: 1px solid #2F5673;
  background: #E2E8EE;
}
.polaroid-comment.pink { background: #F7E6E6; }
.polaroid-comment.pink .polaroid-comment-inner {
  font-family: 'Homemade Apple', cursive;
  font-size: 0.95rem;
  line-height: 1.35;
  color: #B85A6E;
  border: 1px solid #B85A6E;
  background: #F7E6E6;
}

/* Mobile: shrink the stamp slightly if the card is narrow. */
@media (max-width: 700px), (max-height: 670px) {
  .polaroid-comment {
    width: min(208px, calc(100% + 40px));
  }
}

/* ── Active year display (bottom-right) ── */
.year-float {
  position: fixed;
  right: 2.5rem;
  bottom: 2rem;
  z-index: 21;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.year-float.visible {
  opacity: 1;
}
.year-float-year {
  font-family: 'Cormorant', 'EB Garamond', serif;
  font-style: italic;
  font-size: clamp(3.5rem, calc(7 * var(--vw)), 5.5rem);
  font-weight: 500;
  color: #8B2818;
  line-height: 1;
}

@media (min-width: 768px) {
  .polaroid-card-inner { padding: 32px 32px 0; }
  .polaroid-card-caption { padding: 40px 8px 64px; }
}

@media (max-width: 700px), (max-height: 670px) {
  /* 95vw, but capped so comments above + below the card still fit on screen.
     88vw (raw, bypassing --vw floor) ensures rotated corners stay on-screen. */
  .polaroid-card { width: min(calc(95 * var(--vw)), calc(100 * var(--vh) - 320px), 88vw); }
  /* Scale padding proportionally with card width (designed at 522px) */
  .polaroid-card-inner { padding: 5% 5% 0; }
  .polaroid-card-caption { padding: 5.75% 1.15% 9.6%; gap: 1.5%; }
}


/* ── SAVE THE DATE ── */
.save-date {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 4rem 2rem;
  position: relative; z-index: 35;
  background: var(--cream);
}

.save-date::before {
  content: '';
  position: absolute; top: 0; left: 50%;
  transform: translateX(-50%);
  width: 1px; height: 100px;
  background: linear-gradient(to bottom, var(--line), transparent);
}

.save-date-invitation {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 400;
  color: #3d3a33;
  font-size: clamp(18px, calc(2.2 * var(--vw)), 28px);
  line-height: 1.45;
  letter-spacing: 0.01em;
  margin: 0 0 44px;
  opacity: 0; transform: translateY(8px);
  transition: opacity 1.4s ease, transform 1.4s ease;
  transition-delay: 0.1s;
}
.save-date-invitation.visible { opacity: 1; transform: translateY(0); }

.save-date-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 15px 0;
  opacity: 0;
  transition: opacity 1.4s ease;
  transition-delay: 0.4s;
}
.save-date-divider.visible { opacity: 1; }
.save-date-divider span {
  display: inline-block;
  width: 64px;
  height: 1px;
  background: var(--line);
}
.save-date-divider .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--line);
}

.save-date-heading {
  font-family: 'Playfair Display', serif;
  font-size: clamp(44px, calc(5.6 * var(--vw)), 78px);
  font-weight: 500; font-style: italic;
  color: var(--wine); line-height: 1.05;
  letter-spacing: -0.005em;
  margin: 0;
  opacity: 0; transform: translateY(40px);
  transition: opacity 1.4s ease, transform 1.4s ease;
  transition-delay: 0.7s;
}
.save-date-heading.visible { opacity: 1; transform: translateY(0); }

.save-date-location {
  font-family: ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 11px; font-weight: 400;
  text-transform: uppercase; letter-spacing: 0.42em;
  color: #a8a193; margin-top: 22px;
  opacity: 0; transform: translateY(20px); transition: all 1s ease 0.3s;
}
.save-date-location.visible { opacity: 1; transform: translateY(0); }

.save-date-btn {
  margin-top: 2.5rem; padding: 0.9rem 2.5rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.7rem; font-weight: 400;
  text-transform: uppercase; letter-spacing: 0.3em;
  color: #fff; background: var(--wine);
  border: none; border-radius: 50px; cursor: pointer;
  opacity: 0; transform: translateY(20px);
  transition: all 1s ease 0.5s, background 0.3s ease, transform 0.3s ease;
}
.save-date-btn.visible { opacity: 1; transform: translateY(0); }
.save-date-btn:hover { background: var(--wine-light); transform: translateY(-2px) !important; box-shadow: 0 8px 30px rgba(0,0,0,0.2); }

.save-date-note {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem; font-style: italic; font-weight: 300;
  color: var(--text); margin-top: 2rem;
  opacity: 0; transition: opacity 1s ease 0.7s;
}
.save-date-note.visible { opacity: 0.7; }

@media (max-width: 700px), (max-height: 670px) {
  .save-date {
    margin-top: 30vh;
    min-height: 100vh;
    justify-content: center;
  }
  .save-date::before {
    display: none;
  }
}

/* ══════════════════════════════════════════════════════════════
   LANDING VARIANTS — scoped under .landing, one active at a time
   ══════════════════════════════════════════════════════════════ */
.landing {
  position: relative;
  width: 100%;
  min-height: 100vh;
  z-index: 6;
}
.landing-variant {
  position: relative;
}

/* ── Shared photo carousel ── */
.std-carousel { position: relative; overflow: hidden; }
.std-carousel-img { position: absolute; inset: 0; will-change: transform; backface-visibility: hidden; }
.std-carousel-arr { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.45); color: #fff; border: none; font-size: 1.6rem; line-height: 1; padding: 0.6rem 0.5rem; cursor: pointer; z-index: 2; opacity: 0; transition: opacity 0.25s; }
.std-carousel:hover .std-carousel-arr { opacity: 1; }
.std-carousel-prev { left: 0.5rem; }
.std-carousel-next { right: 0.5rem; }
.std-carousel-counter { position: absolute; bottom: 0.6rem; right: 0.8rem; font-family: 'Space Grotesk', sans-serif; font-size: 0.6rem; letter-spacing: 0.15em; color: #fff; background: rgba(0,0,0,0.45); padding: 0.25rem 0.5rem; z-index: 2; }

/* ── V1U · Date Kicker frame ── */
.v1u { min-height: 100vh; background: var(--cream); color: #181818; padding: 2rem 2.5rem max(2.5rem, calc(3.5 * var(--vh))); display: flex; flex-direction: column; gap: 1.6rem; }
.v1u-top { border-bottom: 1px solid #181818; padding-bottom: 0.8rem; font-family: 'Space Grotesk', sans-serif; font-size: 0.7rem; letter-spacing: 0.3em; text-transform: uppercase; color: #555; text-align: right; }
.v1u-stage { flex: 1; display: grid; grid-template-columns: 1fr auto; gap: 2.8rem; align-items: center; position: relative; }
.v1u-photo { width: 460px; max-width: 100%; height: min(calc(70 * var(--vh)), 720px); margin: 0; background: #e0ddd8; }
.v1u-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; filter: contrast(1.05); }
.v1u-bottom { margin-top: auto; padding: 1.1rem 0 0.6rem; border-top: 1px solid #181818; text-align: center; font-family: 'Space Grotesk', sans-serif; font-weight: 500; font-size: 0.78rem; letter-spacing: 0.32em; text-transform: uppercase; color: #2a2a2a; display: flex; align-items: center; justify-content: center; gap: 0.7rem; }
.v1u-bottom .v1u-arrow { display: inline-block; font-size: 1rem; letter-spacing: 0; animation: v1bounce 1.8s ease-in-out infinite; }
@keyframes v1bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(4px)} }

.v1u-text { display: flex; flex-direction: column; }
.v1u-date-main { font-family: 'Playfair Display', serif; font-style: italic; font-weight: 400; font-size: clamp(3.5rem, calc(9 * var(--vw)), 7.5rem); line-height: 0.95; letter-spacing: -0.02em; color: #0a0a0a; margin: 0 0 2.4rem; }
.v1u-date-main .v1u-dot { color: #9a1f1f; padding: 0 0.12em; }
.v1u-names { font-family: 'Playfair Display', serif; font-style: italic; font-weight: 400; font-size: clamp(1.6rem, calc(3.4 * var(--vw)), 2.6rem); line-height: 1.05; margin: 0 0 0.6rem; color: #0a0a0a; }
.v1u-names .amp { color: #9a1f1f; font-weight: 900; }
.v1u-kicker { font-family: 'Playfair Display', serif; font-style: italic; font-weight: 400; font-size: clamp(1.6rem, calc(3.4 * var(--vw)), 2.6rem); line-height: 1; color: #9a1f1f; margin: 0 0 0.7rem; }

/* V1U · Postmark beside text */
.v1u-post { align-self: flex-start; max-width: 380px; margin-top: 1.4rem; background: var(--cream); border: 1.5px solid #9a1f1f; padding: 0.95rem 1.2rem 1rem; display: flex; align-items: center; gap: 0.9rem; transform: rotate(-1.4deg); box-shadow: 0 8px 22px rgba(154,31,31,0.1), 0 1px 3px rgba(0,0,0,0.06); position: relative; }
.v1u-post::before { content: ''; position: absolute; inset: 4px; border: 1px dashed rgba(154,31,31,0.35); pointer-events: none; }
.v1u-post-stamp { font-size: 1.6rem; color: #9a1f1f; line-height: 1; transform: rotate(10deg); flex-shrink: 0; }
.v1u-post-body { display: flex; flex-direction: column; gap: 0.35rem; line-height: 1.15; }
.v1u-post-loc { font-family: 'Playfair Display', serif; font-style: italic; font-weight: 500; font-size: 1.15rem; color: #9a1f1f; }
.v1u-post-rule { display: flex; align-items: center; gap: 0.5rem; color: #9a1f1f; }
.v1u-post-rule::before, .v1u-post-rule::after { content: ''; flex: 1; height: 1px; background: #9a1f1f; opacity: 0.5; }
.v1u-post-mark { font-size: 0.7rem; opacity: 0.8; }
.v1u-post-note { font-family: 'Space Grotesk', sans-serif; font-weight: 500; font-size: 0.62rem; letter-spacing: 0.34em; text-transform: uppercase; color: #9a1f1f; }

/* V1U mobile */
@media (max-width: 900px) {
  .v1u { padding: 1.1rem 1.25rem max(1.6rem, calc(2.5 * var(--vh))); gap: 1rem; }
  .v1u-top { text-align: center; }
  .v1u-stage {
    grid-template-columns: 1fr;
    gap: 1.1rem;
    align-items: stretch;
  }
  .v1u-text { display: contents; }
  .v1u-kicker {
    order: 1;
    text-align: center;
    margin: 0.2rem 0 0;
    font-size: clamp(1.2rem, calc(7 * var(--vw)), 2.2rem);
    white-space: nowrap;
  }
  .v1u-photo {
    order: 2;
    width: 100%;
    height: min(calc(55 * var(--vh)), 420px);
    margin: 0;
  }
  .v1u-date-main {
    order: 3;
    text-align: center;
    font-size: clamp(2.8rem, calc(14 * var(--vw)), 4.4rem);
    margin: 0.4rem 0 0.2rem;
  }
  .v1u-names {
    order: 4;
    text-align: center;
    font-size: clamp(1.15rem, calc(5 * var(--vw)), 1.6rem);
    margin: 0;
  }
  .v1u-post {
    order: 5;
    align-self: center;
    margin: 0.7rem auto 0;
    max-width: 100%;
  }
}

/* ── GRAIN ── */
body::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9999; opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px;
}

