/* ==========================================================================
   Za'Brood: design tokens
   Palette: espresso / terracotta / amber / cream (contrast-checked to WCAG AA)
   ========================================================================== */
:root {
  /* Colour */
  --espresso:      #1C1410;  /* dark backgrounds */
  --espresso-2:    #2A1E18;  /* raised dark surfaces */
  --espresso-line: rgba(246, 238, 227, 0.12);
  --terracotta:    #E07A4F;  /* primary accent (on dark) */
  --terracotta-hi: #EB8F67;
  --amber:         #E8A35C;  /* glow / secondary accent */
  --cream:         #F6EEE3;  /* light backgrounds, text on dark */
  --sand:          #EADBC8;  /* alt light section */
  --ink:           #2A1E18;  /* body text on light */
  --ink-muted:     #6B5446;  /* 6:1 on cream */
  --accent-ink:    #9A4528;  /* accent text on cream/sand, 4.7:1+ */
  --on-dark-muted: #BBA999;  /* 7.7:1 on espresso */
  --line-light:    rgba(42, 30, 24, 0.12);

  /* Type */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Space (spacious scale) */
  --space-1: 0.5rem;  --space-2: 1rem;  --space-3: 1.5rem;
  --space-4: 2rem;    --space-5: 3rem;  --space-6: 4.5rem; --space-7: 6rem;

  --radius-s: 10px; --radius-m: 18px; --radius-l: 28px;
  --container: 1200px;

  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --dur-fast: 160ms; --dur-med: 320ms; --dur-slow: 700ms;
}

/* ============================== Base ============================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--espresso);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.08; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol, dl, dd { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }

:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 3px; border-radius: 6px; }
.section-light :focus-visible, .section-sand :focus-visible { outline-color: var(--accent-ink); }

.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }
.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: 1rem; top: -100px; z-index: 100; background: var(--cream); color: var(--ink); padding: .75rem 1rem; border-radius: var(--radius-s); }
.skip-link:focus { top: 1rem; }

/* ============================== Buttons ============================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 46px; padding: .7rem 1.4rem;
  border-radius: 999px; border: 1px solid transparent;
  font-weight: 500; font-size: .95rem; text-decoration: none;
  transition: background-color var(--dur-fast) ease, transform var(--dur-fast) ease, border-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--terracotta); color: var(--espresso); }
.btn-primary:hover { background: var(--terracotta-hi); }
.btn-ghost { background: transparent; border-color: var(--line-light); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent-ink); color: var(--accent-ink); }

/* ============================== Header ============================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(28, 20, 16, .94);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--espresso-line);
  color: var(--cream);
}
.nav-bar { display: flex; align-items: center; justify-content: space-between; min-height: 76px; gap: var(--space-3); }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; font-family: var(--font-display); font-size: 1.3rem; letter-spacing: .01em; }
.primary-nav { display: flex; align-items: center; gap: var(--space-5); }
.primary-nav ul { display: flex; gap: var(--space-4); }
.primary-nav ul a {
  display: inline-block; padding: .6rem .1rem; text-decoration: none;
  color: var(--on-dark-muted); font-size: .95rem;
  transition: color var(--dur-fast) ease;
}
.primary-nav ul a:hover, .primary-nav ul a[aria-current="page"] { color: var(--cream); }
.nav-toggle { display: none; background: none; border: 1px solid var(--espresso-line); border-radius: 12px; width: 46px; height: 46px; align-items: center; justify-content: center; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .primary-nav {
    position: absolute; inset: 76px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: var(--space-3);
    padding: var(--space-3) 1.25rem var(--space-4);
    background: var(--espresso); border-bottom: 1px solid var(--espresso-line);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity var(--dur-med) var(--ease-out), transform var(--dur-med) var(--ease-out), visibility 0s linear var(--dur-med);
  }
  .primary-nav.open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .primary-nav ul { flex-direction: column; gap: 0; }
  .primary-nav ul a { display: block; padding: .85rem 0; font-size: 1.1rem; border-bottom: 1px solid var(--espresso-line); }
}

/* ============================== Hero ============================== */
.hero {
  position: relative; overflow: hidden;
  background: var(--espresso); color: var(--cream);
  padding: var(--space-6) 0 var(--space-7);
}
.hero::after { /* soft fade into the cream section below */
  content: ""; position: absolute; inset: auto 0 0 0; height: 120px;
  background: linear-gradient(to bottom, transparent, rgba(246,238,227,.06));
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid; grid-template-columns: 1.15fr 1fr .8fr;
  align-items: center; gap: var(--space-4);
  min-height: min(640px, 78vh);
}
.hero-left { position: relative; z-index: 2; align-self: stretch; display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-5); }
.family-chip { display: flex; align-items: center; gap: .9rem; margin-top: var(--space-3); }
.family-chip p { font-size: .95rem; color: var(--cream); }
.avatars { display: flex; }
.avatars span {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 1.05rem; color: var(--espresso);
  background: radial-gradient(circle at 35% 30%, hsl(var(--h) 80% 82%), hsl(var(--h) 60% 58%));
  border: 2px solid var(--espresso);
  margin-left: -10px;
}
.avatars span:first-child { margin-left: 0; }

