/* Robs & Jon · wedding site
   Burgundy cotton paper, cream ink, one script accent. Mobile first. */

:root {
  --burg: #6b2236;
  --burg-deep: #4d1323;
  --cream: #f4eadf;
  --cream-soft: rgba(244, 234, 223, .92);
  --rose: #dfb7b3;
  --olive: #6f7550;
  --ink: #4a1424;
  --ink-soft: rgba(74, 20, 36, .9);
  --line: rgba(244, 234, 223, .4);
  --serif: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
  --script: "Mrs Saint Delafield", "Snell Roundhand", "Apple Chancery", cursive;
  --bar: 56px;
  --gut: 22px;
}

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

html {
  font-size: 20px; /* every rem on the page is measured from this */
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bar) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--cream);
  background: var(--burg) url("img/paper-burgundy.jpg") 0 0 / 256px 256px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* The sheet is lit from above and falls off at the edges, so it reads as paper, not as a flat fill. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(255, 226, 214, .13), transparent 62%),
    radial-gradient(140% 120% at 50% 50%, transparent 55%, rgba(30, 4, 12, .34) 100%);
}

main, .foot { position: relative; z-index: 1; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 600; }

/* Ink pressed into the paper */

.caps, .label, .hero__meta, .links a, .drawer a, .btn, .float, .bar__rsvp, .card__tag, .foot__line {
  text-transform: uppercase;
  letter-spacing: .2em;
}

.script { font-family: var(--script); font-weight: 400; text-transform: none; letter-spacing: 0; }
.dot { padding: 0 .35em; }
.center { text-align: center; }
.soft { color: var(--cream-soft); }

.label {
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .26em;
  color: var(--rose);
}

/* ---------- shiny text: a band of light sweeping across foil-stamped letters ---------- */

.shine {
  --shine-base: #efe3d6;   /* cream, the letters at rest */
  --shine-light: #b4687a;  /* a cabernet glint, close to the paper, so the passing light reads clearly */
  color: var(--shine-base);
  background-image: linear-gradient(115deg, var(--shine-base) 0%, var(--shine-base) 40%, var(--shine-light) 50%, var(--shine-base) 60%, var(--shine-base) 100%);
  background-size: 300% 100%;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  animation: shine 3.6s linear infinite;
}
.hero__the .script.shine { display: inline-block; padding: .45em .6em; margin: -.31em -.6em -.39em; }
.hero__names.shine { padding-bottom: .12em; }
/* The gradient is three times the width of the word and never leaves it uncovered: the band enters from the left and exits right. */
@keyframes shine { from { background-position: 100% 0; } to { background-position: 0% 0; } }
@media (prefers-reduced-motion: reduce) { .shine { animation: none; background-position: 100% 0; } }

/* ---------- top bar (phone and tablet) ---------- */

.bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 30;
  height: var(--bar);
  padding: 0 6px 0 4px;
  display: grid;
  grid-template-columns: 84px 1fr 84px;
  align-items: center;
  background: var(--burg) url("img/paper-burgundy.jpg") 0 0 / 256px 256px;
  box-shadow: 0 1px 0 rgba(244, 234, 223, .14), 0 6px 18px rgba(30, 4, 12, .28);
}

.bar__menu {
  width: 52px; height: 52px;
  display: grid; place-content: center; gap: 6px;
  background: none; border: 0; padding: 0; cursor: pointer; color: var(--cream);
}
.bar__menu span { display: block; width: 26px; height: 1.5px; background: currentColor; }

.bar__mono, .foot__mono {
  font-family: "Cinzel", var(--serif);
  font-size: 1.3rem;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}
.bar__mono i, .foot__mono i {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 1.12em;
  line-height: 0;
  margin: 0 .1em 0 .04em;
  color: var(--cream);
}
/* This J hangs below the line by design: bring its foot up to sit level with the R. */
.bar__mono b, .foot__mono b { display: inline-block; font-weight: 400; transform-origin: 50% 12%; transform: scaleY(.87); }

.bar__rsvp {
  justify-self: end;
  margin-right: 6px;
  padding: 10px 12px 9px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  line-height: 1;
  color: var(--ink);
  background: #f6efe4 url("img/paper-cream.jpg") 0 0 / 256px 256px;
  border-radius: 2px;
}

