/* ==========================================================================
   Theme: ROSA  —  quinceañera / sweet 16 demo
   Mood: ballroom programme, velvet ribbon, antique gold-leaf edge, a
   corsage pinned to wine-coloured card.
   Pairing: Allura (legible flowing script; names only)
   / Bodoni Moda (high-contrast didone, optical sizes 6–96) / Tenor Sans
   (engraved, flared caps for labels).
   Spec: design/design-system.md   Contrast table: design/themes.md
   Rules: --c-primary (dusty rose) is NOT a text colour on paper (3.0:1) —
   it is a fill; ink on rose is 4.7:1. --c-foil is decorative only.
   Themes never set `transform` or `position` on hooks (base.css owns layout).
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Allura&family=Bodoni+Moda:ital,opsz,wght@0,6..96,400..700;1,6..96,400..700&family=Tenor+Sans&display=optional');

:root {
  /* --- required contract --- */
  --c-page:      #EBDBD4;   /* blush satin */
  --c-paper:     #F9F1EC;   /* pearl stock */
  --c-paper-2:   #5A1828;   /* wine card */
  --c-ink:       #3B1820;   /* 14.1:1 on paper */
  --c-ink-soft:  #6A4249;   /* 7.6:1 paper, 6.3:1 page */
  --c-primary:   #B97D84;   /* dusty rose — fill only */
  --c-accent:    #5A1828;   /* deep wine — 11.8:1 as text */
  --c-foil:      #B48F57;   /* antique gold leaf — decorative only */
  --font-script: 'Allura', 'Snell Roundhand', 'Apple Chancery', cursive;
  --font-serif:  'Bodoni Moda', 'Didot', 'Bodoni 72', 'Times New Roman', serif;
  --font-sans:   'Tenor Sans', 'Optima', 'Candara', sans-serif;

  /* --- extended tokens --- */
  --c-on-paper-2:      #F6E7DF;  /* 10.9:1 on wine */
  --c-on-paper-2-soft: #E2C6BD;  /* 8.2:1 */
  --c-on-primary:      #3B1820;  /* 4.7:1 on rose — ≥18px only */
  --c-on-accent:       #F9F1EC;  /* 11.8:1 */
  --c-text-accent:     #5A1828;
  --c-foil-ink:        #7B5C2A;  /* 5.5:1 on paper */
  --c-envelope:        #6B2233;
  --c-photo-paper:     #FCF8F5;
  --c-line:            rgba(59, 24, 32, .25);
  --c-focus:           #5A1828;
  --shadow-rgb:        52, 20, 28;
  --shadow-paper: 0 1px 1px rgba(var(--shadow-rgb), .14),
                  0 6px 12px -6px rgba(var(--shadow-rgb), .28),
                  0 24px 36px -24px rgba(var(--shadow-rgb), .42);
  --shadow-lift:  0 2px 2px rgba(var(--shadow-rgb), .12),
                  0 14px 22px -10px rgba(var(--shadow-rgb), .32),
                  0 36px 50px -30px rgba(var(--shadow-rgb), .45);
  --radius-paper: 1px;
  --grain: url(../assets/shared/paper-grain.svg);
  --grain-size: 200px;
  --ease-paper: cubic-bezier(.2, .7, .2, 1);
  --dur-lift: 240ms;
}

/* ---------- page ground ---------- */
body {
  background-color: var(--c-page);
  background-image: url(../assets/shared/paper-grain.svg);
  background-size: var(--grain-size);
  background-blend-mode: multiply;
  color: var(--c-ink);
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-optical-sizing: auto;
}

