/* Palette: sky blues from the photos, one cream-white, deep blue ink. No black, no gold. */
:root {
  --ink: #1E2C4A;
  --ink-muted: #45546F;
  --paper: #F8F4EC;
  --white-on-sky: #FAF6EE;
  --rule: #C9D0DD;
  --field: #6B7898;
  --underline: #8E9AB3;
  --underline-on-sky: #A9BAD6;
  --error: #8E3A2E;
  --serif: 'Newsreader', Georgia, serif;
  --script: 'Mrs Saint Delafield', 'Newsreader', cursive;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
/* Matches the sea at the bottom of the Rovinj photo: iOS Safari shows it behind its toolbar at the end of the page. */
body { margin: 0; background: #4D6378; }
[hidden] { display: none !important; }

/* One continuous sky behind everything. Stops match the graded sky photo so it fades in seamlessly. */
.page {
  position: relative;
  overflow: hidden;
  container-type: inline-size;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--serif);
  font-optical-sizing: auto;
  color: var(--ink);
  background: linear-gradient(180deg, #456085 0px, #4B688B 335px, #526D8F 536px, #6B82A1 750px, #8C9CB6 938px, #959EB4 1072px, #97A2BB 55%, #A6AFC3 100%);
}

.sky {
  position: absolute; top: 0; left: 0; z-index: 0;
  width: 100%; height: 1100px;
  object-fit: cover; object-position: 50% 0%;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 62%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 62%, transparent 100%);
}

/* ---------- Header on the sky: all text white ---------- */
.hero {
  position: relative; z-index: 1;
  width: 100%;
  padding: 20px clamp(16px, 3.4cqi, 48px) 0;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  color: var(--white-on-sky);
}

.lang-switch {
  align-self: flex-end;
  display: flex;
  padding: 2px;
  background: rgba(248, 244, 236, 0.6);
  border-radius: 2px;
  opacity: 0.4;
  transition: opacity 150ms ease;
}
.lang-switch:hover, .lang-switch:focus-within { opacity: 1; }
.lang-switch button {
  min-width: 44px; min-height: 44px;
  margin: 0; padding: 0 10px;
  border: 0; border-radius: 1px;
  background: transparent; color: var(--ink);
  font-family: var(--serif); font-size: 13px; letter-spacing: 0.14em;
  cursor: pointer;
}
.lang-switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.verse {
  margin: clamp(40px, 5.8cqi, 84px) 0 0;
  max-width: 34ch;
  font-size: clamp(21px, 2.2cqi, 32px);
  line-height: 1.38;
  font-style: italic;
  text-wrap: balance;
}
.verse-ref {
  margin: 14px 0 0;
  font-size: 13px; line-height: 1.5;
  letter-spacing: 0.18em; text-transform: uppercase; font-weight: 500;
}
.names {
  margin: clamp(26px, 3cqi, 44px) 0 0;
  font-family: var(--script); font-weight: 400;
  font-size: clamp(66px, 8.9cqi, 128px); line-height: 1;
  color: var(--white-on-sky);
}
.invite {
  margin: 18px 0 0;
  font-size: clamp(18px, 1.5cqi, 21px); line-height: 1.4;
  font-style: italic;
}
.date {
  margin: 6px 0 0;
  font-size: clamp(14px, 1.1cqi, 16px); line-height: 1.5;
  letter-spacing: 0.18em; text-transform: uppercase; font-weight: 500;
}
.jump {
  margin-top: 22px;
  display: flex; flex-wrap: wrap; justify-content: center;
  column-gap: clamp(16px, 2.2cqi, 34px);
}
.jump a {
  display: inline-block;
  padding: 10px 2px;
  font-size: 16px; line-height: 24px;
  color: var(--white-on-sky);
  text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 6px; text-decoration-color: var(--underline-on-sky);
}
.jump a:hover { text-decoration-color: var(--white-on-sky); }

/* ---------- The cream sheet ---------- */
.sheet {
  position: relative; z-index: 1;
  width: min(880px, calc(100% - 24px));
  margin-top: clamp(170px, 21cqi, 310px);
  background: var(--paper);
}
.paper {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover; pointer-events: none;
}
.sheet-inner {
  position: relative;
  padding: 0 clamp(20px, 6.7cqi, 96px) clamp(48px, 6cqi, 88px);
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
}

/* Photo straddles the top edge of the sheet */
.photo {
  margin: calc(-1 * clamp(130px, 18.5cqi, 268px)) 0 0;
  width: 100%;
  padding: clamp(6px, 0.7cqi, 10px);
  background: #FBF8F2;
}
.photo img {
  display: block; width: 100%;
  aspect-ratio: 4 / 3; object-fit: cover; object-position: 45% 35%;
}

.section {
  width: 100%;
  margin-top: clamp(64px, 8cqi, 112px);
  display: flex; flex-direction: column; align-items: center;
  scroll-margin-top: 24px;
}
.section h2 {
  margin: 0;
  font-weight: 400;
  font-size: clamp(32px, 3.2cqi, 46px); line-height: 1.1;
  color: var(--ink);
}

.label {
  margin: 0;
  font-size: 13px; line-height: 1.5;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-muted);
}
.label--spaced { margin-top: 44px; }

