/* ==========================================================================
   Maria & Dimitris: one-page wedding site
   Order: base · type · header · hero/envelope · RSVP · sections · motion
   ========================================================================== */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 12px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  --grain: url("../images/texture-grain.png") 0 0 / 192px 192px repeat;
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--deep-plum);
  background: var(--grain), var(--warm-ivory);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
button { font: inherit; color: inherit; }
a { color: inherit; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--lilac-mist); color: var(--deep-plum); }
:focus-visible { outline: 2px solid var(--signature-purple); outline-offset: 3px; border-radius: 2px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--signature-purple); color: #fff; padding: 10px 16px; border-radius: 999px;
  font-weight: 700; font-size: var(--fs-small); text-decoration: none;
  transition: top var(--dur-micro) var(--ease-out);
}
.skip-link:focus { top: 10px; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container.narrow { max-width: calc(760px + 2 * var(--gutter)); }
.center { text-align: center; }

/* ---------- Type ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--signature-purple);
  line-height: 1.22;
  letter-spacing: 0;
  padding-block: 0.06em 0.12em;
  text-wrap: balance;
  font-synthesis: none;
}
.section-title { font-size: calc(var(--fs-display) * var(--display-scale)); }
.section-title.xl { font-size: calc(var(--fs-display-xl) * var(--display-scale)); }
.display-sm { font-size: calc(var(--fs-display-sm) * var(--display-scale)); }

.eyebrow {
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--signature-purple);
  margin-bottom: 0.9rem;
}
.lead { font-size: var(--fs-lead); line-height: 1.5; color: var(--deep-plum); font-weight: 700; }
.prose { max-width: 34em; text-wrap: pretty; }
.prose p { text-wrap: pretty; }
.subhead {
  font-size: var(--fs-small);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--signature-purple);
  margin: 0 0 0.9rem;
}
* + .subhead { margin-top: 2rem; }
.aside-line { font-style: normal; color: var(--signature-purple); }

/* Hand-drawn sea strokes, taken from the water marks on the island map */
.strokes { display: block; width: 64px; height: 10px; margin: 0.5rem 0 1.4rem; color: var(--sketch-lavender); overflow: visible; }
.center .strokes, .strokes.mid { margin-inline: auto; }
.strokes path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }

/* Links & buttons */
.text-link {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-size: var(--fs-small); font-weight: 700; letter-spacing: 0.02em;
  color: var(--deep-plum);
  text-decoration: underline; text-decoration-thickness: 1.5px;
  text-decoration-color: var(--sketch-lavender); text-underline-offset: 5px;
  transition: color var(--dur-micro) var(--ease-out), text-decoration-color var(--dur-micro) var(--ease-out);
}
.text-link:hover { color: var(--signature-purple); text-decoration-color: currentColor; }
.text-link.arrow::after { content: "\2192"; display: inline-block; margin-left: 0.45em; text-decoration: none; transition: transform var(--dur-micro) var(--ease-out); }
.text-link.arrow:hover::after { transform: translateX(3px); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  font: 700 0.9375rem/1.1 var(--font-body); letter-spacing: 0.03em;
  padding: 0.95em 1.9em; border-radius: 999px; border: 1.5px solid var(--signature-purple);
  text-decoration: none; cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out),
              border-color var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out),
              transform var(--dur-micro) var(--ease-out);
}
.btn-solid { background: var(--signature-purple); color: #fff; }
.btn-solid:hover { background: var(--deep-plum); border-color: var(--deep-plum); }
.btn-outline { background: transparent; color: var(--signature-purple); }
.btn-outline:hover { background: var(--signature-purple); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn-small { padding: 0.62em 1.15em; font-size: 0.875rem; }
.btn[disabled] { opacity: 0.7; cursor: progress; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: transform 320ms var(--ease-out), background-color 320ms var(--ease-out), border-color 320ms var(--ease-out);
}
.site-header.is-scrolled {
  background: rgba(242, 237, 234, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom-color: rgba(181, 172, 200, 0.45);
}
.site-header.is-hidden { transform: translateY(-100%); }
.header-inner {
  height: 100%;
  display: flex; align-items: center; gap: clamp(12px, 2vw, 28px);
  max-width: calc(1320px + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter);
}
.monogram {
  flex: none;
  font-family: var(--font-display-en);
  font-size: 1.85rem; line-height: 1; color: var(--signature-purple);
  text-decoration: none; padding: 6px 2px 2px;
  white-space: nowrap;
}
.monogram .amp { font-size: 0.8em; margin: 0 0.06em; }
.primary-nav { flex: 1 1 auto; min-width: 0; overflow: hidden; padding: 8px 6px; } /* padding keeps focus rings inside the clip */
.nav-links { display: flex; justify-content: center; gap: clamp(14px, 1.8vw, 28px); white-space: nowrap; }
.nav-links a {
  display: block; position: relative;
  font-size: 0.9375rem; color: var(--deep-plum); text-decoration: none; padding: 6px 0;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 1px; height: 1.5px;
  background: var(--sketch-lavender); transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur-micro) var(--ease-out);
}
.nav-links a:hover::after, .nav-links a[aria-current="true"]::after { transform: scaleX(1); }
.nav-links a[aria-current="true"] { color: var(--signature-purple); }
.header-actions { flex: none; display: flex; align-items: center; gap: clamp(10px, 1.4vw, 18px); margin-left: auto; }
.lang-switch { display: flex; align-items: center; gap: 2px; font-size: 0.875rem; color: var(--sketch-lavender); }
.lang-switch button {
  background: none; border: 0; cursor: pointer; padding: 6px 5px; min-width: 32px; min-height: 32px;
  font-weight: 700; letter-spacing: 0.06em; color: var(--deep-plum); opacity: 0.55;
  transition: opacity var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}
.lang-switch button:hover { opacity: 0.85; }
.lang-switch button[aria-pressed="true"] { opacity: 1; color: var(--signature-purple); text-decoration: underline; text-decoration-color: var(--sketch-lavender); text-underline-offset: 5px; text-decoration-thickness: 1.5px; }
.menu-toggle {
  display: none; align-items: center; gap: 8px;
  background: none; border: 0; cursor: pointer; padding: 8px 4px; min-height: 40px;
  font-size: 0.875rem; font-weight: 700; letter-spacing: 0.04em; color: var(--deep-plum);
}
.menu-icon { width: 18px; height: 10px; position: relative; }
.menu-icon::before, .menu-icon::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor; border-radius: 2px;
  transition: transform var(--dur-micro) var(--ease-out), top var(--dur-micro) var(--ease-out);
}
.menu-icon::before { top: 1px; }
.menu-icon::after { top: 8px; }
.menu-toggle[aria-expanded="true"] .menu-icon::before { top: 4.5px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-icon::after { top: 4.5px; transform: rotate(-45deg); }

.site-header.nav-collapsed .primary-nav { visibility: hidden; height: 0; flex: 1 1 0; }
.site-header.nav-collapsed .menu-toggle { display: inline-flex; }
@media (max-width: 720px) {
  .site-header .primary-nav { visibility: hidden; height: 0; flex: 1 1 0; }
  .site-header .menu-toggle { display: inline-flex; }
  .header-actions .btn-small { padding: 0.55em 0.95em; }
  .monogram { font-size: 1.6rem; }
}
@media (max-width: 380px) {
  .menu-label { display: none; }
}

.mobile-menu {
  position: absolute; left: 0; right: 0; top: 100%;
  background: rgba(242, 237, 234, 0.97);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(181, 172, 200, 0.5);
  box-shadow: 0 24px 40px -28px rgba(79, 70, 105, 0.35);
  padding: 8px var(--gutter) 24px;
}
.mobile-menu ul { max-width: 520px; margin-inline: auto; }
.mobile-menu li + li { border-top: 1px solid rgba(181, 172, 200, 0.4); }
.mobile-menu a { display: block; padding: 14px 2px; font-size: 1.0625rem; color: var(--deep-plum); text-decoration: none; }
.mobile-menu a[aria-current="true"] { color: var(--signature-purple); font-weight: 700; }
.mobile-menu[hidden] { display: none; }

/* ---------- Hero & envelope ---------- */
.hero {
  position: relative;
  margin-top: calc(-1 * var(--header-h));
  padding: calc(var(--header-h) + clamp(4px, 2vh, 28px)) 0 clamp(40px, 7vh, 72px);
  background:
    var(--grain),
    url("../images/texture-brush.png") 0 0 / 720px 360px repeat,
    linear-gradient(180deg, var(--sky-wash) 0%, #E2E8EA 24%, var(--sage-haze) 44%, #EDEAE6 66%, var(--warm-ivory) 100%);
  text-align: center;
}
.stage {
  --ew: clamp(232px, min(82vw, calc((100vh - 316px) * 0.58)), 384px);
  --gap: 30;
  --u: calc(var(--ew) / 100);
  position: relative;
  width: var(--ew);
  height: calc(var(--u) * (138 + var(--gap)));
  margin: 0 auto;
}
@supports (height: 100svh) {
  .stage { --ew: clamp(232px, min(82vw, calc((100svh - 316px) * 0.58)), 384px); }
}
@media (max-width: 640px) { .stage { --gap: 20; } }
.stage.is-open { height: calc(var(--u) * 227.7); }

.env-part, .card, .env-hit { position: absolute; left: 0; }
.env-part { width: var(--ew); top: calc(var(--u) * (4 + var(--gap))); }
.env-part svg { display: block; width: 100%; height: 100%; overflow: visible; }
.env-back {
  height: calc(var(--u) * 134); z-index: 1;
  filter: drop-shadow(0 22px 26px rgba(79, 70, 105, 0.16)) drop-shadow(0 2px 3px rgba(79, 70, 105, 0.08));
}
.env-flap {
  height: calc(var(--u) * 84); z-index: 5;
  transform-origin: 50% 0;
  transform: perspective(1400px) rotateX(0deg);
  transform-style: preserve-3d;
}
.flap-face { position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.flap-front { filter: drop-shadow(0 3px 2.5px rgba(79, 70, 105, 0.13)); }
.flap-back { transform: rotateX(180deg); }
.env-pocket { height: calc(var(--u) * 134); z-index: 4; pointer-events: none; }
.env-seal {
  width: calc(var(--u) * 36); left: calc(var(--u) * 32);
  top: calc(var(--u) * (4 + var(--gap) + 55));
  z-index: 6; pointer-events: none;
}
.card {
  left: calc(var(--u) * 5);
  top: calc(var(--u) * (7 + var(--gap)));
  width: calc(var(--u) * 90);
  z-index: 3;
  transform-origin: 50% 100%;
}
.card img {
  width: 100%; aspect-ratio: 1443 / 2048; border-radius: 2px;
  background: #C9C9D6;
  box-shadow: 0 1px 2px rgba(79, 70, 105, 0.14), 0 22px 40px -22px rgba(79, 70, 105, 0.5);
}
.card:focus { outline: none; }
.env-hit {
  z-index: 8;
  top: calc(var(--u) * (4 + var(--gap)));
  width: var(--ew); height: calc(var(--u) * 134);
  background: none; border: 0; padding: 0; cursor: pointer; border-radius: 4px;
}
.env-hit:focus-visible { outline-offset: 6px; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .stage:not(.is-open) .env-seal svg { transition: transform 300ms var(--ease-out); }
  .stage:not(.is-open):has(.env-hit:hover) .env-seal svg { transform: translateY(-2px) scale(1.03); }
}

/* Open state (the animation ends exactly here) */
.stage.is-open .env-back,
.stage.is-open .env-pocket { transform: translateY(calc(var(--u) * (89.7 - var(--gap)))); }
.stage.is-open .env-flap { transform: translateY(calc(var(--u) * (89.7 - var(--gap)))) perspective(1400px) rotateX(180deg); z-index: 2; }
.stage.is-open .card { transform: translateY(calc(var(--u) * -1 * (var(--gap) + 3))) rotate(-1.8deg); }
.stage.is-open .env-seal { opacity: 0; visibility: hidden; }
.stage.is-open .env-hit { display: none; }

.hero-text { position: relative; z-index: 2; margin-top: clamp(14px, 2.4vh, 26px); padding-inline: var(--gutter); }
.hero .eyebrow { margin-bottom: 0.35rem; color: var(--deep-plum); } /* small label on the sky wash: plum for contrast */
.names {
  font-size: calc(clamp(2.6rem, 1.9rem + 3vw, 4.6rem) * var(--display-scale));
  line-height: 1.15;
}
.hero-date {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.35em 0.8em;
  margin: 0.35rem 0 0; font-size: 0.875rem; font-weight: 700; letter-spacing: 0.14em; color: var(--deep-plum);
}
.dot { width: 4px; height: 4px; border-radius: 50%; background: var(--sketch-lavender); }
/* Before/after controls share one grid cell, so swapping them never shifts the page */
.hero-controls { display: grid; margin-top: clamp(16px, 2.6vh, 26px); }
.hero-actions, .hero-after { grid-area: 1 / 1; align-self: start; }
.hero-actions { display: flex; flex-direction: column; align-items: center; gap: 14px; transition: opacity 260ms var(--ease-out), visibility 0s; }
.hero-after { visibility: hidden; opacity: 0; }
.hero-welcome { font-size: var(--fs-lead); color: var(--deep-plum); max-width: 28em; margin: 0 auto 0.8rem; text-wrap: balance; }
.hero-links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 18px; }
.is-opening .hero-actions, .is-opened .hero-actions { visibility: hidden; opacity: 0; transition: opacity 260ms var(--ease-out), visibility 0s 260ms; }
.is-opened .hero-after { visibility: visible; opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .is-opened .hero-after { animation: fade-up 700ms 80ms var(--ease-out) both; }
}

/* ---------- Sections (shared) ---------- */
.section { position: relative; padding-block: var(--section-gap); }
.art img { width: 100%; border-radius: var(--radius); }
.art { position: relative; }

/* Event layout: art + text, art spans both text rows on desktop */
.event-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  grid-template-areas: "art head" "art body";
  grid-template-rows: auto 1fr;
  column-gap: clamp(32px, 5vw, 80px);
  align-items: start;
}
.event-grid .art { grid-area: art; align-self: center; }
.event-head { grid-area: head; align-self: end; }
.event-body { grid-area: body; }
.event-grid.flip { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-areas: "head art" "body art"; }

.details { margin: 1.6rem 0 1.4rem; border-top: 1px solid var(--rule); }
.details > div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.25rem 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--rule); }
.details dt { font-size: var(--fs-eyebrow); font-weight: 700; letter-spacing: 0.14em; color: var(--signature-purple); padding-top: 0.2em; }
.details dd { margin: 0; }
:lang(el) .details > div { grid-template-columns: 8.5rem 1fr; }

