/* ---------- Tokens (docs/design-handoff/README.md) ---------- */
:root {
  --cream: #FFF9F3;
  --ink: #33302B;
  --coral: #F0705C;
  --coral-hover: #DB5945;
  --link-hover: #DB5945;
  --coral-deep: #C74A38;
  --sky: #3D95C9;
  --blue: #256687;
  --peach: #FDE8E0;
  --hairline: #F3E2D9;
  --peach-hi: #FFC9B8;
  --gold: #E8A13C;
  --field: #E4F1FA;
  --font-display: 'Fredoka', sans-serif;
  --font-body: 'Nunito Sans', sans-serif;
  --shadow-card: 0 6px 24px rgba(51, 48, 43, 0.08);
  --radius-card: 22px;
  --max: 1120px;
  --treat: 58px;
  /* Primary-button pair: WCAG AA (≥4.5:1) for cream text — the brand coral #F0705C measured 2.80:1 */
  --btn-primary: #C74A38;
  --btn-primary-hover: #A83B2C;
}
/* In Memoriam sub-palette (body.memorial) */
body.memorial {
  --cream: #FBF7F1;
  --ink: #4A4640;
  --blue: #4A6B7C;
  --sky: #6E93A8;
  --coral: #6E93A8;
  --coral-hover: #4A6B7C;
  --link-hover: #B07A6E;
  --coral-deep: #8FA394;
  --peach: #E9EFE6;
  --hairline: #EDE5D8;
  --peach-hi: #F1E9DD;
  --btn-primary: #4A6B7C;
  --btn-primary-hover: #3A5563;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.5; }
a { color: var(--blue); }
a:hover { color: var(--link-hover); }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; color: var(--blue); margin: 0; line-height: 1.1; }
body.memorial h1, body.memorial h2, body.memorial h3 { font-weight: 500; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.h1 { font-size: clamp(36px, 5vw, 56px); }
.h1--hero { font-size: clamp(38px, 5.5vw, 60px); line-height: 1.05; text-wrap: pretty; }
.h2 { font-size: clamp(26px, 3.5vw, 34px); }
.lede { font-size: clamp(16px, 2vw, 19px); line-height: 1.6; text-wrap: pretty; }
.kicker { font-weight: 800; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--coral-deep); }
.prose { font-size: 17px; line-height: 1.75; display: flex; flex-direction: column; gap: 22px; }
.pullquote { font-family: var(--font-display); font-weight: 500; font-size: 21px; color: var(--blue); }

