/* Joseph & Filiz — dannawedding2027.com
   Marble, ink and evergreen. Libre Caslon: the face of the founding-era
   printed page, chosen for Washington and Cedarhurst's classical lines. */

:root {
  --marble: #f2f1ec;
  --marble-deep: #e3e0d7;
  --vein: #a9a59b;
  --stone: #5e5a52;
  --ink: #1a1918;
  --evergreen: #2e3a31;

  --display: "Libre Caslon Display", "Libre Caslon Text", Georgia, serif;
  --text: "Libre Caslon Text", Georgia, serif;

  --gutter: clamp(16px, 5vw, 72px);
  --measure: 34rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--marble);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
figure { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--evergreen); outline-offset: 3px; }

h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; line-height: 1.1; }
h2 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); letter-spacing: -0.01em; }
h3 { font-family: var(--text); font-style: italic; font-size: 1.35rem; }
p { margin: 0 0 1em; max-width: var(--measure); }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  transition: background .35s ease, box-shadow .35s ease;
}
.nav.scrolled { background: rgba(242, 241, 236, .94); box-shadow: 0 1px 0 var(--marble-deep); backdrop-filter: blur(6px); }
.monogram { font-family: var(--display); font-size: 1.5rem; text-decoration: none; letter-spacing: .04em; }
.monogram span { font-family: var(--text); font-style: italic; font-size: .8em; margin: 0 .12em; color: var(--stone); }
.nav-links { display: flex; gap: clamp(16px, 2.4vw, 36px); }
.nav-links a { text-decoration: none; font-size: .95rem; padding: 4px 0; border-bottom: 1px solid transparent; }
.nav-links a:hover { border-bottom-color: currentColor; }
.nav-rsvp { font-style: italic; }
.nav-toggle { display: none; }

@media (max-width: 760px) {
  .nav-toggle {
    display: block; font: inherit; font-size: .95rem; background: none; border: 1px solid var(--ink);
    color: var(--ink); padding: 6px 14px; border-radius: 999px; cursor: pointer;
  }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--marble); padding: 8px var(--gutter) 20px; box-shadow: 0 1px 0 var(--marble-deep);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 0; font-size: 1.1rem; border-bottom: 1px solid var(--marble-deep); }
}

/* ---------- Hero ---------- */
.hero { position: relative; height: 100svh; min-height: 560px; overflow: hidden; background: var(--marble-deep); }
.hero picture, .hero img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero img { object-fit: cover; object-position: 40% 62%; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(242,241,236,.55) 0%, rgba(242,241,236,0) 42%);
  pointer-events: none;
}
.hero-text {
  position: absolute; z-index: 1; left: 0; right: 0; top: clamp(96px, 15vh, 170px);
  text-align: center; padding: 0 var(--gutter);
}
.frieze {
  font-size: clamp(2.6rem, 8.4vw, 7.4rem);
  text-transform: uppercase; letter-spacing: .14em;
  line-height: 1; margin-right: -.14em; /* balance trailing tracking */
}
.frieze .amp { font-family: var(--text); font-style: italic; text-transform: none; letter-spacing: 0; font-size: .62em; color: var(--stone); vertical-align: .12em; margin: 0 .1em 0 0; }
.hero-sub { font-style: italic; font-size: clamp(1.1rem, 1.8vw, 1.45rem); margin: 1.1rem auto .2rem; max-width: none; }
.hero-date { font-size: clamp(1rem, 1.4vw, 1.15rem); letter-spacing: .08em; margin: 0 auto; max-width: none; }

@media (prefers-reduced-motion: no-preference) {
  .frieze span:not(.amp) { display: inline-block; animation: settle 1.8s cubic-bezier(.2,.7,.2,1) both; }
  .frieze span:last-child { animation-delay: .15s; }
  .frieze .amp, .hero-sub, .hero-date { animation: appear 1.4s ease .9s both; }
  body.intro-active .frieze span, body.intro-active .hero-sub, body.intro-active .hero-date { animation-play-state: paused; }
  @keyframes settle { from { opacity: 0; letter-spacing: .4em; } to { opacity: 1; letter-spacing: .14em; } }
  @keyframes appear { from { opacity: 0; } to { opacity: 1; } }
}

@media (max-width: 700px) {
  .hero img { object-position: 24% 60%; }
  .frieze span:not(.amp) { display: block; }
  .frieze .amp { display: block; margin: .15em 0; }
}