.body {
  margin: 8px 0 0;
  max-width: 46ch;
  font-size: clamp(17px, 1.25cqi, 18px); line-height: 1.6;
}
.body--spaced { margin-top: 40px; }
.body--intro { margin-top: 24px; }
.body--rsvp { margin-top: 20px; }

.note {
  margin: 6px 0 0;
  font-size: 17px; line-height: 1.5;
  font-style: italic; color: var(--ink-muted);
}

.link, .link-inline, .link-button {
  color: var(--ink);
  text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 5px; text-decoration-color: var(--underline);
}
.link:hover, .link-inline:hover, .link-button:hover { text-decoration-color: var(--ink); }
.link { display: inline-block; margin-top: 8px; padding: 10px 0; font-size: 16px; line-height: 24px; }
.link-inline { white-space: nowrap; }

/* Venues: two columns with a hairline, stacked on phones */
.venues {
  width: 100%;
  margin-top: 40px;
  columns: 2 240px; column-gap: 64px; column-rule: 1px solid var(--rule);
}
.venue { break-inside: avoid; padding: 4px 8px 32px; }
.venue-time {
  margin: 10px 0 0;
  font-size: clamp(34px, 3cqi, 42px); line-height: 1.1;
  font-variant-numeric: lining-nums;
}
.venue-time--italic { font-style: italic; }
.venue-name { margin: 12px 0 0; font-size: 20px; line-height: 1.35; }

.timeline { list-style: none; margin: 6px 0 0; padding: 0; }
.timeline li {
  display: grid;
  grid-template-columns: minmax(0, 7em) minmax(0, 15em);
  column-gap: 18px;
  margin-top: 10px;
  text-align: left;
  font-size: clamp(17px, 1.25cqi, 18px); line-height: 1.45;
}
.timeline .time {
  text-align: right; color: var(--ink-muted);
  font-variant-numeric: lining-nums tabular-nums;
}

.travel-block { margin-top: 32px; max-width: 48ch; }

.hotel { margin-top: 40px; }
.hotel-name {
  margin: 0;
  font-size: 15px; line-height: 1.5;
  letter-spacing: 0.16em; text-transform: uppercase;
}
.button-outline {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; margin-top: 14px; padding: 0 22px;
  border: 1px solid var(--ink); color: var(--ink);
  font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase;
  text-decoration: none;
  transition: background 150ms ease, color 150ms ease;
}
.button-outline:hover { background: var(--ink); color: var(--paper); }

