:root {
  --paper: #f8f5ef;
  --paper-2: #efe9de;
  --ink: #292b23;
  --olive: #626848;
  --olive-deep: #343a2c;
  --wine: #68182e;
  --wine-deep: #4e1022;
  --line: rgba(56, 58, 43, .18);
  --serif: "Cormorant Garamond", Georgia, serif;
  --script: "Pinyon Script", cursive;
  --sans: "DM Sans", Arial, sans-serif;
  --shadow: 0 30px 80px rgba(49, 42, 34, .16), 0 4px 18px rgba(49, 42, 34, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--serif); font-size: 18px; overflow-x: hidden; }
body.is-locked { overflow: hidden; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }

.ambient { position: fixed; z-index: -2; width: 42vw; height: 42vw; border-radius: 50%; filter: blur(100px); opacity: .12; pointer-events: none; }
.ambient-one { left: -18vw; top: 24vh; background: #9ea185; }
.ambient-two { right: -19vw; bottom: 6vh; background: #9c5261; }

/* Opening invitation */
.opening { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; background: #fbfaf6; transition: opacity .7s ease, visibility .7s ease; }
.opening::before { content: ""; position: absolute; inset: 0; background: url("assets/painting.webp") center top/cover no-repeat; opacity: .08; filter: blur(3px); }
.opening.is-open { opacity: 0; visibility: hidden; pointer-events: none; }
.opening-card { position: relative; z-index: 1; width: min(860px, 95vw); border: 0; padding: 0; cursor: pointer; background: transparent; box-shadow: 0 24px 75px rgba(43, 37, 29, .12); transform: translateY(0); transition: transform .35s ease, box-shadow .35s ease; }
.opening-card:hover { transform: translateY(-5px); box-shadow: 0 30px 90px rgba(43, 37, 29, .18); }
.opening-card img { width: 100%; height: auto; object-fit: contain; }
.tap-hint { position: absolute; left: 50%; bottom: 4.5%; transform: translateX(-50%); padding: 7px 13px; border-radius: 999px; font: 500 9px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: #fff; background: rgba(52,58,44,.88); opacity: 0; transition: opacity .25s; }
.opening-card:hover .tap-hint { opacity: 1; }

/* Navigation */
.topbar { position: sticky; top: 0; z-index: 100; height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 34px; border-bottom: 1px solid rgba(71,71,55,.12); background: rgba(248,245,239,.88); backdrop-filter: blur(16px); }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.seal { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #f9f1ed; background: radial-gradient(circle at 35% 28%, #995467 0 13%, #6f1c34 38%, #45101f 100%); box-shadow: inset 0 0 0 2px rgba(255,255,255,.16), 0 2px 7px rgba(61,21,31,.24); font: 500 10px var(--serif); letter-spacing: .02em; }
.seal span { margin: 0 1px; font-size: 8px; opacity: .75; }
.brand-name { font-size: 18px; letter-spacing: .015em; }
.topbar nav { display: flex; align-items: center; gap: 26px; }
.topbar nav a, .topbar nav button { border: 0; padding: 7px 0; color: #4c4d40; background: none; text-decoration: none; cursor: pointer; font: 500 9px var(--sans); letter-spacing: .17em; text-transform: uppercase; }
.topbar nav button { color: var(--wine); }
.topbar nav a:hover, .topbar nav button:hover { color: var(--wine); }
.menu { display: none; width: 42px; height: 42px; border: 0; background: transparent; }
.menu span { display: block; width: 21px; height: 1px; margin: 6px auto; background: var(--ink); transition: .2s; }

.micro { margin: 0; color: #6e6b61; text-align: center; font: 500 9px var(--sans); letter-spacing: .19em; text-transform: uppercase; }

/* Main invitation art */
.invitation-view { min-height: calc(100svh - 72px); padding: 48px 22px 86px; }
.intro-line { margin-bottom: 20px; }
.invitation-shell { position: relative; width: min(760px, 100%); margin: 0 auto; background: white; box-shadow: var(--shadow); }
.home-art { width: 100%; height: auto; }
.scroll-line { margin-top: 24px; }
.hotspot { position: absolute; z-index: 5; border: 0; background: transparent; cursor: pointer; text-decoration: none; }
.hotspot span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hotspot::after { content: ""; position: absolute; inset: 0; border-radius: inherit; transition: .2s ease; }
.hotspot:hover::after { background: rgba(255,255,255,.09); box-shadow: 0 0 0 1px rgba(104,24,46,.22); }
.hotspot-details { left: 55%; top: 42.5%; width: 28%; height: 13%; border-radius: 50%; }
.hotspot-rsvp { left: 20%; top: 49%; width: 29%; height: 17%; }
.hotspot-story { left: 17%; top: 64%; width: 56%; height: 22%; }

/* Shared painted title bars */
.paint-header { position: relative; min-height: 330px; display: grid; place-items: center; overflow: hidden; color: #fff; background: url("assets/painting.webp") center 58%/cover no-repeat; }
.paint-header::before { content: ""; position: absolute; inset: -20px; background: inherit; transform: scale(1.08); filter: saturate(.85) contrast(.94); }
.paint-shade { position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(35,39,30,.20), rgba(35,39,30,.46)); }
.paint-header h2 { position: relative; z-index: 2; margin: 20px 0 0; text-align: center; text-transform: uppercase; font-size: clamp(48px, 7vw, 82px); font-weight: 400; line-height: .78; letter-spacing: .02em; text-shadow: 0 2px 20px rgba(27,28,24,.25); }
.paint-header h2 em { display: block; margin-top: 8px; font: 400 1.05em/1 var(--script); text-transform: none; letter-spacing: 0; }
.back-link { position: absolute; z-index: 3; top: 34px; left: 50%; transform: translateX(-50%); padding-bottom: 4px; border-bottom: 1px solid rgba(255,255,255,.55); color: rgba(255,255,255,.90); text-decoration: none; font: 500 8px var(--sans); letter-spacing: .18em; text-transform: uppercase; white-space: nowrap; }

/* Story */
.story-section { background: rgba(255,255,255,.54); }
.story-inner { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 110px 0 125px; display: grid; grid-template-columns: minmax(320px,.94fr) minmax(330px,.8fr); gap: clamp(55px, 8vw, 120px); align-items: center; }
.story-art { margin: 0; }
.story-art img { width: 100%; height: auto; object-fit: contain; filter: drop-shadow(0 26px 38px rgba(52,42,36,.12)); }
.story-copy { position: relative; max-width: 480px; font-size: clamp(19px, 1.55vw, 23px); line-height: 1.47; }
.story-copy p { margin: 0 0 24px; }
.story-copy p:first-of-type::first-letter { float: left; padding: 4px 8px 0 0; color: var(--wine); font-size: 73px; line-height: .74; font-family: var(--script); }
.chapter-mark { display: inline-block; margin-bottom: 22px; color: var(--wine); font: 500 9px var(--sans); letter-spacing: .2em; }
.signature { margin-top: 30px; color: var(--wine); font: 400 64px/1 var(--script); }
.signature span { color: var(--olive); font-size: .55em; }

/* Details */
.details-section { background: var(--paper); }
.paint-header-details { min-height: 300px; }
.details-inner { width: min(1050px, calc(100% - 40px)); margin: 0 auto; padding: 100px 0 120px; }
.details-intro { max-width: 640px; margin: 0 auto 70px; text-align: center; }
.eyebrow { margin: 0 0 10px; color: var(--olive); font: 500 9px var(--sans); letter-spacing: .2em; text-transform: uppercase; }
.details-intro h3 { margin: 8px 0 18px; font-size: clamp(42px, 6vw, 72px); line-height: .94; font-weight: 400; text-transform: uppercase; }
.details-intro > p:last-child { margin: 0 auto; max-width: 540px; color: #5f5d54; font-size: 21px; line-height: 1.5; }
.detail-list { display: grid; grid-template-columns: repeat(3,1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.detail-list article { min-height: 280px; padding: 35px 34px 38px; border-right: 1px solid var(--line); }
.detail-list article:last-child { border-right: 0; }
.detail-list article > span { color: rgba(104,24,46,.55); font: 500 9px var(--sans); letter-spacing: .18em; }
.detail-list h4 { margin: 48px 0 10px; font-size: 34px; font-weight: 500; }
.detail-list p { margin: 0; color: #656258; line-height: 1.45; }
.gratitude { max-width: 700px; margin: 76px auto 0; text-align: center; font-size: 24px; line-height: 1.45; }
.script-line { margin: 13px 0 0; color: var(--wine); text-align: center; font: 400 43px var(--script); }

/* RSVP */
.rsvp-section { padding: 110px 20px; background: #f1ece3; }
.rsvp-card { position: relative; width: min(670px, 100%); margin: 0 auto; padding: 82px 30px 72px; border: 1px solid rgba(88,72,56,.24); background: #fbf8f2; text-align: center; box-shadow: 0 20px 60px rgba(62,49,38,.08); }
.rsvp-card::before, .rsvp-card::after { content: ""; position: absolute; inset: 12px; border: 1px solid rgba(88,72,56,.18); pointer-events: none; }
.rsvp-card::after { inset: 18px; border-color: rgba(88,72,56,.10); }
.wax-mini { position: relative; z-index: 2; width: 54px; height: 54px; display: grid; place-items: center; margin: -109px auto 40px; border-radius: 50%; color: #f4dce2; background: radial-gradient(circle at 35% 28%, #9b5368 0 12%, #701d35 40%, #45101f 100%); box-shadow: 0 5px 13px rgba(72,20,35,.22); font: 500 11px var(--serif); }
.rsvp-card h2 { margin: -4px 0 4px; color: var(--wine); font: 400 clamp(78px, 12vw, 122px)/.9 var(--script); }
.rsvp-card > p:not(.eyebrow) { margin: 10px auto 30px; color: #636057; font-size: 21px; }
.rsvp-button { position: relative; z-index: 3; display: inline-flex; justify-content: center; align-items: center; min-width: 180px; min-height: 48px; border: 1px solid var(--wine); padding: 13px 24px; color: #fff; background: var(--wine); text-decoration: none; cursor: pointer; font: 500 9px var(--sans); letter-spacing: .18em; text-transform: uppercase; transition: .2s; }
.rsvp-button:hover { background: var(--wine-deep); transform: translateY(-1px); }

/* Footer */
.footer { position: relative; min-height: 360px; display: grid; place-items: center; overflow: hidden; color: #fff; background: url("assets/painting.webp") center 60%/cover no-repeat; text-align: center; }
.footer::before { content: ""; position: absolute; inset: -20px; background: inherit; transform: scale(1.08); filter: saturate(.8); }
.footer-shade { position: absolute; inset: 0; z-index: 1; background: rgba(33,38,30,.55); }
.footer-copy { position: relative; z-index: 2; }
.footer-copy p { margin: 0 0 5px; font: 400 34px var(--script); }
.footer-copy h2 { margin: 0; font-size: clamp(40px, 6vw, 68px); font-weight: 400; letter-spacing: .03em; }
.footer-copy h2 span { color: #e5bdc8; font-family: var(--script); font-weight: 400; }
.footer-copy a { display: inline-block; margin-top: 24px; padding-bottom: 4px; border-bottom: 1px solid rgba(255,255,255,.55); text-decoration: none; font: 500 8px var(--sans); letter-spacing: .18em; text-transform: uppercase; }

/* Dialog */
.rsvp-dialog { width: min(560px, calc(100% - 28px)); border: 0; padding: 0; color: var(--ink); background: #fbf8f2; box-shadow: 0 30px 90px rgba(30,28,24,.35); }
.rsvp-dialog::backdrop { background: rgba(32,36,28,.64); backdrop-filter: blur(8px); }
.dialog-close { position: absolute; top: 10px; right: 13px; z-index: 2; width: 42px; height: 42px; border: 0; color: #5d5a52; background: transparent; cursor: pointer; font: 300 31px var(--serif); }
.dialog-inner { padding: 66px 56px 52px; text-align: center; }
.dialog-inner h2 { margin: -2px 0 16px; color: var(--wine); font: 400 88px/.8 var(--script); }
.dialog-inner > p:not(.eyebrow,.tiny) { max-width: 390px; margin: 0 auto 26px; color: #5f5d55; font-size: 20px; line-height: 1.45; }
.tiny { margin: 22px 0 0; color: #8b877e; font: 400 11px var(--sans); }
.tiny code { font-size: 10px; }
.is-hidden { display: none; }

@media (max-width: 800px) {
  .topbar { height: 64px; padding: 0 18px; }
  .brand-name { font-size: 16px; }
  .topbar nav { position: fixed; inset: 64px 0 auto 0; display: grid; gap: 0; padding: 18px 22px 26px; background: rgba(248,245,239,.98); border-bottom: 1px solid var(--line); transform: translateY(-115%); opacity: 0; visibility: hidden; transition: .25s ease; }
  .topbar.is-menu-open nav { transform: translateY(0); opacity: 1; visibility: visible; }
  .topbar nav a, .topbar nav button { width: 100%; padding: 14px 0; text-align: left; border-bottom: 1px solid var(--line); }
  .topbar nav button { border-left: 0; border-right: 0; border-top: 0; }
  .menu { display: block; }
  .topbar.is-menu-open .menu span:first-child { transform: translateY(3.5px) rotate(45deg); }
  .topbar.is-menu-open .menu span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

  .invitation-view { padding: 30px 14px 66px; }
  .invitation-shell { width: min(650px, 100%); }
  .story-inner { grid-template-columns: 1fr; gap: 48px; padding: 74px 0 86px; }
  .story-art { width: min(520px, 100%); margin: 0 auto; }
  .story-copy { max-width: 600px; margin: 0 auto; text-align: center; }
  .story-copy p:first-of-type::first-letter { float: none; padding: 0; font-size: inherit; line-height: inherit; font-family: inherit; color: inherit; }
  .signature { font-size: 56px; }
  .detail-list { grid-template-columns: 1fr; }
  .detail-list article { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .detail-list article:last-child { border-bottom: 0; }
  .detail-list h4 { margin-top: 28px; }
}

@media (max-width: 520px) {
  .opening { padding: 0; }
  .opening-card { width: 100vw; box-shadow: none; }
  .tap-hint { display: none; }
  .topbar { height: 60px; }
  .seal { width: 31px; height: 31px; }
  .invitation-view { min-height: auto; padding: 0 0 48px; }
  .intro-line { display: none; }
  .invitation-shell { width: 100%; box-shadow: none; }
  .scroll-line { margin-top: 17px; padding: 0 15px; font-size: 7px; }
  .paint-header { min-height: 235px; }
  .paint-header h2 { font-size: 50px; }
  .back-link { top: 23px; }
  .story-inner, .details-inner { width: min(100% - 32px, 680px); }
  .story-inner { padding: 65px 0 76px; }
  .story-copy { font-size: 19px; line-height: 1.48; }
  .story-copy p { margin-bottom: 21px; }
  .details-inner { padding: 70px 0 82px; }
  .details-intro { margin-bottom: 46px; }
  .details-intro h3 { font-size: 44px; }
  .details-intro > p:last-child { font-size: 18px; }
  .detail-list article { padding: 30px 22px; }
  .detail-list h4 { font-size: 30px; }
  .gratitude { margin-top: 55px; font-size: 20px; }
  .script-line { font-size: 37px; }
  .rsvp-section { padding: 90px 16px 72px; }
  .rsvp-card { padding-inline: 22px; }
  .dialog-inner { padding: 62px 26px 44px; }
  .footer { min-height: 310px; }
}

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