/* ---------- RSVP ---------- */
.rsvp { padding-top: clamp(40px, 6vw, 72px); }
.rsvp-frame {
  position: relative;
  max-width: 1080px; margin-inline: auto;
  padding: clamp(64px, 7vw, 96px) clamp(20px, 6vw, 88px) clamp(48px, 6vw, 80px);
  background: var(--grain), linear-gradient(180deg, var(--lilac-mist), #EAE4EC 60%, #ECE6EC);
  border-radius: 2px;
  text-align: center;
}
.rsvp-frame::before {
  content: ""; position: absolute; inset: clamp(10px, 1.4vw, 16px);
  border: 1px solid rgba(109, 99, 147, 0.28); pointer-events: none; border-radius: 1px;
}
.rsvp-seal { position: absolute; top: 0; left: 50%; width: 66px; transform: translate(-50%, -48%); }
.rsvp-seal svg { width: 100%; height: auto; overflow: visible; }
.rsvp-intro { max-width: 34em; margin: 0 auto 2.4rem; text-wrap: balance; }
.rsvp-form { max-width: 680px; margin: 0 auto; text-align: left; }
.form-error-summary {
  display: flex; gap: 8px; align-items: baseline;
  margin-bottom: 1.5rem; padding: 0.8rem 1rem;
  border: 1px solid rgba(154, 69, 96, 0.45); border-radius: 8px;
  background: rgba(242, 237, 234, 0.7); color: var(--deep-plum); font-weight: 700; font-size: var(--fs-small);
}
.form-error-summary::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--error); transform: translateY(-1px); }
.form-error-summary[hidden] { display: none; }
.field { margin: 0 0 1.4rem; min-width: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.field label:not(.choice), .field legend {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  font-weight: 700; font-size: var(--fs-small); color: var(--deep-plum); margin-bottom: 0.45rem; padding: 0;
}
fieldset.field { border: 0; padding: 0; margin-inline: 0; }
fieldset.field legend { width: 100%; margin-bottom: 0.6rem; }
.optional { font-weight: 400; font-size: 0.8125rem; letter-spacing: 0.04em; color: #625880; }
.help { font-size: 0.875rem; color: #625880; margin: 0.45rem 0 0; }
.input {
  width: 100%;
  font: inherit; font-size: 1rem; color: var(--deep-plum);
  background: var(--warm-ivory);
  border: 1px solid var(--field-border); border-radius: 8px;
  padding: 0.8rem 0.95rem; min-height: 50px;
  transition: border-color var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}
textarea.input { min-height: 112px; resize: vertical; line-height: 1.5; }
.input::placeholder { color: #8F86AB; }
.input:hover { border-color: var(--signature-purple); }
.input:focus { outline: none; border-color: var(--signature-purple); box-shadow: 0 0 0 3px rgba(109, 99, 147, 0.2); background: #F6F2EF; }
.is-invalid .input, .input[aria-invalid="true"] { border-color: var(--error); }
.is-invalid .input:focus { box-shadow: 0 0 0 3px rgba(154, 69, 96, 0.18); }
.field-error { display: flex; gap: 6px; align-items: baseline; color: var(--error); font-size: 0.875rem; font-weight: 700; margin: 0.45rem 0 0; }
.field-error::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; transform: translateY(-1px); }
.field-error[hidden] { display: none; }

.choices { display: grid; gap: 10px; }
.choices.two { grid-template-columns: 1fr 1fr; }
.choices.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice {
  position: relative; display: flex; gap: 12px; align-items: center;
  padding: 0.85rem 0.95rem; min-height: 54px;
  background: var(--warm-ivory); border: 1px solid var(--field-border); border-radius: 10px;
  cursor: pointer; font-size: 1rem; margin: 0;
  transition: border-color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out);
}
.choice:hover { border-color: var(--signature-purple); }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.choice-mark {
  flex: none; width: 20px; height: 20px;
  border: 1.5px solid var(--signature-purple); border-radius: 50%; background: #FBF9F8;
  display: grid; place-items: center;
  transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out);
}
.choice-mark::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--signature-purple); transform: scale(0); transition: transform var(--dur-micro) var(--ease-out); }
.choice.is-check .choice-mark { border-radius: 5px; }
.choice.is-check .choice-mark::after {
  width: 11px; height: 6px; border-radius: 0; background: none;
  border: 2px solid #fff; border-top: 0; border-right: 0;
  transform: rotate(-45deg) translate(1px, -1px) scale(0);
}
.choice:has(input:checked) { border-color: var(--signature-purple); background: #F7F3F2; box-shadow: inset 0 0 0 1px var(--signature-purple); }
.choice:has(input:checked) .choice-mark::after { transform: scale(1); }
.choice.is-check:has(input:checked) .choice-mark { background: var(--signature-purple); }
.choice.is-check:has(input:checked) .choice-mark::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.choice:has(input:focus-visible) { outline: 2px solid var(--signature-purple); outline-offset: 3px; }
.choice-text { display: flex; flex-direction: column; gap: 2px; line-height: 1.35; }
.choice-text strong { font-weight: 700; }
.choice-text small { font-size: 0.8125rem; color: #625880; line-height: 1.35; }
.choice-text strong + small { margin-top: 2px; }
.is-invalid .choice { border-color: var(--error); }

.collapsible { display: grid; grid-template-rows: 1fr; transition: grid-template-rows 360ms var(--ease-out), opacity 300ms var(--ease-out); }
.collapsible > .collapsible-inner { overflow: hidden; min-height: 0; }
.collapsible.is-settled > .collapsible-inner { overflow: visible; } /* no clipping of focus rings once open */
.collapsible.is-collapsed { grid-template-rows: 0fr; opacity: 0; }

.form-actions { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 2rem; text-align: center; }
.form-actions .btn { min-width: 220px; }
.preview-note { font-size: 0.8125rem; color: #625880; letter-spacing: 0.02em; }
.rsvp-done { max-width: 34em; margin: 0 auto; padding: 0.5rem 0 0; }
.rsvp-done:focus { outline: none; }
.done-title { font-size: calc(var(--fs-display-sm) * 1.15 * var(--display-scale)); margin-bottom: 0.6rem; }
.rsvp-done p:not(.done-title) { margin-bottom: 1.4rem; text-wrap: balance; }
@media (prefers-reduced-motion: no-preference) {
  .rsvp-done:not([hidden]) { animation: fade-up 600ms var(--ease-out) both; }
}

/* ---------- Pre-wedding ---------- */
.prewedding { background: var(--grain), linear-gradient(180deg, var(--warm-ivory) 0%, var(--warm-ivory) 30%, var(--ivory-lilac) 100%); }
.prewedding .event-grid { grid-template-areas: "art head"; grid-template-rows: auto; align-items: center; }
.prewedding .event-head { align-self: center; }
.details-wrap { margin-top: clamp(40px, 5vw, 64px); }
.details--band { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; border-bottom: 1px solid var(--rule); }
.details--band > div { display: block; padding: 1.1rem 1.2rem 1.2rem; border-bottom: 0; }
.details--band > div + div { border-left: 1px solid var(--rule); }
.details--band dt { margin-bottom: 0.35rem; }
.details--band dd { font-size: var(--fs-small); line-height: 1.5; }
.details-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px 32px; margin-top: 1.4rem; }
.details-foot .aside-line { margin: 0; max-width: 38em; }

/* ---------- Ceremony ---------- */
.ceremony {
  padding-top: calc(var(--section-gap) * 1.25);
  background:
    var(--grain),
    url("../images/texture-brush.png") 0 120px / 720px 360px repeat,
    linear-gradient(180deg, var(--ivory-lilac) 0%, #EBE7EC 45%, #EDE8EC 75%, var(--ivory-lilac) 100%);
}
.ceremony-head { margin-bottom: clamp(28px, 4vw, 48px); }
.ceremony-head .lead { font-weight: 400; max-width: 30em; margin-inline: auto; text-wrap: balance; }
.ceremony-art { max-width: 1100px; margin-inline: auto; padding-inline: var(--gutter); }
.ceremony-info {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(24px, 5vw, 72px);
  margin-top: clamp(40px, 5vw, 64px); align-items: start;
}
.ceremony-info .info-intro p { max-width: 24em; }
.info-pair { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 3vw, 40px); }
.info-item { border-top: 1px solid var(--rule); padding-top: 1rem; }
.info-item h4 { font-size: 1rem; font-weight: 700; color: var(--signature-purple); margin-bottom: 0.4rem; }
.info-item p { font-size: var(--fs-small); line-height: 1.6; }
.time { font-weight: 700; color: var(--signature-purple); white-space: nowrap; }
.onward {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center;
  gap: clamp(20px, 4vw, 56px); margin-top: clamp(72px, 9vw, 120px);
}
.onward-line { text-align: right; }
.onward-art img { border-radius: var(--radius); }

/* ---------- Wedding party ---------- */
.party { background: var(--grain), linear-gradient(180deg, var(--ivory-lilac) 0%, var(--warm-ivory) 55%); padding-top: clamp(32px, 4vw, 56px); }
.party-hero { position: relative; max-width: 1440px; margin-inline: auto; padding-inline: clamp(0px, 2vw, 24px); }
.party-hero img { width: 100%; border-radius: var(--radius); }
.party-heading { position: absolute; top: clamp(16px, 4.5vw, 64px); left: clamp(28px, 7vw, 112px); text-align: left; }
.party-heading .eyebrow { margin-bottom: 0.4rem; }
.party-grid {
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 80px);
  margin-top: clamp(40px, 5vw, 72px); align-items: start;
}
.venue-line { font-weight: 700; color: var(--signature-purple); letter-spacing: 0.02em; margin-bottom: 1rem; }
.programme { display: flex; gap: 0; margin: 0.4rem 0 2rem; counter-reset: step; }
.programme li { flex: 1; position: relative; padding-top: 22px; font-weight: 700; font-size: var(--fs-small); color: var(--deep-plum); line-height: 1.35; padding-right: 12px; }
.programme li::before { content: ""; position: absolute; top: 4px; left: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--signature-purple); }
.programme li::after { content: ""; position: absolute; top: 8px; left: 16px; right: 6px; border-top: 1.5px dotted var(--sketch-lavender); }
.programme li:last-child::after { display: none; }
.notes { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(18px, 3vw, 32px); margin-bottom: 1.6rem; }
.notes h4 { font-size: 1rem; font-weight: 700; color: var(--signature-purple); margin-bottom: 0.35rem; }
.notes p { font-size: var(--fs-small); }
.party-venue { margin-top: clamp(0px, 3vw, 40px); }
.party-venue img { border-radius: var(--radius); }