.info { list-style: none; margin: 30px 0 0; padding: 0; max-width: 46ch; text-align: left; }
.info li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  column-gap: 16px; align-items: start;
  font-size: clamp(17px, 1.25cqi, 18px); line-height: 1.6;
}
.info li + li { margin-top: 18px; }
.info svg { margin-top: 3px; color: var(--ink); }

/* ---------- RSVP form: styled controls only, no native dropdowns ---------- */
.rsvp { width: 100%; max-width: 460px; margin-top: 12px; text-align: left; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.field { margin: 28px 0 0; padding: 0; border: 0; min-width: 0; }
.field legend { padding: 0; }
label.label { display: block; }

.input {
  display: block; width: 100%;
  margin-top: 6px; min-height: 46px; padding: 10px 2px;
  border: 0; border-bottom: 1px solid var(--field); border-radius: 0;
  background: transparent; color: var(--ink);
  font-family: var(--serif); font-size: 18px;
}
.textarea {
  display: block; width: 100%;
  margin-top: 10px; padding: 12px;
  border: 1px solid var(--field); border-radius: 0;
  background: transparent; color: var(--ink);
  font-family: var(--serif); font-size: 18px; line-height: 1.5;
  resize: vertical;
}
.input:focus, .textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 1px 0 0 var(--ink); }
.textarea:focus { box-shadow: inset 0 0 0 1px var(--ink); }

.choices { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.choice {
  min-height: 46px; padding: 0 20px;
  border: 1px solid var(--ink); border-radius: 0;
  background: transparent; color: var(--ink);
  font-family: var(--serif); font-size: 17px;
  cursor: pointer;
}
.choice[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.stepper { display: flex; align-items: center; margin-top: 10px; }
.step {
  width: 46px; height: 46px; padding: 0;
  border: 1px solid var(--ink); border-radius: 0;
  background: transparent; color: var(--ink);
  font-family: var(--serif); font-size: 22px; line-height: 1;
  cursor: pointer;
}
#count {
  display: flex; align-items: center; justify-content: center;
  min-width: 64px; height: 46px;
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
  font-size: 20px; font-variant-numeric: lining-nums tabular-nums;
}

.error { margin: 8px 0 0; font-size: 15px; line-height: 1.4; color: var(--error); }

.submit {
  margin-top: 34px; min-height: 52px; padding: 0 34px;
  border: 0; border-radius: 0;
  background: var(--ink); color: var(--paper);
  font-family: var(--serif); font-size: 14px;
  letter-spacing: 0.18em; text-transform: uppercase;
  cursor: pointer;
}
.submit[disabled] { opacity: 0.6; cursor: wait; }

.thanks { margin-top: 36px; max-width: 460px; }
.thanks-title { margin: 0; font-size: clamp(24px, 2.2cqi, 30px); line-height: 1.3; font-style: italic; }
.link-button {
  margin-top: 18px; min-height: 44px; padding: 0 2px;
  border: 0; background: transparent;
  font-family: var(--serif); font-size: 16px;
  cursor: pointer;
}

button:focus-visible, a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.hero a:focus-visible { outline-color: var(--white-on-sky); }

/* ---------- Signature at the bottom of the sheet ---------- */
.heart { display: block; margin-top: 40px; color: var(--ink); line-height: 0; }
.closing { margin: 14px 0 0; font-size: clamp(22px, 2cqi, 28px); line-height: 1.4; font-style: italic; }
.signature {
  margin: 6px 0 0;
  font-family: var(--script);
  font-size: clamp(50px, 5cqi, 72px); line-height: 1.1;
  color: var(--ink);
}

/* ---------- Sky flows into Rovinj ---------- */
.sky-gap { width: 100%; height: 124px; }
.footer { position: relative; z-index: 1; width: 100%; }
.footer img {
  display: block; width: 100%;
  aspect-ratio: 1915 / 821; min-height: 360px;
  object-fit: cover; object-position: 48% 55%;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 14%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 14%);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