/* ---------- Save the date ---------- */
.save {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: end;
  padding: clamp(80px, 12vw, 160px) var(--gutter) clamp(64px, 9vw, 120px);
  max-width: 1320px; margin: 0 auto;
}
.kicker { font-style: italic; color: var(--stone); margin-bottom: 1.2rem; }
.display-date { font-size: clamp(2.3rem, 5.4vw, 4.6rem); line-height: 1.08; }
.facts { margin: 0 0 2rem; }
.facts div { padding: 14px 0; border-top: 1px solid var(--vein); }
.facts div:last-child { border-bottom: 1px solid var(--vein); }
.facts dt { font-style: italic; color: var(--stone); font-size: .95rem; }
.facts dd { margin: 0; font-size: 1.15rem; }
.countdown { font-family: var(--display); font-size: 1.6rem; margin-bottom: .3rem; }
.note { color: var(--stone); font-style: italic; }

@media (max-width: 860px) { .save { grid-template-columns: 1fr; align-items: start; } }

/* ---------- Gallery ---------- */
.gallery {
  display: grid; grid-template-columns: 7fr 5fr; gap: clamp(12px, 2vw, 28px);
  padding: 0 var(--gutter); max-width: 1320px; margin: 0 auto;
}
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.g-portrait { aspect-ratio: 4 / 5; }
.g-garden { aspect-ratio: 2 / 3; align-self: end; margin-bottom: clamp(-80px, -6vw, -24px); }
@media (max-width: 640px) {
  .gallery { grid-template-columns: 1fr 1fr; }
  .g-garden { margin-bottom: 0; }
}

/* ---------- Story ---------- */
.story {
  display: grid; grid-template-columns: 5fr 6fr; gap: clamp(32px, 7vw, 110px); align-items: center;
  padding: clamp(110px, 14vw, 200px) var(--gutter) clamp(80px, 10vw, 140px);
  max-width: 1320px; margin: 0 auto;
}
.story-photo { aspect-ratio: 2 / 3; overflow: hidden; }
.story-photo img { width: 100%; height: 100%; object-fit: cover; }
.story-text h2 { margin-bottom: 1.6rem; }
.sign { font-style: italic; color: var(--stone); margin-top: 1.8rem; }
@media (max-width: 820px) {
  .story { grid-template-columns: 1fr; }
  .story-photo { max-width: 420px; }
}

/* ---------- Weekend ---------- */
.weekend { background: var(--marble-deep); padding: clamp(80px, 11vw, 150px) var(--gutter); }
.weekend > h2, .weekend > .lede { max-width: 1320px; margin-left: auto; margin-right: auto; }
.weekend > h2 { margin-bottom: 1.2rem; }
.weekend > .lede { margin-bottom: clamp(40px, 6vw, 72px); }
.weekend > .lede { max-width: min(1320px, 100%); }
.lede { font-size: 1.15rem; }
.venues {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 4vw, 56px);
  max-width: 1320px; margin: 0 auto; align-items: end;
}
.venue h3 { border-top: 1px solid var(--ink); padding-top: 22px; }
.venue h3 { margin-bottom: .2rem; }
.venue-when { color: var(--stone); font-size: .95rem; margin-bottom: .8rem; }
.venue-plate, .venue img {
  aspect-ratio: 3 / 2; width: 100%; object-fit: cover; margin-bottom: 26px;
}
.venue-plate {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem;
  background: var(--evergreen); color: var(--marble); text-align: center;
  outline: 1px solid rgba(242,241,236,.35); outline-offset: -14px;
}
.plate-name { font-family: var(--display); font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: .12em; text-transform: uppercase; margin-right: -.12em; }
.plate-est { font-style: italic; opacity: .8; }
.plate-ceremony { background: var(--marble); color: var(--ink); outline-color: var(--vein); }
@media (max-width: 760px) { .venues { grid-template-columns: 1fr; } }

/* ---------- Travel ---------- */
.travel { padding: clamp(80px, 11vw, 150px) var(--gutter); }
.travel-inner { max-width: 1320px; margin: 0 auto; display: grid; grid-template-columns: 5fr 6fr; gap: clamp(24px, 6vw, 96px); }
.travel strong { font-weight: 400; font-style: italic; }
@media (max-width: 820px) { .travel-inner { grid-template-columns: 1fr; } }

