/* ==========================================================================
   Katharina & Fynn · 16.09.2026 · Einladungskarte
   ========================================================================== */

@font-face { font-family: "Ephesis"; src: url("../assets/fonts/ephesis-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("../assets/fonts/eb-garamond-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("../assets/fonts/eb-garamond-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("../assets/fonts/eb-garamond-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("../assets/fonts/eb-garamond-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --paper: #fdf6ee;
  --paper-back: #f8eee2;
  --ground: #e8dccb;
  --ink: #9b4826;          /* rust lettering */
  --ink-strong: #833a1b;
  --text: #3d2a21;
  --text-soft: #5f4637;
  --hair: rgba(155, 72, 38, 0.32);

  --c-orange: #ee9a62;
  --c-pink: #f3abc7;
  --c-yellow: #f6dc7c;
  --c-aqua: #a5dad8;
  --c-olive: #8d9b3d;

  --script: "Ephesis", "Snell Roundhand", "Apple Chancery", cursive;
  --serif: "EB Garamond", "Garamond", "Georgia", serif;

  --g: clamp(8px, 2.4vmin, 28px);   /* outer gutter */
  --ctl: 52px;                       /* pager height */
  --gap: 10px;
  --card-ratio: 0.6;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  background: var(--ground);
  color: var(--text);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.5;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: #f5d5c0; color: var(--ink-strong); }
img, svg { display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 3px; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- table ground behind the card ---------- */
.backdrop { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.backdrop__wash { position: absolute; width: 60vmax; height: auto; opacity: 0.38; }
.backdrop__wash--a { left: -22vmax; top: -18vmax; transform: rotate(-12deg); }
.backdrop__wash--b { right: -24vmax; bottom: -22vmax; transform: rotate(18deg); }
.backdrop__wash--c { right: -26vmax; top: -24vmax; width: 44vmax; opacity: 0.28; }

/* ---------- stage ---------- */
.stage {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--gap);
  padding: var(--g);
  padding-top: max(var(--g), env(safe-area-inset-top));
  padding-bottom: max(var(--g), env(safe-area-inset-bottom));
}

/* ---------- the card ---------- */
.card {
  position: relative;
  width: min(560px, calc(100vw - 2 * var(--g)), calc((100svh - var(--ctl) - var(--gap) - 2 * var(--g)) * var(--card-ratio)));
  aspect-ratio: var(--card-ratio);
  container-type: size;
  container-name: card;
}
/* the paper stack peeking out underneath */
.card::before, .card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background: var(--paper-back);
  box-shadow: 0 1px 2px rgba(80, 48, 24, 0.14);
}
.card::before { transform: translate(5px, 6px) rotate(0.6deg); }
.card::after  { transform: translate(-3px, 9px) rotate(-0.9deg); box-shadow: 0 26px 50px -18px rgba(80, 48, 24, 0.42), 0 2px 6px rgba(80, 48, 24, 0.12); }

.book {
  position: absolute;
  inset: 0;
  z-index: 1;
  perspective: 2600px;
  perspective-origin: 50% 40%;
}

.sheet {
  --p: 0;   /* turn progress: 0 = lying on the stack, 1 = turned away */
  --u: 0;   /* shadow cast by the sheet above while it turns */
  position: absolute;
  inset: 0;
  transform-origin: 0 50%;
  transform: rotateY(calc(var(--p) * -180deg));
  transform-style: preserve-3d;
}
.sheet.is-moving { will-change: transform; }

.face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 6px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .32 0 0 0 0 .2 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: clamp(0, calc((1 - var(--p)) * 7), 1);
}
.face--front { box-shadow: inset 0 0 0 1px rgba(155, 72, 38, 0.06); }
/* turning away: the front darkens toward the free edge */
.face--front::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(70, 38, 16, 0.02) 0%, rgba(70, 38, 16, 0.2) 70%, rgba(70, 38, 16, 0.34) 100%);
  opacity: min(calc(var(--p) * 2.4), 1);
}
/* shadow of the sheet above, falling on this page */
.face--front::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 19;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(60, 32, 12, 0.36) 0%, rgba(60, 32, 12, 0.12) 45%, rgba(60, 32, 12, 0) 85%);
  opacity: var(--u);
}
.face--back {
  transform: rotateY(180deg);
  display: grid;
  place-items: center;
  background-color: var(--paper-back);
}
.face--back::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(270deg, rgba(70, 38, 16, 0.26) 0%, rgba(70, 38, 16, 0.05) 60%, rgba(70, 38, 16, 0) 100%);
  opacity: calc(1.4 - var(--p));
}
.monogram {
  font-family: var(--script);
  font-size: 30cqw;
  color: var(--ink);
  opacity: 0.12;
}

