/* Vedika & Dhruv — phone first, laptop second.
   Colours and type are lifted from the reference site (Instrument Serif + Instrument Sans). */

/* Fonts live in /fonts so there is no round-trip to Google on a phone */
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/instrument-sans-normal-var.woff2") format("woff2");
}
/* Google Sans Flex (Google Fonts, OFL), latin subset — used where content.js asks for it */
@font-face {
  font-family: "Google Sans Flex";
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url("../fonts/google-sans-flex-var.woff2") format("woff2");
}

:root {
  --bg: #fcf7ed;
  --surface: #fffaf1;
  --sand: #f6edd7;
  --text: #2f241b;
  --text-soft: rgba(47, 36, 27, 0.8);
  --muted: #76614d;
  --accent: #8a5a2b;
  --button-text: #fff9f1;
  --hairline: rgba(47, 36, 27, 0.2);
  --gate: var(--red); /* the opening screen's background (version 3.0: red; it was dark brown, #29231f) */

  /* the pencil-underline red, reused as the site's one accent colour everywhere red shows up */
  --red: #cf3a2e;
  --red-soft: #f3d9d4;

  /* soft section tints — a coherent pastel family built around --red (main.js blends the page through them) */
  --pastel-peach: #fbe8d8;
  --pastel-blush: #fbdde2;
  --pastel-sky: #e4e7f4;
  --pastel-gold: #f7ecc9;
  --pastel-rose: #f6d7d1;

  --font-display: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --font-body: "Instrument Sans", "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  --gutter: 24px;
  --section-space: 100px; /* 80 until 21 Nov: he wanted more room between sections */
  --header-offset: 78px;
  --ease: cubic-bezier(0.22, 0.72, 0.36, 1);
}

@media (min-width: 768px) {
  :root { --gutter: 40px; --section-space: 130px; } /* was 112 */
}

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