/* ---------- Closing / RSVP ---------- */
.closing { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: var(--ink); color: var(--marble); }
.closing img { width: 100%; height: 100%; max-height: 90vh; object-fit: cover; object-position: 50% 20%; }
.closing-text { align-self: center; padding: clamp(48px, 7vw, 110px) var(--gutter); }
.closing-text h2 { margin-bottom: 1.4rem; }
@media (max-width: 760px) {
  .closing { grid-template-columns: 1fr; }
  .closing img { aspect-ratio: 4 / 5; max-height: none; }
}

/* ---------- Footer ---------- */
.footer { text-align: center; padding: 64px var(--gutter) 72px; color: var(--stone); }
.footer p { margin: 0 auto .3rem; max-width: none; }
.footer-mono { font-size: 2.2rem; color: var(--ink); margin-bottom: 1rem !important; }
.footer-date { font-style: italic; }

/* ---------- Envelope intro ---------- */
body.intro-active { overflow: hidden; }
body.revealed .intro { display: none; }
.intro {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  /* A frosted veil over the site itself, which clears once the card is out. */
  background: rgba(242, 241, 236, .38);
  -webkit-backdrop-filter: blur(26px) saturate(.9);
  backdrop-filter: blur(26px) saturate(.9);
  transition: background 1.5s ease, -webkit-backdrop-filter 1.5s ease, backdrop-filter 1.5s ease, opacity .6s ease 1.1s;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .intro { background: rgba(227, 224, 215, .96); }
}
.intro.leaving {
  background: rgba(242, 241, 236, 0);
  -webkit-backdrop-filter: blur(0) saturate(1); backdrop-filter: blur(0) saturate(1);
  opacity: 0; pointer-events: none;
}
.intro .envelope, .intro-hint { transition: opacity .7s ease, transform .9s cubic-bezier(.4,0,.2,1); }
.intro.leaving .envelope { opacity: 0; transform: translateY(-18px) scale(.97); }
.envelope { position: relative; width: min(86vw, 540px); aspect-ratio: 3 / 2; perspective: 1600px; }
.env-back, .env-front, .env-flap-wrap, .letter { position: absolute; }
.env-back { inset: 0; background: #d8d1c1; box-shadow: 0 30px 60px -30px rgba(40, 35, 25, .45); }
.letter {
  left: 5%; right: 5%; top: 6%; bottom: 5%; z-index: 2;
  background: #fbfaf6; text-align: center; padding: 5% 8% 0;
  box-shadow: 0 0 0 1px rgba(0,0,0,.04);
  transition: transform 1.2s cubic-bezier(.3,.7,.2,1);
}
.letter p { margin-left: auto; margin-right: auto; max-width: none; }
.letter-kicker { font-style: italic; color: var(--stone); font-size: clamp(.72rem, 1.9vw, .9rem); margin-bottom: .5em; }
.letter-names { font-family: var(--display); font-size: clamp(1.35rem, 4.2vw, 2.1rem); line-height: 1.1; margin-bottom: 0; }
.letter-names em { font-family: var(--text); color: var(--stone); font-size: .75em; }
.letter-rule { display: block; width: 28px; height: 1px; background: var(--vein); margin: .7em auto; }
.letter-date { font-size: clamp(.8rem, 2.1vw, 1rem); margin-bottom: .15em; }
.letter-place { font-size: clamp(.72rem, 1.9vw, .9rem); color: var(--stone); margin-bottom: .7em; }
.letter-note { font-style: italic; font-size: clamp(.68rem, 1.7vw, .82rem); color: var(--stone); margin-bottom: 0; }
.env-front {
  inset: 0; z-index: 3; background: #e8e2d4;
  clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%);
}
.env-front::after {
  content: ""; position: absolute; inset: 0; background: #e2dbcb;
  clip-path: polygon(0 100%, 50% 50%, 100% 100%);
}
.env-flap-wrap { left: 0; right: 0; top: 0; height: 60%; z-index: 4; transform-origin: 50% 0; transition: transform .9s cubic-bezier(.4,.1,.3,1); filter: drop-shadow(0 3px 3px rgba(40,35,25,.18)); }
.env-flap { position: absolute; inset: 0; background: #eee9de; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.seal {
  position: absolute; z-index: 5; left: 50%; top: 60%; width: 24%; aspect-ratio: 1;
  transform: translate(-50%, -50%); padding: 0; border: 0; background: none; cursor: pointer;
  border-radius: 50%; filter: drop-shadow(0 4px 5px rgba(20, 25, 20, .35));
  transition: transform .3s ease;
}
.seal:hover { transform: translate(-50%, -50%) scale(1.04); }
.seal svg { width: 100%; height: 100%; overflow: visible; display: block; }
.half { transform-box: fill-box; transform-origin: 50% 50%; }
.intro-hint { font-style: italic; color: var(--stone); margin: 0; max-width: none; transition: opacity .4s ease; }