.hero-title {
  font-size: clamp(3rem, 7.4vw, 6.4rem);
  font-weight: 300; letter-spacing: -0.01em;
  font-variation-settings: "opsz" 144;
  margin-right: -40%; /* lets the headline overlap the glow, like the reference */
}

.hero-art { position: relative; aspect-ratio: 1; display: grid; place-items: center; }
.glow {
  position: absolute; inset: -30%;
  background:
    radial-gradient(closest-side, rgba(224,122,79,.38), rgba(232,163,92,.14) 55%, transparent 75%);
  filter: blur(8px);
  animation: breathe 7s ease-in-out infinite;
}
.nest { position: relative; width: 78%; filter: drop-shadow(0 30px 40px rgba(0,0,0,.45)); animation: float 8s ease-in-out infinite; }
.egg { transform-box: fill-box; transform-origin: 50% 100%; animation: wobble 6s ease-in-out infinite; }
.egg.e2 { animation-delay: -2s; } .egg.e3 { animation-delay: -4s; }
.firefly { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 12px 3px rgba(232,163,92,.7); animation: drift 9s ease-in-out infinite; }
.f1 { top: 12%; left: 22%; } .f2 { top: 26%; right: 10%; animation-delay: -3s; width: 4px; height: 4px; }
.f3 { bottom: 20%; left: 8%; animation-delay: -5s; width: 5px; height: 5px; } .f4 { top: 6%; right: 32%; animation-delay: -7s; width: 3px; height: 3px; }

@keyframes breathe { 0%,100% { opacity: .85; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes float   { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes wobble  { 0%,88%,100% { transform: rotate(0); } 92% { transform: rotate(-5deg); } 96% { transform: rotate(4deg); } }
@keyframes drift   { 0%,100% { transform: translate(0,0); opacity: .9; } 50% { transform: translate(14px,-22px); opacity: .4; } }

.hero-right { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); }
.stats { display: grid; grid-template-columns: repeat(2, auto); gap: var(--space-5); }
.stats dd { font-family: var(--font-display); font-weight: 300; font-size: clamp(2.6rem, 4.5vw, 3.6rem); line-height: 1; font-variant-numeric: tabular-nums; }
.stats dt { order: 2; margin-top: .5rem; font-size: .9rem; color: var(--on-dark-muted); }
.stats div { display: flex; flex-direction: column; }
.stats dd { order: 1; }

.socials { display: flex; gap: .75rem; }
.socials a {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  background: var(--espresso-2); color: var(--terracotta); border: 1px solid var(--espresso-line);
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.socials a:hover { background: var(--terracotta); color: var(--espresso); }
.socials svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.hero-copy { max-width: 30ch; color: var(--cream); opacity: .9; }

.hero-bottom {
  display: grid; grid-template-columns: .8fr 1.6fr; gap: var(--space-5);
  align-items: end; margin-top: var(--space-7);
}
.hero-small { max-width: 38ch; font-size: .95rem; color: var(--on-dark-muted); }
.hero-statement { font-family: var(--font-display); font-weight: 300; font-size: clamp(2.2rem, 5vw, 4.2rem); line-height: 1.1; letter-spacing: -0.02em; }
.hero-statement em { font-style: italic; color: var(--amber); }

@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr 1fr; }
  .hero-left { grid-column: 1 / -1; }
  .hero-title { margin-right: 0; }
}
@media (max-width: 680px) {
  .hero { padding-top: var(--space-4); }
  .hero-grid { grid-template-columns: 1fr; min-height: 0; }
  .hero-art { width: min(80vw, 340px); margin-inline: auto; }
  .hero-bottom { grid-template-columns: 1fr; margin-top: var(--space-6); }
  .stats { gap: var(--space-4); }
}

/* ============================== Sections ============================== */
.section { padding: var(--space-7) 0; }
.section-light { background: var(--cream); }
.section-sand  { background: var(--sand); }
.section-head { max-width: 640px; margin-bottom: var(--space-5); }
.eyebrow { font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: var(--space-2); }
.section-head h2 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); font-weight: 350; letter-spacing: -0.02em; margin-bottom: var(--space-2); }
.lead { font-size: 1.1rem; color: var(--ink-muted); max-width: 52ch; }