/* ---------- shared paper behaviour ---------- */
.card, .card--alt, .polaroid, .tag-button, .envelope, .page {
  background-image: url(../assets/shared/paper-grain.svg);
  background-size: var(--grain-size);
  background-blend-mode: multiply;
}
.card, .card--alt, .polaroid, .tag-button, .seal, .envelope {
  transition: translate var(--dur-lift) var(--ease-paper),
              scale 120ms ease-out,
              box-shadow var(--dur-lift) var(--ease-paper);
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) and (pointer: fine) {
  .card:hover, .polaroid:hover, .tag-button:hover, .envelope:hover {
    translate: 0 -4px;
    box-shadow: var(--keyline, 0 0 #0000), var(--shadow-lift);
  }
  .seal:hover { translate: 0 -2px; }
}
.card:active, .polaroid:active, .tag-button:active, .seal:active { scale: .985; }

:where(.card, .card--alt, .polaroid, .tag-button, .seal, .envelope, .btn, a, button, input, select, textarea):focus-visible {
  outline: 2px dashed var(--c-focus);
  outline-offset: 6px;
}

.polaroid, .tag-button, .envelope { --keyline: 0 0 #0000; }

/* ---------- envelope ---------- */
.envelope {
  background-color: var(--c-envelope);
  color: var(--c-on-paper-2);
  border-radius: var(--radius-paper);
  box-shadow: var(--shadow-paper);
}
.envelope {
  --envelope-liner-image: url(../assets/rosa/envelope-liner.svg);
  --envelope-interior: #cbaea7;
}

/* ---------- invitation card (pearl, gilt edge) ---------- */
.card {
  background-color: var(--c-paper);
  color: var(--c-ink);
  border-radius: var(--radius-paper);
  /* gilt edge (outer 2px) + engraved inner rule */
  --keyline: inset 0 0 0 2px var(--c-foil),
              inset 0 0 0 11px var(--c-paper),
              inset 0 0 0 12px rgba(90, 24, 40, .35);
  box-shadow: var(--keyline), var(--shadow-paper);
  text-align: center;
}
.card :where(h1, h2, .card__names) {
  font-family: var(--font-script);
  font-weight: 400;
  color: var(--c-text-accent);
  line-height: 1.1;
}
.card :where(.card__kicker, small) {
  font-family: var(--font-sans);
  font-size: .75rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--c-ink-soft);
}

/* ---------- wine card ---------- */
.card--alt {
  background-color: var(--c-paper-2);
  color: var(--c-on-paper-2);
  --keyline: inset 0 0 0 2px var(--c-foil),
              inset 0 0 0 11px var(--c-paper-2),
              inset 0 0 0 12px rgba(180, 143, 87, .6);
  box-shadow: var(--keyline), var(--shadow-paper);
}
.card--alt :where(h1, h2, .card__names, .card__date) { color: var(--c-on-paper-2); }
.card--alt :where(.card__kicker, small, p) { color: var(--c-on-paper-2-soft); }

/* ---------- seal: gold wax ---------- */
.seal {
  background: url(../assets/rosa/seal.svg) center / contain no-repeat;
  border-radius: 50%;
  color: var(--c-ink);
  font-family: var(--font-script);
  min-width: 44px;
  min-height: 44px;
  filter: drop-shadow(0 2px 1px rgba(var(--shadow-rgb), .35))
          drop-shadow(0 6px 8px rgba(var(--shadow-rgb), .25));
}

/* ---------- polaroids ---------- */
.polaroid {
  background-color: var(--c-photo-paper);
  color: var(--c-ink);
  padding: 6% 6% 20%;
  border-radius: 1px;
  box-shadow: var(--shadow-paper);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.0625rem;
  line-height: 1.25;
  text-align: center;
}
.polaroid img, .polaroid .polaroid__photo {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background-color: #DCC3BC;
  filter: sepia(.1) saturate(.9);
}
/* a short length of velvet ribbon instead of tape */
.polaroid::before {
  content: '';
  position: absolute;
  top: -9px; right: 12%;
  width: 30%; height: 18px;
  rotate: 6deg;
  background-color: var(--c-envelope);
  background-image: url(../assets/shared/paper-grain.svg);
  background-size: 100px;
  background-blend-mode: soft-light;
  clip-path: polygon(0 0, 100% 0, 94% 50%, 100% 100%, 0 100%, 6% 50%);  /* swallowtail ends */
  box-shadow: 0 1px 1px rgba(var(--shadow-rgb), .3);
  pointer-events: none;
}

/* ---------- round "details" tag ---------- */
.tag-button {
  background-color: var(--c-primary);
  color: var(--c-on-primary);
  border: 0;
  border-radius: 50%;
  min-width: 44px;
  min-height: 44px;
  box-shadow: var(--shadow-paper);
  font-family: var(--font-sans);
  font-size: .8125rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
}
.tag-button :where(em, .tag-button__script) {
  display: block;
  font-family: var(--font-script);
  font-style: normal;
  text-transform: none;
  letter-spacing: 0;
  font-size: 3em;
  line-height: .95;
  color: var(--c-ink);
}
.tag-button::before {
  content: '';
  position: absolute;
  top: 9%; left: 50%;
  width: 10%; aspect-ratio: 1;
  translate: -50% 0;
  border-radius: 50%;
  background: var(--c-page);
  box-shadow: 0 0 0 2.5px var(--c-foil), inset 0 1px 2px rgba(var(--shadow-rgb), .5);
}
.tag-button::after {
  content: '';
  position: absolute;
  inset: 5%;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--c-foil);
  pointer-events: none;
}