/* ---------- page content ---------- */
.page {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 7cqw 4cqw;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  touch-action: pan-y;
  text-align: center;
  font-size: clamp(13px, 3.05cqw, 17.5px);
  line-height: 1.52;
  scrollbar-width: thin;
  scrollbar-color: rgba(155, 72, 38, 0.35) transparent;
}
.page::-webkit-scrollbar { width: 6px; }
.page::-webkit-scrollbar-thumb { background: rgba(155, 72, 38, 0.32); border-radius: 3px; }

.deco { position: absolute; z-index: 0; pointer-events: none; user-select: none; -webkit-user-drag: none; height: auto; max-width: none; }

.wave { position: absolute; left: -1%; width: 102%; height: 5cqw; z-index: 1; pointer-events: none; }
.wave path { fill: none; stroke: var(--ink); stroke-width: 1.1; stroke-opacity: 0.62; vector-effect: non-scaling-stroke; }
.wave--top { top: 11cqw; }
.wave--bottom { bottom: 6cqw; }

/* nav printed on every page */
.nav {
  position: relative;
  z-index: 3;
  flex: none;
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 3cqw;
  padding-top: 4.4cqw;
}
.nav__brand {
  font-size: max(1.42em, 17px);
  letter-spacing: 0.1em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  padding: 0.25em 0;
}
.nav__list { display: flex; gap: clamp(10px, 4.4cqw, 26px); }
.nav__list a {
  display: inline-block;
  padding: 0.95em 0 0.7em;
  font-size: max(0.7em, 10.5px);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
  transition: color 0.2s;
}
.nav__list a:hover { color: var(--ink); }
.nav__list a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.75em;
}