/* ============================== Gallery ============================== */
.filters { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: var(--space-4); }
.chip {
  min-height: 44px; padding: .55rem 1.15rem; border-radius: 999px;
  background: transparent; border: 1px solid var(--line-light); color: var(--ink);
  font-size: .93rem; white-space: nowrap;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.chip:hover { border-color: var(--accent-ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--cream); }

.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  grid-auto-rows: 220px; grid-auto-flow: dense; gap: var(--space-2);
}
.gallery-grid li.tall { grid-row: span 2; }
.gallery-grid li[hidden] { display: none; }
.tile {
  position: relative; width: 100%; height: 100%; padding: 0; border: 0;
  border-radius: var(--radius-m); overflow: hidden; text-align: left;
  background: var(--sand);
}
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-slow) var(--ease-out); }
.tile:hover img, .tile:hover .placeholder-art { transform: scale(1.04); }
.tile-caption {
  position: absolute; inset: auto 0 0 0; padding: 2.5rem 1rem 1rem;
  background: linear-gradient(to top, rgba(28,20,16,.78), transparent);
  color: var(--cream);
}
.tile-caption strong { display: block; font-family: var(--font-display); font-weight: 400; font-size: 1.15rem; }
.tile-caption span { font-size: .82rem; opacity: .85; }

/* Placeholder art (shown until a real photo is added) */
.placeholder-art {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 70% 28%, hsl(calc(var(--h) + 20) 85% 78% / .95) 0 9%, transparent 10%),
    linear-gradient(170deg, hsl(var(--h) 70% 78%), hsl(var(--h) 55% 52%) 60%, hsl(calc(var(--h) - 6) 45% 32%));
  transition: transform var(--dur-slow) var(--ease-out);
}
.placeholder-art::before, .placeholder-art::after { /* rolling hills */
  content: ""; position: absolute; left: -10%; right: -10%; border-radius: 50% 50% 0 0;
}
.placeholder-art::before { bottom: -18%; height: 55%; background: hsl(calc(var(--h) - 4) 40% 30% / .55); transform: translateX(-12%); }
.placeholder-art::after  { bottom: -28%; height: 50%; background: hsl(calc(var(--h) - 8) 38% 22% / .7); transform: translateX(18%); }
.placeholder-tag {
  position: absolute; top: .8rem; left: .8rem; z-index: 1;
  font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  background: rgba(28,20,16,.55); color: var(--cream); padding: .25rem .6rem; border-radius: 999px;
}

/* ============================== Events ============================== */
.events-layout { display: grid; grid-template-columns: .9fr 1.1fr; gap: var(--space-6); align-items: start; }
.sticky-head { position: sticky; top: 110px; }
.next-up {
  margin-top: var(--space-4); padding: var(--space-3);
  border-radius: var(--radius-m); background: var(--espresso); color: var(--cream);
  display: flex; align-items: center; gap: var(--space-3);
}
.next-up .count { font-family: var(--font-display); font-weight: 300; font-size: 3.2rem; line-height: 1; color: var(--terracotta); font-variant-numeric: tabular-nums; }
.next-up p { font-size: .95rem; color: var(--on-dark-muted); }
.next-up strong { display: block; color: var(--cream); font-weight: 500; font-size: 1.05rem; }

