/* ==========================================================================
   Theme: TIDE  —  baby shower demo ("sleep tight, little tide")
   Mood: a quiet moonlit cove at dusk — gouache washes of foam-teal and warm
   sand, a sleeping baby whale, a sea turtle on a slow wave, a starfish and
   scattered shells; a deep-sea envelope lining with painted bubbles and
   small stars overhead; cards drawn with a soft looping hand.
   Pairing: Sacramento (flowing single-stroke script; display sizes only) /
   Lora (warm book serif, text safe) / Nunito (rounded sans for tiny labels).
   Rules: --c-accent (coral) and --c-foil are fills only; ink on coral is
   6.9:1. Text teal is --c-primary #406B7C (5.6:1 on paper); the softer
   wave teal #88AEB3 (--c-wave) is decoration only. Script >= 28px.
   Themes never set `transform` or `position` on hooks (base.css owns layout).
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Sacramento&family=Lora:ital,wght@0,400;0,500;0,600;1,400&family=Nunito:wght@400;600;700&display=optional');

:root {
  /* --- required contract --- */
  --c-page:      #E6EDED;   /* very pale sea foam */
  --c-paper:     #F7F2E4;   /* warm cream shore paper */
  --c-paper-2:   #CDD9DC;   /* foam / mist card stock */
  --c-ink:       #1F3B4D;   /* deep sea — 11.3:1 on paper */
  --c-ink-soft:  #53697A;   /* 5.2:1 on paper */
  --c-primary:   #406B7C;   /* deep teal, text-safe (5.6:1 on paper) */
  --c-accent:    #D47D5A;   /* coral — fill only */
  --c-foil:      #C09355;   /* warm brass */
  --font-script: 'Sacramento', 'Snell Roundhand', 'Apple Chancery', cursive;
  --font-serif:  'Lora', 'Iowan Old Style', Georgia, serif;
  --font-sans:   'Nunito', 'Avenir Next', 'Helvetica Neue', sans-serif;

  /* --- extended tokens --- */
  --c-on-paper-2:      #1F3B4D;  /* 8.4:1 on foam */
  --c-on-paper-2-soft: #3C536B;  /* 5.1:1 on foam */
  --c-on-primary:      #F7F2E4;  /* 5.6:1 */
  --c-on-accent:       #1F3B4D;  /* 6.9:1 on coral */
  --c-text-accent:     #406B7C;
  --c-foil-ink:        #7E5C27;  /* 4.6:1 on paper */
  --c-wave:            #88AEB3;  /* soft wave teal — decoration only */
  --c-depth:           #1F3B4D;  /* envelope liner / countdown night */
  --c-envelope:        #88AEB3;  /* sea mist stock */
  --c-photo-paper:     #FDFCF8;
  --c-line:            rgba(31, 59, 77, .2);
  --c-stitch:          rgba(64, 107, 124, .5);
  --c-focus:           #406B7C;
  --shadow-rgb:        30, 50, 68;
  --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: 4px;
  --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/tide/envelope-liner.svg);
  --envelope-interior: #d7dad0;
}

/* ---------- invitation card ---------- */
.card {
  background-color: var(--c-paper);
  color: var(--c-ink);
  border-radius: var(--radius-paper);
  /* a soft hairline + a wave-blue inset keyline, no tight dashed outline over the text */
  --keyline: inset 0 0 0 10px var(--c-paper),
              inset 0 0 0 11px rgba(64, 107, 124, .28);
  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);
}

/* ---------- foam 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(31, 59, 77, .28);
  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: coral wax ---------- */
.seal {
  background: url(../assets/tide/seal.svg) center / contain no-repeat;
  border-radius: 50%;
  color: var(--c-paper);
  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: #D1DBDE;
  filter: saturate(.85);
}
/* a strip of washi tape in soft coral with a pencil anchor mark */
.polaroid::before {
  content: '';
  position: absolute;
  top: -8px; left: 14%;
  width: 26%; height: 20px;
  rotate: -5deg;
  background-color: rgba(212, 125, 90, .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-accent);
  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: 2.5em;
  line-height: 1.1;
}
.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: 1.25px dashed rgba(31, 59, 77, .38);
  border-radius: 50%;
  pointer-events: none;
}

/* ---------- countdown band: a strip of deep tide ---------- */
.countdown {
  background-color: var(--c-depth);
  background-image: url(../assets/tide/envelope-liner.svg);
  background-size: 240px;
  color: var(--c-paper);
  font-family: var(--font-serif);
}
.countdown :where(.countdown__title) {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(2rem, 8.5vw, 3rem);
  line-height: 1.2;
  color: var(--c-accent);         /* coral on deep sea */
}
.countdown :where(.countdown__unit) {
  background-color: var(--c-paper);
  color: var(--c-ink);
  border-radius: var(--radius-paper);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .25), 0 8px 14px -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: .2em;
  text-transform: uppercase;
  color: var(--c-ink-soft);
}
.countdown :where(.countdown__done) { color: var(--c-ink); }

/* ---------- 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(2.5rem, 11vw, 4.25rem);
  line-height: 1.05;
  color: var(--c-primary);
}
.page :where(h2, h3) {
  font-family: var(--font-sans);
  font-weight: 700;
  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: 700;
  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: 700;
  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: #335966; }
.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 ---------- */
.page__title::after { content: none; }
.page__sprig { display: block; width: 132px; max-width: 40%; height: auto; margin: .35em auto 0; }

.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; }

.photo-frame img, .polaroid img, .gallery__photo img {
  filter: sepia(.04) saturate(.9) contrast(.96) brightness(1.02);
}
.photo-frame::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background-color: rgba(136, 174, 179, .12);
  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: .75rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  line-height: 1.35;
  hyphens: manual;
  overflow-wrap: normal;
  word-break: normal;
  font-weight: 700;
  border: 0;
  box-shadow: inset 0 0 0 6px var(--c-paper), inset 0 0 0 7px rgba(64, 107, 124, .4), 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: stamped reply */
.rsvp-thanks {
  rotate: -1deg;
  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(64, 107, 124, .55);
}
.rsvp-thanks .demo-note { font-style: normal; font-size: .8125rem; color: var(--c-ink-soft); }
.rsvp-thanks .demo-note::before { display: none; }

/* keep the big script "Details" inside the round tag */
.piece--tag.tag-button .tag__main { font-size: 17cqi; line-height: 1.15; }

/* countdown band padding (garland hangs into it on desktop) */
.countdown { padding-top: 2.6rem; }
@media (min-width: 1024px) { .countdown { padding-top: 6.25rem; } }