.content {
  position: relative;
  z-index: 2;
  flex: 1 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* title lockup: spaced capitals + script, read as one heading */
.title { display: flex; flex-direction: column; align-items: center; }
.title__h { display: flex; flex-direction: column; align-items: center; font-size: 1em; font-weight: 400; line-height: 1.3; outline: none; }
.caps {
  display: block;
  font-size: 1.02em;
  font-weight: 500;
  letter-spacing: 0.38em;
  margin-right: -0.38em; /* optical centring of tracked caps */
  text-transform: uppercase;
  color: var(--text);
}
.script {
  display: block;
  font-family: var(--script);
  font-weight: 400;
  color: var(--ink);
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}
.script--names { font-size: 13.2cqw; margin-top: 0.12em; }
.script--page  { font-size: 17.5cqw; margin-top: 0.02em; }
.script--place { font-size: 15cqw; margin-top: 0.06em; }
.date {
  margin-top: 0.2em;
  font-size: 2.05em;
  font-weight: 500;
  letter-spacing: 0.13em;
  margin-right: -0.13em;
  color: var(--ink);
  line-height: 1.1;
  font-variant-numeric: lining-nums;
}
.caps--place { font-size: 0.74em; letter-spacing: 0.44em; margin-right: -0.44em; margin-top: 0.75em; }
.drop { width: 2.3cqw; min-width: 9px; height: auto; margin-top: 0.6em; }
.drop path { fill: none; stroke: var(--ink); stroke-width: 1.1; }
.drop .drop__heart { fill: var(--ink); stroke: none; }

.rule { display: block; width: 9cqw; height: 1px; background: var(--ink); opacity: 0.55; margin: 1.5em auto 1.2em; }
.rule--short { margin: 1.1em auto 0; }

.caps-h {
  font-size: 0.95em;
  font-weight: 500;
  letter-spacing: 0.3em;
  margin-right: -0.3em;
  text-transform: uppercase;
  line-height: 1.6;
  color: var(--text);
}
.lead {
  margin-top: 0.6em;
  max-width: 31em;
  font-size: 1.04em;
  line-height: 1.55;
  color: var(--text);
  text-wrap: pretty;
}

/* CTA: outlined pill as on the card */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.8em;
  margin-top: 1.5em;
  padding: 0.78em 1.7em 0.72em;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 0.8em;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  background: rgba(253, 246, 238, 0.7);
  transition: background-color 0.25s, color 0.25s;
}
.pill:hover { background: var(--ink); color: var(--paper); }
.arrow { width: 1.7em; height: auto; flex: none; transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1); }
.arrow path { fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.pill:hover .arrow, .textlink:hover .arrow { transform: translateX(4px); }

.textlink {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  font-weight: 500;
}
.textlink .arrow { width: 1.5em; }

/* ---------- Home ---------- */
.content--home { padding-top: 4cqw; padding-bottom: 9cqw; }
.sheet[data-slug="home"] .wave--bottom { bottom: 2.5cqw; }
.photo { position: relative; width: 84cqw; margin-top: 2.2cqw; }
.photo__img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  aspect-ratio: 1.8;
  object-fit: cover;
  object-position: 45% 30%;
  border-radius: 11cqw 9cqw 2.4cqw 12cqw;
  box-shadow: 0 10px 24px -14px rgba(80, 48, 24, 0.45);
}
.deco--photo-left  { z-index: 2; width: 44cqw; left: -16cqw; top: -11cqw; transform: rotate(-14deg); }
.deco--photo-right { z-index: 2; width: 36cqw; right: -13cqw; bottom: -9cqw; transform: scaleX(-1) rotate(-30deg); }
.content--home .rule { margin-top: 2em; }

.deco--home-lemon { width: 38cqw; right: -19cqw; top: 9cqw; transform: rotate(4deg); z-index: 1; }
.deco--home-peach { width: 60cqw; left: -28cqw; bottom: -32cqw; }
.deco--home-pink  { width: 52cqw; left: 2cqw; bottom: -36cqw; transform: rotate(20deg); opacity: 0.9; }
.deco--home-aqua  { width: 52cqw; right: -26cqw; bottom: -32cqw; transform: rotate(-10deg); }

