/* ==========================================================================
   Theme: SAFARI  —  baby shower demo
   Mood: a children's picture book left open on a sunny table — gouache animals
   asleep in the long grass, sand-coloured stock, terracotta and sage.
   Pairing: Corinthia (airy, legible script; display sizes only) / Crimson Pro
   (warm book serif) / Work Sans (quiet labels).
   Rules: --c-sage and --c-foil are decorative only. Text sage is --c-primary
   (#5E6A4C, 5.4:1 on paper). Tag is pale terracotta with ink (5.8:1).
   Themes never set `transform` or `position` on hooks (base.css owns layout).
   Seal art + wax colour come from the seal artist (base.css) — no filter here.
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Corinthia:wght@400;700&family=Crimson+Pro:ital,wght@0,400;0,500;0,600;1,400&family=Work+Sans:wght@400;500;600&display=optional');

:root {
  /* --- required contract --- */
  --c-page:      #F1E9DB;   /* warm sand */
  --c-paper:     #FBF6EC;   /* cream picture-book stock */
  --c-paper-2:   #E7D6B9;   /* sand stock */
  --c-ink:       #3A3A32;   /* warm graphite — 10.7:1 on paper */
  --c-ink-soft:  #57564A;   /* 6.9:1 paper, 6.1:1 page, 5.2:1 sand */
  --c-primary:   #5E6A4C;   /* deep sage, text-safe (5.4:1) */
  --c-sage:      #8E9A78;   /* brief sage — liner, decor only */
  --c-accent:    #C47E57;   /* terracotta — fill only */
  --c-foil:      #B8955A;   /* dry-grass gold — decorative only */
  --font-script: 'Corinthia', 'Snell Roundhand', 'Apple Chancery', cursive;
  --font-serif:  'Crimson Pro', 'Iowan Old Style', Georgia, serif;
  --font-sans:   'Work Sans', 'Avenir Next', 'Helvetica Neue', sans-serif;

  /* --- extended tokens --- */
  --c-on-paper-2:      #3A3A32;  /* 8.0:1 on sand */
  --c-on-paper-2-soft: #4F4E43;  /* 5.6:1 on sand */
  --c-on-primary:      #FBF6EC;  /* 5.4:1 */
  --c-on-accent:       #3A3A32;
  --c-tag:             #E2AE8C;  /* pale terracotta tag — ink 5.8:1 */
  --c-text-accent:     #5E6A4C;
  --c-foil-ink:        #7C5B2C;  /* 5.8:1 on paper */
  --c-envelope:        #D9C29C;
  --c-photo-paper:     #FDFAF3;
  --c-line:            rgba(58, 58, 50, .22);
  --c-focus:           #5E6A4C;
  --shadow-rgb:        74, 60, 40;
  --shadow-paper: 0 1px 1px rgba(var(--shadow-rgb), .10),
                  0 6px 12px -6px rgba(var(--shadow-rgb), .20),
                  0 20px 30px -20px rgba(var(--shadow-rgb), .30);
  --shadow-lift:  0 2px 2px rgba(var(--shadow-rgb), .10),
                  0 14px 22px -10px rgba(var(--shadow-rgb), .26),
                  0 30px 44px -28px rgba(var(--shadow-rgb), .34);
  --radius-paper: 3px;
  --grain: url(../assets/shared/paper-grain.svg);
  --grain-size: 260px;
  --ease-paper: cubic-bezier(.2, .7, .2, 1);
  --dur-lift: 260ms;
}

/* ---------- 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;
}

/* ---------- 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 140ms 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 -3px;
    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-ink);
  border-radius: var(--radius-paper);
  box-shadow: var(--shadow-paper);
}
.envelope {
  --envelope-liner-image: url(../assets/safari/envelope-liner.svg);
  --envelope-interior: #e4d6bb;
}

/* ---------- invitation card ---------- */
.card {
  background-color: var(--c-paper);
  color: var(--c-ink);
  border-radius: var(--radius-paper);
  /* single sage hairline + a fine terracotta inner rule, like a picture-book plate */
  --keyline: inset 0 0 0 10px var(--c-paper),
              inset 0 0 0 11px rgba(94, 106, 76, .5),
              inset 0 0 0 14px var(--c-paper),
              inset 0 0 0 15px rgba(196, 126, 87, .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-primary);
  line-height: 1;
}
.card :where(.card__kicker, small) {
  font-family: var(--font-sans);
  font-size: .75rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--c-ink-soft);
}

/* ---------- sand card ---------- */
.card--alt {
  background-color: var(--c-paper-2);
  color: var(--c-on-paper-2);
  --keyline: inset 0 0 0 10px var(--c-paper-2),
              inset 0 0 0 11px rgba(58, 58, 50, .3);
  box-shadow: var(--keyline), var(--shadow-paper);
}
.card--alt :where(h1, h2, .card__names, .card__date) { color: var(--c-ink); }
.card--alt :where(.card__kicker, small, p) { color: var(--c-on-paper-2-soft); }

/* ---------- seal: terracotta wax (art + wax colour by the seal artist) ---------- */
.seal {
  background: url(../assets/safari/seal.svg) center / contain no-repeat;
  border-radius: 50%;
  color: var(--c-ink);
  font-family: var(--font-script);
  min-width: 44px;
  min-height: 44px;
}