@media (prefers-reduced-motion: no-preference) {
  .intro:not(.cracking) .seal { animation: breathe 3.2s ease-in-out infinite; }
  @keyframes breathe { 50% { transform: translate(-50%, -50%) scale(1.035); } }
}

.half { opacity: 0; }
.intro.cracking .seal { cursor: default; outline: none; visibility: hidden; transition: visibility 0s 1s; }
.intro.cracking .whole { opacity: 0; }
.intro.cracking .half { opacity: 1; }
.intro.cracking .half { animation: none; }
.intro.cracking .half-l { animation: fallL .9s cubic-bezier(.3,.6,.4,1) forwards; }
.intro.cracking .half-r { animation: fallR .9s cubic-bezier(.3,.6,.4,1) forwards; }
@keyframes fallL { 0% { transform: none; opacity: 1; } 20% { transform: translate(-4%, 0) rotate(-4deg); opacity: 1; } 100% { transform: translate(-24%, 32%) rotate(-26deg); opacity: 0; } }
@keyframes fallR { 0% { transform: none; opacity: 1; } 20% { transform: translate(4%, 0) rotate(4deg); opacity: 1; } 100% { transform: translate(24%, 36%) rotate(22deg); opacity: 0; } }
.intro.cracking .intro-hint { opacity: 0; }
.intro.opening .env-flap-wrap { transform: rotateX(180deg); }
.intro.flap-behind .env-flap-wrap { z-index: 1; }
.intro.rising .letter { transform: translateY(-62%); }

/* ---------- Music toggle ---------- */
.sound {
  position: fixed; right: 18px; bottom: 18px; z-index: 20;
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: .9rem; color: var(--ink);
  background: rgba(242, 241, 236, .92); border: 1px solid var(--vein); border-radius: 999px;
  padding: 8px 14px 8px 11px; cursor: pointer; backdrop-filter: blur(6px);
}
.sound svg { width: 18px; height: 18px; }
.sound[aria-pressed="false"] .waves { opacity: .2; }
.sound[hidden] { display: none; }

/* ---------- Spotify "now playing" card ---------- */
.np {
  position: fixed; right: 16px; bottom: 16px; z-index: 20;
  width: min(320px, calc(100vw - 32px)); border-radius: 14px; overflow: hidden;
  box-shadow: 0 10px 30px -12px rgba(26, 25, 24, .45);
  transition: opacity .6s ease, transform .6s ease;
}
.np[hidden] { display: block; opacity: 0; transform: translateY(12px); pointer-events: none; }
.np iframe { display: block; border: 0; }

/* ---------- Our song (YouTube player) ---------- */
.our-song { margin: 2.2rem 0 0; }
.our-song-player { position: relative; aspect-ratio: 16 / 9; min-height: 200px; background: var(--ink); }
.our-song-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.our-song figcaption { margin-top: .6rem; font-size: .92rem; color: var(--stone); }
.our-song figcaption em { color: var(--ink); }

/* ---------- Pages (tabs) ---------- */
.view[hidden] { display: none; }
.nav-links a[aria-current="page"] { border-bottom-color: currentColor; }
.page-head {
  max-width: 1320px; margin: 0 auto;
  padding: clamp(130px, 16vw, 200px) var(--gutter) clamp(48px, 7vw, 96px);
}
.page-title { font-family: var(--display); font-weight: 400; font-size: clamp(2.6rem, 6.4vw, 5.4rem); line-height: 1.04; letter-spacing: -.01em; max-width: 16ch; }
.page-lede { font-size: 1.2rem; margin-top: 1.4rem; }

/* Photo slots: show the image if it exists, otherwise the engraved plate */
.slot { position: relative; margin: 0; overflow: hidden; }
.slot > img, .slot > .venue-plate { width: 100%; height: 100%; object-fit: cover; margin: 0; }
.slot > .venue-plate { display: none; }
.slot.missing > img { display: none; }
.slot.missing > .venue-plate { display: flex; }
.venue .slot { aspect-ratio: 3 / 2; margin-bottom: 26px; }
.more { display: inline-block; margin-top: .2rem; font-style: italic; text-decoration: none; border-bottom: 1px solid var(--vein); padding-bottom: 2px; }
.more:hover { border-bottom-color: var(--ink); }