/* ---------- Paros ---------- */
.paros { background: var(--grain), var(--warm-ivory); }
.paros-head { margin-bottom: clamp(40px, 5vw, 64px); }
.paros-head p { max-width: 32em; margin-inline: auto; text-wrap: balance; }
.paros-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: clamp(32px, 5vw, 88px); align-items: center; }
.map-figure { max-width: 520px; justify-self: end; width: 100%; }
.map-zoom {
  display: block; position: relative; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in;
  border-radius: var(--radius);
}
.map-zoom img { border-radius: var(--radius); box-shadow: 0 1px 2px rgba(79, 70, 105, 0.1), 0 26px 50px -30px rgba(79, 70, 105, 0.45); }
.map-zoom-hint {
  position: absolute; right: 12px; bottom: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px;
  background: rgba(242, 237, 234, 0.92); color: var(--signature-purple);
  font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.02em;
}
.map-zoom:hover .map-zoom-hint { background: #fff; }
.map-notes { max-width: 460px; }
.place-list { margin-bottom: 2.2rem; }
.place-list li { display: flex; justify-content: space-between; gap: 16px; padding: 0.55rem 0; border-bottom: 1px solid var(--rule); font-size: var(--fs-small); }
.place-list li:first-child { border-top: 1px solid var(--rule); }
.place-list .place { font-weight: 700; color: var(--deep-plum); }
.place-list .note { color: #675D84; text-align: right; }
.place-list--wedding .place::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--signature-purple);
  margin-right: 10px; transform: translateY(-1px);
}

