/* ============================================================
   Jesse & Isabella — thank-you site
   Matches the printed card: cream ground, terracotta accent,
   thin terracotta photo frames, tracked-out sans labels.
   Mobile-first — most guests arrive by QR code on a phone.
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  /* ground */
  --cream:        #f5ece1;   /* page */
  --cream-lift:   #faf3ea;   /* photo mats, film block */
  --cream-deep:   #efe2d3;   /* subtle fills */

  /* accent */
  --terracotta:       #c1603e;  /* large display text, rules, ornaments */
  --terracotta-deep:  #a94f2c;  /* small text — 4.7:1 on cream */
  --terracotta-band:  #b45635;  /* footer band — 4.9:1 with white */
  --terracotta-line:  rgba(193, 96, 62, .42);

  /* text */
  --ink:       #33261d;   /* 12.5:1 */
  --ink-soft:  #5c4a3d;   /*  7.2:1 */
  --label:     #7d6350;   /*  4.7:1 */

  /* type */
  --display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --body:    "EB Garamond", Georgia, "Times New Roman", serif;
  --sans:    "Jost", "Helvetica Neue", Arial, sans-serif;

  /* rhythm */
  --gutter:  clamp(1.25rem, 5vw, 2.5rem);
  --section: clamp(4.5rem, 14vw, 8.5rem);
  --gap:     clamp(.6rem, 2.4vw, 1.15rem);

  --ease: cubic-bezier(.22, .61, .36, 1);
}

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

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1.02rem, .95rem + .45vw, 1.18rem);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, video { max-width: 100%; display: block; }
[hidden] { display: none !important; }

h1, h2, h3, p, figure, figcaption { margin: 0; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--terracotta-deep);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--cream-lift);
  color: var(--terracotta-deep);
  padding: .75rem 1.25rem;
  font-family: var(--sans);
}
.skip-link:focus { left: .5rem; top: .5rem; }

/* ---------- shared type ---------- */
.wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.display {
  font-family: var(--display);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: .005em;
}

.label {
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(.64rem, .6rem + .18vw, .72rem);
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--label);
  margin: 0;
}
.label--accent { color: var(--terracotta-deep); }

.prose {
  color: var(--ink-soft);
  max-width: 34em;
}

.amp {
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  color: var(--terracotta);
  font-size: 1.06em;
  padding-inline: .06em;
}

/* thin centred terracotta rule, like the card's frames */
.rule {
  width: 54px;
  height: 1px;
  background: var(--terracotta);
  opacity: .55;
  margin: clamp(1.4rem, 4vw, 2rem) auto;
}

.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .9rem;
  color: var(--terracotta);
  font-size: .5rem;
  opacity: .5;
  padding-inline: var(--gutter);
}
.ornament span {
  display: block;
  width: min(90px, 18vw);
  height: 1px;
  background: currentColor;
}

/* ---------- photo frame (the card's signature detail) ---------- */
.frame {
  display: block;
  padding: clamp(4px, 1.1vw, 8px);
  background: var(--cream-lift);
  border: 1px solid var(--terracotta-line);
}
.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- hero ---------- */
.hero {
  text-align: center;
  padding-top: calc(clamp(3rem, 11vw, 5.5rem) + env(safe-area-inset-top, 0px));
  padding-bottom: clamp(3rem, 10vw, 5rem);
}

.hero__eyebrow { letter-spacing: .42em; margin-bottom: clamp(1rem, 3.5vw, 1.5rem); }

.hero__names {
  font-size: clamp(2.7rem, 12.5vw, 6rem);
  margin: 0 auto;
  max-width: 14ch;
}

.hero__photo {
  max-width: 480px;
  margin: 0 auto clamp(2rem, 6vw, 3rem);
}
.hero__photo .frame img { aspect-ratio: 4 / 5; }

.hero__note {
  margin-inline: auto;
  font-size: 1.06em;
}

/* ---------- sections ---------- */
.section { padding-block: var(--section); }
.section--film { padding-top: 0; }

.section-head {
  text-align: center;
  margin-bottom: clamp(2.2rem, 7vw, 3.5rem);
}
.section-head h2 {
  font-size: clamp(1.95rem, 7.5vw, 3.1rem);
  margin-top: .5rem;
}
.section-head .rule { margin-bottom: 0; }
.section-head__note {
  margin: clamp(1.2rem, 4vw, 1.75rem) auto 0;
  text-align: center;
}

/* ---------- galleries ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
}

@media (min-width: 760px) {
  .gallery { grid-template-columns: repeat(3, 1fr); }
}

.tile { min-width: 0; }

.tile__btn {
  display: block;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}
.tile__btn .frame { transition: border-color .45s var(--ease); }
.tile__btn img {
  aspect-ratio: 4 / 5;
  transition: transform .6s var(--ease), filter .45s var(--ease);
}

/* a wide tile spans the full row — gives the grid some editorial rhythm */
.tile--wide { grid-column: 1 / -1; }
.tile--wide img { aspect-ratio: 3 / 2; }

@media (hover: hover) {
  .tile__btn:hover .frame { border-color: var(--terracotta); }
  .tile__btn:hover img { transform: scale(1.028); filter: saturate(1.04); }
}
.tile__btn:active img { transform: scale(.995); }

.tile__cap {
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(.58rem, .55rem + .15vw, .66rem);
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--label);
  text-align: center;
  margin-top: .85rem;
  line-height: 1.6;
}