/* Story chapters */
.chapters { list-style: none; margin: 0 auto; padding: 0 var(--gutter) clamp(80px, 10vw, 140px); max-width: 1320px; }
.chapter {
  display: grid; grid-template-columns: 5fr 6fr; gap: clamp(32px, 7vw, 110px); align-items: center;
  padding: clamp(40px, 6vw, 80px) 0;
}
.chapter + .chapter { border-top: 1px solid var(--marble-deep); }
.chapter:nth-child(even) .chapter-photo { order: 2; }
.chapter-photo { aspect-ratio: 4 / 5; overflow: hidden; margin: 0; }
.chapter-photo > img { width: 100%; height: 100%; object-fit: cover; }
.chapter-when { font-style: italic; color: var(--stone); margin-bottom: .6rem; }
.chapter-text h2 { margin-bottom: 1.3rem; }
@media (max-width: 820px) {
  .chapter { grid-template-columns: 1fr; }
  .chapter:nth-child(even) .chapter-photo { order: 0; }
  .chapter-photo { max-width: 460px; }
}

/* Wedding page */
.feature {
  display: grid; grid-template-columns: 6fr 5fr; gap: clamp(32px, 6vw, 96px); align-items: center;
  max-width: 1320px; margin: 0 auto; padding: 0 var(--gutter) clamp(64px, 8vw, 110px);
}
.feature-flip .feature-photo { order: 2; }
.feature-photo { aspect-ratio: 4 / 3; }
.feature-text h2 { margin-bottom: 1.4rem; }
.feature-text .facts { margin-bottom: 1.6rem; }
@media (max-width: 860px) {
  .feature { grid-template-columns: 1fr; }
  .feature-flip .feature-photo { order: 0; }
}

.rite {
  display: grid; grid-template-columns: 7fr 4fr; gap: clamp(32px, 6vw, 96px);
  max-width: 1320px; margin: 0 auto clamp(80px, 10vw, 140px); padding: 0 var(--gutter);
}
.rite-steps { list-style: none; margin: 0; padding: 0; counter-reset: rite; }
.rite-steps li {
  counter-increment: rite; position: relative;
  padding: 22px 0 18px 4.2rem; border-top: 1px solid var(--vein);
}
.rite-steps li:last-child { border-bottom: 1px solid var(--vein); }
.rite-steps li::before {
  content: counter(rite, upper-roman); position: absolute; left: 0; top: 18px;
  font-family: var(--display); font-size: 1.6rem; color: var(--stone);
}
.rite-steps h3 { margin-bottom: .4rem; }
.rite-steps p { margin-bottom: 0; }
.rite-notes { align-self: start; background: var(--marble-deep); padding: 28px 30px; }
.rite-notes h3 { margin-bottom: .7rem; }
.rite-notes p { margin: 0; }
@media (max-width: 860px) { .rite { grid-template-columns: 1fr; } }

.history { background: var(--evergreen); color: var(--marble); padding: clamp(80px, 11vw, 150px) var(--gutter); }
.history-inner { max-width: 40rem; margin: 0 auto; }
.history h2 { margin-bottom: 1.8rem; }
.history p { font-size: 1.12rem; }
.history-note { font-style: italic; opacity: .8; margin-top: 2rem; padding-top: 1.6rem; border-top: 1px solid rgba(242,241,236,.3); }

.closing-page { min-height: 100svh; }
.closing-page img { max-height: none; }
.closing-page .page-title { color: var(--marble); margin-bottom: 1.4rem; }

/* Crowning excerpt, portrait photo, diptych, credits */
.feature-photo.feature-portrait { aspect-ratio: 9 / 16; max-width: 340px; justify-self: center; }
.crowning { background: var(--ink); color: var(--marble); padding: clamp(72px, 10vw, 130px) var(--gutter); margin-bottom: clamp(64px, 8vw, 110px); }
.crowning-inner { max-width: 40rem; margin: 0 auto; }
.crowning h2 { margin-bottom: 1.6rem; }
.crowning p { font-size: 1.12rem; }
.more-light { color: var(--marble); border-bottom-color: rgba(242,241,236,.4); margin-top: .8rem; }
.more-light:hover { border-bottom-color: var(--marble); }
.diptych { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 0 0 2.2rem; }
.diptych figure { margin: 0; }
.diptych img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.diptych figcaption { font-style: italic; font-size: .88rem; opacity: .75; margin-top: .5rem; }
@media (max-width: 560px) { .diptych { grid-template-columns: 1fr; } }
.credits { font-size: .78rem; margin-top: 1.4rem !important; opacity: .8; }
