/* MOTHERPUPPERS — Biscuit & collar red. Palette from research/design-language.md §2. */

:root {
  --ground: #FAF5EC;
  --surface: #FFFFFF;
  --ink: #2B1B14;
  --muted: #5F4B40;
  --brand: #B3261E;        /* CTA fill — white 6.54:1 */
  --brand-text: #B3261E;   /* brand as small text on light */
  --biscuit: #E8C58A;      /* highlight fill — dark ink only */
  --ink-on-fill: #2B1B14;  /* text on biscuit — fixed */
  --biscuit-text: #7A5420; /* biscuit as small text on light */
  --on-brand: #FFFFFF;     /* text on brand/dark bands — fixed */
  --accent-on-dark: #E8C58A;
  --band: #2A1A13;         /* always-dark header/hero/footer/CTA/groom-card */
  --band-ink: #FFFFFF;     /* body text inside dark bands — stays light both themes */
  --band-muted: #C4B1A4;   /* secondary text inside dark bands */

  --radius: 14px;
  --radius-lg: 22px;
  --maxw: 1080px;
  --gap: 1.25rem;
  --shadow: 0 2px 10px rgba(43,27,20,.08);

  --font-head: "DM Serif Display", Georgia, serif;
  --font-body: "DM Sans", system-ui, -apple-system, Segoe UI, sans-serif;
}

html[data-theme="dark"] {
  --ground: #171210;
  --surface: #251D19;
  --ink: #F6EDE3;
  --muted: #C4B1A4;
  --brand: #C0392F;        /* white 5.43:1 */
  --brand-text: #F4A59E;
  --biscuit: #E8C58A;
  --ink-on-fill: #2B1B14;  /* fixed dark ink on biscuit */
  --biscuit-text: #E8C58A;
  --on-brand: #FFFFFF;
  --accent-on-dark: #E8C58A;
  --band: #0D0908;
  --band-ink: #FFFFFF;
  --band-muted: #C4B1A4;
  --shadow: 0 2px 12px rgba(0,0,0,.4);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--ink);
  background: var(--ground);
  line-height: 1.6;
  overflow-wrap: break-word;
  word-wrap: break-word;
}
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 400; line-height: 1.15; color: var(--ink); margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 6vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1rem; }
a { color: var(--brand-text); }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-left: 1.25rem; padding-right: 1.25rem; }
/* Rule 4: never `padding: X 0` on an element that is also `.container`.
   Vertical spacing comes from .section, never from padding shorthand on .container. */
.section { padding-top: 3.5rem; padding-bottom: 3.5rem; }
.section--tight { padding-top: 2rem; padding-bottom: 2rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--brand); color: var(--on-brand);
  padding: .6rem 1rem; z-index: 100; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font-body); font-weight: 700; font-size: 1rem;
  padding: .75rem 1.25rem; border-radius: 999px; border: 2px solid transparent;
  text-decoration: none; cursor: pointer; line-height: 1.2; text-align: center;
  max-width: 100%; overflow-wrap: break-word;
}
.btn--primary { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.btn--primary:hover { filter: brightness(1.08); color: var(--on-brand); }
.btn--biscuit { background: var(--biscuit); color: var(--ink-on-fill); border-color: var(--biscuit); }
.btn--biscuit:hover { filter: brightness(1.05); color: var(--ink-on-fill); }
.btn--ghost { background: transparent; color: var(--brand-text); border-color: var(--brand); }
.btn--ghost:hover { background: var(--brand); color: var(--on-brand); }
.btn--block { width: 100%; }

/* ---------- Chips / badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--biscuit); color: var(--ink-on-fill);
  border-radius: 999px; padding: .35rem .8rem; font-size: .85rem; font-weight: 500;
  max-width: 100%; overflow-wrap: break-word;
}
.badge {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--surface); color: var(--ink); border: 1px solid var(--biscuit);
  border-radius: 999px; padding: .35rem .8rem; font-size: .9rem; font-weight: 500; box-shadow: var(--shadow);
}
.stars { color: var(--biscuit-text); letter-spacing: 2px; } /* decorative stars — 6.2:1 light, bright dark */

/* ---------- Cards ---------- */
.grid { display: grid; gap: var(--gap); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid > * { min-width: 0; } /* rule 3: min-width:0 on grid children */

.card {
  background: var(--surface); color: var(--ink);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  overflow: hidden; display: flex; flex-direction: column;
}
.card__body { padding: 1.25rem 1.25rem 1.4rem; }
.card__img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--biscuit); }
.img-note { font-size: .78rem; color: var(--muted); padding: .5rem 1.25rem 0; }

