:root {
  color-scheme: light;
  --ivory: #fbf1df;
  --paper: #fff8ec;
  --ink: #5c2529;
  --muted: #753d38;
  --red: #a82b35;
  --deep-red: #87242f;
  --line: #cfaa94;
  --rail: clamp(78px, 14.9vw, 260px);
  --type: Baskerville, "Baskervville", Georgia, "Times New Roman", serif;
  --texture: url("./assets/ivory-cotton.webp");
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--type);
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, p, figure { margin: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; }

:focus-visible { outline: 2px solid var(--deep-red); outline-offset: 5px; }
section:focus { outline: none; }

.music-toggle {
  position: fixed;
  z-index: 5;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 7px 12px;
  border: 1px solid var(--deep-red);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
  font: 600 .92rem/1.1 var(--type);
  cursor: pointer;
}

.music-toggle:not([hidden]) { display: inline-flex; }
.music-toggle:hover { background: #f5dece; }
.music-note { color: var(--deep-red); font-size: 1.25rem; }

.cover {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: stretch;
  grid-template-rows: 1fr auto;
  min-height: 690px;
  min-height: max(690px, 100svh);
  background: var(--texture) repeat var(--ivory);
  overflow: hidden;
}

.cover-inner {
  grid-row: 1;
  min-width: 0;
  width: 100%;
  padding: clamp(29px, 5.2svh, 58px) 18px clamp(25px, 4svh, 50px);
  display: grid;
  grid-template-rows: auto minmax(300px, 1fr) auto;
  align-items: center;
  text-align: center;
}

.cover-inner, .cover-band { margin-inline: var(--rail); width: auto; }

.cover-rail {
  position: absolute;
  inset-block: 0;
  z-index: -1;
  width: var(--rail);
  background: url("./assets/weave-wide.webp") center top / 100% 100% no-repeat;
}

.cover-rail--left { left: 0; }
.cover-rail--right { right: 0; transform: scaleX(-1); }

.woven-band {
  height: clamp(25px, 4.4svh, 49px);
  background: url("./assets/weave-band.webp") center / auto 100% repeat-x;
}

.cover-band { grid-row: 2; }

.cover-intro, .cover-details {
  display: grid;
  justify-items: center;
  position: relative;
  z-index: 1;
}

.cover-intro { gap: 13px; }

.divider {
  --pixel: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--pixel) * 5);
  color: var(--red);
}

.divider::before, .divider::after {
  content: "";
  display: block;
  width: clamp(40px, 7vw, 97px);
  height: 1px;
  background: currentColor;
}

.divider span {
  width: var(--pixel);
  height: var(--pixel);
  margin: calc(var(--pixel) * 2);
  background: currentColor;
  box-shadow:
    0 calc(var(--pixel) * -2) currentColor,
    calc(var(--pixel) * -1) calc(var(--pixel) * -1) currentColor,
    var(--pixel) calc(var(--pixel) * -1) currentColor,
    calc(var(--pixel) * -2) 0 currentColor,
    calc(var(--pixel) * 2) 0 currentColor,
    calc(var(--pixel) * -1) var(--pixel) currentColor,
    var(--pixel) var(--pixel) currentColor,
    0 calc(var(--pixel) * 2) currentColor;
}

.overline {
  color: var(--deep-red);
  font: 600 clamp(.67rem, 1.2vw, .84rem)/1.6 var(--type);
  letter-spacing: .23em;
  text-transform: uppercase;
}

.name-stage {
  position: relative;
  display: grid;
  place-items: center;
  align-self: stretch;
  min-width: 0;
}

.konark-wheel {
  position: absolute;
  z-index: 0;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: min(52svh, 74%, 550px);
  height: auto;
  opacity: .64;
  mix-blend-mode: multiply;
  pointer-events: none;
}

h1 {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  justify-content: center;
  column-gap: .2em;
  color: var(--ink);
  font-size: clamp(2.9rem, 5.1vw, 5.6rem);
  font-weight: 400;
  line-height: 1.01;
  letter-spacing: -.044em;
}

.ampersand {
  color: var(--red);
  font-size: .73em;
  font-style: italic;
  letter-spacing: 0;
}

.cover-details .divider { margin-bottom: 12px; }

.cover-date {
  font-size: clamp(1.36rem, 2.35vw, 2.24rem);
  line-height: 1.14;
}

