/* Palette and type are taken from the printed invitation. */
:root {
  --paper: #FBF5EC;
  --paper-deep: #F3E9DE;
  --ink: #8E5B68;        /* the names */
  --ink-deep: #5B3F49;   /* body text */
  --lavender: #7D6B8C;   /* the script line */
  --hairline: #DCCBCB;

  --serif: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --sans: "Jost", "Avenir Next", "Helvetica Neue", sans-serif;
  --script: "Mrs Saint Delafield", cursive;

  --measure: 60ch;
  --gutter: clamp(20px, 5vw, 64px);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-deep);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

p { margin: 0; }
h1, h2, h3 { font-weight: 400; margin: 0; }
em { font-style: italic; }

a { color: var(--ink); }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

/* ---------- Hero: the invitation, at scale ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto auto;
}

.hero-text {
  text-align: center;
  padding: clamp(56px, 12vh, 120px) var(--gutter) clamp(40px, 6vh, 64px);
  align-self: center;
  justify-self: center;
  max-width: 560px;
}

.names {
  font-family: var(--serif);
  font-size: clamp(3.6rem, 13vw, 6.6rem);
  font-variation-settings: "opsz" 96;
  line-height: .95;
  letter-spacing: -.01em;
  color: var(--ink);
  margin-bottom: .35em;
}
.names em { font-size: .8em; }

.script { font-family: var(--script); line-height: 1.1; }
.together {
  font-size: clamp(1.9rem, 6vw, 2.5rem);
  color: var(--lavender);
}
.son {
  font-size: clamp(2.6rem, 9vw, 3.9rem);
  color: var(--ink);
  margin-bottom: .45em;
}

.invite {
  font-size: clamp(1.1rem, 3.6vw, 1.35rem);
  letter-spacing: .04em;
  color: var(--ink);
  line-height: 1.5;
  padding-bottom: 28px;
  margin-bottom: 28px;
  position: relative;
}
.invite::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 0;
  width: 112px; height: 1px;
  transform: translateX(-50%);
  background: var(--hairline);
}

.when { color: var(--ink); line-height: 1.55; }
.when + .when { margin-top: 20px; }
.date {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 5vw, 1.9rem);
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.quiet { font-size: .92em; opacity: .8; }

.countdown {
  margin-top: 32px;
  font-size: .9rem;
  letter-spacing: .06em;
  color: var(--lavender);
}

/* The watercolour from the card, cropped to the chapel. */
.hero-art {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1024 / 736;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 28%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 28%);
}
.hero-art-img {
  position: absolute;
  inset: -6% 0 0;
  background: var(--paper) url("assets/chapel.jpg") center bottom / cover no-repeat;
  transform-origin: 50% 100%;
  will-change: transform;
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 46fr) minmax(0, 54fr);
    grid-template-rows: 100vh;
    grid-template-rows: 100svh;
  }
  .hero-text {
    padding: 0 clamp(40px, 5vw, 96px);
    max-width: 640px;
  }
  .hero-art {
    aspect-ratio: auto;
    height: 100%;
    -webkit-mask-image:
      linear-gradient(to right, transparent 0, #000 22%),
      linear-gradient(to bottom, transparent 0, #000 26%);
            mask-image:
      linear-gradient(to right, transparent 0, #000 22%),
      linear-gradient(to bottom, transparent 0, #000 26%);
    -webkit-mask-composite: source-in;
            mask-composite: intersect;
  }
  .hero-art-img {
    inset: -8% -4% 0;
    background-position: 30% bottom;
  }
  .names {
    font-size: clamp(3rem, 5.4vw, 5rem);
    white-space: nowrap;
  }
}

/* ---------- Body sections: editorial two-column grid ---------- */
main { padding: 0 var(--gutter); }

.section {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(72px, 10vw, 128px) 0;
  display: grid;
  gap: 28px 64px;
}
.section + .section { border-top: 1px solid var(--hairline); }

.section-title {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-variation-settings: "opsz" 72;
  line-height: 1.05;
  color: var(--ink);
}

@media (min-width: 900px) {
  .section { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
}

/* The day */
.programme { list-style: none; margin: 0; padding: 0; max-width: var(--measure); }
.programme li {
  display: grid;
  grid-template-columns: minmax(7rem, max-content) 1fr;
  gap: 32px;
  padding: 28px 0;
  border-top: 1px solid var(--hairline);
}
.programme li:last-child { border-bottom: 1px solid var(--hairline); }
.time {
  font-family: var(--serif);
  font-size: 1.7rem;
  line-height: 1.1;
  color: var(--ink);
}
.event h3 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1.15rem;
  margin-bottom: 4px;
}
.directions {
  display: inline-block;
  margin-top: 12px;
  font-size: .95rem;
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 2px;
  transition: border-color .2s;
}
.directions:hover { border-color: var(--ink); }

/* Reply */
.lede { max-width: var(--measure); font-size: 1.15rem; line-height: 1.6; }
.button {
  display: inline-block;
  margin-top: 28px;
  padding: 16px 36px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: .02em;
  transition: background .2s;
}
.button:hover { background: var(--ink-deep); }
.rsvp-pending { margin-top: 20px; color: var(--lavender); }
[hidden] { display: none !important; }

/* Good to know */
.notes { display: grid; gap: 36px; max-width: var(--measure); }
.notes h3 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1.15rem;
  margin-bottom: 8px;
}
@media (min-width: 900px) {
  .notes { max-width: none; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px; }
}

/* ---------- The cake: the first dance, scrubbed by scroll ---------- */
.dance {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 24px;
  border-top: 1px solid var(--hairline);
  padding: 48px 0;
  max-width: 1120px;
  margin: 0 auto;
}
.dance-title {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-variation-settings: "opsz" 72;
  color: var(--ink);
}
.scene {
  position: relative;
  width: min(640px, 100%, calc((100vh - 160px) * 836 / 1060));
  aspect-ratio: 836 / 1060;
  overflow: hidden;
  /* the photograph melts into the paper at its edges */
  -webkit-mask-image: radial-gradient(ellipse 58% 56% at 50% 50%, #000 62%, transparent 100%);
          mask-image: radial-gradient(ellipse 58% 56% at 50% 50%, #000 62%, transparent 100%);
}
.scene-inner {
  position: absolute;
  inset: 0;
  transform-origin: 50% 36%;
  will-change: transform;
}
.scene .poster, .scene .frames {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 72px var(--gutter) 56px;
  color: var(--ink);
  border-top: 1px solid var(--hairline);
  font-size: .95rem;
  letter-spacing: .04em;
}
.footer-names {
  font-family: var(--serif);
  font-size: 2rem;
  margin-bottom: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .button, .directions { transition: none; }
}