html {
  background-color: var(--bg); /* cream; from "our story" on, main.js blends it through the section colours as you scroll */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
html.gate-active, html.is-locked { overflow: hidden; }

body {
  margin: 0;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
a { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

/* ---------- shared type ---------- */
.display-xl {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 12.3vw, 3rem);
  line-height: 0.92;
}
.caps {
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
@media (min-width: 768px) {
  .display-xl { font-size: 3.75rem; }
  .caps { font-size: 14px; line-height: 20px; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 16px 48px;
  border-radius: 999px;
  background: var(--red); /* red like the opening screen (22 Nov; was var(--accent), brown) */
  color: var(--button-text);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.5s var(--ease);
}
.btn:active { transform: scale(0.97); }
@media (hover: hover) { .btn:hover { transform: scale(1.02); } }
@media (min-width: 768px) { .btn { font-size: 14px; line-height: 20px; } }

.section {
  position: relative;
  padding: var(--section-space) var(--gutter);
  scroll-margin-top: var(--header-offset);
}

/* ---------- things that ease in when they scroll into view ---------- */
[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  transition: opacity 0.76s var(--ease) var(--d, 0ms), transform 0.76s var(--ease) var(--d, 0ms);
}
[data-reveal="fade"] { transform: none; transition-duration: 1.2s; }
[data-reveal].is-in { opacity: 1; transform: none; }

/* ==================== opening screen ==================== */
.gate { position: fixed; inset: 0; z-index: 80; overflow: hidden; touch-action: none; }
.gate-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0 24px;
  border: 0;
  background: var(--gate);
  color: #fff;
  text-align: center;
  cursor: pointer;
  transition: transform 0.7s cubic-bezier(0.76, 0, 0.24, 1);
}
.gate.is-open .gate-btn { transform: translateY(-100%); }
.gate-text {
  max-width: 64rem;
  color: #fff; /* "welcome to our story" — white on the red opening screen (version 3.0; it was red on dark brown) */
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(2.75rem, 9vw, 4rem);
  line-height: 1;
  letter-spacing: -0.05em;
}
.gate-word { display: inline-block; white-space: nowrap; }
.gate-char {
  display: inline-block;
  opacity: 0;
  filter: blur(16px);
  transform: translateX(40px);
  animation: letterIn 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes letterIn {
  from { opacity: 0; filter: blur(16px); transform: translateX(40px); }
  to { opacity: 1; filter: blur(0); transform: translateX(0); }
}
.gate-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.gate-loading, .gate-bar, .gate-prompt { opacity: 0; transition: opacity 0.6s ease; }
.gate-loading { font-size: 10px; letter-spacing: 0.22em; }
.gate-bar { display: block; width: 120px; height: 1px; background: rgba(255, 255, 255, 0.4); overflow: hidden; }
.gate-bar span { display: block; height: 100%; background: #fff; transform: scaleX(0); transform-origin: left; transition: transform 0.35s ease; }
.gate-prompt { position: absolute; bottom: 0; white-space: nowrap; }
.gate.is-loading .gate-loading { opacity: 0.9; }
.gate.is-loading .gate-bar { opacity: 1; }
.gate.is-ready .gate-loading, .gate.is-ready .gate-bar { opacity: 0; }
.gate.is-ready .gate-prompt { opacity: 1; transition-delay: 0.25s; }
.gate-btn.is-waiting { cursor: wait; }
@media (min-width: 768px) { .gate-foot { bottom: 56px; } }

/* ==================== menu bar ==================== */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 16px 0;
  pointer-events: none;
}
.nav-shell {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 72px;
  margin: 0 auto;
  border: 1px solid transparent;
  color: #fff;
  pointer-events: auto;
}
.nav-row { display: flex; align-items: center; justify-content: space-between; height: 100%; padding: 0 16px; }
/* SPEED (22 Nov, later), phones: the row of links keeps its full height and is slid up as the bar gets shorter
   (updateNav in main.js), so the links are not laid out and redrawn on every frame of the scroll */
@media (max-width: 767.98px) { .nav-row { will-change: transform; } }
.nav-logo {
  display: flex;
  align-items: center;
  height: 100%;
  max-height: 48px;
  color: inherit;
  font-size: 18px;
  letter-spacing: -0.025em;
  white-space: nowrap;
  text-decoration: none;
}
/* VERSION 3.0: their hand-drawn VD (images/logo-vd.png is only a shape; it takes the menu's text colour) */
.nav-mark { display: block; height: 1em; aspect-ratio: 453 / 389; background-color: currentColor; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; } /* the image itself is set on the element (main.js) */
.nav-mark-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nav-right { display: flex; align-items: center; gap: 16px; }
.nav-links { display: none; }
.nav-rsvp {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--red); /* red like the opening screen (22 Nov; was var(--accent), brown) */
  color: var(--button-text);
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
}
.nav-rsvp::after { content: ""; position: absolute; inset: -8px -4px; } /* bigger tap area */
.nav-burger {
  display: grid;
  place-items: center;
  width: 40px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  cursor: pointer;
  transition: transform 0.3s;
}
.nav-burger:active { transform: scale(0.9); }
.nav-burger-lines { position: relative; display: flex; flex-direction: column; justify-content: space-between; width: 24px; height: 10px; }
.nav-burger-lines span { height: 2px; width: 100%; background: currentColor; transform-origin: center; transition: transform 0.3s; }
.nav-burger[aria-expanded="true"] .nav-burger-lines span:first-child { transform: translateY(4px) rotate(45deg); }
.nav-burger[aria-expanded="true"] .nav-burger-lines span:last-child { transform: translateY(-4px) rotate(-45deg); }

.nav-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 180px;
  margin-top: 8px;
  padding: 16px;
  border: 1px solid rgba(47, 36, 27, 0.1);
  border-radius: 16px;
  background: rgba(255, 250, 241, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  text-align: right;
  transform-origin: top right;
  transform: scale(0.95);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.3s, opacity 0.3s, visibility 0.3s;
}
.nav-menu.is-open { transform: none; opacity: 1; visibility: visible; pointer-events: auto; }
.nav-menu ul { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.nav-menu a { display: block; padding: 10px 8px 10px 0; color: var(--text); font-size: 18px; line-height: 28px; text-decoration: none; opacity: 0.85; }

/* Links sit in the bar on every screen size (no burger menu), like the laptop view */
.nav-burger, .nav-menu { display: none; }
.nav-links { display: flex; align-items: center; gap: clamp(8px, 2.6vw, 14px); min-width: 0; font-size: clamp(12px, 3.5vw, 14px); }
.nav-links a { padding: 10px 0; color: inherit; text-decoration: none; white-space: nowrap; transition: opacity 0.2s; }
@media (max-width: 767px) {
  .nav-row { padding: 0 14px; }
  .nav-logo { font-size: 17px; }
  .nav-right { gap: clamp(8px, 2.6vw, 14px); }
  .nav-rsvp { padding: 5px 12px; font-size: clamp(12px, 3.5vw, 14px); }
}
@media (max-width: 359px) {
  /* smallest phones (iPhone SE 1st gen): tighter so the bar never spills */
  .nav-row { padding: 0 10px; }
  .nav-links { gap: 7px; font-size: 11px; }
  .nav-right { gap: 7px; }
  .nav-rsvp { padding: 5px 10px; font-size: 11px; }
}
@media (min-width: 768px) {
  .nav-links { gap: 28px; font-size: inherit; }
  .nav-links a { padding: 0; }
  .nav-links a:hover { opacity: 0.7; }
  .nav-right { gap: 28px; }
}

/* ==================== 1. hero ==================== */
.hero { position: relative; height: calc(100vh + 1200px); height: calc(100svh + 1200px); }
.hero-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.hero-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.hero-card {
  position: relative;
  flex-shrink: 0;
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  overflow: hidden;
  border-radius: 24px;
  background: #d8c4a0;
  will-change: transform;
}
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(var(--hero-brightness, 100%));
  transition: filter 1.7s cubic-bezier(0.74, 0, 0.16, 1);
}
/* SPEED (22 Nov): once loaded, main.js sizes the photo once (fitHeroImage) and only scales it while the card shrinks,
   so it is drawn once instead of every frame. Its box has the photo's own shape, so fill = cover here. */
.hero-img.is-fitted { right: auto; bottom: auto; max-width: none; object-fit: fill; transform-origin: 0 0; will-change: transform; }
html.gate-active { --hero-brightness: 62%; }
/* SPEED (22 Nov, later): once the photo has brightened after the opening screen, the (now do-nothing) filter comes off,
   so the phone stops running a full-screen filter pass on every frame of the scroll */
.hero-img.is-lit { filter: none; transition: none; }
.hero-shade { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.2); opacity: 0.22; }
/* SPEED (22 Nov, later), phones: the card only gets shorter there (its width never changes), so everything inside it
   keeps the size it has on the full-screen card and is drawn once. The card is then just a window that closes over
   ready-made layers; before, the title, the shade and the card were laid out and redrawn on every frame of the scroll.
   main.js sets .is-rigid and --hero-h0 (layoutHero) and --fg-rise (updateHero). Laptops are unchanged. */
.hero-card.is-rigid { background: none; }
.hero-card.is-rigid::before { content: ""; position: absolute; inset: 0 0 auto 0; height: var(--hero-h0); background: #d8c4a0; will-change: transform; } /* the card's own colour (seen only while the photo loads) */
.hero-card.is-rigid .hero-shade { bottom: auto; height: var(--hero-h0); will-change: opacity; }
.hero-card.is-rigid .hero-fg { top: auto; height: var(--hero-h0); } /* hangs from the card's bottom edge, where all its words sit */
.hero-card.is-rigid .hero-fg::before { transform: translate3d(0, var(--fg-rise, 0px), 0); will-change: transform; } /* the fade stays at the card's top edge */
.hero-card.is-rigid .hero-headline { will-change: transform; } /* the names shrink a little as they fade: scaled, not redrawn */
.hero-fg {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 32px;
  transition: opacity 0.18s;
  will-change: opacity;
}
/* soft dark fade at the top of the photo so the white menu bar reads over a bright sky; fades out with the title */
.hero-fg::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 150px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0));
  pointer-events: none;
}
.hero-headline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 128px;
  display: flex;
  justify-content: center;
  padding: 0 24px;
  pointer-events: none;
  transform-origin: bottom center;
}
.hero-headline-in { width: 100%; font-weight: 400; transition: opacity 0.85s ease 0.25s, transform 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.25s; }
html.gate-active .hero-headline-in { opacity: 0; transform: translate3d(0, 16px, 0); }
.hero-headline svg { display: block; width: 100%; height: auto; overflow: visible; }
.hero-headline text { font-family: var(--font-display); font-style: italic; font-size: 140px; fill: #fff; }
.hero-sub {
  display: block;
  margin-top: 10px;
  color: #fff;
  font-family: var(--font-display);
  font-style: normal;
  font-size: clamp(1.25rem, 5.5vw, 2rem);
  line-height: 1;
  text-align: center;
  opacity: 0.92;
}
.hero-cue {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  padding: 0 24px 16px;
  pointer-events: none;
}
.hero-divider { width: 100%; height: 1px; background: #fff; opacity: 0.5; }
.hero-prompt {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* the line sits right after the arrow, clear of the music button in the corner (22 Nov; was space-between) */
  gap: 12px;
  color: #fff;
  font-size: 10px;
  line-height: 15px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.9;
}
.hero-prompt svg { opacity: 0.8; animation: bounce 1s infinite; }
@keyframes bounce {
  0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(0.8, 0, 1, 1); }
  50% { transform: none; animation-timing-function: cubic-bezier(0, 0, 0.2, 1); }
}
@media (min-width: 768px) {
  .hero-headline, .hero-cue { padding-left: 48px; padding-right: 48px; }
  .hero-prompt { font-size: 12px; letter-spacing: 0.4em; }
}

/* the four photos that fly in */
.hero-gallery { position: absolute; inset: 0; z-index: 10; overflow: hidden; pointer-events: none; }
.hero-group { position: absolute; display: flex; }
.hero-tile { position: relative; flex-shrink: 0; overflow: hidden; background: #e2d2b2; opacity: 0; will-change: transform, opacity; }
.hero-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ==================== 2 + 8. words that light up ==================== */
.words {
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72vh; /* 60 until 21 Nov: more room around "you're officially invited" */
  min-height: 72svh;
  text-align: center;
}
.words-text {
  width: 100%;
  max-width: 90vw;
  font-family: var(--font-display);
  font-weight: 700; /* Instrument Serif has one weight; the browser thickens it, same as the reference */
  font-size: clamp(2.3rem, 12.3vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
}
.words-lg .words-text { font-size: clamp(2.6rem, 14.4vw, 3.5rem); }
.words.font-flex .words-text { font-family: "Google Sans Flex", var(--font-body); font-weight: 700; letter-spacing: -0.025em; line-height: 1.04; }
/* the cursive serif of "welcome to our story" and the footer line; its one real weight (no fake bold) */
.words.font-italic .words-text { font-style: italic; font-weight: 400; letter-spacing: -0.04em; line-height: 1.02; }
.words-text .w { opacity: 0.4; transition: opacity 0.3s ease-out; }
/* red pencil underline (svg inside the word); the #pencil filter in index.html roughens its edges */
.words-text .has-mark { position: relative; display: inline-block; }
.sketch { position: absolute; left: -3%; bottom: -0.2em; width: 106%; height: auto; overflow: visible; pointer-events: none; }
.sketch path {
  fill: none;
  stroke: #cf3a2e;
  stroke-width: 4.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  opacity: 0.9;
  filter: url(#pencil);
  transition: stroke-dashoffset 0.55s cubic-bezier(0.65, 0, 0.35, 1);
}
.sketch path:nth-child(2) { stroke-width: 3; opacity: 0.7; transition-duration: 0.45s; transition-delay: 0.42s; }
.has-mark.is-drawn .sketch path { stroke-dashoffset: 0; }
.words-sub { display: block; margin-top: 0.55em; font-size: 0.42em; font-weight: 500; letter-spacing: 0; line-height: 1.2; color: var(--muted); }
@media (min-width: 768px) {
  .words-text { max-width: 60rem; font-size: 3.75rem; }
  .words-lg .words-text { max-width: 70rem; font-size: 4.5rem; }
}

/* ==================== 3. our story ==================== */
.story { position: relative; z-index: 3; width: 100%; }
.story-pin { position: sticky; top: 0; width: 100%; height: 100vh; height: 100svh; }
.story-title-wrap {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px;
  pointer-events: none;
}
.story-sub {
  margin-top: 6px;
  color: var(--muted);
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.1rem, 4.6vw, 1.4rem);
  line-height: 1.2;
  text-align: center;
}
.story-title {
  width: 100%;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: min(14vw, 3.28125rem);
  line-height: 1;
  letter-spacing: -0.025em;
  text-align: center;
  white-space: nowrap;
}
.story-cap {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 35;
  padding: 0 16px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
}
.story-cap h3 {
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.25rem, 5vw, 1.5rem);
  line-height: 1.25;
}
.story-cap p { max-width: 42rem; margin: 0 auto; color: var(--muted); font-size: 1.125rem; line-height: 1.55; }
.story-cap p.is-reduced { font-size: clamp(0.9rem, 3.6vw, 1rem); line-height: 1.38; }
.story-cap p.is-compact { font-size: clamp(0.78rem, 3.15vw, 0.92rem); line-height: 1.32; }
.story-cap .story-eyebrow { margin-bottom: 6px; font-size: 12px; line-height: 15px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; }

.story-card {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform;
  pointer-events: none;
}
.story-card-box { position: relative; flex-shrink: 0; pointer-events: auto; }
.polaroid {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 4.5% 4.5% 20%; /* the thick bottom strip is where each line is written */
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.45rem;
  background: #f8f3e8;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
.polaroid button { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.polaroid-media { width: 100%; height: 100%; }
.polaroid-photo { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 0.2rem; background: rgba(0, 0, 0, 0.05); }
.polaroid-photo img, .polaroid-photo video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* a wide group photo shown whole, with polaroid paper above and below instead of cropping people off the ends (from version 1) */
.polaroid-photo.is-contain { background: #f8f3e8; }
.polaroid-photo.is-contain img { object-fit: contain; }
/* a chapter with no photos yet: its lines written where the photo would be */
.polaroid-photo.is-note { display: flex; align-items: center; justify-content: center; padding: 8%; background: #efe5d2; }
.polaroid-photo.is-note p { color: var(--text); font-size: max(12px, calc(var(--card-w, 300px) * 0.05)); line-height: 1.5; text-align: center; }
/* VERSION 3.0: the first polaroid with "our story" written on it (story.introCard); the title above the pile goes,
   and on a phone each chapter's heading takes the title's place, bigger */
/* The same words on the trajectory's growing card (.lcf-intro): both are sized from their own width (cqw), so
   when that card has grown to the polaroid's picture width they are identical and the hand-over has no jump. */
.polaroid-photo.is-intro, .lcf-card.lcf-intro { container-type: inline-size; background: #efe5d2; }
.polaroid-photo.is-intro { flex-direction: column; gap: 2.2cqw; padding: 0; }
.lcf-card.lcf-intro .lcf-img { visibility: hidden; }
.lcf-intro-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.2cqw; color: var(--text); text-align: center; }
.polaroid-photo.is-intro .intro-title, .lcf-intro .intro-title { display: block; font-family: var(--font-display); font-size: 2.5rem; font-size: 22cqw; font-weight: 400; line-height: 1; letter-spacing: -0.025em; white-space: nowrap; }
.polaroid-photo.is-intro .intro-sub, .lcf-intro .intro-sub { display: block; color: var(--muted); font-family: var(--font-display); font-style: italic; font-size: 1rem; font-size: 8.2cqw; line-height: 1.2; }
.story.has-intro .story-title-wrap { display: none; }
@media (max-width: 767px) {
  .story.has-intro .story-cap h3 { font-size: clamp(1.9rem, 8.6vw, 2.4rem); line-height: 1.08; text-wrap: balance; }
  .story.has-intro .story-cap .story-eyebrow { margin-bottom: 10px; font-size: 13px; line-height: 16px; }
}
/* TRIAL (21 Nov, he may ask to revert: delete this block): on a phone "chapter 3" is the big bold line and the
   chapter's own words ("long distance i guess…") sit under it, smaller and not bold */
@media (max-width: 767px) {
  .story.has-intro .story-cap .story-eyebrow { margin-bottom: 6px; color: var(--text); font-family: var(--font-display); font-size: clamp(2.1rem, 9.6vw, 2.7rem); font-weight: 700; line-height: 1.05; letter-spacing: -0.01em; text-transform: none; }
  .story.has-intro .story-cap h3 { font-size: clamp(1.35rem, 6vw, 1.7rem); font-weight: 400; line-height: 1.15; }
}
/* the line written in the bottom strip; sized from the card width so it fits the strip on any screen */
.polaroid-cap {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 0;
  height: calc(var(--card-w, 300px) * 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0, 0, 0, 0.74);
  font-size: max(11px, calc(var(--card-w, 300px) * 0.048));
  line-height: 1.22;
  text-align: center;
  text-wrap: balance;
}
.polaroid-cap span { display: block; }

@media (min-width: 768px) {
  /* a smaller title than the reference's 11.2rem, so the polaroids get the screen height */
  .story-title { font-size: min(8.5vw, 7rem); }
  .story-cap {
    display: grid;
    grid-template-columns: 28% calc(var(--card-w, 400px) + 32px) 28%;
    justify-content: center;
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 32px;
  }
  /* chapter heading sits well out to the side of the pile */
  .story-cap-in { grid-column: 1; padding: 0 64px 0 8px; text-align: right; }
  .story-cap.is-right .story-cap-in { grid-column: 3; padding: 0 8px 0 64px; text-align: left; }
  .story-cap h3 { font-size: clamp(2.25rem, 3vw, 3.25rem); line-height: 1.06; text-wrap: balance; }
  .story-cap p, .story-cap p.is-reduced, .story-cap p.is-compact { font-size: 1.125rem; line-height: 1.75rem; }
  .story-cap .story-eyebrow { margin-bottom: 12px; font-size: 15px; line-height: 18px; letter-spacing: 0.24em; }
  .story-sub { font-size: 1.75rem; }
  .story-card { padding: 0 32px; }
  .polaroid { box-shadow: 0 14px 42px rgba(0, 0, 0, 0.32); transition: transform 0.3s ease-out, box-shadow 0.3s; }
}

/* ==================== 4. so please join us ==================== */
.join { position: relative; z-index: 2; scroll-margin-top: 0; }
.join-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  /* the calendar picture makes this taller than a screen, so it needs its own room; the top tops up whatever room the
     story's pile left under itself (--pile-room, set in main.js) to about 200 px on a phone, 260 on a laptop (21 Nov) */
  padding: max(0px, calc(200px - var(--pile-room, 200px))) 16px 40px;
  text-align: center;
}
@media (min-width: 768px) { .join-inner { padding: max(0px, calc(260px - var(--pile-room, 25px))) 16px 120px; } }
.join-kicker { width: 100%; margin-bottom: 64px; }
.join-date { width: 100%; max-width: 1120px; margin: 0 0 64px; padding: 0 8px; font-weight: 400; }
.join-date svg { display: block; width: 100%; height: auto; overflow: visible; }
.join-date text { font-family: var(--font-display); font-size: 150px; fill: var(--text); letter-spacing: -0.025em; }
.join.has-place .join-date { margin-bottom: 22px; }
.join-place { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 56px; color: var(--text-soft); }
.join-pin { flex-shrink: 0; width: 1.35em; height: 1.35em; margin-top: -0.15em; } /* the red pin before the place (21 Nov) */
.join-when { margin: 4px 0 10px; font-family: var(--font-display); font-style: normal; font-size: clamp(1.8rem, 8vw, 2.4rem); line-height: 1.1; letter-spacing: -0.01em; } /* the dates, under the calendar; upright like "so please pull up" (he hated the italic, 22 Nov) */
@media (min-width: 768px) { .join-when { font-size: 2.5rem; margin-bottom: 14px; } }

/* ---------- tear-off calendar ---------- */
.join.has-cal .join-kicker { margin-bottom: 36px; }
.cal { position: relative; width: min(84vw, 340px); margin: 0 auto 30px; text-align: left; }
.join-cal-img { display: block; width: min(84vw, 340px); height: auto; margin: 0 auto 30px; } /* their calendar picture */
@media (min-width: 768px) { .join-cal-img { width: 400px; margin-bottom: 36px; } }
/* it hangs from its pin and can be swung (setupCalendarSwing in main.js); a vertical swipe over it still scrolls the page */
.join-cal-img { touch-action: pan-y; cursor: grab; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none; }
.join-cal-img:active { cursor: grabbing; }
.cal-binding {
  position: relative;
  z-index: 10;
  height: 18px;
  margin: 0 6px;
  border-radius: 10px 10px 4px 4px;
  background: var(--accent);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.08);
}
.cal-binding i { position: absolute; top: -9px; width: 8px; height: 22px; border-radius: 4px; background: #3a2c22; }
.cal-binding i:first-child { left: 22%; }
.cal-binding i:last-child { right: 22%; }
.cal-pad { position: relative; }
.cal-shadow { position: absolute; inset: 0; border-radius: 0 0 14px 14px; background: #f3ead9; box-shadow: 0 14px 30px rgba(47, 36, 27, 0.14), 0 3px 0 #eadfca, 0 6px 0 #e3d6be; }
.cal-page {
  position: relative;
  padding: 16px 14px 12px;
  border-radius: 0 0 14px 14px;
  background: #fffdf7;
  transform-origin: 14% 0;
  /* perforated top edge, so a page that rips off looks torn */
  -webkit-mask: radial-gradient(circle at 5px 0, transparent 2.6px, #000 3.1px) top / 10px 6px repeat-x, linear-gradient(#000, #000) 0 6px / 100% calc(100% - 6px) no-repeat;
  mask: radial-gradient(circle at 5px 0, transparent 2.6px, #000 3.1px) top / 10px 6px repeat-x, linear-gradient(#000, #000) 0 6px / 100% calc(100% - 6px) no-repeat;
}
.cal-page.is-tear { position: absolute; inset: 0; z-index: 2; will-change: transform, opacity; box-shadow: 0 6px 14px rgba(47, 36, 27, 0.12); }
.cal-page.is-tear:last-child { z-index: 3; }
.cal-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; padding: 0 4px; }
.cal-month { font-family: var(--font-display); font-size: 34px; line-height: 1; letter-spacing: -0.02em; }
.cal-year { color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0.2em; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.cal-wd { padding-bottom: 6px; color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; }
.cal-day { position: relative; display: grid; place-items: center; aspect-ratio: 1 / 0.8; color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.cal-day.is-sun { color: var(--accent); }
.cal-day b { position: relative; z-index: 1; font-weight: 500; }
/* the wedding dates: a clear filled circle (not a hand-drawn mark that can get missed mid-scroll) */
.cal-day.is-wedding b { color: #fffaf1; font-weight: 700; }
.cal-mark {
  position: absolute;
  inset: 10%;
  z-index: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #e2574a, var(--red) 70%);
  box-shadow: 0 3px 8px rgba(207, 58, 46, 0.35);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.38s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition-delay: var(--draw, 0s);
}
.cal.is-on .cal-mark, .cal.is-final .cal-mark { opacity: 1; transform: scale(1); }
.cal.is-on .cal-page.is-tear { animation: calTear 0.9s cubic-bezier(0.5, 0, 0.75, 0.45) var(--tear) forwards; }
.cal.is-final .cal-page.is-tear { display: none; }
/* the page stays solid paper while it rips and falls, and only fades once it's below the pad */
@keyframes calTear {
  0% { transform: none; opacity: 1; }
  16% { transform: translateY(-3px) rotate(-1.6deg); opacity: 1; }
  40% { transform: translate(4%, 8%) rotate(8deg); opacity: 1; }
  80% { transform: translate(15%, 78%) rotate(21deg); opacity: 1; }
  100% { transform: translate(20%, 122%) rotate(28deg); opacity: 0; }
}
@keyframes calDraw { to { stroke-dashoffset: 0; } }
@keyframes calShade { to { opacity: 0.4; } }
@media (min-width: 768px) {
  .join.has-cal .join-kicker { margin-bottom: 44px; }
  .cal { width: 400px; margin-bottom: 36px; }
  .cal-month { font-size: 40px; }
  .cal-day { font-size: 17px; }
}
.countdown { display: flex; align-items: flex-start; justify-content: center; gap: 8px; width: 100%; min-height: 100px; }
.cd-unit { display: flex; flex-direction: column; align-items: center; width: 64px; }
.cd-num { margin-bottom: 4px; font-size: 30px; line-height: 36px; font-weight: 400; font-variant-numeric: tabular-nums; }
.cd-label { font-size: 0.55rem; letter-spacing: 0.15em; text-transform: uppercase; opacity: 0.8; }
.cd-sep { margin-top: 4px; font-size: 24px; line-height: 32px; opacity: 0.3; }
@media (min-width: 768px) {
  .countdown { gap: 16px; }
  .cd-unit { width: 96px; }
  .cd-num { margin-bottom: 8px; font-size: 60px; line-height: 1; }
  .cd-label { font-size: 14px; letter-spacing: 0.2em; }
  .cd-sep { margin-top: 8px; font-size: 48px; line-height: 1; }
}

/* ==================== 5. rsvp ==================== */
.rsvp { z-index: 3; text-align: center; }
.rsvp-deadline { margin-top: 20px; color: var(--text-soft); }
.rsvp .btn { margin-top: 32px; }

/* ==================== 6. events ==================== */
.events { z-index: 2; }
.events-title { margin-bottom: 40px; text-align: center; }
.events-list { width: 100%; max-width: 44rem; margin: 0 auto; border-top: 1px solid var(--hairline); }
.event {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 20px;
  align-items: center;
  padding: 26px 0;
  border-bottom: 1px solid var(--hairline);
}
.event-date { text-align: center; }
.event-day { font-family: var(--font-display); font-size: 2.75rem; line-height: 0.9; color: var(--red); }
.event-month { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 14px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; }
.event-name { margin-bottom: 8px; font-family: var(--font-display); font-weight: 400; font-size: clamp(1.9rem, 8vw, 2.4rem); line-height: 1; }
.event-time { margin-bottom: 6px; color: var(--text-soft); }
.event-where { font-size: 16px; line-height: 24px; }
.event-where a { color: var(--text); text-decoration: underline; text-decoration-color: rgba(47, 36, 27, 0.35); text-underline-offset: 4px; }
@media (min-width: 768px) {
  .events-title { margin-bottom: 56px; }
  .events-list { max-width: 52rem; }
  .event { grid-template-columns: 96px 1fr; gap: 32px; padding: 34px 0; }
  .event-day { font-size: 3.5rem; }
  .event-name { font-size: 2.9rem; }
  .event-where { font-size: 18px; line-height: 28px; }
}

/* ==================== 7. what to wear ==================== */
.wear { z-index: 2; }
.wear-head { display: flex; flex-direction: column; align-items: center; margin-bottom: 24px; padding: 0 8px; text-align: center; }
.wear-intro { max-width: 48rem; margin-top: 10px; color: var(--muted); font-family: var(--font-display); font-style: italic; font-size: clamp(1.1rem, 4.6vw, 1.35rem); line-height: 1.2; } /* small, like "(in case that wasn't clear)" (21 Nov) */
/* VERSION 3.0: the clothing rail (its own styles come with js/vendor/dresscode-rail.js); the plain list is what shows
   until it loads, or if it can't */
.wear-rail { width: 100%; max-width: 72rem; margin: 24px auto 0; }

@media (min-width: 768px) {
  .wear-intro { font-size: 1.5rem; }
  /* three outfits on a full-width rod looked lost, so the rod is kept short (21 Nov): since 22 Nov the rail itself sets
     34rem per three hangers (the men's five get a longer rod at the same size); this only caps the longest */
  .wear-rail { max-width: 57rem; }
}

/* ==================== 9. questions and answers ==================== */
.faq { z-index: 2; }
.faq-wrap { display: flex; flex-direction: column; gap: 64px; width: 100%; max-width: 72rem; margin: 0 auto; }
.faq-title {
  margin-bottom: 24px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 3rem;
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.faq-help { margin-bottom: 4px; color: var(--muted); font-size: 18px; line-height: 28px; }
.faq-contact { color: var(--text); font-size: 18px; line-height: 28px; text-decoration: underline; text-underline-offset: 4px; }
.faq-list { border-top: 1px solid var(--hairline); }
.faq-item { border-bottom: 1px solid var(--hairline); }
.faq-q {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  padding: 24px 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.faq-q span:first-child { padding-right: 32px; font-size: 18px; line-height: 28px; font-weight: 500; }
.faq-chevron {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-top: 4px;
  border-radius: 4px;
  background: rgba(47, 36, 27, 0.1);
}
.faq-chevron svg { transition: transform 0.3s; }
.faq-q[aria-expanded="true"] .faq-chevron svg { transform: rotate(180deg); }
.faq-a { max-height: 0; overflow: hidden; opacity: 0; transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out; }
.faq-a-in { padding: 0 16px 24px 0; color: var(--muted); font-size: 16px; line-height: 1.625; }
.faq-a-in p + p { margin-top: 16px; }
@media (min-width: 1024px) {
  .faq-wrap { flex-direction: row; gap: 96px; }
  .faq-head { width: 33.333%; }
  .faq-head > * { position: relative; }
  .faq-list { width: 66.666%; }
  .faq-title { font-size: 4.5rem; }
  .faq-a-in { padding-right: 48px; font-size: 18px; }
}

/* ==================== footer ==================== */
.footer { padding: 112px var(--gutter) calc(56px + env(safe-area-inset-bottom, 0px)); text-align: center; } /* top was 72 until 21 Nov */
.footer-line { font-family: var(--font-display); font-style: italic; font-size: 2.25rem; line-height: 1; }
.footer-sub { margin-top: 16px; color: var(--text-soft); }

/* ==================== the very end: nimbu mirchi + "see you!!" (version 3.0) ==================== */
/* The one section with a colour block of its own, on purpose: he asked for a clear line where the rope starts and the
   demo's deep red behind the charm (21 Nov). The rope comes out of the section's top edge.
   pan-y keeps the page scrolling under a finger; a touch that starts on the charm drags the charm instead. */
.bye { position: relative; height: 100vh; height: 100svh; min-height: 520px; margin-top: 100px; overflow: hidden; touch-action: pan-y; background: #76150f; color: #efefef; } /* margin: with no footer, room after the questions (21 Nov) */
@media (min-width: 768px) { .bye { margin-top: 130px; } }
.bye-charm { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.bye-line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(16vh + env(safe-area-inset-bottom, 0px)); /* phone: the charm ends about halfway down */
  bottom: calc(16svh + env(safe-area-inset-bottom, 0px));
  padding: 0 var(--gutter);
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(3.5rem, 17vw, 5.5rem);
  line-height: 1;
  letter-spacing: -0.04em;
  text-align: center;
  pointer-events: none;
}
@media (min-width: 768px) { .bye-line { bottom: 9vh; bottom: 9svh; } } /* laptop: the charm reaches lower */
/* VERSION 3.0: "pull me" with a pencil arrow up at the charm; "leave it" once it is pulled far enough (main.js) */
.bye-line.is-prompt {
  /* beside the lemon, on its left, pointing at it (--lemon-x/y/r come from the charm, main.js) */
  top: var(--lemon-y, 45%);
  bottom: auto;
  left: auto;
  right: calc(100% - var(--lemon-x, 50%) + var(--lemon-r, 40px) + 10px);
  padding: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: clamp(1.6rem, 7.2vw, 3rem);
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 0.6s ease;
}
.bye.has-charm .bye-line.is-prompt { opacity: 1; }
/* phones: back under the charm with the arrow pointing up at it (he preferred that there, 22 Nov); laptops keep it beside the lemon */
@media (max-width: 767px) {
  .bye-line.is-prompt {
    top: auto;
    bottom: calc(24vh + env(safe-area-inset-bottom, 0px));
    bottom: calc(24svh + env(safe-area-inset-bottom, 0px));
    left: 0;
    right: 0;
    flex-direction: column-reverse;
    justify-content: center;
    gap: 14px;
    font-size: clamp(2.2rem, 10vw, 3rem);
    transform: none;
  }
  .bye-line.is-prompt .bye-arrow { transform: rotate(-90deg); }
}
.bye-arrow { width: 1.3em; height: 0.8em; overflow: visible; fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; filter: url(#pencil); transition: opacity 0.25s ease; }
.bye-say { display: block; transition: transform 0.25s ease; }
.bye.is-armed .bye-arrow { opacity: 0; }
.bye.is-armed .bye-say { transform: scale(1.12); }

/* ==================== RSVP form (full screen) ==================== */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 90;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.sheet.is-open { opacity: 1; transform: none; }
.sheet-close {
  position: absolute;
  top: calc(22px + env(safe-area-inset-top, 0px));
  right: 20px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.sheet-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 560px;
  min-height: calc(100% + 1px); /* always scrollable by a hair, so the page behind never scrolls on iPhone */
  margin: 0 auto;
  padding: calc(96px + env(safe-area-inset-top, 0px)) 24px calc(48px + env(safe-area-inset-bottom, 0px));
}
.sheet-title { font-family: var(--font-display); font-weight: 400; font-size: 3rem; line-height: 0.92; text-align: center; }
.sheet-sub { margin: 26px 0 52px; color: var(--muted); font-size: 14px; line-height: 20px; letter-spacing: 0.3em; text-align: center; }
.sheet-input {
  display: block;
  width: 100%;
  margin: 0 0 22px;
  padding: 14px 0 18px;
  border: 0;
  border-bottom: 1px solid rgba(47, 36, 27, 0.18);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 28px;
  line-height: 1.3;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.sheet-input::placeholder { color: rgba(47, 36, 27, 0.3); }
.sheet-input:focus { border-bottom-color: var(--text); }
.sheet-note { margin-top: 28px; font-size: 20px; resize: none; }
.sheet-choice { display: flex; flex-direction: column; gap: 12px; }
.sheet-option { position: relative; display: block; cursor: pointer; }
.sheet-option input { position: absolute; opacity: 0; pointer-events: none; }
.sheet-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 14px 24px;
  border: 1px solid rgba(47, 36, 27, 0.25);
  border-radius: 999px;
  font-size: 18px;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.sheet-option input:checked + span { border-color: var(--accent); background: var(--accent); color: var(--button-text); }
.sheet-option input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 3px; }
.sheet-guests { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 32px; font-size: 18px; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(47, 36, 27, 0.25);
  border-radius: 50%;
  background: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.stepper output { min-width: 40px; font-size: 24px; text-align: center; font-variant-numeric: tabular-nums; }
.sheet-done { text-align: center; }
.sheet-thanks { font-family: var(--font-display); font-size: 2rem; line-height: 1.1; }
.sheet-preview { margin-top: 24px; color: var(--muted); font-size: 14px; }
.sheet-error { min-height: 20px; margin-top: 4px; color: #a23b2a; font-size: 14px; }
.sheet-next {
  align-self: flex-end;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-top: 28px;
  padding: 0;
  border: 1px solid var(--text);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, transform 0.2s;
}
.sheet-next:active { transform: scale(0.94); background: var(--text); color: var(--bg); }
.sheet-next[disabled] { opacity: 0.4; }

/* ==================== photo viewer ==================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(24, 18, 13, 0.82);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.25s ease;
  cursor: zoom-out;
  touch-action: none;
}
.lightbox.is-open { opacity: 1; }
.lightbox figure { margin: 0; padding: 14px 14px 0; border-radius: 0.45rem; background: #f8f3e8; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4); }
.lightbox img, .lightbox video { display: block; max-width: min(86vw, 900px); max-height: 70vh; max-height: 70svh; border-radius: 0.2rem; }
.lightbox figcaption[hidden] { display: none; }
.lightbox figure:has(figcaption[hidden]) { padding-bottom: 14px; }
.lightbox figcaption { padding: 14px 8px 16px; color: rgba(0, 0, 0, 0.7); font-size: 15px; text-align: center; }

/* ==================== flower burst ==================== */
.flowers { position: fixed; inset: 0; z-index: 100; width: 100%; height: 100%; pointer-events: none; display: none; }
.flowers.is-on { display: block; }

/* ==================== floating music toggle ==================== */
.music-toggle {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(47, 36, 27, 0.12);
  border-radius: 50%;
  background: rgba(255, 250, 241, 0.92);
  color: var(--accent);
  box-shadow: 0 10px 24px rgba(47, 36, 27, 0.18);
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: transform 0.25s var(--ease), background-color 0.25s, color 0.25s;
}
.music-toggle:active { transform: scale(0.92); }
.music-toggle.is-playing { background: var(--red); color: #fffaf1; }
/* a slow pulse ring while playing, so the button reads as "live" without being noisy */
.music-toggle.is-playing::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid var(--red);
  opacity: 0.6;
  animation: musicPulse 2.2s ease-out infinite;
}
@keyframes musicPulse {
  0% { transform: scale(1); opacity: 0.55; }
  100% { transform: scale(1.55); opacity: 0; }
}
@media (min-width: 768px) { .music-toggle { right: 24px; bottom: 24px; } }

/* ==================== calmer for people who ask for less motion ==================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .gate-char { animation: none; opacity: 1; filter: none; transform: none; }
  .hero-prompt svg { animation: none; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .sketch path { stroke-dashoffset: 0; transition: none; }
}

/* ==================== VERSION 2.0: "vedika & dhruv's trajectory" ====================
   From trajectory-website/css/styles.css. The page-level bits it needs are scoped to .lc here so they
   can't touch the rest of the wedding site; the .lcf-* / .lcr-* rules below are its own, unchanged. */
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-400.woff2") format("woff2");
}
.lc {
  --serif: var(--font-display);
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --frame-max: 1056px;
  --pad: 24px;
  --gutter: 24px;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ink: var(--text); /* the chapter + caption around the big card, in the wedding site's ink */
  --mute: var(--muted);
}
/* VERSION 3.0: the trajectory starts 30% of a screen sooner, so its photos begin arriving as "you're officially
   invited" leaves the screen (there was ~400 px of scrolling with only the headline, 21 Nov). The invited line's own
   section is see-through and has nothing to tap, so it must not catch taps meant for the photos under it. */
.lc { margin-top: -30vh; margin-top: -30svh; }
#story-intro { pointer-events: none; }
/* ...and its headline (and photos) no longer ride up ahead of the section while it arrives (the trajectory's
   --lift), so "vedika & dhruv's journey" stays half a screen below the invited line (he asked, 21 Nov) */
.lc .lcf-space, .lc .lcf-word { translate: none; }
@media (min-width: 1512px) { .lc { --frame-max: 1440px; } }
@media (min-width: 1900px) { .lc { --frame-max: 1560px; } }
@media (max-width: 959px) { .lc { --gutter: 16px; } }
@media (max-width: 559px) { .lc { --gutter: 10px; } }
.lc p, .lc figure { margin: 0; }
.lc a { color: inherit; text-decoration: none; }
/* the column everything lines up to (the big card is exactly this wide) */
.lc .frame { z-index: 1; width: min(var(--frame-max), 100% - 2 * var(--gutter)); min-height: 100svh; padding: 0 var(--pad); margin-inline: auto; position: relative; container-type: inline-size; }
@media (min-width: 960px) {
  .lc .frame { width: max(880px, min(var(--frame-max), 100% - 2 * var(--gutter), 100svh * 1008 / 803 + 2 * var(--pad))); }
}
.lc .sr-only { clip: rect(0 0 0 0); white-space: nowrap; border: 0; width: 1px; height: 1px; margin: -1px; padding: 0; position: absolute; overflow: hidden; }

/* --------------------------------------------- the animation (original rules) */

.lc {
  z-index: 1;
  position: relative;
}
.lcf {
  height: 600svh;
  position: relative;
}
.lcf-stage {
  width: 100%;
  height: 100svh;
  position: sticky;
  top: 0;
  overflow: hidden;
}
.lcf {
  --lcf-ink: #1f1f1f;
  --lcf-mute: #8f8f8f;
  --lcf-blank: #f1f1ef;
  --lcf-bg: #fff;
}
.lcf-space {
  width: 0;
  height: 0;
  translate: 0 var(--lift, 0px);
  position: absolute;
  top: 50%;
  left: 50%;
}
.lcf-card {
  opacity: 0;
  background: var(--lcf-blank);
  will-change: transform, opacity;
  transition:
    box-shadow 0.22s,
    background-color 0.4s;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  translate: -50% -50%;
}
.lcf-img {
  object-fit: cover;
  width: 100%;
  height: 100%;
  opacity: var(--pic, 1);
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  display: block;
}
.lcf-card[data-live]:not(.lcf-blank) {
  cursor: pointer;
}
.lcf-card[data-live]:hover,
.lcf-card[data-live]:focus-visible {
  box-shadow: 0 24px 48px -28px #00000073;
  z-index: 900 !important;
}
.lcf-blank {
  pointer-events: none;
}
.lcf-card[data-cap]::after {
  content: attr(data-cap) '\a ' attr(data-sub);
  white-space: pre;
  pointer-events: none;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--lcf-ink);
  opacity: 0;
  transition:
    opacity 0.2s ease,
    translate 0.26s var(--ease-out);
  font-size: 11px;
  line-height: 1.45;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  translate: 0 -4px;
}
.lcf-card[data-live]:hover::after,
.lcf-card[data-live]:focus-visible::after {
  opacity: 1;
  translate: 0;
}
.lcf-card:not([data-live]) {
  pointer-events: none;
}
.lcf-card:focus-visible {
  outline: 1px solid var(--lcf-ink);
  outline-offset: 3px;
}
.lcf-word {
  white-space: nowrap;
  pointer-events: none;
  z-index: 400;
  font-family: var(--serif);
  letter-spacing: -0.01em;
  color: var(--lcf-ink);
  opacity: 0;
  translate: 0 var(--lift, 0px);
  margin: 0;
  font-size: clamp(34px, 5vw, 76px);
  font-weight: 400;
  line-height: 1;
  position: absolute;
  top: 50%;
  left: 50%;
}
.lcf {
  background: linear-gradient(var(--lcf-bg) calc(100% - 2px), #111214 0);
}
.frame.lcf-rails {
  z-index: 0;
  pointer-events: none;
  min-height: 0;
  padding: 0;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  translate: -50%;
}
.lcf-rails::before,
.lcf-rails::after {
  content: '';
  background: repeating-linear-gradient(#e0e0e0 0 6px, #0000 6px 12px);
  width: 1px;
  position: absolute;
  top: 0;
  bottom: 0;
}
.lcf-rails::before {
  left: 0;
}
.lcf-rails::after {
  right: 0;
}
.lcf-stage {
  z-index: 1;
}
.lcf-reel {
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  position: absolute;
  inset: 0;
}

.lcr {
  color: #fff;
  background: #111214;
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.lcr-slide {
  opacity: 0;
  margin: 0;
  transition: opacity 0.7s;
  position: absolute;
  inset: 0;
}
.lcr-slide[data-on] {
  opacity: 1;
}
.lcr-media {
  object-fit: cover;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  width: 100%;
  height: 100%;
  display: block;
  position: absolute;
  inset: 0;
}
.lcr-slide img.lcr-media {
  transition: scale 1.4s var(--ease-out);
  scale: 1.04;
}
.lcr-slide[data-on] img.lcr-media {
  scale: 1;
}
@keyframes lcr-in {
  0% {
    opacity: 0;
    translate: 0 10px;
  }
}
.lcr-side {
  color: #fff;
  cursor: pointer;
  width: min(22vw, 320px);
  opacity: var(--ui, 1);
  background: 0 0;
  border: 0;
  padding: 0;
  position: absolute;
  top: 0;
  bottom: 0;
}
.lcr-side[data-side='l'] {
  left: 0;
}
.lcr-side[data-side='r'] {
  right: 0;
}
.lcr-side::before {
  content: '';
  opacity: 0;
  transition: opacity 0.42s var(--ease-out);
  background: linear-gradient(90deg, #0000006b, #00000024 55%, #0000);
  position: absolute;
  inset: 0;
}
.lcr-side[data-side='r']::before {
  background: linear-gradient(270deg, #0000006b, #00000024 55%, #0000);
}
.lcr-side-chev {
  opacity: 0.5;
  width: 44px;
  height: 44px;
  transition:
    opacity 0.26s ease,
    translate 0.36s var(--ease-out);
  place-items: center;
  display: grid;
  position: absolute;
  top: 50%;
  translate: 0 -50%;
}
.lcr-side[data-side='l'] .lcr-side-chev {
  left: max(16px, 2.6vw);
}
.lcr-side[data-side='r'] .lcr-side-chev {
  right: max(16px, 2.6vw);
}
.lcr-side:hover::before,
.lcr-side:focus-visible::before,
.lcr-side:hover .lcr-side-chev,
.lcr-side:focus-visible .lcr-side-chev {
  opacity: 1;
}
.lcr-side[data-side='l']:hover .lcr-side-chev {
  translate: -3px -50%;
}
.lcr-side[data-side='r']:hover .lcr-side-chev {
  translate: 3px -50%;
}
.lcr-side:focus-visible {
  outline: none;
}
.lcr-side:focus-visible .lcr-side-chev {
  outline-offset: 2px;
  outline: 1px solid #fff;
}
.lcr[data-card] {
  overflow: visible;
}
.lcr[data-card] .lcr-slide {
  overflow: hidden;
}
.lcr[data-track] {
  clip-path: inset(-40px -100vw -40px 0);
  touch-action: pan-y;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
}
.lcr[data-track][data-moved] {
  clip-path: inset(-40px -100vw);
}
.lcr[data-track][data-dragging] {
  cursor: grabbing;
}
.lcr[data-track] .lcr-slide {
  opacity: 1;
  visibility: hidden;
  transition: none;
}
.lcr[data-track] .lcr-slide:not([data-on]) img.lcr-media {
  scale: 1;
}
.lcr[data-track] .lcr-slide {
  box-shadow:
    1px 0 #111214,
    -1px 0 #111214;
}
.lcr[data-track]:is([data-sliding], [data-dragging]) .lcr-side::before {
  opacity: 0;
  transition: opacity 0.12s;
}
.lcr-peekhit[data-side='l'] {
  left: auto;
  right: 100%;
}
.lcr-peekhit {
  width: var(--gut, 0px);
  cursor: pointer;
  opacity: var(--ui, 1);
  background: 0 0;
  border: 0;
  padding: 0;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 100%;
}
@media (max-width: 759px) {
  .lcr-side {
    width: 18vw;
  }
  .lcr[data-card] .lcr-side-chev {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .lcr-slide,
  .lcr-slide img.lcr-media {
    transition: none;
  }

}
.lcr-end {
  background: #111214;
  place-items: center;
  display: grid;
}
.lcr-end-in {
  text-align: center;
  opacity: var(--ui, 1);
  justify-items: center;
  gap: 22px;
  padding: 24px;
  display: grid;
}
.lcr-end-btn {
  color: #fff;
  height: 40px;
  font-family: var(--mono);
  text-transform: uppercase;
  border: 1px solid #ffffffb3;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  padding: 0 18px;
  font-size: 12px;
  text-decoration: none;
  transition:
    background-color 0.25s,
    color 0.25s,
    border-color 0.25s;
  display: inline-flex;
}
.lcr-end-btn span {
  transition: translate 0.25s;
}
.lcr-end-btn:is(:hover, :focus-visible) {
  color: #111214;
  background: #fff;
  border-color: #fff;
}
.lcr-end-btn:is(:hover, :focus-visible) span {
  translate: 3px;
}
.lcr[data-end] :is(.lcr-side[data-side='r'], .lcr-peekhit[data-side='r']) {
  visibility: hidden;
}
.lcr[data-track] .lcr-slide.lcr-end {
  box-shadow: 0 0 0 2px #111214;
}
@media (max-width: 559px) {
  .rails::before,
  .rails::after,
  .lcf-rails::before,
  .lcf-rails::after {
    background: 0 0 !important;
  }

}

/* ------------------------------------------------ the words around the big card */
/* Added for Vedika & Dhruv (not in the original): the chapter sits in the white space above the
   card and the photo's caption below it, instead of on the picture. They fade in with the card. */
.lc .story-head,
.lc .story-foot {
  pointer-events: none;
  text-align: center;
  opacity: var(--ui, 1);
  position: absolute;
  left: 0;
  right: 0;
}
.lc .story-head {
  bottom: calc(100% + clamp(14px, 3.2svh, 32px));
}
.lc .story-foot {
  top: calc(100% + clamp(14px, 3.2svh, 32px));
}
.lc .story-chapter {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mute);
  animation: lcr-in 0.7s var(--ease-out) both;
  font-size: 12px;
  line-height: 1.45;
}
.lc .story-kicker {
  font-family: var(--serif);
  letter-spacing: -0.01em;
  color: var(--ink);
  text-wrap: balance;
  animation: lcr-in 0.7s var(--ease-out) 90ms both;
  margin-top: 8px;
  font-size: clamp(26px, min(3.6vw, 5.4svh), 48px);
  line-height: 1.05;
}
.lc .story-caption {
  font-family: var(--serif);
  color: #4a4a4a;
  text-wrap: balance;
  animation: lcr-in 0.7s var(--ease-out) both;
  font-size: clamp(18px, min(2.2vw, 3.2svh), 28px);
  line-height: 1.2;
}
@media (prefers-reduced-motion: reduce) {
  .lc .story-chapter,
  .lc .story-kicker,
  .lc .story-caption {
    animation: none;
  }
}

/* wedding-site colours for the trajectory: cream page instead of white, the site's ink and muted tones */
.lc .lcf { --lcf-ink: var(--text); --lcf-mute: var(--muted); --lcf-blank: #efe6d6; background: transparent; }
.lc .story-caption { color: var(--text-soft); }

/* "vedika dhruv, version 2.0" on the opening screen */
.gate-version {
  position: absolute;
  top: calc(30px + env(safe-area-inset-top, 0px));
  left: 0;
  right: 0;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-align: center;
  opacity: 0.9;
}

/* VERSION 3.0: no big card of slides; the zoomed-in photo hands over to the polaroid stack instead */
.lc .lcf-reel { display: none !important; }

/* VERSION 3.0: the photo that turns into the first polaroid (setupZoomIntoPolaroids in main.js) */

/* The first polaroid has no layer of its own that appears when the change starts and vanishes when it ends, and
   no transition that could fire when main.js clears its inline styles at the end (the desktop .polaroid rule
   above has one): either would show as a tiny pop at the start or the landing.
   Its shadow follows --form (0 to 1, set by main.js while the frame grows); unset it is the polaroid's own. */
.zoom-card .polaroid {
  transition: none;
  box-shadow: 0 calc(var(--form, 1) * 6px) calc(var(--form, 1) * 20px) rgba(0, 0, 0, calc(var(--form, 1) * 0.2));
}
@media (min-width: 768px) {
  .zoom-card .polaroid {
    box-shadow: 0 calc(var(--form, 1) * 14px) calc(var(--form, 1) * 42px) rgba(0, 0, 0, calc(var(--form, 1) * 0.32));
  }
}

/* the zoomed photo, kept over the first polaroid's clip until the polaroid has landed (main.js sets its opacity) */
.polaroid-photo img.zoom-ghost { pointer-events: none; }

/* ==================== PAPER TEXTURE (trial, 21 Nov) ====================
   images/paper.jpg is a seamless 600px tile made from the paper photo he sent: only its fine grain, near-white,
   multiplied over whatever colour is underneath, so the page keeps its own (changing) colour and just gains the grain.
   Shown at 300px so it stays crisp on retina screens. On the page's own background (it scrolls with the page and the
   photos stay clean), plus the red opening screen and the red ending, which paint their own colour.
   Delete this block (and images/paper.jpg, images/paper-grain.webp) to remove it. */
/* the red opening screen and the red ending: the same grain drawn over their red (black with alpha over a colour is
   exactly paper.jpg multiplied into it), so only one grain file is downloaded */
.gate-btn, .bye { background-image: url("../images/paper-grain.webp"); background-size: 300px 300px; }
/* SPEED (22 Nov): on the page itself the grain is its own layer under everything, not part of the page's background.
   The page's colour changes on every scroll frame from "our story" on (updatePageTint in main.js); while the grain was
   multiplied into that colour, the phone had to repaint the whole screen each frame. Now only the plain colour changes
   and the grain, painted once, sits on top of it. images/paper-grain.webp is paper.jpg turned into black with
   alpha = 255 - paper (paper.jpg is pure grey), which over any colour gives exactly what multiplying by paper.jpg did. */
body { position: relative; } /* (the grain's box: the whole page, top to bottom; nothing else is placed against body) */
body::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1; /* under every section, just above the page's own colour, as the background image was */
  background: url("../images/paper-grain.webp") 0 0 / 300px 300px;
  pointer-events: none;
  will-change: transform; /* its own layer, so the colour changing under it never repaints it */
}