.event-list { display: flex; flex-direction: column; }
.event {
  display: grid; grid-template-columns: 84px 1fr auto; align-items: center; gap: var(--space-3);
  padding: var(--space-3) 0; border-top: 1px solid var(--line-light);
}
.event:last-child { border-bottom: 1px solid var(--line-light); }
.event-date { text-align: center; }
.event-date .day { display: block; font-family: var(--font-display); font-size: 2.4rem; font-weight: 300; line-height: 1; }
.event-date .mon { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink); font-weight: 600; }
.event h3 { font-size: 1.35rem; font-weight: 400; margin-bottom: .2rem; }
.event p { font-size: .92rem; color: var(--ink-muted); }
.badge {
  font-size: .78rem; font-weight: 500; white-space: nowrap;
  padding: .3rem .75rem; border-radius: 999px; border: 1px solid currentColor; color: var(--accent-ink);
}
.empty { color: var(--ink-muted); padding: var(--space-3) 0; }

@media (max-width: 860px) {
  .events-layout { grid-template-columns: 1fr; gap: var(--space-4); }
  .sticky-head { position: static; }
}
@media (max-width: 520px) {
  .event { grid-template-columns: 64px 1fr; }
  .event .badge { grid-column: 2; justify-self: start; }
}

/* ============================== Stories ============================== */
.story-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-3); }
.story-card {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-4); border-radius: var(--radius-l);
  background: #FFFaf3; border: 1px solid var(--line-light);
  text-align: left; width: 100%;
  transition: transform var(--dur-med) var(--ease-out), box-shadow var(--dur-med) var(--ease-out), border-color var(--dur-fast) ease;
}
.story-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -20px rgba(42,30,24,.35); border-color: rgba(154,69,40,.35); }
.story-card .meta { font-size: .82rem; color: var(--ink-muted); display: flex; gap: .5rem; flex-wrap: wrap; }
.story-card .meta .cat { color: var(--accent-ink); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.story-card h3 { font-size: 1.6rem; font-weight: 400; }
.story-card p.excerpt { color: var(--ink-muted); flex: 1; }
.story-card .read { font-weight: 500; color: var(--accent-ink); display: inline-flex; align-items: center; gap: .4rem; }
.story-card .read svg { width: 18px; height: 18px; transition: transform var(--dur-fast) ease; }
.story-card:hover .read svg { transform: translateX(4px); }

/* ============================== Modals ============================== */
.modal {
  width: min(100% - 2rem, 920px); max-height: calc(100dvh - 2rem);
  padding: 0; border: 0; border-radius: var(--radius-l);
  background: var(--cream); color: var(--ink); overflow: auto;
}
.modal::backdrop { background: rgba(28,20,16,.72); backdrop-filter: blur(4px); }
.modal[open] { animation: pop var(--dur-med) var(--ease-out); }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal-close {
  position: absolute; top: .8rem; right: .8rem; z-index: 2;
  width: 44px; height: 44px; border-radius: 50%; border: 0;
  display: grid; place-items: center; background: rgba(28,20,16,.6); color: var(--cream);
}
.modal-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.lightbox-media { position: relative; aspect-ratio: 3 / 2; background: var(--sand); }
.lightbox-media img { width: 100%; height: 100%; object-fit: contain; background: var(--espresso); }
.lightbox-caption { padding: var(--space-3) var(--space-4) 0; }
.lightbox-caption h3 { font-size: 1.6rem; }
.lightbox-caption p { color: var(--ink-muted); font-size: .92rem; }
.lightbox-nav { display: flex; justify-content: space-between; padding: var(--space-3) var(--space-4) var(--space-4); }
.modal-story { width: min(100% - 2rem, 720px); }
.modal-story article { padding: var(--space-6) var(--space-5) var(--space-5); }
.modal-story h3 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: var(--space-3); }
.modal-story .modal-close { background: var(--sand); color: var(--ink); }
.story-body p { margin-bottom: 1.1em; font-size: 1.08rem; line-height: 1.75; max-width: 65ch; }
@media (max-width: 520px) { .modal-story article { padding: var(--space-6) var(--space-3) var(--space-4); } }

/* ============================== Footer ============================== */
.site-footer { background: var(--espresso); color: var(--cream); padding: var(--space-6) 0 var(--space-3); }
.footer-grid { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-4); }
.footer-note { margin-top: var(--space-2); color: var(--on-dark-muted); max-width: 36ch; font-size: .95rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); }
.footer-links a { display: inline-block; padding: .6rem 0; color: var(--on-dark-muted); text-decoration: none; transition: color var(--dur-fast) ease; }
.footer-links a:hover { color: var(--cream); }
.footer-base { margin-top: var(--space-5); padding-top: var(--space-3); border-top: 1px solid var(--espresso-line); font-size: .85rem; color: var(--on-dark-muted); }