/* ---------- countdown band ---------- */
.countdown {
  background-color: var(--c-paper-2);
  background-image: url(../assets/shared/paper-grain.svg);
  background-size: var(--grain-size);
  background-blend-mode: multiply;
  color: var(--c-on-paper-2);
  font-family: var(--font-serif);
  box-shadow: inset 0 3px 0 -1px var(--c-foil), inset 0 -3px 0 -1px var(--c-foil);
}
.countdown :where(.countdown__title) {
  font-family: var(--font-script);
  font-size: clamp(2.5rem, 10vw, 3.75rem);
  line-height: 1;
  color: var(--c-on-paper-2);
}
.countdown :where(.countdown__unit) {
  background-color: var(--c-paper);
  color: var(--c-ink);
  border-radius: var(--radius-paper);
  box-shadow: inset 0 0 0 1px var(--c-foil), 0 8px 12px -8px rgba(0, 0, 0, .5);
}
.countdown :where(.countdown__num) {
  font-family: var(--font-serif);
  font-weight: 500;
  font-variant-numeric: lining-nums tabular-nums;
  line-height: 1;
}
.countdown :where(.countdown__label) {
  font-family: var(--font-sans);
  font-size: .6875rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--c-ink-soft);
}

/* ---------- inner pages ---------- */
.page {
  background-color: var(--c-paper);
  color: var(--c-ink);
  box-shadow: var(--shadow-lift);
}
.page__title {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(3rem, 14vw, 4.75rem);
  line-height: 1;
  color: var(--c-text-accent);
}
.page :where(h2, h3) {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: .8125rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--c-text-accent);
}
.page :where(a:not(.btn)) {
  color: var(--c-text-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
}

/* ---------- form fields ---------- */
.field label, .field legend {
  font-family: var(--font-sans);
  font-size: .75rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--c-ink-soft);
}
.field :where(input, select, textarea) {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  color: var(--c-ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--c-ink-soft);
  border-radius: 0;
  min-height: 48px;
  padding: .5rem .125rem;
}
.field textarea {
  background-image: repeating-linear-gradient(to bottom, transparent 0 1.95rem, var(--c-line) 1.95rem 2rem);
  line-height: 2rem;
  border-bottom: 0;
}
.field :where(input, select, textarea)::placeholder { color: var(--c-ink-soft); opacity: 1; font-style: italic; }
.field :where(input, select, textarea):focus { border-bottom: 2px solid var(--c-accent); }
.field :where(input[type=radio], input[type=checkbox]) { accent-color: var(--c-accent); width: 22px; height: 22px; min-height: 0; }
.field [aria-invalid=true] { border-bottom-color: #8E1B1B; }
.field .field__error { color: #8E1B1B; font-size: .9375rem; font-style: italic; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 48px;
  min-width: 44px;
  padding: .75rem 1.75rem;
  background-color: var(--c-accent);
  background-image: url(../assets/shared/paper-grain.svg);
  background-size: 160px;
  background-blend-mode: multiply;
  color: var(--c-on-accent);
  border: 0;
  border-radius: var(--radius-paper);
  font-family: var(--font-sans);
  font-size: .875rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px var(--c-foil), inset 0 0 0 4px var(--c-accent), inset 0 0 0 5px rgba(180, 143, 87, .5);
  cursor: pointer;
  transition: background-color 160ms ease, translate 120ms ease;
}
.btn:hover { filter: brightness(.86); }
.btn:active { translate: 0 1px; }
.btn[disabled], .btn[aria-disabled=true] { opacity: .55; cursor: not-allowed; }
.btn--ghost {
  background: transparent;
  color: var(--c-text-accent);
  box-shadow: inset 0 0 0 1px currentColor;
}

@media (prefers-reduced-motion: reduce) {
  .card, .card--alt, .polaroid, .tag-button, .seal, .envelope, .btn { transition: none; }
  .card:hover, .polaroid:hover, .tag-button:hover, .envelope:hover, .seal:hover { translate: none; }
}

/* ==========================================================================
   PHASE 2 — launch fixes (design/design-system.md §5, BRIEF-v2 fix list)
   ========================================================================== */

/* page-title ornament: rendered by the engine as <img class="page__sprig"> (header-sprig.svg) */
.page__title::after { content: none; }
.page__sprig { display: block; width: 132px; max-width: 40%; height: auto; margin: .35em auto 0; }

/* polaroid captions: serif italic, never below 16px */
.polaroid__caption,
.gallery__item .polaroid__caption {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: max(16px, 10cqi);
  letter-spacing: .01em;
  line-height: 1.2;
  color: var(--c-ink);
}
.gallery__item .polaroid__caption { font-size: 1.0625rem; }

/* real photos: a touch of warmth, printed grain and a fine edge, so phone snaps sit on the paper */
.photo-frame img, .polaroid img, .gallery__photo img {
  filter: sepia(.08) saturate(.92) contrast(.96) brightness(1.02);
}
.photo-frame::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background-color: rgba(220, 170, 160, .14);
  background-image: url(../assets/shared/paper-grain.svg);
  background-size: 160px;
  background-blend-mode: multiply;
  mix-blend-mode: multiply;
  opacity: .5;
  box-shadow: inset 0 0 0 1px rgba(var(--shadow-rgb), .14), inset 0 0 18px rgba(var(--shadow-rgb), .10);
}