/* ---------- 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-script);
  font-size: 1.875rem;            /* 30px — script floor */
  line-height: 1;
  text-align: center;
}
.polaroid img, .polaroid .polaroid__photo {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background-color: #E4D6BC;
  filter: saturate(.85);
}
/* a strip of sage washi tape */
.polaroid::before {
  content: '';
  position: absolute;
  top: -8px; left: 14%;
  width: 26%; height: 20px;
  rotate: -7deg;
  background-color: rgba(142, 154, 120, .55);
  background-image: url(../assets/shared/paper-grain.svg);
  background-size: 120px;
  background-blend-mode: multiply;
  pointer-events: none;
}

/* ---------- round "details" tag ---------- */
.tag-button {
  background-color: var(--c-tag);
  color: var(--c-on-accent);
  border: 0;
  border-radius: 50%;
  min-width: 44px;
  min-height: 44px;
  box-shadow: var(--shadow-paper);
  font-family: var(--font-sans);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
}
.tag-button :where(em, .tag-button__script) {
  display: block;
  font-family: var(--font-script);
  font-weight: 400;
  font-style: normal;
  text-transform: none;
  letter-spacing: 0;
  font-size: 3.6em;
  line-height: .9;
}
.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 2px var(--c-paper), inset 0 1px 2px rgba(var(--shadow-rgb), .4);
}
.tag-button::after {
  content: '';
  position: absolute;
  inset: 7%;
  border: 1px dashed rgba(58, 58, 50, .35);
  border-radius: 50%;
  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-ink);
  font-family: var(--font-serif);
}
.countdown :where(.countdown__title) {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(2.5rem, 10vw, 3.5rem);
  line-height: 1;
  color: var(--c-ink);            /* 8.0:1 on sand */
}
.countdown :where(.countdown__unit) {
  background-color: var(--c-paper);
  color: var(--c-ink);
  border-radius: var(--radius-paper);
  box-shadow: 0 1px 1px rgba(var(--shadow-rgb), .15), 0 8px 12px -8px rgba(var(--shadow-rgb), .35);
}
.countdown :where(.countdown__num) {
  font-family: var(--font-serif);
  font-weight: 400;
  font-variant-numeric: lining-nums tabular-nums;
  line-height: 1;
}
.countdown :where(.countdown__label) {
  font-family: var(--font-sans);
  font-size: .6875rem;
  letter-spacing: .2em;
  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(3.25rem, 15vw, 5rem);
  line-height: .9;
  color: var(--c-primary);
}
.page :where(h2, h3) {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: .8125rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--c-primary);
}
.page :where(a:not(.btn)) {
  color: var(--c-text-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
}

/* ---------- form fields ---------- */
.field label, .field legend {
  font-family: var(--font-sans);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .18em;
  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: 1.5px 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-color: var(--c-primary); }
.field :where(input[type=radio], input[type=checkbox]) { accent-color: var(--c-primary); width: 22px; height: 22px; min-height: 0; }
.field [aria-invalid=true] { border-bottom-color: #8A2E1C; }
.field .field__error { color: #8A2E1C; 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-primary);
  background-image: url(../assets/shared/paper-grain.svg);
  background-size: 160px;
  background-blend-mode: multiply;
  color: var(--c-on-primary);
  border: 0;
  border-radius: 3px;
  font-family: var(--font-sans);
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 1px 1px rgba(var(--shadow-rgb), .25);
  cursor: pointer;
  transition: background-color 160ms ease, translate 120ms ease;
}
.btn:hover { background-color: #4E5A3E; }
.btn:active { translate: 0 1px; }
.btn[disabled], .btn[aria-disabled=true] { opacity: .55; cursor: not-allowed; }
.btn--ghost {
  background: transparent;
  color: var(--c-primary);
  box-shadow: inset 0 0 0 1.5px 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(.06) saturate(.92) contrast(.96) brightness(1.02);
}
.photo-frame::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background-color: rgba(196, 126, 87, .10);
  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;
  font-weight: 600;
  letter-spacing: .14em;
  border: 0;
  box-shadow: inset 0 0 0 6px var(--c-paper), inset 0 0 0 7px rgba(94, 106, 76, .45), var(--shadow-paper);
}
.choices--tickets .choice:has(input:checked) {
  background-color: var(--c-paper-2);
  color: var(--c-ink);
  box-shadow: inset 0 0 0 6px var(--c-paper-2), inset 0 0 0 7px var(--c-primary), 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-primary);
  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(196, 126, 87, .6);
}
.rsvp-thanks .demo-note { font-style: normal; font-size: .8125rem; color: var(--c-ink-soft); }
.rsvp-thanks .demo-note::before { display: none; }


/* ==========================================================================
   SAFARI touches
   ========================================================================== */
/* Corinthia is lighter than Rouge Script: set display script a touch larger and bolder */
.card :where(h1, h2, .card__names), .page__title, .countdown :where(.countdown__title),
.page .rsvp-thanks__title { font-weight: 700; }
.page__title { font-size: clamp(3.5rem, 16vw, 5.5rem); }
.polaroid { font-size: 2.125rem; }
/* countdown band in sand with a sage pinstripe edge, under the clothesline garland */
.countdown {
  box-shadow: inset 0 3px 0 rgba(94, 106, 76, .35), inset 0 -3px 0 rgba(94, 106, 76, .35);
}
/* the clothesline hangs ~48% of its height below the band's top edge: give the title room
   (garland is 112vw wide, 1400x220, below 1024px; capped at 170px tall above) */
.countdown { padding-top: max(2rem, calc(8.8vw + .5rem)); }
@media (min-width: 1024px) { .countdown { padding-top: 6rem; } }