/* ============================== Reveal on scroll ============================== */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   Playful layer: warmer, softer, a bit more personality
   ========================================================================== */
:root {
  --sage:   #A9BC85;  /* trips */
  --rose:   #F0A99A;  /* birthdays */
  --butter: #F4D58A;  /* gatherings */
  --peach:  #F7C3A3;
  --radius-m: 24px; --radius-l: 32px;
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 48' preserveAspectRatio='none'%3E%3Cpath d='M0 48V28C120 6 240 2 360 18s240 30 360 14S960 0 1080 10c50 4 90 12 120 20v18z'/%3E%3C/svg%3E");
}

/* Soft, slightly wonky serif everywhere it's used */
h1, h2, h3, .brand, .hero-statement, .stats dd, .event-date .day, .next-up .count {
  font-variation-settings: "SOFT" 100, "WONK" 1;
}
.hero-title { font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1; }

/* Hand-drawn squiggle under "brood" */
.squiggle {
  color: var(--amber); font-style: italic;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 12'%3E%3Cpath d='M2 8c10-6 18-6 28 0s18 6 28 0 18-6 28 0 18 6 30-1' fill='none' stroke='%23E07A4F' stroke-width='3.5' stroke-linecap='round'/%3E%3C/svg%3E") bottom / 100% .22em no-repeat;
  padding-bottom: .08em;
}

/* Friendlier hero */
.glow { background: radial-gradient(closest-side, rgba(240,140,95,.5), rgba(244,213,138,.18) 55%, transparent 75%); }
.avatars span { transition: transform var(--dur-med) var(--ease-spring); }
.avatars span:nth-child(odd)  { transform: rotate(-6deg); }
.avatars span:nth-child(even) { transform: rotate(5deg) translateY(2px); }
.family-chip:hover .avatars span { transform: translateY(-4px) rotate(0); }
.family-chip p { background: rgba(246,238,227,.08); padding: .35rem .8rem; border-radius: 999px; }

.doodle { position: absolute; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; animation: bob 6s ease-in-out infinite; }
.d-heart   { width: 30px; top: 14%; left: 14%; stroke: var(--rose); fill: rgba(240,169,154,.25); transform: rotate(-14deg); }
.d-star    { width: 26px; top: 8%;  right: 18%; stroke: var(--butter); animation-delay: -2s; }
.d-swirl   { width: 46px; bottom: 16%; right: 4%; stroke: var(--sage); animation-delay: -4s; }
.d-sparkle { width: 20px; bottom: 26%; left: 4%; stroke: var(--peach); animation-delay: -1s; }
@keyframes bob { 0%,100% { translate: 0 0; rotate: 0deg; } 50% { translate: 0 -10px; rotate: 8deg; } }

.hero-statement em { position: relative; }

/* Springy buttons */
.btn { transition: background-color var(--dur-fast) ease, transform var(--dur-med) var(--ease-spring), box-shadow var(--dur-med) ease, color var(--dur-fast) ease, border-color var(--dur-fast) ease; }
.btn-primary:hover { transform: translateY(-2px) rotate(-1.5deg); box-shadow: 0 10px 24px -10px rgba(224,122,79,.7); }
.socials a { transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease, transform var(--dur-med) var(--ease-spring); }
.socials a:hover { transform: translateY(-3px) rotate(-8deg); }

/* Wavy edges between sections (each wave takes its own section's colour) */
.hero { padding-bottom: calc(var(--space-7) + 24px); }
.hero::after { display: none; }
.section, .site-footer { position: relative; }
.section::before, .site-footer::before {
  content: ""; position: absolute; left: 0; right: 0; top: -46px; height: 48px;
  background: inherit; pointer-events: none;
  -webkit-mask: var(--wave) center / 100% 100% no-repeat; mask: var(--wave) center / 100% 100% no-repeat;
}
.section-sand::before { transform: scaleX(-1); }

/* Eyebrows become little pill stickers */
.eyebrow {
  display: inline-block; padding: .35rem .85rem; border-radius: 999px;
  background: var(--peach); color: var(--ink); letter-spacing: .1em;
  transform: rotate(-2deg);
}
.section-sand .eyebrow { background: var(--butter); }