.cover-city {
  margin-top: 4px;
  color: var(--muted);
  font-size: clamp(1.03rem, 1.67vw, 1.48rem);
  line-height: 1.2;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 10px 20px;
  border: 1px solid var(--deep-red);
  color: var(--ink);
  font: 400 clamp(1.04rem, 1.5vw, 1.24rem)/1.2 var(--type);
  text-decoration: none;
  transition: background-color 180ms ease, color 180ms ease;
}

.button:hover { background: #edd6c2; }

.button--down {
  flex-direction: column;
  min-width: min(clamp(225px, 20vw, 320px), 100%);
  margin-top: clamp(16px, 2.65svh, 27px);
  gap: 5px;
  padding-block: 9px 12px;
}

.chevron {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}

.section-inner { width: min(100% - 44px, 1050px); margin-inline: auto; }
.celebrations { background: var(--paper); padding: clamp(57px, 10vw, 114px) 0; }
.section-heading { text-align: center; }
.section-heading .divider { margin-bottom: 20px; }

.celebrations .section-heading .divider { --pixel: 5px; }
.celebrations .section-heading .divider::before,
.celebrations .section-heading .divider::after {
  width: clamp(66px, 13vw, 172px);
  height: 2px;
}

h2 {
  font-size: clamp(2.2rem, 5vw, 4.15rem);
  font-weight: 400;
  letter-spacing: -.038em;
  line-height: 1.02;
}

.section-heading p {
  margin-top: 13px;
  font-size: clamp(1.03rem, 2.1vw, 1.24rem);
  line-height: 1.5;
  color: var(--muted);
}

.text-link { text-underline-offset: .19em; text-decoration-thickness: 1px; }

.schedule {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  padding: 0;
  margin: clamp(30px, 6vw, 55px) 0 0;
  border-block: 1px solid var(--line);
}

.event {
  --event-reveal-delay: 0ms;
  text-align: center;
  padding: 30px 15px 32px;
  min-width: 0;
}

.event + .event { border-inline-start: 1px solid var(--line); }

.event-day {
  color: var(--deep-red);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.event h3 {
  display: grid;
  place-items: center;
  min-height: 2.2em;
  margin: 10px 0 7px;
  font-size: clamp(1.7rem, 2.75vw, 2.35rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -.03em;
}

.event-stitch {
  display: block;
  width: min(100%, 248px);
  height: 22px;
  margin: 12px auto 14px;
  background: url("./assets/weave-band.webp") center / auto 100% repeat-x;
  clip-path: inset(0 24%);
  opacity: .84;
}

@media (hover: hover) {
  .event:hover { background-color: #f5dece; }
  .event:hover .event-stitch {
    clip-path: inset(0);
    opacity: 1;
  }
}

@media (hover: none) {
  .event-stitch {
    clip-path: inset(0 6%);
    opacity: 1;
  }
}

.event-time { font-size: 1.23rem; line-height: 1.28; }
.event-room { margin-top: 6px; color: var(--muted); font-size: 1.06rem; }

.venue {
  padding: clamp(43px, 8vw, 90px) 0;
  background: var(--texture) repeat var(--ivory);
  border-top: 1px solid #dec2ae;
}

.venue-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(20px, 5vw, 60px);
  padding: clamp(25px, 5vw, 57px);
  border: 1px solid var(--line);
  background: #fff7eac4;
}

.venue-details .overline { margin-bottom: 12px; }
.venue-details h2 { font-size: clamp(2rem, 4.4vw, 3.5rem); }
.venue-details address {
  margin-top: 15px;
  font-size: clamp(1rem, 2vw, 1.21rem);
  font-style: normal;
  color: var(--muted);
  line-height: 1.5;
}

.button--filled {
  margin-top: 21px;
  background: var(--deep-red);
  color: var(--paper);
}

.button--filled:hover { background: var(--ink); }

.venue-qr {
  display: grid;
  justify-items: center;
  gap: 9px;
  text-align: center;
  color: var(--muted);
  font-size: 1rem;
}

.venue-qr img {
  width: clamp(133px, 16vw, 172px);
  height: auto;
  outline: 1px solid var(--line);
}

.closing {
  padding: clamp(40px, 7vw, 84px) 0 clamp(42px, 7vw, 82px);
  border-top: 1px solid #dec2ae;
  background: var(--paper);
  text-align: center;
}

.closing-inner {
  display: grid;
  justify-items: center;
}

.closing h2 {
  max-width: 24ch;
  font-size: clamp(1.9rem, 4.4vw, 3.55rem);
  text-wrap: balance;
}

.closing-portrait {
  width: clamp(220px, 34vw, 335px);
  height: auto;
  margin: 14px auto 18px;
}

.closing-signoff { margin-top: 17px; line-height: 1.35; }
.closing-love { font-size: 1.17rem; font-style: italic; color: var(--muted); }
.closing-family { margin-top: 2px; font-size: clamp(1.55rem, 3vw, 2.15rem); }

.footer { text-align: center; background: var(--paper); }
.music-credit {
  padding: 0 16px 16px;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.4;
}
.back-link {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  text-underline-offset: .2em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 740px) {
  :root { --rail: clamp(23px, 8.5vw, 63px); }

  .cover {
    min-height: 630px;
    min-height: max(630px, 100svh);
  }

  .cover-rail { background-image: url("./assets/weave-narrow.webp"); }

  .cover-inner {
    padding: clamp(34px, 9.4svh, 95px) 8px clamp(26px, 6.7svh, 66px);
    grid-template-rows: auto minmax(235px, 1fr) auto;
  }

  .cover-intro { gap: 17px; }
  .cover-intro .overline { letter-spacing: .165em; }

  h1 {
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: clamp(2.65rem, 10.15vw, 4.3rem);
    line-height: .98;
  }

  .ampersand { font-size: .66em; line-height: 1.16; }
  .konark-wheel { width: min(98%, 43svh, 420px); }
  .button--down { min-width: min(182px, 100%); }

  .schedule { grid-template-columns: 1fr; }
  .event { padding: 24px 13px 25px; }
  .event + .event { border-inline-start: 0; border-top: 1px solid var(--line); }
  .event h3 { min-height: 0; }
}

@media (max-width: 560px) {
  .venue-panel { grid-template-columns: 1fr; text-align: center; gap: 28px; }
  .venue-break { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .cover-intro, h1, .cover-details { animation: arrival 760ms both ease-out; }
  h1 { animation-delay: 100ms; }
  .cover-details { animation-delay: 190ms; }
  .cover-rail, .konark-wheel { animation: weave-in 950ms both ease-out; }
  .will-reveal { opacity: 0; transform: translateY(12px); }
  .will-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 620ms ease-out, transform 620ms ease-out;
  }
  .will-reveal:focus-within { opacity: 1; transform: none; }

  .event { transition: background-color 280ms ease; }

  .event.will-reveal:not(.is-visible) { transform: translateY(34px); }

  .event.will-reveal.is-visible {
    transition:
      opacity 600ms ease-out var(--event-reveal-delay),
      transform 680ms cubic-bezier(.18, .65, .28, 1) var(--event-reveal-delay),
      background-color 280ms ease;
  }

  .event-stitch {
    transition: clip-path 420ms cubic-bezier(.18, .65, .28, 1), opacity 280ms ease;
  }

  .event.will-reveal:not(.is-visible) .event-stitch {
    clip-path: inset(0 50%);
    opacity: 0;
  }

  .event.will-reveal.is-visible .event-stitch {
    animation: reveal-stitch 700ms cubic-bezier(.18, .65, .28, 1) calc(var(--event-reveal-delay) + 90ms) backwards;
  }

  .celebrations .section-heading.will-reveal:not(.is-visible, :focus-within) .divider {
    --thread-length: 0;
  }

  .celebrations .section-heading .divider::before,
  .celebrations .section-heading .divider::after {
    transform: scaleX(var(--thread-length, 1));
    transition: transform 740ms cubic-bezier(.18, .65, .28, 1);
  }

  .celebrations .section-heading .divider::before { transform-origin: right; }
  .celebrations .section-heading .divider::after { transform-origin: left; }
}

@media (min-width: 741px) and (prefers-reduced-motion: no-preference) {
  .schedule > .event:nth-child(1) { --event-reveal-delay: 100ms; }
  .schedule > .event:nth-child(2) { --event-reveal-delay: 280ms; }
  .schedule > .event:nth-child(3) { --event-reveal-delay: 460ms; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button { transition: none; }
}

@keyframes arrival {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes weave-in { from { opacity: 0; } }

@keyframes reveal-stitch {
  from { clip-path: inset(0 50%); opacity: 0; }
}