.drawer {
  position: fixed;
  inset: var(--bar) 0 0 0;
  z-index: 29;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: 4px;
  overflow: hidden;
  padding-bottom: 170px;
  background: var(--burg-deep) url("img/paper-burgundy.jpg") 0 0 / 256px 256px;
}
.drawer[hidden] { display: none; }
.drawer a { font-size: 1rem; font-weight: 700; padding: 16px 24px; }
.drawer__sign {
  position: absolute; left: 0; right: 0;
  bottom: calc(28px + env(safe-area-inset-bottom));
  text-align: center; padding: 0 var(--gut);
}
.drawer__yes { font-size: 1.25rem; font-weight: 600; }
.drawer__date { font-size: 1rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--rose); margin-top: 6px; }
.drawer__from { font-size: 1.15rem; font-weight: 700; letter-spacing: .2em; padding-left: .2em; text-transform: uppercase; margin-top: 18px; }
.drawer__from .script { display: block; font-size: 2.5rem; line-height: 1; margin-bottom: 2px; padding: 0 .3em; }
@media (max-height: 640px) { .drawer { justify-content: flex-start; padding-top: 12px; } .drawer a { padding: 10px 24px; } }

/* ---------- hero ---------- */

.hero { display: flex; flex-direction: column; padding-top: var(--bar); }

.hero__photo { order: 1; margin: 0; }
.hero__photo img { width: 100%; aspect-ratio: 2000 / 1589; object-fit: cover; }

.hero__title { order: 2; text-align: center; padding: 46px var(--gut) 40px; }

.hero__the { display: flex; flex-direction: column; align-items: center; }
.hero__the .caps { font-size: 1.2rem; letter-spacing: .5em; padding-left: .5em; font-weight: 700; }
.hero__the .script {
  font-size: clamp(5.6rem, 31vw, 8.6rem);
  line-height: .78;
  margin: .14em 0 .06em;
  padding: 0 .1em;
  white-space: nowrap;
}