/* ---------- Layout ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.wrap--text { max-width: 760px; }
.wrap--prose { max-width: 680px; }
.wrap--mid { max-width: 1020px; }
.section { padding: 64px 0; }
.section--lg { padding: 72px 0; }
.section--peach { background: var(--peach); }
.intro { text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; padding-top: 64px; padding-bottom: 40px; }
.grid { display: grid; gap: 22px; }
.grid--cards { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 24px; }
.grid--family { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid--mem { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--board { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.grid--mini { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.center { text-align: center; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 13px 28px; border-radius: 999px; border: 0; cursor: pointer; text-decoration: none; font-family: var(--font-display); font-weight: 600; font-size: 18px; line-height: 1; transition: background 0.15s, color 0.15s; }
body.memorial .btn { font-weight: 500; }
.btn--primary { background: var(--btn-primary); color: var(--cream); }
.btn--primary:hover { background: var(--btn-primary-hover); color: var(--cream); }
.btn--outline { background: rgba(255, 249, 243, 0.9); color: var(--blue); border: 2px solid var(--blue); padding: 11px 28px; }
.btn--outline:hover { background: var(--blue); color: var(--cream); }
.btn--cream { background: var(--cream); color: var(--blue); font-family: var(--font-body); font-weight: 800; font-size: 15px; padding: 10px 20px; }
.btn--cream:hover { background: var(--peach-hi); color: var(--blue); }
.btn--peach { background: var(--peach-hi); color: var(--blue); font-size: 19px; padding: 14px 32px; }
.btn--peach:hover { background: var(--cream); color: var(--blue); }
.btn--sm { font-size: 16px; padding: 11px 22px; }
.btn--lg { font-size: 22px; padding: 16px 40px; }
.link-more { font-weight: 800; text-decoration: none; }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(255, 249, 243, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--hairline); display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 12px 24px; }
body.memorial .nav { background: rgba(251, 247, 241, 0.92); }
.nav__brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav__logo-img { height: 46px; width: auto; flex: none; }
.nav__word { font-family: var(--font-display); font-weight: 600; font-size: 19px; color: var(--blue); line-height: 1.1; }
.nav__links { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.nav__link { text-decoration: none; color: var(--ink); font-weight: 700; font-size: 15px; padding: 10px 12px; border-radius: 999px; }
.nav__link:hover { background: var(--peach); color: var(--ink); }
.nav__back { font-weight: 800; }
.nav__donate { margin-left: auto; }
.nav__links .nav__donate { margin-left: 0; }
@keyframes wiggle { 0%, 88%, 100% { transform: rotate(0); } 90% { transform: rotate(-4deg); } 93% { transform: rotate(4deg); } 96% { transform: rotate(-2deg); } }
.nav__donate--pulse { animation: wiggle 2.8s ease-in-out infinite; }

/* ---------- Hero (home) ---------- */
.hero { position: relative; min-height: min(78vh, 640px); display: flex; }
.hero__media { position: absolute; inset: 0; }
.hero__media img, .hero__media .ph { width: 100%; height: 100%; object-fit: cover; }
.hero__scrim { position: relative; flex: 1; display: flex; align-items: center; background: linear-gradient(100deg, rgba(255, 249, 243, 0.94) 0%, rgba(255, 249, 243, 0.82) 38%, rgba(255, 249, 243, 0) 68%); }
.hero__inner { width: 100%; padding: 64px 24px; }
.hero__card { max-width: 560px; display: flex; flex-direction: column; gap: 20px; background: rgba(255, 249, 243, 0.94); border-radius: 26px; padding: 32px 34px; box-shadow: 0 10px 32px rgba(46, 49, 43, 0.10); }
.hero__card p { font-size: clamp(17px, 2vw, 20px); max-width: 46ch; }
.hero__ctas { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Impact band ---------- */
.band { background: var(--sky); color: var(--cream); padding: 26px 24px; }
.band__inner { max-width: var(--max); margin: 0 auto; display: flex; align-items: center; justify-content: center; gap: 12px 28px; flex-wrap: wrap; text-align: center; }
.band__stat { font-family: var(--font-display); font-weight: 600; font-size: clamp(19px, 2.4vw, 24px); }
.band__stat em { font-style: normal; color: var(--cream); text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; }
.band__dot { opacity: 0.55; font-size: 22px; }

/* ---------- Cards ---------- */
.card { background: #fff; border-radius: var(--radius-card); overflow: hidden; box-shadow: var(--shadow-card); display: flex; flex-direction: column; }
.card__media { height: 190px; }
.card__media--square { aspect-ratio: 1; height: auto; }
.card__media img, .card__media .ph { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card__body h2 { font-size: 24px; }
.card__body p { line-height: 1.55; }
.card__body .link-more { margin-top: auto; }
.card--flat { background: var(--cream); border-radius: 20px; padding: 26px; display: flex; flex-direction: column; gap: 8px; box-shadow: none; }
.card--flat h3 { font-size: 20px; }
.card--flat p { font-size: 15px; line-height: 1.6; }
.card--white { background: #fff; border: 1px solid var(--hairline); }

/* Family card */
.fam__body { padding: 18px 20px 22px; gap: 8px; }
.fam__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.fam__head h2 { font-size: 22px; }
.fam__age { font-weight: 800; font-size: 13px; color: var(--coral-deep); white-space: nowrap; }
.fam__meta { display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 1.5; }
.fam__sponsor { font-weight: 800; text-decoration: none; font-size: 14px; margin-top: 4px; min-height: 44px; display: inline-flex; align-items: center; }

/* Cat of the month */
.cotm { display: flex; gap: 44px; align-items: center; flex-wrap: wrap; }
.cotm__media { flex: 1 1 380px; min-width: 280px; aspect-ratio: 4 / 3; border-radius: 26px; overflow: hidden; }
.cotm__media img, .cotm__media .ph { width: 100%; height: 100%; object-fit: cover; }
.cotm__text { flex: 1 1 340px; min-width: 280px; display: flex; flex-direction: column; gap: 14px; }
.cotm__text h2 { font-size: clamp(34px, 4.5vw, 48px); line-height: 1.05; }
.cotm__job { font-family: var(--font-display); font-weight: 500; font-size: 20px; color: var(--blue); }
.cotm__text p.story { line-height: 1.6; max-width: 48ch; }
.kicker--cotm { letter-spacing: 0.12em; font-size: 14px; }

/* Cams band */
.cams { background: var(--blue); color: var(--cream); border-radius: var(--radius-card); padding: 28px 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cams__text { display: flex; flex-direction: column; gap: 4px; }
.cams__live { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cream); }
.cams__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--coral); }
.cams__title { font-family: var(--font-display); font-weight: 600; font-size: 24px; }
.cams__sub { opacity: 0.9; font-size: 15px; }
.cams__pill { font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--blue); background: var(--cream); padding: 11px 24px; border-radius: 999px; }

/* Instagram */
.ig__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.ig__head h2 { font-size: 26px; }
.ig__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.ig__tile { aspect-ratio: 1; border-radius: 16px; overflow: hidden; }
.ig__tile img, .ig__tile .ph { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Footer ---------- */
.footer { background: var(--blue); color: var(--cream); margin-top: 56px; padding: 56px 24px 32px; }
.footer__inner { max-width: var(--max); margin: 0 auto; display: flex; flex-direction: column; gap: 40px; }
.footer__cta { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; background: var(--sky); border-radius: var(--radius-card); padding: 26px 30px; }
.footer__cta-title { font-family: var(--font-display); font-weight: 600; font-size: 26px; }
.footer__cta-sub { opacity: 1; }
.footer__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 32px; }
.footer__col { display: flex; flex-direction: column; gap: 8px; }
.footer__brand { font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.footer__about { line-height: 1.6; opacity: 0.9; font-size: 15px; }
.footer__legal { line-height: 1.6; opacity: 0.75; font-size: 13px; }
.footer__h { font-weight: 800; font-size: 14px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.8; }
.footer a { color: var(--cream); text-decoration: none; font-size: 15px; }
.footer a:hover { color: var(--peach-hi); }
.footer .btn--peach, .footer .btn--peach:hover { color: var(--blue); font-size: 19px; } /* beat `.footer a` specificity: deep-blue text on peach */
.footer__note { font-size: 15px; opacity: 0.9; }
.footer__copy { font-size: 13px; opacity: 0.85; text-align: center; }
.footer--quiet { background: transparent; color: var(--ink); margin-top: 0; padding: 56px 24px; text-align: center; display: flex; flex-direction: column; gap: 10px; }
.footer--quiet .footer__quote { font-family: var(--font-display); font-weight: 500; font-size: 19px; color: var(--blue); font-style: italic; }
.footer--quiet .footer__copy { color: #8FA394; opacity: 1; }

/* ---------- Story page ---------- */
.story-hero { display: flex; gap: 40px; align-items: center; flex-wrap: wrap; padding: 64px 0 48px; }
.story-hero__media { flex: 1 1 300px; min-width: 260px; max-width: 380px; aspect-ratio: 1; border-radius: 28px; overflow: hidden; }
.story-hero__media img, .story-hero__media .ph { width: 100%; height: 100%; object-fit: cover; }
.story-hero__text { flex: 1 1 320px; min-width: 280px; display: flex; flex-direction: column; gap: 14px; }
.board__card { background: #fff; border: 1px solid var(--hairline); border-radius: 18px; padding: 24px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.board__photo { width: 88px; height: 88px; border-radius: 50%; overflow: hidden; }
.board__photo img, .board__photo .ph { width: 100%; height: 100%; object-fit: cover; }
.board__name { font-family: var(--font-display); font-weight: 600; font-size: 17px; color: var(--blue); }
.board__role { font-size: 13px; opacity: 0.8; }

/* ---------- In Memoriam ---------- */
.mem__intro { padding: 72px 0 48px; gap: 16px; }
.mem__intro .kicker { letter-spacing: 0.16em; color: #8FA394; }
.mem__intro .lede { line-height: 1.7; max-width: 54ch; }
.mem__card { background: #fff; border: 1px solid var(--hairline); border-radius: 22px; padding: 28px 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.mem__photo { width: 130px; height: 130px; border-radius: 50%; overflow: hidden; }
.mem__photo img, .mem__photo .ph { width: 100%; height: 100%; object-fit: cover; }
.mem__card h2 { font-size: 24px; }
.mem__years { font-size: 14px; font-weight: 700; color: var(--blue); }
.mem__line { line-height: 1.6; font-size: 15px; white-space: pre-line; }
.poem { white-space: pre-line; font-style: italic; line-height: 1.85; font-size: 16px; }
.mem-feat { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding-bottom: 56px; }
.mem-feat__photo { width: 170px; height: 170px; }
.mem-feat h2 { font-size: clamp(30px, 4.5vw, 40px); }
.mem-closing { padding-bottom: 40px; }

/* ---------- Treat Chase ---------- */
.game { display: flex; flex-direction: column; gap: 20px; padding: 40px 0 24px; }
.game__head { display: flex; flex-direction: column; gap: 8px; text-align: center; }
.game__head h1 { font-size: clamp(38px, 6vw, 56px); }
.field { position: relative; height: min(62vh, 480px); background: var(--field); border: 3px dashed var(--sky); border-radius: 28px; overflow: hidden; }
.field__screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; text-align: center; }
.field__screen[hidden] { display: none; }
.field__lead { font-family: var(--font-display); font-weight: 500; font-size: 22px; color: var(--blue); }
.field__hud { position: absolute; top: 14px; left: 0; right: 0; display: flex; justify-content: center; gap: 14px; pointer-events: none; }
.field__hud[hidden] { display: none; }
.pill { font-family: var(--font-display); font-weight: 600; font-size: 19px; color: var(--blue); background: rgba(255, 249, 243, 0.9); padding: 8px 18px; border-radius: 999px; }
.pill--time { color: var(--coral-deep); }
@keyframes pop { 0% { transform: scale(0); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
.treats { position: absolute; inset: 0; pointer-events: none; } /* the layer must never block the idle/done screens */
.treat { position: absolute; pointer-events: auto; width: var(--treat); height: var(--treat); border-radius: 50%; border: 0; cursor: pointer; box-shadow: 0 4px 10px rgba(37, 102, 135, 0.25); animation: pop 0.25s ease-out; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 0; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
@media (hover: hover) { .treat:hover { transform: scale(1.1); } }
.treat__dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(0, 0, 0, 0.22); }
.treat__dot--low { margin-top: 12px; }
.game__score { font-family: var(--font-display); font-weight: 600; font-size: clamp(32px, 5vw, 44px); color: var(--blue); }
.game__rank { font-family: var(--font-display); font-weight: 500; font-size: 22px; color: var(--coral-deep); }
.game__actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.catoffer { display: flex; align-items: center; gap: 14px; background: rgba(255, 249, 243, 0.95); border-radius: 16px; padding: 12px 18px; max-width: 480px; flex-wrap: wrap; justify-content: center; }
.catoffer__photo { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex: none; }
.catoffer__text { font-size: 14px; line-height: 1.5; max-width: 30ch; text-align: left; margin: 0; }
.catoffer__actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.ask { background: var(--peach); border-radius: var(--radius-card); padding: 22px 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ask__text { font-family: var(--font-display); font-weight: 500; font-size: 19px; color: var(--blue); }
.ask__text strong { color: var(--coral-deep); }

/* ---------- Placeholder image tile ---------- */
.ph { background: var(--peach) url('../assets/placeholder.svg') center / min(48%, 160px) no-repeat; }
.hero__media .ph { background-image: none; } /* the hero copy card covers the mark anyway — keep the backdrop clean until a photo lands */

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nav__donate--pulse { animation: none; }
  .treat { animation: none; }
  .btn { transition: none; }
}

/* ---------- Skip link ---------- */
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--blue); color: var(--cream); padding: 10px 16px; border-radius: 999px; font-weight: 800; text-decoration: none; }
.skip:focus { left: 16px; }