/* ---------- Header ---------- */
.site-header { background: var(--band); color: var(--band-ink); position: sticky; top: 0; z-index: 50; }
.site-header .container { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding-top: .8rem; padding-bottom: .8rem; }
.brand { display: flex; flex-direction: column; text-decoration: none; margin-right: auto; }
.brand__name {
  font-family: var(--font-head); font-size: 1.4rem; color: var(--band-ink);
  letter-spacing: .5px; white-space: normal; /* rule 3: wrap at spaces */
}
.brand__tag { font-size: .8rem; color: var(--band-muted); }
.nav { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.nav a {
  color: var(--band-ink); text-decoration: none; font-weight: 500; font-size: .95rem;
  padding: .45rem .7rem; border-radius: 999px;
}
.nav a:hover, .nav a[aria-current="page"] { background: rgba(232,197,138,.18); color: var(--accent-on-dark); }
.header-cta { display: inline-flex; }
.theme-toggle {
  background: transparent; border: 2px solid var(--band-muted); color: var(--band-ink);
  width: 42px; height: 42px; border-radius: 999px; cursor: pointer; font-size: 1.1rem;
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.theme-toggle:hover { border-color: var(--accent-on-dark); color: var(--accent-on-dark); }

/* ---------- Hero ---------- */
.hero { background: var(--band); color: var(--band-ink); }
.hero .container { display: grid; grid-template-columns: 1.1fr .9fr; gap: 2rem; align-items: center; }
.hero__copy { min-width: 0; }
.hero__fig { margin: 0; min-width: 0; }
.hero__img { width: 100%; border-radius: var(--radius-lg); aspect-ratio: 4/3; object-fit: cover; }
.hero__lead { font-size: 1.15rem; color: var(--band-muted); }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }

/* ---------- Always-dark band ---------- */
.band { background: var(--band); color: var(--band-ink); }

/* ---------- Proof strip ---------- */
.proof { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.proof .badge { background: rgba(255,255,255,.06); color: var(--band-ink); border-color: var(--band-muted); }
.proof .stars { color: var(--accent-on-dark); }

/* ---------- NAP / find-us ---------- */
dl.nap { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; }
dl.nap dt { font-weight: 700; color: var(--muted); }
dl.nap dd { margin: 0; overflow-wrap: break-word; }

/* ---------- Groom card (signature) ---------- */
.gc-field { margin-bottom: 1.6rem; }
.gc-field > legend, .gc-field > .label { font-family: var(--font-head); font-size: 1.15rem; margin-bottom: .6rem; padding: 0; color: var(--ink); }
.gc-hint { font-size: .9rem; color: var(--muted); margin: .2rem 0 .6rem; } /* rule 8: readable helper */
fieldset.gc-field { border: 0; padding: 0; margin-inline: 0; }
.option-row { display: flex; flex-wrap: wrap; gap: .6rem; }
.option {
  position: relative; display: inline-flex;
}
.option input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.option span {
  display: inline-block; padding: .55rem 1rem; border-radius: 999px;
  border: 2px solid var(--muted); color: var(--ink); background: var(--surface); font-weight: 500;
}
.option input:checked + span { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.option input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }
.gc-input, .gc-date, .gc-textarea {
  width: 100%; max-width: 420px; font: inherit; color: var(--ink); background: var(--surface);
  border: 2px solid var(--muted); border-radius: var(--radius); padding: .6rem .8rem;
}
.gc-textarea { max-width: 100%; }
.gc-charcount { font-size: .8rem; color: var(--muted); }

/* The coat-match preview card */
.coat-preview { margin-top: 1rem; max-width: 420px; }

/* Always-dark output panel — full text rules (rule 1) */
.groom-card {
  background: var(--band); color: var(--band-ink);
  border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow);
}
.groom-card h1, .groom-card h2, .groom-card h3, .groom-card h4 { color: var(--band-ink); }
.groom-card p, .groom-card li, .groom-card dd, .groom-card dt { color: var(--band-ink); }
.groom-card .muted { color: var(--band-muted); }
.groom-card a { color: var(--accent-on-dark); }
.groom-card .chip { background: var(--biscuit); color: var(--ink-on-fill); }
.groom-card .btn--ghost { color: var(--accent-on-dark); border-color: var(--accent-on-dark); }
.groom-card .btn--ghost:hover { background: var(--accent-on-dark); color: var(--ink-on-fill); }
.groom-card .img-note { color: var(--band-muted); }
.gc-summary {
  font-size: 1.1rem; font-weight: 500; background: rgba(232,197,138,.1);
  border: 1px solid var(--band-muted); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem;
}
.gc-note-label { font-weight: 700; color: var(--accent-on-dark); }
/* demo-note strip: solid dark background (rule 1) */
.demo-note {
  background: #0D0908; color: var(--band-ink); border: 1px solid var(--band-muted);
  border-radius: var(--radius); padding: .8rem 1rem; font-size: .88rem; margin-top: 1rem;
}
.demo-note strong { color: var(--accent-on-dark); }

/* ===== Rule 1/7: text + link rules inside ALL dark sections =====
   Applies to .hero, .band, .site-header, .groom-card, .site-footer. */
.hero h1, .hero h2, .hero h3, .hero h4,
.band h1, .band h2, .band h3, .band h4,
.site-footer h1, .site-footer h2, .site-footer h3, .site-footer h4 { color: var(--band-ink); }
.hero p, .hero li, .hero dd, .hero dt,
.band p, .band li, .band dd, .band dt,
.site-footer p, .site-footer li, .site-footer dd, .site-footer dt { color: var(--band-ink); }
.hero .muted, .band .muted, .site-footer .muted { color: var(--band-muted); }
.hero dl.nap dt, .band dl.nap dt, .site-footer dl.nap dt { color: var(--band-muted); }
.hero .img-note, .band .img-note, .site-footer .img-note { color: var(--band-muted); }
.hero .chip, .band .chip, .site-footer .chip { background: var(--biscuit); color: var(--ink-on-fill); }

/* plain links inside dark sections */
.hero a, .band a, .site-footer a, .groom-card a { color: var(--accent-on-dark); }
.hero a:hover, .band a:hover, .site-footer a:hover, .groom-card a:hover { color: var(--accent-on-dark); }

/* Rule 7: button exceptions must NOT be overridden by the link rules above,
   including :hover. Equal-or-higher specificity restores button text colours. */
.hero a.btn--primary, .band a.btn--primary, .site-footer a.btn--primary, .groom-card a.btn--primary,
.hero a.btn--primary:hover, .band a.btn--primary:hover, .site-footer a.btn--primary:hover, .groom-card a.btn--primary:hover {
  color: var(--on-brand);
}
.hero a.btn--biscuit, .band a.btn--biscuit, .site-footer a.btn--biscuit, .groom-card a.btn--biscuit,
.hero a.btn--biscuit:hover, .band a.btn--biscuit:hover, .site-footer a.btn--biscuit:hover, .groom-card a.btn--biscuit:hover {
  color: var(--ink-on-fill);
}
.hero a.btn--ghost, .band a.btn--ghost, .site-footer a.btn--ghost {
  color: var(--accent-on-dark); border-color: var(--accent-on-dark);
}
.hero a.btn--ghost:hover, .band a.btn--ghost:hover, .site-footer a.btn--ghost:hover {
  color: var(--ink-on-fill); background: var(--accent-on-dark);
}

/* ---------- Footer ---------- */
.site-footer { background: var(--band); color: var(--band-ink); padding-top: 2.5rem; padding-bottom: 2.5rem; margin-top: 2rem; }
.site-footer .footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 1.5rem; }
.site-footer .footer-grid > * { min-width: 0; }
.site-footer nav a { display: block; padding: .25rem 0; color: var(--accent-on-dark); text-decoration: none; }
.site-footer nav a:hover { text-decoration: underline; }
.footer-legal { border-top: 1px solid var(--band-muted); margin-top: 1.5rem; padding-top: 1.2rem; font-size: .85rem; color: var(--band-muted); }