.album {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(18px, 2.6vw, 36px);
  margin-top: clamp(72px, 9vw, 128px);
  align-items: start;
}
.album-item img { width: 100%; border-radius: 2px; box-shadow: 0 1px 2px rgba(79, 70, 105, 0.08), 0 18px 34px -24px rgba(79, 70, 105, 0.42); }
.album-item figcaption { margin-top: 0.7rem; font-size: 0.8125rem; letter-spacing: 0.02em; color: #675D84; }
.a-pier { grid-column: 1 / span 7; }
.a-detail { grid-column: 9 / span 4; margin-top: clamp(24px, 6vw, 80px); }
.a-lane { grid-column: 1 / span 4; margin-top: clamp(-120px, -6vw, -24px); }
.a-windmill { grid-column: 5 / span 3; margin-top: clamp(24px, 4vw, 56px); }
.a-evening { grid-column: 8 / span 5; margin-top: clamp(24px, 4vw, 56px); align-self: center; }

/* ---------- Accommodation ---------- */
.stay { background: var(--grain), linear-gradient(180deg, var(--warm-ivory) 0%, var(--ivory-peach) 100%); }
.stay .event-head { align-self: end; }
.stay-soon { color: var(--signature-purple); font-weight: 700; margin-top: 1.2rem; }
.stay-list { margin-top: 1.2rem; border-top: 1px solid var(--rule); }
.stay-list li { padding: 0.9rem 0; border-bottom: 1px solid var(--rule); }
.stay-list .name { font-weight: 700; }
.stay-list .area { font-size: var(--fs-eyebrow); letter-spacing: 0.14em; font-weight: 700; color: var(--signature-purple); display: block; margin-bottom: 0.2rem; }

/* ---------- Transport ---------- */
/* the car is painted on a lighter, warmer paper: meet it halfway */
.transport { background: var(--grain), linear-gradient(180deg, var(--ivory-peach) 0%, #F7EEEB 30%, #F8EFEC 62%, var(--warm-ivory) 100%); }
.transport .event-grid { grid-template-columns: minmax(0, 6.5fr) minmax(0, 5.5fr); }
.route { position: relative; margin-top: 1.6rem; }
.route::before { content: ""; position: absolute; left: 4px; top: 10px; bottom: 22px; border-left: 1.5px dotted var(--sketch-lavender); }
.route li { position: relative; padding: 0 0 1.5rem 30px; }
.route li::before {
  content: ""; position: absolute; left: 0; top: 6px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--warm-ivory); border: 1.5px solid var(--signature-purple);
}
.route .day { font-size: var(--fs-eyebrow); font-weight: 700; letter-spacing: 0.14em; color: var(--signature-purple); display: block; margin-bottom: 0.15rem; }
.route h3 { font-size: 1.0625rem; font-weight: 700; color: var(--deep-plum); margin-bottom: 0.25rem; }
.route p { font-size: var(--fs-small); }

/* ---------- FAQs ---------- */
.faqs { background: var(--grain), var(--warm-ivory); }
.faq-list { margin-top: clamp(24px, 3vw, 40px); border-top: 1px solid var(--rule); text-align: left; }
.faq { border-bottom: 1px solid var(--rule); }
.faq h3 { margin: 0; }
.faq-q {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 20px;
  background: none; border: 0; cursor: pointer; text-align: left;
  padding: 1.15rem 0.1rem; font-size: 1.0625rem; font-weight: 700; color: var(--deep-plum); line-height: 1.4;
}
.faq-q:hover { color: var(--signature-purple); }
.faq-icon { flex: none; position: relative; width: 14px; height: 14px; color: var(--signature-purple); }
.faq-icon::before, .faq-icon::after { content: ""; position: absolute; left: 0; right: 0; top: 6.25px; height: 1.5px; background: currentColor; border-radius: 1px; transition: transform 300ms var(--ease-out); }
.faq-icon::after { transform: rotate(90deg); }
.faq-q[aria-expanded="true"] .faq-icon::after { transform: rotate(0deg); }
.faq-a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 320ms var(--ease-out); }
.faq-a > div { overflow: hidden; min-height: 0; visibility: hidden; transition: visibility 0s 320ms; }
.faq.is-open .faq-a { grid-template-rows: 1fr; }
.faq.is-open .faq-a > div { visibility: visible; transition: visibility 0s 0s; }
.faq-a p { padding: 0 2.4rem 1.3rem 0.1rem; max-width: 40em; }

/* ---------- Closing ---------- */
.closing {
  padding: calc(var(--section-gap) * 0.9) var(--gutter) clamp(72px, 9vw, 120px);
  text-align: center;
  background:
    var(--grain),
    linear-gradient(180deg, var(--warm-ivory) 0%, #F8F0EA 9%, #F9F1EB 46%, #F4E7E1 60%, var(--peach-veil) 72%, var(--lilac-mist) 87%, var(--sky-wash) 100%);
}
.closing-art { width: min(400px, 78vw); margin: 0 auto clamp(36px, 5vw, 56px); }
.closing-art img { border-radius: var(--radius); }
.closing-line { font-size: calc(var(--fs-display-sm) * 1.25 * var(--display-scale)); max-width: 15em; margin: 0 auto 1rem; }
.closing-names { font-size: 0.875rem; font-weight: 700; letter-spacing: 0.14em; color: var(--deep-plum); margin-bottom: 1.6rem; line-height: 1.7; }
.closing-names span { display: block; }
.closing-names .closing-date { font-weight: 400; letter-spacing: 0.12em; }
.closing-seal { width: 30px; margin: clamp(40px, 5vw, 56px) auto 0; opacity: 0.9; }
.closing-seal svg { width: 100%; height: auto; overflow: visible; }

/* ---------- Map dialog ---------- */
.map-dialog {
  width: min(92vw, 760px); max-height: 92vh; padding: 0; border: 0; border-radius: 4px;
  background: var(--warm-ivory); color: var(--deep-plum);
  box-shadow: 0 40px 80px -30px rgba(40, 34, 60, 0.55);
}
.map-dialog::backdrop { background: rgba(79, 70, 105, 0.45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.map-dialog-inner { position: relative; padding: clamp(12px, 2vw, 20px); max-height: 92vh; overflow: auto; }
.map-dialog img { width: 100%; border-radius: 2px; }
.dialog-close {
  position: sticky; top: 0; float: right; z-index: 2; margin: 0 0 -44px;
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(242, 237, 234, 0.95); color: var(--signature-purple); font-size: 1.5rem; line-height: 1;
  box-shadow: 0 4px 14px -6px rgba(79, 70, 105, 0.4);
}
@media (prefers-reduced-motion: no-preference) {
  .map-dialog[open] { animation: fade-up 320ms var(--ease-out); }
}

/* ---------- Sketch-in (js/sketch.js): pencil first, then the wash ---------- */
.sketch-host { position: relative; }
.sketch-img { transition: opacity 320ms var(--ease-out); }
.sketch-img.sketch-wait { opacity: 0; }
.sketch-canvas { position: absolute; z-index: 1; pointer-events: none; transition: opacity 480ms var(--ease-out); }
.sketch-canvas.is-leaving { opacity: 0; }
.map-zoom-hint { transition: opacity 320ms var(--ease-out), background-color var(--dur-micro) var(--ease-out); }
.sketch-host .sketch-wait ~ .map-zoom-hint { opacity: 0; }
@media print { .sketch-img.sketch-wait { opacity: 1; } .sketch-canvas { display: none; } }

/* ---------- Reveal motion (once, gentle) ---------- */
.js .reveal { opacity: 0; transform: translateY(var(--reveal-shift)); transition: opacity var(--dur-reveal) var(--ease-out), transform var(--dur-reveal) var(--ease-out); transition-delay: calc(var(--i, 0) * 90ms); }
.js .reveal.is-in { opacity: 1; transform: none; }
.js .strokes path { stroke-dasharray: 30; stroke-dashoffset: 30; transition: stroke-dashoffset 900ms var(--ease-out); }
.js .strokes path:nth-child(2) { transition-delay: 120ms; }
.js .strokes path:nth-child(3) { transition-delay: 240ms; }
.js .is-in .strokes path, .js .strokes.is-in path { stroke-dashoffset: 0; }

@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .js .strokes path { stroke-dasharray: none; transition: none; }
  .collapsible, .faq-a, .faq-a > div { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .details--band { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .details--band > div:nth-child(4) { border-left: 0; }
  .details--band > div:nth-child(n + 4) { border-top: 1px solid var(--rule); }
  .ceremony-info { grid-template-columns: 1fr; }
  .party-grid { grid-template-columns: 1fr; }
  .party-venue { max-width: 640px; }
}

@media (max-width: 860px) {
  .event-grid, .event-grid.flip, .transport .event-grid, .prewedding .event-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "head" "art" "body";
    grid-template-rows: auto;
  }
  .event-grid .art { margin: 1.6rem 0 1.8rem; }
  .paros-grid { grid-template-columns: 1fr; }
  .map-figure { justify-self: center; }
  .map-notes { max-width: none; }
  .onward { grid-template-columns: 1fr; }
  .onward-line { text-align: center; }
}

@media (max-width: 720px) {
  .field-row, .choices.two, .choices.three { grid-template-columns: 1fr; }
  .info-pair, .notes { grid-template-columns: 1fr; }
  .programme { flex-direction: column; gap: 14px; }
  .programme li { padding: 0 0 0 24px; }
  .programme li::before { top: 6px; }
  .programme li::after { top: 16px; left: 4px; right: auto; bottom: -12px; border-top: 0; border-left: 1.5px dotted var(--sketch-lavender); }
  .party-heading { position: static; padding: 0 var(--gutter) 1.2rem; text-align: left; }
  .party-hero { display: flex; flex-direction: column-reverse; padding-inline: 0; }
  .party-hero img { border-radius: 0; }
  .ceremony-art { padding-inline: 0; }
  .ceremony-art img { border-radius: 0; }
  .album { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .a-pier, .a-evening { grid-column: 1 / -1; margin-top: 0; }
  .a-detail, .a-lane { grid-column: auto; margin-top: 0; }
  .a-windmill { grid-column: 1 / -1; width: 58%; justify-self: center; margin-top: 0; }
  .details > div, :lang(el) .details > div { grid-template-columns: 1fr; gap: 0.15rem; }
  .details--band { grid-template-columns: 1fr; }
  .details--band > div, .details--band > div + div { border-left: 0; padding: 0.8rem 0; }
  .details--band > div + div { border-top: 1px solid var(--rule); }
  .rsvp-frame { padding-inline: 18px; }
  .rsvp-frame::before { inset: 8px; }
  .hero-date { flex-direction: column; gap: 2px; letter-spacing: 0.1em; }
  .hero-date .dot { display: none; }
}

/* ---------- Not-found page ---------- */
.lost { min-height: 100vh; min-height: 100svh; display: grid; place-content: center; justify-items: center; gap: 0.4rem; padding: 48px var(--gutter); text-align: center; }
.lost .lost-seal { width: 54px; margin-bottom: 1.2rem; }
.lost p { max-width: 26em; }
.lost .btn { margin: 1.4rem 0 1.6rem; }
