/* alicia & ryan — shared stylesheet for every page.
   Text is ordinary flowing HTML on one fluid type scale. Only the decorative collage pieces are positioned,
   and only inside their own .collage box, which scales as a unit. */

@font-face { font-family: "29LT Makina"; src: url("/assets/fonts/29lt-makina-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("/assets/fonts/courier-prime-regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("/assets/fonts/courier-prime-bold.woff") format("woff"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("/assets/fonts/courier-prime-italic.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("/assets/fonts/courier-prime-bold-italic.woff") format("woff"); font-weight: 700; font-style: italic; font-display: swap; }

:root {
  --paper: #f1eee3;
  --ink: #222;
  --blue: #7790bb;      /* friday / faq */
  --blue-text: #5a74a3; /* same hue, dark enough to read as body text on the paper colour */
  --olive: #696d44;     /* saturday */
  --rose: #b96f67;      /* sunday */
  --rose-text: #a4554d;
  --wine: #6c2118;      /* call-out links */

  --font-display: "29LT Makina", "Courier Prime", "Courier New", monospace;
  --font-body: "Courier Prime", "Courier New", Courier, monospace;

  /* type scale: one set of sizes for all pages */
  --fs-display: clamp(1.75rem, 0.9rem + 4.1vw, 4.5rem);   /* page titles, home headline */
  --fs-h2: clamp(1.3rem, 1.03rem + 1.3vw, 2.25rem);       /* section headings */
  --fs-h3: clamp(1.125rem, 1.03rem + 0.45vw, 1.5rem);     /* sub-headings, sign-off */
  --fs-body: clamp(1rem, 0.95rem + 0.25vw, 1.1875rem);    /* never below 16px */
  --fs-small: clamp(0.9375rem, 0.9rem + 0.15vw, 1.0625rem);

  --measure: 34rem;      /* about 60-65 characters of Courier Prime */
  --gutter: clamp(1rem, 0.4rem + 3vw, 3.5rem);
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: clamp(2rem, 1.5rem + 2vw, 3.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0; min-height: 100svh; overflow-x: clip;
  background: var(--paper); color: var(--ink);
  font-family: var(--font-body); font-size: var(--fs-body); line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

h1, h2, h3, .display { font-family: var(--font-display); font-weight: 400; text-wrap: balance; }
h1, .display { font-size: var(--fs-display); line-height: 1.05; }
h2 { font-size: var(--fs-h2); line-height: 1.15; }
h3 { font-size: var(--fs-h3); line-height: 1.25; }
p, li, dd { text-wrap: pretty; overflow-wrap: break-word; }
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: var(--space-2); }
.prose > h2 { margin-top: var(--space-4); }
.prose > h2:first-child { margin-top: 0; }
.small { font-size: var(--fs-small); }

a { color: inherit; text-decoration: underline; text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 0.14em; }
a:focus-visible, button:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 2px; }
.callout { color: var(--wine); font-weight: 700; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- collage: decorative pieces placed in percentages of their own box ---------- */
.collage { position: relative; width: 100%; aspect-ratio: var(--ar); pointer-events: none; user-select: none; }
.collage--clip { overflow: clip; }
.piece {
  position: absolute; left: var(--x); top: var(--y); width: var(--w); height: var(--h);
  max-width: none; rotate: var(--r, 0deg); display: block;
}
.piece.flip, .piece .flip { scale: -1 1; }
.piece.crop { overflow: hidden; }
.piece.crop > img { position: absolute; max-width: none; display: block; }
svg.piece { overflow: visible; }

/* ---------- page shell for the inner pages ---------- */
.page { width: min(100%, 90rem); margin-inline: auto; padding: var(--space-3) var(--gutter) var(--space-4); }
.page-head { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }
.home-link { font-family: var(--font-display); font-size: var(--fs-small); line-height: 1.1; display: inline-block; padding: 0.6rem 0.25rem; }
/* title sitting on its paper banner: the banner art is a background layer, the heading is in flow */
.banner { display: grid; width: min(100%, var(--banner-w, 30rem)); container-type: inline-size; }
.banner > * { grid-area: 1 / 1; }
.banner > .collage { align-self: center; }
.banner > h1 {
  align-self: center; justify-self: center; text-align: center; z-index: 1;
  /* as large as it was on the banner, but never wider than the banner itself and never more than the display size */
  font-size: min(var(--title-size, 15cqw), calc(100cqw / (var(--chars, 8) * 0.64)), 4.5rem); white-space: nowrap; padding: 0.15em 0;
}
.columns { display: grid; gap: var(--space-4); align-items: start; }
.columns > .art { width: min(100%, var(--art-w, 30rem)); margin-inline: auto; }
@media (min-width: 60rem) {
  .columns { grid-template-columns: minmax(0, 1fr) minmax(0, var(--art-col, 1fr)); gap: var(--space-4) clamp(2rem, 4vw, 5rem); }
  .columns > .art { margin-inline: 0; justify-self: center; position: sticky; top: var(--space-3); }
}

/* sign-off written over the bottom corner of the photo collage */
.signed { display: grid; container-type: inline-size; }
.signed > * { grid-area: 1 / 1; }
.signoff { align-self: end; justify-self: end; z-index: 1; font-family: var(--font-display); font-size: var(--fs-h3); line-height: 1.3; padding: 0 4% 3% 0; text-align: left; }

/* ---------- home ---------- */
.home { min-height: 100svh; display: grid; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--gutter); width: min(100%, 96rem); margin-inline: auto; }
.home__photo { width: min(100%, 26rem); margin-inline: auto; }
.home__words { text-align: center; display: grid; gap: var(--space-3); justify-items: center; }
.home__splash { display: grid; width: min(100%, 36rem); }
.home__splash > * { grid-area: 1 / 1; }
.home__splash-text { z-index: 1; padding-top: 13%; display: grid; gap: 0.6rem; justify-items: center; align-content: start; }
.home__more { font-family: var(--font-display); font-size: var(--fs-h3); padding: 0.35rem 0.5rem; }
.home__trinkets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); align-items: center; justify-items: center; width: min(100%, 26rem); margin-inline: auto; }
.home__trinkets > .collage { width: min(100%, calc(var(--cw) * 0.8rem)); }
@media (min-width: 60rem) {
  .home { grid-template-columns: minmax(0, 31fr) minmax(0, 46fr) minmax(0, 13fr); gap: clamp(1rem, 2.5vw, 3rem); }
  .home__photo { width: 100%; max-width: 31rem; }
  .home__splash { width: min(100%, 37rem); }
  .home__trinkets { grid-template-columns: 1fr; gap: var(--space-3); width: 100%; }
  .home__trinkets > .collage { width: min(100%, calc(var(--cw) * 1rem)); }
}

/* ---------- entrance animation (only with JS on, and only if motion is welcome) ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }

  /* stop-motion: a piece appears, takes two jerky hops with a wobble, then lands */
  .js .piece.a-hop { animation: hop 720ms step-end both; animation-delay: var(--d, 0ms); }
  @keyframes hop {
    0% { opacity: 0; translate: calc(var(--dx, 0) * 1vw) calc(var(--dy, 0) * 1vw); rotate: calc(var(--r, 0deg) + var(--r0, 5deg)); }
    1% { opacity: 1; translate: calc(var(--dx, 0) * 0.56vw) calc(var(--dy, 0) * 0.56vw); rotate: calc(var(--r, 0deg) + 4.5deg); }
    34% { opacity: 1; translate: calc(var(--dx, 0) * 0.56vw) calc(var(--dy, 0) * 0.56vw); rotate: calc(var(--r, 0deg) + 4.5deg); }
    67% { opacity: 1; translate: calc(var(--dx, 0) * 0.21vw) calc(var(--dy, 0) * 0.21vw); rotate: calc(var(--r, 0deg) - 3.5deg); }
    100% { opacity: 1; translate: 0 0; rotate: var(--r, 0deg); }
  }
  /* smooth glide in */
  .js .piece.a-slide { animation: slide var(--dur, 500ms) cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: var(--d, 0ms); }
  @keyframes slide {
    from { opacity: 0; translate: calc(var(--dx, 0) * 0.12vw) calc(var(--dy, 0) * 0.12vw); }
    to { opacity: 1; translate: 0 0; }
  }
  .js .piece.a-fade { animation: fade 400ms ease-out both; animation-delay: var(--d, 0ms); }
  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
  /* watercolour wash painted in from the left */
  .js .piece.a-wipe {
    -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 45%, transparent 55%); mask-image: linear-gradient(90deg, #000 0%, #000 45%, transparent 55%);
    -webkit-mask-size: 230% 100%; mask-size: 230% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    animation: wipe var(--dur, 2200ms) linear both; animation-delay: var(--d, 0ms);
  }
  @keyframes wipe { from { -webkit-mask-position: 100% 0; mask-position: 100% 0; } to { -webkit-mask-position: 0% 0; mask-position: 0% 0; } }

  /* text: display lines type on, body copy rises in */
  .js [data-type]:not(.typed) { visibility: hidden; }
  .js [data-type] .ch { opacity: 0; animation: fade 1ms linear forwards; animation-delay: calc(var(--i) * 42ms + 150ms); }
  .js .rise { animation: rise 500ms cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: var(--d, 200ms); }
  @keyframes rise { from { opacity: 0; translate: 0 1.5rem; } to { opacity: 1; translate: 0 0; } }
}
.word { display: inline-block; white-space: nowrap; }

/* ---------- inner pages: content ---------- */
.banner > h1 { translate: calc(var(--sx, 0) * 1cqw) calc(var(--sy, 0) * 1cqw); }
.lead { font-family: var(--font-display); font-size: var(--fs-h3); line-height: 1.35; text-wrap: balance; }
.subhead { font-family: var(--font-body); font-weight: 700; font-size: var(--fs-body); line-height: 1.4; text-wrap: balance; }
.tone-blue { color: var(--blue); }
.tone-olive { color: var(--olive); }
.tone-rose { color: var(--rose); }

.signoff { padding: 0; margin: 0 var(--sign-r, 4%) var(--sign-b, 3%) var(--sign-l, 0); justify-self: var(--sign-j, end); white-space: nowrap; font-size: clamp(1.125rem, 5cqw, 2.25rem); }
.signoff--right { text-align: right; }

/* FAQ: question / answer pairs */
.faq > .qa + .qa { margin-top: var(--space-3); }
.qa > * + * { margin-top: 0.35rem; }
.hotels > li { font-style: italic; padding-left: 1.2em; text-indent: -1.2em; }
.hotels > li + li { margin-top: 0.5rem; }
.stars { font-style: normal; white-space: nowrap; }

/* schedule: one block per day */
.schedule > .day + .day { margin-top: var(--space-4); }
.day > * + * { margin-top: 0.5rem; }
.day > h3 { margin-top: var(--space-3); font-size: var(--fs-h2); }
.day > h3 + p { margin-top: 0.25rem; }
.events { margin-top: var(--space-2) !important; display: grid; gap: 0.5rem; }
.events > li { padding-left: 1.4em; text-indent: -1.4em; }
.events > li::before { content: "\2014\00a0"; }

/* directions */
address { font-style: normal; font-weight: 700; }
.directions > address { margin-top: 0; }
.directions > h2 { margin-top: var(--space-3); }
.arrows { display: grid; gap: 0.35rem; }
.arrows > li { padding-left: 1.9em; text-indent: -1.9em; }
.arrows > li::before { content: "\27F6\00a0"; }
.directions > .arrows + .arrows { margin-top: var(--space-3); }
.directions > .callout { margin-top: var(--space-3); }

.map { width: min(100%, 40rem); }
.map > img { display: block; width: 100%; height: auto; }

/* where the RSVP form will be mounted */
.form-placeholder { border: 2px dashed var(--rose); border-radius: 0.5rem; padding: var(--space-3); min-height: 16rem; display: grid; align-content: center; gap: var(--space-1); background: rgb(255 255 255 / 0.35); }
.form-placeholder > h2 { font-family: var(--font-body); font-weight: 700; font-size: var(--fs-body); letter-spacing: 0.04em; text-transform: uppercase; color: var(--rose-text); }
.form-placeholder > p { font-size: var(--fs-small); max-width: 32rem; }

/* second schedule page: framed photos across the top; friday + saturday beside sunday on wide screens */
.frames { width: min(100%, 44rem); margin: 0 auto var(--space-3); }
.schedule--wide { display: grid; gap: var(--space-4); }
.schedule--wide > .schedule { max-width: var(--measure); }
.day__deco { width: min(55%, 13rem); margin-bottom: var(--space-1); }
.trinkets { display: grid; grid-template-columns: 1fr 2.2fr 1.6fr; gap: var(--space-2); align-items: center; width: min(100%, 24rem); margin-top: var(--space-4); }
@media (min-width: 60rem) {
  .page--schedule-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); column-gap: clamp(2rem, 4vw, 5rem); align-items: start; }
  .page--schedule-2 > .page-head { margin-bottom: 0; }
  .page--schedule-2 > .frames { width: 100%; margin: 0; }
  .page--schedule-2 > .schedule--wide { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: clamp(2rem, 5vw, 6rem); margin-top: var(--space-4); width: min(100%, 76rem); margin-inline: auto; }
  .day--doves { display: grid; grid-template-columns: minmax(0, 1fr); }
}

/* RSVP page: the form component (built separately, see /rsvp/rsvp.css) sits in the text column. Its own
   header repeats the page title and home link, so it is hidden here. */
.rsvp-col { max-width: 40rem; display: grid; gap: var(--space-2); }
.rsvp-col .rsvp-head { display: none; }
.preview-note { font-size: var(--fs-small); color: var(--rose-text); border: 1px dashed var(--rose); border-radius: 0.35rem; padding: 0.4rem 0.7rem; justify-self: start; }