/* ---------- Section intros ---------- */
.lead { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.note {
  background: var(--surface); border-left: 4px solid var(--biscuit);
  border-radius: var(--radius); padding: 1rem 1.2rem; color: var(--ink); box-shadow: var(--shadow);
}
.needs-content {
  border: 2px dashed var(--muted); border-radius: var(--radius-lg);
  padding: 2rem; text-align: center; color: var(--muted); background: var(--surface);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero__fig { order: -1; }
  .site-footer .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .grid--3 { grid-template-columns: 1fr; }
  .grid--2 { grid-template-columns: 1fr; }
}
/* rule 3: nav on its own row ≤700px */
@media (max-width: 700px) {
  .site-header .container { flex-wrap: wrap; }
  .brand { margin-right: auto; }
  .nav { order: 3; flex-basis: 100%; justify-content: flex-start; }
  .site-footer .footer-grid { grid-template-columns: 1fr; }
}
/* rule 3: hide header CTA + subtitle ≤480px */
@media (max-width: 480px) {
  .header-cta { display: none; }
  .brand__tag { display: none; }
  .btn-row .btn { width: 100%; } /* big buttons wrap/stack */
}
/* 320px safety */
@media (max-width: 360px) {
  .container { padding-left: .9rem; padding-right: .9rem; }
  .btn { padding-left: .9rem; padding-right: .9rem; }
}

@media (prefers-reduced-motion: no-preference) {
  a, .btn, .option span, .theme-toggle { transition: background-color .15s, color .15s, border-color .15s, filter .15s; }
}
/* disable transitions during contrast measurement / theme swap flash guard */
.no-transition, .no-transition * { transition: none !important; }