.hero__names {
  margin-top: 34px;
  font-size: clamp(2rem, 12vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: .13em;
  padding-left: .13em;
  text-transform: uppercase;
  white-space: nowrap;
}
.hero__names .amp { font-size: .86em; }

.hero__meta { margin-top: 20px; font-size: 1.15rem; font-weight: 700; letter-spacing: .14em; line-height: 1.5; }
.hero__date span { display: block; }
.hero__date .dot { display: none; }
.hero__count { margin-top: 10px; font-size: 1.05rem; color: var(--rose); min-height: 1.4em; }

.links { display: none; }

/* ---------- the essentials ---------- */

.glance {
  margin: 0 var(--gut);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.glance__item { padding: 30px 0; }
.glance__item + .glance__item { border-top: 1px solid var(--line); }
.glance__big { font-size: 1.5rem; font-weight: 700; text-wrap: balance; line-height: 1.25; margin: 8px 0 4px; }
.glance .soft { text-wrap: balance; }
.glance a { color: var(--rose); font-weight: 700; letter-spacing: .04em; }

/* ---------- welcome note ---------- */

.note { text-align: center; padding: 64px var(--gut) 12px; max-width: 900px; margin: 0 auto; }
.script--line { font-size: clamp(2.2rem, 11.4vw, 3.4rem); line-height: 1; margin-bottom: 18px; white-space: nowrap; }
.note__text { font-size: 1.4rem; line-height: 1.4; color: var(--cream-soft); text-wrap: balance; }

/* ---------- sections ---------- */

.block { text-align: center; padding: 72px var(--gut) 0; max-width: 1080px; margin: 0 auto; }

.block h2, .rsvp h2 {
  font-size: clamp(1.4rem, 7.6vw, 3rem);
  letter-spacing: .06em;
  padding-left: .06em;
  white-space: nowrap;
  text-transform: uppercase;
  line-height: 1.15;
  margin: 12px 0 14px;
}

.lead { font-size: 1.3rem; color: var(--cream-soft); text-wrap: balance; }

address { font-style: normal; font-size: 1.45rem; font-weight: 700; line-height: 1.4; margin: 22px 0 24px; }

.btn {
  display: inline-block;
  min-height: 52px;
  padding: 16px 30px;
  font: 700 .9rem/1.3 var(--serif);
  letter-spacing: .14em;
  white-space: nowrap;
  color: var(--cream);
  background: transparent;
  border: 1px solid var(--cream);
  border-radius: 2px;
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
.btn:hover { background: var(--cream); color: var(--ink); }

.space { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 40px; }
.space img { width: 100%; height: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.space img:first-child { grid-column: 1 / -1; }

.cards { display: grid; gap: 14px; margin: 26px 0 24px; text-align: center; }
.block > .soft { font-size: 1.15rem; }

.card {
  padding: 34px 24px 32px;
  background: rgba(40, 6, 16, .2);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 0 0 6px transparent, inset 0 0 0 7px rgba(244, 234, 223, .1);
}
.card h3 { font-size: 1.7rem; font-weight: 700; letter-spacing: .04em; line-height: 1.25; }
.card p { color: var(--cream-soft); text-wrap: balance; }
.card__soon { font-size: 1.2rem; font-weight: 700; color: var(--rose) !important; margin: 6px 0 12px; }
.card__tag { font-size: .95rem; font-weight: 700; letter-spacing: .24em; color: var(--rose) !important; margin-bottom: 10px; }
.card h3 + p { margin-top: 12px; }
.card__soon + p { margin-top: 0; }
.code { font-size: .7em; font-weight: 700; letter-spacing: .14em; color: var(--rose); padding-left: .3em; }

/* ---------- photos: morph slider ---------- */

.morph { margin: 28px auto 0; max-width: 760px; outline: 0; text-shadow: none; }
.morph__stage {
  position: relative;
  height: min(620px, 118vw);
  border-radius: 16px;
  overflow: hidden;
  background: #05060a;
  box-shadow: 0 2px 4px rgba(30, 4, 12, .3), 0 22px 44px rgba(30, 4, 12, .4);
}
.morph:focus-visible .morph__stage { outline: 2px solid var(--cream); outline-offset: 4px; }
.morph__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.morph__src img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; opacity: 0; }
.morph__src img.is-on { opacity: 1; }
.morph--gl .morph__src { visibility: hidden; }
.morph__shade { position: absolute; inset: auto 0 0 0; height: 42%; background: linear-gradient(to top, rgba(5, 6, 10, .78), rgba(5, 6, 10, 0)); pointer-events: none; }
.morph__cap {
  position: absolute; left: 22px; right: 22px; bottom: 20px;
  font-size: 1.3rem; font-weight: 600; letter-spacing: .02em; color: #fff; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.morph__nav {
  position: absolute; top: 50%; margin-top: -24px;
  width: 48px; height: 48px; display: grid; place-content: center;
  color: #fff; background: rgba(5, 6, 10, .42); border: 1px solid rgba(255, 255, 255, .28); border-radius: 50%;
  cursor: pointer; padding: 0; transition: background-color .2s;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.morph__nav:hover { background: rgba(5, 6, 10, .7); }
.morph__nav:disabled { opacity: .35; cursor: default; }
.morph__nav--prev { left: 12px; }
.morph__nav--next { right: 12px; }
.morph__dots { display: flex; justify-content: center; gap: 2px; margin-top: 12px; }
.morph__dot { width: 20px; height: 32px; padding: 0; background: none; border: 0; cursor: pointer; position: relative; }
.morph__dot::after { content: ""; position: absolute; left: 3px; right: 3px; top: 15px; height: 2px; background: var(--line); transition: background-color .2s; }
.morph__dot.is-on::after { background: var(--cream); }

/* ---------- RSVP: a cream card laid on the burgundy sheet ---------- */

.rsvp { padding: 84px 14px 0; }

.invite {
  max-width: 600px;
  margin: 0 auto;
  padding: 44px 22px 40px;
  text-align: center;
  color: var(--ink);
  background: #f6efe4 url("img/paper-cream.jpg") 0 0 / 256px 256px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, 0 2px 4px rgba(30, 4, 12, .3), 0 22px 44px rgba(30, 4, 12, .38);
}

.script--ink { font-size: clamp(2.2rem, 13vw, 3.3rem); line-height: .9; color: var(--burg); }
.rsvp h2 { margin: 6px 0 12px; color: var(--ink); }
.invite__lead { color: var(--ink-soft); text-wrap: balance; max-width: 30em; margin: 0 auto 30px; }
.invite__lead strong { font-weight: 700; color: var(--ink); }

form { text-align: left; }
.field { margin-bottom: 20px; }

label, legend {
  display: block;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
  padding: 0;
}

input[type="text"], input[type="email"], input[type="tel"] {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  font: 700 1.2rem/1 var(--serif);
  color: var(--ink);
  background: rgba(255, 255, 255, .55);
  border: 1.5px solid rgba(74, 20, 36, .55);
  border-radius: 2px;
  appearance: none;
}
input::placeholder { color: rgba(74, 20, 36, .45); font-weight: 500; }
input:focus-visible { outline: 2px solid var(--burg); outline-offset: 1px; border-color: var(--burg); }
.field--bad input { border-color: #a3261f; background: rgba(163, 38, 31, .06); }

.hint { font-size: 1rem; font-weight: 600; color: var(--ink-soft); margin-top: 6px; }

.choice { border: 0; padding: 0; margin: 0 0 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; min-width: 0; }
.choice legend { grid-column: 1 / -1; }
.choice--stack { grid-template-columns: 1fr; }
.choice label { margin: 0; letter-spacing: 0; text-transform: none; font-size: 1.16rem; font-weight: 600; color: var(--ink); cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span {
  display: flex; align-items: center; justify-content: center;
  min-height: 54px; padding: 10px 12px; text-align: center; line-height: 1.2;
  border: 1.5px solid rgba(74, 20, 36, .55); border-radius: 2px;
  background: rgba(255, 255, 255, .55);
  transition: background-color .15s, color .15s, border-color .15s;
}
.choice input:checked + span { background: var(--burg); border-color: var(--burg); color: var(--cream); }
.choice input:focus-visible + span { outline: 2px solid var(--burg); outline-offset: 2px; }
.choice--bad span { border-color: #a3261f; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form__error { color: #8f1f19; font-size: 1.05rem; margin: 0 0 16px; text-align: center; }

.btn--ink { display: block; width: 100%; color: var(--cream); background: var(--burg); border-color: var(--burg); font-size: .84rem; letter-spacing: .08em; padding-left: 8px; padding-right: 8px; min-height: 64px; }
.btn--ink:hover { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.btn--ink[disabled] { opacity: .6; cursor: default; }

.thanks { padding: 10px 0 6px; outline: 0; }
.thanks__text { font-size: 1.2rem; font-weight: 600; color: var(--ink); text-wrap: balance; margin-top: 14px; }

/* ---------- footer ---------- */

.foot { text-align: center; padding: 84px var(--gut) 120px; }
.foot__mono { font-size: 2.3rem; }
.foot__line { font-size: 1rem; font-weight: 700; letter-spacing: .2em; color: var(--cream-soft); margin-top: 10px; }

/* ---------- floating RSVP (phone) ---------- */

.float {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 20;
  padding: 15px 24px;
  font: 700 .84rem/1 var(--serif);
  letter-spacing: .1em;
  white-space: nowrap;
  color: var(--ink);
  background: #f6efe4 url("img/paper-cream.jpg") 0 0 / 256px 256px;
  border-radius: 2px;
  box-shadow: 0 2px 4px rgba(30, 4, 12, .35), 0 12px 28px rgba(30, 4, 12, .45);
  transition: opacity .25s, visibility .25s;
}
.float.is-off { opacity: 0; visibility: hidden; }

/* ---------- tablet and desktop ---------- */

@media (min-width: 720px) {
  .glance { display: grid; grid-template-columns: repeat(3, 1fr); max-width: 1240px; margin: 0 auto; }
  .glance__item { padding: 34px 20px; }
  .glance__item + .glance__item { border-top: 0; border-left: 1px solid var(--line); }
  .cards { grid-template-columns: 1fr 1fr; gap: 18px; }
  .space { gap: 12px; }
  .invite { padding: 60px 64px 56px; }
  .block { padding-top: 96px; }
  .rsvp { padding-top: 108px; }
}

@media (min-width: 960px) {
  html { font-size: 22px; }
  html { scroll-padding-top: 24px; }
  .bar, .drawer, .float { display: none !important; }

  .hero { padding-top: 0; }
  .hero__title { order: 1; padding: 84px 24px 0; }
  .hero__photo { order: 2; width: min(1240px, calc(100% - 96px)); margin: 0 auto; }

  .hero__the { flex-direction: row; justify-content: center; align-items: center; gap: 6px; }
  .hero__the .caps { font-size: 1.5rem; letter-spacing: .4em; font-weight: 700; }
  .hero__the .script { font-size: 9.5rem; line-height: .9; }
  .hero__the .script.shine { margin: -.45em -.5em -.45em -.55em; }
  .hero__names { font-size: 4.4rem; margin-top: 30px; letter-spacing: .12em; }
  .hero__meta { font-size: 1.35rem; margin-top: 24px; }
  .hero__date span { display: inline; }
  .hero__date .dot { display: inline; }
  .hero__count { font-size: 1.15rem; }

  .links { display: flex; justify-content: center; gap: 30px; margin: 56px 0 34px; }
  .links a { font-size: .8rem; font-weight: 700; letter-spacing: .14em; padding: 8px 0; color: var(--cream-soft); transition: color .2s; }
  .links a:hover { color: var(--cream); }

  .glance { margin-top: 72px; }
  .space { grid-template-columns: repeat(3, 1fr); }
  .space img:first-child { grid-column: auto; }
  .foot { padding-bottom: 96px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