/* Gallery: rounder, bouncier tiles with a gentle tilt */
.gallery-grid { gap: 1.1rem; }
.tile { transition: transform var(--dur-med) var(--ease-spring), box-shadow var(--dur-med) ease; }
.gallery-grid li:nth-child(odd)  .tile:hover { transform: rotate(-1.2deg) scale(1.02); }
.gallery-grid li:nth-child(even) .tile:hover { transform: rotate(1.2deg) scale(1.02); }
.tile:hover { box-shadow: 0 20px 40px -18px rgba(42,30,24,.5); }
.placeholder-tag { background: var(--cream); color: var(--ink); font-weight: 600; transform: rotate(-3deg); }
.chip { transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease, border-color var(--dur-fast) ease, transform var(--dur-med) var(--ease-spring); }
.chip:hover { transform: translateY(-2px); }
.chip[aria-pressed="true"] { background: var(--terracotta); border-color: var(--terracotta); color: var(--espresso); font-weight: 500; }

/* Events: colourful ticket-style dates */
.event { border-top: 2px dashed rgba(42,30,24,.15); }
.event:last-child { border-bottom: 2px dashed rgba(42,30,24,.15); }
.event-date {
  --tone: var(--peach);
  background: var(--tone); border-radius: 20px; padding: .7rem 0 .55rem;
  transform: rotate(-3deg); transition: transform var(--dur-med) var(--ease-spring);
}
.event:nth-child(even) .event-date { transform: rotate(3deg); }
.event:hover .event-date { transform: rotate(0) scale(1.06); }
.event-date .mon { color: var(--ink); }
.type-birthday  .event-date, .type-birthday  .badge { --tone: var(--rose); }
.type-trip      .event-date, .type-trip      .badge { --tone: var(--sage); }
.type-gathering .event-date, .type-gathering .badge { --tone: var(--butter); }
.badge { --tone: var(--peach); background: var(--tone); border: 0; color: var(--ink); font-weight: 600; padding: .35rem .85rem; }
.next-up { background: var(--terracotta); color: var(--espresso); border-radius: var(--radius-l); transform: rotate(-1.5deg); }
.next-up .count { color: var(--espresso); }
.next-up p, .next-up strong { color: var(--espresso); }

/* Stories: colour-topped cards that tilt on hover */
.story-card { --tone: var(--peach); position: relative; overflow: hidden; padding-top: calc(var(--space-4) + 10px); transition: transform var(--dur-med) var(--ease-spring), box-shadow var(--dur-med) ease, border-color var(--dur-fast) ease; }
.story-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 10px; background: var(--tone); }
.story-card::after { /* soft blob in the corner */
  content: ""; position: absolute; width: 140px; height: 140px; right: -50px; bottom: -60px;
  border-radius: 46% 54% 60% 40% / 50% 40% 60% 50%; background: var(--tone); opacity: .35;
  transition: transform var(--dur-slow) var(--ease-out);
}
.story-card:hover::after { transform: scale(1.25) rotate(20deg); }
.story-card > * { position: relative; z-index: 1; }
.story-card:nth-child(odd):hover  { transform: translateY(-6px) rotate(-1deg); }
.story-card:nth-child(even):hover { transform: translateY(-6px) rotate(1deg); }
.cat-travel { --tone: var(--sage); } .cat-home { --tone: var(--butter); } .cat-family { --tone: var(--rose); }

/* Footer wave + friendlier note */
.footer-note::after { content: " \2665"; color: var(--rose); }

@media (prefers-reduced-motion: reduce) {
  .event-date, .next-up, .avatars span, .eyebrow { transform: none !important; }
}

/* ==========================================================================
   Places we've been: passport-stamp strip
   ========================================================================== */
.section-dark { background: var(--espresso); color: var(--cream); }
.section-dark .lead { color: var(--on-dark-muted); }
.places-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-3); flex-wrap: wrap; }
.places-head .section-head { margin-bottom: var(--space-4); }

.btn-outline-light { background: transparent; color: var(--cream); border-color: var(--espresso-line); margin-bottom: var(--space-4); }
.btn-outline-light:hover { border-color: var(--peach); color: var(--peach); }
.marquee-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.marquee-toggle .i-play { display: none; }
.marquee-toggle[aria-pressed="true"] .i-play { display: block; }
.marquee-toggle[aria-pressed="true"] .i-pause { display: none; }