/* attendance tickets */
.choices--tickets .choice {
  font-family: var(--font-sans);
  font-size: .8125rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  line-height: 1.35;
  hyphens: manual;
  overflow-wrap: normal;
  word-break: normal;
  letter-spacing: .12em;
  border: 0;
  box-shadow: inset 0 0 0 2px var(--c-foil), inset 0 0 0 7px var(--c-paper), inset 0 0 0 8px rgba(90, 24, 40, .3), var(--shadow-paper);
}
.choices--tickets .choice:has(input:checked) {
  background-color: var(--c-paper-2);
  color: var(--c-on-paper-2);
  box-shadow: inset 0 0 0 2px var(--c-foil), inset 0 0 0 7px var(--c-paper-2), inset 0 0 0 8px rgba(180, 143, 87, .7), var(--shadow-paper);
}

/* RSVP success: the reply card comes back stamped */
.rsvp-thanks {
  rotate: -1.2deg;
  margin: .5rem auto 0;
  max-width: 30rem;
  padding: 2.75rem 1.75rem 2.25rem;

}
.rsvp-thanks:hover { translate: none; box-shadow: var(--keyline), var(--shadow-paper); }
.page .rsvp-thanks__title {
  font-family: var(--font-script);
  font-size: clamp(3rem, 13vw, 3.75rem);
  line-height: 1;
  color: var(--c-text-accent);
  margin: .1em 0 0;

}
.rsvp-thanks p {
  max-width: 24ch;
  font-style: italic;
  font-size: 1.125rem;
  line-height: 1.5;
}
.rsvp-thanks p::before {
  content: '';
  display: block;
  width: 56px; height: 0;
  margin: 0 auto .9rem;
  border-top: 1px dashed rgba(180, 143, 87, .8);
}
.rsvp-thanks .demo-note { font-style: normal; font-size: .8125rem; color: var(--c-ink-soft); }
.rsvp-thanks .demo-note::before { display: none; }

/* hyphenation: Spanish copy in spaced capitals must never break mid-word */
body, .card, .page, .choice, .tag-button {
  hyphens: manual;
  -webkit-hyphens: manual;
  overflow-wrap: normal;
}
.card :where(.card__kicker, .invite__line, small), .page :where(.page__kicker, .page__lede), .rsvp-thanks p {
  text-wrap: balance;
}
.card :where(.card__kicker, .invite__line) { letter-spacing: .16em; }


/* tickets: long Spanish words ("LAMENTABLEMENTE") overflowed in spaced capitals; set them as Bodoni italic */
.choices--tickets .choice {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: .975rem;
  letter-spacing: 0;
  text-transform: none;
  padding-inline: .6rem;
}