/* ---------- honeymoon location groups ---------- */
.place + .place { margin-top: clamp(3.5rem, 11vw, 6rem); }

.place__head {
  text-align: center;
  margin-bottom: clamp(1.5rem, 5vw, 2.25rem);
}
.place__head h3 {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.55rem, 6vw, 2.35rem);
  line-height: 1.15;
  margin-top: .35rem;
  color: var(--terracotta);
}
.place__blurb {
  margin: .85rem auto 0;
  text-align: center;
  font-style: italic;
  font-size: .97em;
}

/* ---------- film ---------- */
.film { max-width: 900px; margin-inline: auto; }
.film .frame { padding: clamp(5px, 1.2vw, 9px); }
.film video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #241a14;
  display: block;
}

.film__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .9rem;
  aspect-ratio: 16 / 9;
  background: var(--cream-deep);
  color: var(--terracotta-deep);
  text-align: center;
  padding: 1.5rem;
}
.film__placeholder .play {
  width: clamp(44px, 9vw, 60px);
  aspect-ratio: 1;
  border: 1px solid currentColor;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: .8rem;
  opacity: .8;
}
.film__cap {
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(.6rem, .56rem + .15vw, .68rem);
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--label);
  text-align: center;
  margin-top: 1rem;
}

/* ---------- footer ---------- */
.footer { text-align: center; }

.footer .wrap { padding-bottom: clamp(3rem, 9vw, 4.5rem); }

.footer__script {
  font-style: italic;
  font-size: clamp(1.8rem, 7vw, 2.75rem);
  color: var(--terracotta);
  margin-bottom: clamp(1.2rem, 4vw, 1.75rem);
}

.footer__note { margin-inline: auto; }

.footer__sig {
  font-size: clamp(1.3rem, 5vw, 1.85rem);
  margin-top: clamp(1.75rem, 5vw, 2.5rem);
  color: var(--ink);
}

/* terracotta band — echoes the QR strip on the back of the card */
.band {
  background: var(--terracotta-band);
  color: #fff;
  text-align: center;
  padding: clamp(1.75rem, 6vw, 2.5rem) var(--gutter);
  padding-bottom: calc(clamp(1.75rem, 6vw, 2.5rem) + env(safe-area-inset-bottom, 0px));
}
.band__label { color: rgba(255, 255, 255, .92); }
.band__url {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.25rem, 5.5vw, 1.75rem);
  margin-top: .5rem;
  letter-spacing: .01em;
}

/* ---------- lightbox ---------- */
.lb {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: #2a1e17;
  padding: clamp(1rem, 4vw, 2.5rem);
  padding-top: calc(clamp(3.5rem, 10vw, 4rem) + env(safe-area-inset-top, 0px));
  padding-bottom: calc(clamp(1rem, 4vw, 2.5rem) + env(safe-area-inset-bottom, 0px));
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.lb.is-open { opacity: 1; }

.lb__stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(1000px, 100%);
  max-height: 100%;
}

.lb__frame {
  padding: clamp(5px, 1.2vw, 9px);
  background: var(--cream-lift);
  border: 1px solid var(--terracotta-line);
  min-height: 0;
}
.lb__img {
  max-width: 100%;
  max-height: min(68vh, 760px);
  width: auto;
  height: auto;
  object-fit: contain;
  transition: opacity .22s var(--ease);
}
.lb.is-swapping .lb__img { opacity: 0; }

.lb__cap {
  margin-top: clamp(.9rem, 3vw, 1.35rem);
  text-align: center;
  display: grid;
  gap: .4rem;
  max-width: 44ch;
}
.lb__place { color: rgba(245, 236, 225, .72); }
.lb__alt {
  color: rgba(245, 236, 225, .95);
  max-width: none;
  font-size: .97em;
  line-height: 1.55;
}
.lb__count {
  font-family: var(--sans);
  font-weight: 300;
  font-size: .68rem;
  letter-spacing: .24em;
  color: rgba(245, 236, 225, .5);
}

.lb__close,
.lb__nav {
  position: absolute;
  color: #f5ece1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(245, 236, 225, .28);
  border-radius: 50%;
  background: rgba(38, 27, 20, .45);
  transition: background .3s var(--ease), border-color .3s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.lb__close:hover,
.lb__nav:hover {
  background: var(--terracotta);
  border-color: var(--terracotta);
}

.lb__close {
  top: calc(env(safe-area-inset-top, 0px) + .9rem);
  right: .9rem;
  width: 44px;
  height: 44px;
  font-size: 1.05rem;
}

.lb__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  font-size: 1.9rem;
  line-height: 1;
  padding-bottom: .2em;
}
.lb__nav--prev { left: .6rem; }
.lb__nav--next { right: .6rem; }

@media (min-width: 900px) {
  .lb__nav { width: 56px; height: 56px; }
  .lb__nav--prev { left: 1.75rem; }
  .lb__nav--next { right: 1.75rem; }
}

/* On narrow phones the arrows would sit on top of the photo — swiping
   is the primary gesture there, so move them below the caption. */
@media (max-width: 560px) {
  .lb__nav {
    top: auto;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 1rem);
    transform: none;
  }
  .lb__nav--prev { left: 25%; }
  .lb__nav--next { right: 25%; }
  .lb__img { max-height: 58vh; }
  .lb { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 5.5rem); }
}

body.lb-open { overflow: hidden; }

/* ---------- scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .85s var(--ease), transform .85s var(--ease);
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