.marquee {
  overflow: hidden; padding: var(--space-3) 0 var(--space-2);
  -webkit-mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.stamp-track { display: flex; width: max-content; animation: stamp-scroll 60s linear infinite; }
.stamp-track.paused, .marquee:hover .stamp-track, .marquee:focus-within .stamp-track { animation-play-state: paused; }
@keyframes stamp-scroll { to { transform: translateX(-50%); } }
.stamp-list { display: flex; align-items: center; gap: 2rem; padding-right: 2rem; }

.stamp {
  --tone: var(--peach);
  flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  color: var(--tone);
  border: 2.5px solid var(--tone);
  outline: 1.5px solid var(--tone); outline-offset: -9px;
  background: color-mix(in srgb, var(--tone) 8%, transparent);
  transform: rotate(-6deg);
  transition: transform var(--dur-med) var(--ease-spring), background-color var(--dur-fast) ease;
}
.stamp:nth-child(3n+2) { transform: rotate(5deg) translateY(10px); }
.stamp:nth-child(3n)   { transform: rotate(-2deg) translateY(-8px); }
.stamp:hover { transform: rotate(0) scale(1.08); background: color-mix(in srgb, var(--tone) 18%, transparent); }
.tone-peach  { --tone: var(--peach); }
.tone-butter { --tone: var(--butter); }
.tone-sage   { --tone: var(--sage); }
.tone-rose   { --tone: var(--rose); }

.shape-round  { width: 150px; height: 150px; border-radius: 50%; padding: 1rem; }
.shape-rect   { min-width: 170px; height: 120px; border-radius: 14px; padding: 1rem 1.4rem; border-style: dashed; }
.shape-ticket { min-width: 190px; height: 96px; border-radius: 999px; padding: .8rem 1.8rem; }

.stamp-country {
  font-family: var(--font-display); font-variation-settings: "SOFT" 100, "WONK" 1;
  font-size: 1.45rem; line-height: 1.1; text-transform: uppercase; letter-spacing: .04em;
}
.stamp-meta { margin-top: .3rem; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; opacity: .9; }

@media (max-width: 680px) {
  .places-head .btn-outline-light { margin-bottom: var(--space-3); }
  .shape-round { width: 128px; height: 128px; }
  .stamp-country { font-size: 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .marquee { -webkit-mask: none; mask: none; }
  .stamp-track { width: auto; animation: none; justify-content: center; }
  .stamp-list { flex-wrap: wrap; justify-content: center; padding: 0 1.25rem; row-gap: 2.5rem; }
  .stamp-list[aria-hidden="true"], .marquee-toggle { display: none; }
}

/* ==========================================================================
   Stories: "coming soon" card (shown while there are no stories)
   ========================================================================== */
.story-soon {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: var(--space-5);
  padding: var(--space-5) var(--space-5);
  border-radius: var(--radius-l);
  border: 2px dashed rgba(154, 69, 40, .35);
  background: #FFFAF3;
  position: relative; overflow: hidden;
}
.story-soon::after {
  content: ""; position: absolute; width: 260px; height: 260px; right: -90px; bottom: -120px;
  border-radius: 46% 54% 60% 40% / 50% 40% 60% 50%; background: var(--butter); opacity: .35;
}
.story-soon > * { position: relative; z-index: 1; }
.story-soon .hatch { flex: none; width: 96px; transform: rotate(-8deg); animation: hatch-wobble 3.2s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes hatch-wobble { 0%, 70%, 100% { rotate: 0deg; } 76% { rotate: -6deg; } 84% { rotate: 6deg; } 92% { rotate: -3deg; } }
.soon-tag {
  display: inline-block; margin-bottom: var(--space-2);
  padding: .3rem .8rem; border-radius: 999px; transform: rotate(-2deg);
  background: var(--terracotta); color: var(--espresso);
  font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
}
.story-soon h3 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: .5rem; }
.story-soon .excerpt { color: var(--ink-muted); max-width: 52ch; }
@media (max-width: 600px) {
  .story-soon { flex-direction: column; align-items: flex-start; gap: var(--space-3); padding: var(--space-4) var(--space-3); }
  .story-soon .hatch { width: 72px; }
}

/* Stat holidays: cycle through the warm tones so the list stays colourful */
.type-stat-holiday:nth-child(4n+1) .event-date, .type-stat-holiday:nth-child(4n+1) .badge,
.type-holiday:nth-child(4n+1) .event-date, .type-holiday:nth-child(4n+1) .badge { --tone: var(--peach); }
.type-stat-holiday:nth-child(4n+2) .event-date, .type-stat-holiday:nth-child(4n+2) .badge,
.type-holiday:nth-child(4n+2) .event-date, .type-holiday:nth-child(4n+2) .badge { --tone: var(--butter); }
.type-stat-holiday:nth-child(4n+3) .event-date, .type-stat-holiday:nth-child(4n+3) .badge,
.type-holiday:nth-child(4n+3) .event-date, .type-holiday:nth-child(4n+3) .badge { --tone: var(--sage); }
.type-stat-holiday:nth-child(4n+4) .event-date, .type-stat-holiday:nth-child(4n+4) .badge,
.type-holiday:nth-child(4n+4) .event-date, .type-holiday:nth-child(4n+4) .badge { --tone: var(--rose); }

/* ==========================================================================
   Multi-page: inner page headers + home "Explore" cards
   ========================================================================== */
.page-hero {
  position: relative; overflow: hidden;
  background: var(--espresso); color: var(--cream);
  padding: var(--space-6) 0 calc(var(--space-6) + 24px);
}
.page-hero::before { /* soft warm glow, echoing the home hero */
  content: ""; position: absolute; width: 760px; height: 760px; right: -260px; top: -380px; filter: blur(30px); opacity: .8;
  background: radial-gradient(closest-side, rgba(240,140,95,.35), rgba(244,213,138,.12) 60%, transparent 75%);
  pointer-events: none;
}
.page-hero-inner { position: relative; }
.page-hero .section-head { margin-bottom: 0; }
.page-hero h1 {
  font-size: clamp(2.8rem, 6.4vw, 5.2rem); font-weight: 300; letter-spacing: -0.015em;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  margin-bottom: var(--space-2);
}
.page-hero .lead { color: var(--on-dark-muted); }
.page-hero-places { padding-bottom: calc(var(--space-7) + 24px); }
.page-hero-places .places-head { margin-bottom: var(--space-3); }
.page-hero-places .marquee { position: relative; }

/* Events page: countdown on the left, list on the right */
@media (min-width: 861px) {
  #events .events-layout { grid-template-columns: minmax(260px, .75fr) 1.25fr; }
}
#events .next-up { margin-top: 0; }

/* Home: explore cards */
.explore-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-3); }
.explore-card {
  --tone: var(--peach);
  position: relative; overflow: hidden; height: 100%;
  display: flex; flex-direction: column; gap: .6rem;
  padding: var(--space-4); border-radius: var(--radius-l);
  background: #FFFAF3; border: 1px solid var(--line-light);
  text-decoration: none; color: var(--ink);
  transition: transform var(--dur-med) var(--ease-spring), box-shadow var(--dur-med) ease;
}
.explore-card::after {
  content: ""; position: absolute; width: 150px; height: 150px; right: -55px; top: -60px;
  border-radius: 46% 54% 60% 40% / 50% 40% 60% 50%; background: var(--tone); opacity: .45;
  transition: transform var(--dur-slow) var(--ease-out);
}
.explore-card > * { position: relative; z-index: 1; }
.explore-icon { width: 46px; height: 46px; padding: 10px; border-radius: 14px; background: var(--tone); color: var(--ink); transform: rotate(-6deg); }
.explore-card h3 { font-size: 1.7rem; margin-top: .4rem; }
.explore-card p { color: var(--ink-muted); flex: 1; }
.explore-card .read { font-weight: 500; color: var(--accent-ink); display: inline-flex; align-items: center; gap: .4rem; }
.explore-card .read svg { width: 18px; height: 18px; transition: transform var(--dur-fast) ease; }
.explore-grid li:nth-child(odd)  .explore-card:hover { transform: translateY(-6px) rotate(-1deg); }
.explore-grid li:nth-child(even) .explore-card:hover { transform: translateY(-6px) rotate(1deg); }
.explore-card:hover { box-shadow: 0 18px 40px -20px rgba(42,30,24,.35); }
.explore-card:hover::after { transform: scale(1.2) rotate(20deg); }
.explore-card:hover .read svg { transform: translateX(4px); }

/* Places page: the footer follows a dark header, so give it a divider */
body:has(.page-hero-places) .site-footer { border-top: 1px solid var(--espresso-line); }
body:has(.page-hero-places) .site-footer::before { display: none; }