/* ---------- Details ---------- */
.content--details { padding-top: 5.5cqw; }
.facts { width: 100%; margin-top: 1.1em; text-align: left; }
.fact {
  display: grid;
  grid-template-columns: 10cqw 1fr;
  column-gap: 5.4cqw;
  align-items: start;
  padding: 0.8em 0 0.9em;
  border-top: 1px solid var(--hair);
}
.fact:first-child { border-top: 0; padding-top: 0; }
.icon { width: 10cqw; height: auto; margin-top: 0.1em; }
.icon path, .icon rect { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.fact__h {
  font-size: 0.92em;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 0.45em;
}
.fact__body p { font-size: 0.94em; line-height: 1.5; text-wrap: pretty; }
.fact__body .textlink { margin-top: 0.55em; font-size: 0.94em; }
.timeline { display: grid; grid-template-columns: auto 1fr; column-gap: 1.6em; row-gap: 0.18em; font-size: 0.96em; }
.timeline > div { display: contents; }
.timeline dt { text-align: right; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.timeline dd { color: var(--text); }
.swatches { display: flex; gap: 2.4cqw; margin-top: 0.85em; }
.swatches li { width: 7cqw; aspect-ratio: 1; border-radius: 50%; background: var(--c); box-shadow: inset 0 -2px 3px rgba(80, 48, 24, 0.12); }

.deco--det-pink { width: 50cqw; right: -32cqw; top: -24cqw; transform: rotate(14deg); }
.deco--det-sprig-top { width: 32cqw; right: -9cqw; top: 13cqw; transform: scaleX(-1) rotate(-8deg); z-index: 1; }
.deco--det-yellow { width: 62cqw; left: -22cqw; bottom: -34cqw; }
.deco--det-olive  { width: 62cqw; right: -24cqw; bottom: -36cqw; transform: rotate(30deg); opacity: 0.9; }
.deco--det-sprig-bottom { width: 30cqw; left: -9cqw; bottom: -3cqw; transform: rotate(-150deg) scaleY(-1); z-index: 1; }
.sheet[data-slug="details"] .wave--bottom { bottom: 9cqw; }
.content--details { padding-bottom: 7.5cqw; }

/* ---------- Location ---------- */
.content--location { padding-top: 5.5cqw; padding-bottom: 22cqw; }
.postcard { position: relative; width: 68cqw; margin: 3.4cqw 0 2cqw; }
.postcard__sheet { position: absolute; inset: 0; border-radius: 2px; }
.postcard__sheet--aqua { background: #bfe3e0; transform: translate(-5cqw, -3.4cqw) rotate(-4deg); }
.postcard__sheet--pink { background: #f6c3cf; transform: translate(-3.2cqw, 3.4cqw) rotate(3.5deg); }
.postcard__print {
  position: relative;
  z-index: 1;
  display: block;
  padding: 2.2cqw;
  background: #fffdf9;
  transform: rotate(1.6deg);
  box-shadow: 0 14px 26px -14px rgba(70, 40, 20, 0.5), 0 1px 2px rgba(70, 40, 20, 0.16);
}
.postcard__print img { width: 100%; height: auto; aspect-ratio: 1200 / 820; }
.deco--loc-sprig { z-index: 2; width: 28cqw; right: -17cqw; bottom: 0; transform: scaleX(-1) rotate(-38deg); }
.content--location .lead { margin-top: 1.4em; }
.deco--loc-grove { left: 0; bottom: -3cqw; width: 100%; height: auto; }

/* ---------- RSVP ---------- */
.content--rsvp { padding-top: 5.5cqw; justify-content: flex-start; }
.lead--rsvp { margin-top: 1.1em; max-width: 27em; }
.form-frame {
  position: relative;
  flex: 1 1 0;
  width: 100%;
  min-height: 300px;
  margin-top: 1.4em;
  border-radius: 4px;
  background: #fffdf9;
  box-shadow: 0 0 0 1px var(--hair), 0 14px 30px -20px rgba(70, 40, 20, 0.45);
  overflow: hidden;
}
.form-frame__loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-style: italic;
  color: var(--text-soft);
}
.form-frame__iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.form-fallback { margin-top: 0.9em; font-size: 0.86em; color: var(--text-soft); }
.form-fallback .textlink { font-size: 1em; }
.deco--rsvp-aqua  { width: 50cqw; left: -34cqw; top: -22cqw; transform: rotate(-16deg); }
.deco--rsvp-lemon { width: 27cqw; left: -13cqw; top: 15cqw; transform: scaleX(-1) rotate(-4deg); z-index: 1; }
.deco--rsvp-peach { width: 60cqw; right: -30cqw; bottom: -26cqw; transform: rotate(12deg); }
.deco--rsvp-yellow { width: 46cqw; left: -24cqw; bottom: -22cqw; opacity: 0.8; }

/* ---------- corner: dog-ear that turns the page ---------- */
.corner {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 10;
  width: max(13cqw, 48px);
  height: max(13cqw, 48px);
  padding: 0;
  border: 0;
  background: none;
  cursor: grab;
  touch-action: none;
}
.corner__fold {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 46%;
  height: 46%;
  background: linear-gradient(315deg, var(--ground) 0 48%, #efe2d2 50%, #fbf1e5 78%, #f3e6d6 100%);
  border-top-left-radius: 3px;
  box-shadow: -2px -2px 5px -2px rgba(80, 48, 24, 0.28);
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1), height 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.corner:hover .corner__fold, .corner:focus-visible .corner__fold { width: 66%; height: 66%; }
.corner:active { cursor: grabbing; }

/* ---------- pager below the card ---------- */
.pager {
  position: relative;
  z-index: 2;
  height: var(--ctl);
  width: min(560px, calc(100vw - 2 * var(--g)));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.pager__btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(155, 72, 38, 0.4);
  border-radius: 50%;
  background: rgba(253, 246, 238, 0.55);
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, opacity 0.2s;
}
.pager__btn svg { width: 20px; height: 20px; }
.pager__btn path { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.pager__btn:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.pager__btn:disabled { opacity: 0.35; cursor: default; }
.pager__dots { display: flex; gap: 2px; }
.pager__dots button {
  position: relative;
  width: 26px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.pager__dots button::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  border: 1px solid var(--ink);
  transition: transform 0.3s;
}
.pager__dots button[aria-current="step"]::after { background: var(--ink); transform: scale(1.15); }

/* ---------- phones: the card fills the screen ---------- */
@media (max-width: 640px) {
  :root { --g: 8px; --ctl: 48px; --gap: 4px; }
  .card {
    width: calc(100vw - 2 * var(--g));
    height: calc(100svh - var(--ctl) - var(--gap) - 2 * var(--g) - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    aspect-ratio: auto;
  }
  .card::before { transform: translate(3px, 4px) rotate(0.4deg); }
  .card::after  { transform: translate(-2px, 6px) rotate(-0.6deg); }
  .page { padding: 0 6cqw 8cqw; }
  .nav { padding-top: 3.6cqw; }
  .wave--top { top: 15cqw; }
  .content--home { padding-top: 10cqw; }
  .photo { width: 88cqw; }
  .deco--home-lemon { top: 13cqw; width: 33cqw; right: -15cqw; }
  .fact { grid-template-columns: 11cqw 1fr; column-gap: 4.4cqw; }
  .icon { width: 11cqw; }
  .content--location { padding-bottom: 34cqw; }
  .form-frame { min-height: 340px; flex: 1 1 0; }
  .pager { gap: 10px; }
}

/* ---------- reduced motion: pages fade instead of turning ---------- */
@media (prefers-reduced-motion: reduce) {
  .sheet { transform: none !important; }
  .face { opacity: calc(1 - var(--p)); }
  .face--front::after, .face--front::before { display: none; }
  .arrow, .corner__fold { transition: none; }
}

/* ---------- without JavaScript: pages simply follow one another ---------- */
html:not(.js) .stage { display: block; }
html:not(.js) .card { width: min(560px, 100%); aspect-ratio: auto; margin: 0 auto; container-type: inline-size; }
html:not(.js) .card::before, html:not(.js) .card::after { display: none; }
html:not(.js) .book { position: static; perspective: none; }
html:not(.js) .sheet { position: relative; transform: none; margin-bottom: 24px; height: 167cqw; }
html:not(.js) .face--back, html:not(.js) .corner, html:not(.js) .pager, html:not(.js) .form-frame { display: none; }
.form-frame.is-loaded .form-frame__loading { visibility: hidden; }

/* RSVP on phones: a clear in-world path to the form above the embed */
.rsvp-open { display: none; }
@media (max-width: 640px), (pointer: coarse) {
  .rsvp-open { display: inline-flex; margin-top: 1.1em; }
}
