/* ============================================
   SixteenGenerations.com — Design System & Styles
   Connecting Generations. Celebrating Family.
   ============================================ */

/* --- CSS Variables / Design Tokens --- */
:root {
  /* Brand Colors — Oxford Navy with warm gold accent on parchment */
  --color-primary: #1B3A6F;
  --color-primary-light: #2E5BB8;
  --color-primary-dark: #0F2557;
  --color-accent: #C9A961;        /* warm heritage gold */
  --color-accent-light: #E8D7A8;
  --color-accent-dark: #A88940;

  /* Warm parchment neutral palette */
  --color-bg: #FBFAF6;            /* parchment */
  --color-surface: #FFFFFF;
  --color-surface-alt: #F2EDE2;   /* cream for alt panels */
  --color-border: #E5DDC8;        /* parchment border */
  --color-border-light: #F0EAD8;
  --color-text: #0F1729;          /* deep navy-ink */
  --color-text-secondary: #475569;
  --color-text-muted: #64748B;
}

/* A11y: inline accent-colored links (e.g. "Forgot password?", "Sign up")
   relied on green color alone to indicate they were links — WCAG 1.4.1
   wants a second signifier. Underline only the inline body links, not
   the buttons or nav items that use the same color variable. */
a[style*="color:var(--color-primary)"]:not(.btn):not(.nav-link):not(.header__logo) {
  text-decoration: underline;
  text-underline-offset: 2px;
}

:root {
  /* Semantic */
  --color-success: #2E7D32;
  --color-warning: #F59E0B;
  --color-error: #DC2626;
  --color-info: #2563EB;

  /* Typography — Instrument Serif (editorial italic display) + Inter for body */
  --font-heading: 'Instrument Serif', 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing — slightly more generous to feel modern */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.25rem;
  --space-2xl: 3.5rem;
  --space-3xl: 5rem;
  --space-4xl: 7rem;

  /* Border Radius — softer corners */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows — softer, more layered */
  --shadow-sm: 0 1px 2px rgba(15,15,15,0.04);
  --shadow-md: 0 4px 20px rgba(15,15,15,0.06), 0 1px 3px rgba(15,15,15,0.04);
  --shadow-lg: 0 12px 40px rgba(15,15,15,0.08), 0 2px 6px rgba(15,15,15,0.04);
  --shadow-xl: 0 24px 64px rgba(15,15,15,0.12), 0 4px 12px rgba(15,15,15,0.06);

  /* Transitions — slightly snappier */
  --transition-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 220ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 360ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --container-max: 1200px;
  --container-narrow: 760px;
  --header-height: 76px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.65;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-light);
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-text);
  line-height: 1.1;
  font-weight: 400;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.025em; }
h3 { font-size: clamp(1.5rem, 2.5vw, 1.875rem); }
h4 { font-size: 1.375rem; }
h5 { font-family: var(--font-body); font-size: 1rem; font-weight: 600; letter-spacing: 0; }
h6 { font-family: var(--font-body); font-size: 0.875rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-text-muted); }

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  text-align: center;
  margin-bottom: var(--space-md);
  color: var(--color-text);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.section-subtitle {
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 1.0625rem;
  max-width: 580px;
  margin: 0 auto var(--space-3xl);
  line-height: 1.6;
}

/* Display utilities — Instrument Serif italic for editorial emphasis */
.display-italic {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-primary);
}

/* Roman numeral display for generation markers */
.roman {
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 400;
  color: var(--color-accent);
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.section {
  padding: var(--space-4xl) 0;
}

.section--alt {
  background-color: var(--color-surface-alt);
}

.section--dark {
  background: linear-gradient(135deg, var(--color-accent-dark) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.section--dark::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 80% 20%, rgba(255,255,255,0.06), transparent 60%);
  pointer-events: none;
}

.section--dark > * { position: relative; }

.section--dark .section-title {
  color: #fff;
  font-weight: 400;
}

.section--dark .section-subtitle {
  color: rgba(255,255,255,0.78);
}

/* Grid */
.grid {
  display: grid;
  gap: var(--space-xl);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid--4, .grid--3, .grid--2 { grid-template-columns: 1fr; }
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.75rem; }
  .section-title { font-size: 1.75rem; }
  .section { padding: var(--space-3xl) 0; }
}

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-center { align-items: center; justify-content: center; }
.flex-between { align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* Text utilities */
.text-center { text-align: center; }
.text-muted { color: var(--color-text-secondary); }
.text-small { font-size: 0.875rem; }

/* ===========================
   HEADER & NAVIGATION
   =========================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(251,250,247,0.85);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid rgba(232,226,216,0.6);
  z-index: 1000;
  transition: box-shadow var(--transition-base), border-color var(--transition-base);
}

.header.scrolled {
  box-shadow: 0 1px 3px rgba(15,15,15,0.04);
  border-bottom-color: var(--color-border);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color var(--transition-fast);
}

.header__logo:hover { color: var(--color-primary); }

.header__logo-icon {
  width: 40px;
  height: 40px;
  background: var(--color-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.header__nav a {
  padding: var(--space-sm) var(--space-md);
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.header__nav a:hover,
.header__nav a.active {
  color: var(--color-primary);
  background: rgba(27,58,111,0.06);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text);
}

.menu-toggle:hover {
  background: var(--color-surface-alt);
}

.menu-toggle svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 900px) {
  .header__nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-lg);
    gap: var(--space-xs);
    z-index: 9999;
    overflow-y: auto;
    max-height: calc(100vh - var(--header-height));
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    border-top: 1px solid var(--color-border-light);
  }

  .header__nav.open {
    display: flex;
  }

  .header__nav a {
    font-size: 1.125rem;
    padding: var(--space-md);
  }

  .menu-toggle {
    display: flex;
  }

  .header__actions {
    display: none;
  }

  .header__nav .mobile-auth {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-border);
  }
}

@media (min-width: 901px) {
  .mobile-auth { display: none; }
}

/* ===========================
   BUTTONS — modern pill style, generous tap targets
   =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  position: relative;
}

.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(15,37,87,0.2);
}

.btn--primary:hover {
  background: var(--color-primary-dark);
  color: #fff;
  box-shadow: 0 8px 24px rgba(27,58,111,0.25);
  transform: translateY(-1px);
}

.btn--secondary {
  background: transparent;
  color: var(--color-primary);
  border-color: rgba(27,58,111,0.25);
}

.btn--secondary:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.btn--accent {
  background: var(--color-text);
  color: #fff;
}

.btn--accent:hover {
  background: #000;
  color: #fff;
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--color-text-secondary);
}

.btn--ghost:hover {
  background: var(--color-surface-alt);
  color: var(--color-text);
}

.btn--white {
  background: #fff;
  color: var(--color-primary-dark);
  border-color: var(--color-border);
}

.btn--white:hover {
  background: var(--color-surface-alt);
  color: var(--color-primary-dark);
  border-color: var(--color-border);
  transform: translateY(-1px);
}

.btn--lg {
  padding: 0.875rem 1.875rem;
  font-size: 1rem;
}

.btn--sm {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
}

.btn--full {
  width: 100%;
}

/* ===========================
   CARDS — borderless, soft shadow, generous radius
   =========================== */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: rgba(27,58,111,0.15);
}

.card__image {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--color-surface-alt);
}

.card__body {
  padding: var(--space-xl);
}

.card__tag {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: var(--radius-full);
  background: var(--color-accent-light);
  color: var(--color-primary-dark);
  margin-bottom: var(--space-md);
}

.card__title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin-bottom: var(--space-sm);
  line-height: 1.3;
}

.card__text {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border-light);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.card__meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* ===========================
   HERO SECTION — modern editorial layout
   =========================== */
.hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  overflow: hidden;
  margin-top: var(--header-height);
  padding: var(--space-3xl) 0;
}

/* Soft radial red wash in the background — subtle, not saturated */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 75% 20%, rgba(27,58,111,0.07), transparent 60%),
    radial-gradient(ellipse 60% 50% at 10% 90%, rgba(27,58,111,0.05), transparent 60%);
  z-index: 0;
}

/* Decorative thin line at the top */
.hero::after {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 60px; height: 3px;
  background: var(--color-primary);
  border-radius: 2px;
}

.hero__overlay { display: none; } /* legacy noise pattern off */

.hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  max-width: 760px;
  margin: 0 auto;
}

.hero__crest {
  width: 96px;
  height: 96px;
  margin: 0 auto var(--space-xl);
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 10px 30px rgba(27,58,111,0.18));
}

.hero__crest img,
.hero__crest svg {
  width: 96px;
  height: 96px;
  color: var(--color-primary);
}

.hero__title {
  font-family: var(--font-heading);
  font-size: clamp(2.75rem, 6vw, 4.75rem);
  font-weight: 400;
  color: var(--color-text);
  margin-bottom: var(--space-lg);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.hero__title em {
  font-style: italic;
  font-weight: 400;
  color: var(--color-primary);
}

.hero__tagline {
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2xl);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.55;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

.hero__actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .hero { padding: var(--space-2xl) 0; }
  .hero__crest, .hero__crest img, .hero__crest svg { width: 72px; height: 72px; }
}

/* ============================================================
   V3 — EDITORIAL MAGAZINE HOME (logged-out)
   ============================================================ */

/* Page band right under the fixed header — masthead area */
.v3-masthead {
  margin-top: var(--header-height);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}
.v3-masthead__row {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.6875rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--color-text-muted);
}
.v3-masthead__row span:nth-child(2) { color: var(--color-primary); }

/* HERO — asymmetric split, left = title/copy, right = 4x4 grid */
.v3-hero {
  background: var(--color-bg);
  padding: var(--space-3xl) 0 var(--space-4xl);
  position: relative;
  overflow: hidden;
}
.v3-hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 50% 50% at 95% 20%, rgba(27,58,111,0.06), transparent 60%),
    radial-gradient(ellipse 30% 40% at 5% 90%, rgba(201,169,97,0.08), transparent 60%);
  pointer-events: none;
}
.v3-hero__grid {
  position: relative;
  display: grid; grid-template-columns: 1.15fr 1fr;
  gap: clamp(var(--space-xl), 5vw, var(--space-3xl));
  align-items: center;
  max-width: var(--container-max); margin: 0 auto;
  padding: 0 var(--space-lg);
}
.v3-hero__edition {
  display: flex; align-items: center; gap: var(--space-md);
  margin-bottom: var(--space-xl);
}
.v3-hero__edition .rule { flex: 0 0 48px; height: 1px; background: var(--color-text-muted); opacity: 0.4; }
.v3-hero__edition .num {
  font-family: var(--font-mono);
  font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--color-text-muted);
}
.v3-hero__title {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 400;
  color: var(--color-text);
  letter-spacing: -0.035em;
  line-height: 0.95;
  margin-bottom: var(--space-xl);
}
.v3-hero__title em {
  font-style: italic;
  color: var(--color-primary);
  display: block;
}
.v3-hero__lede {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  line-height: 1.45;
  color: var(--color-text-secondary);
  max-width: 460px;
  margin-bottom: var(--space-xl);
}
.v3-hero__body {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text-secondary);
  max-width: 460px;
  margin-bottom: var(--space-2xl);
}
.v3-hero__actions {
  display: flex; gap: var(--space-md); flex-wrap: wrap;
}

/* 4x4 grid of generation tiles on the right side of the hero */
.v3-gen-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  aspect-ratio: 1;
  max-width: 460px; width: 100%;
  margin: 0 auto;
}
.v3-gen-cell {
  aspect-ratio: 1;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  font-family: var(--font-heading);
  font-style: italic;
  color: var(--color-text-muted);
  font-size: 1rem;
  transition: all var(--transition-base);
  position: relative;
}
.v3-gen-cell--filled {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.v3-gen-cell--current {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-primary-dark);
}
.v3-gen-cell::after {
  content: attr(data-roman);
}

/* BRANCH MARQUEE — long horizontal strip of family branches */
.v3-marquee {
  background: var(--color-primary);
  color: #fff;
  padding: var(--space-md) 0;
  overflow: hidden;
  position: relative;
  border-top: 1px solid var(--color-primary-dark);
  border-bottom: 1px solid var(--color-primary-dark);
}
.v3-marquee__track {
  display: flex; align-items: center; gap: var(--space-2xl);
  animation: v3marquee 40s linear infinite;
  width: max-content;
}
.v3-marquee__item {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: clamp(1.25rem, 2.5vw, 1.875rem);
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.v3-marquee__sep {
  color: var(--color-accent);
  font-family: var(--font-heading);
  font-size: 1.25rem;
}
@keyframes v3marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ASYMMETRIC FEATURE BLOCK — 1 big tile + 3 small tiles */
.v3-features {
  padding: var(--space-4xl) 0;
  background: var(--color-bg);
}
.v3-features__head {
  display: flex; align-items: end; justify-content: space-between;
  gap: var(--space-xl); margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}
.v3-features__title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--color-text);
  margin: 0;
  max-width: 720px;
}
.v3-features__title em { font-style: italic; color: var(--color-primary); }
.v3-features__num {
  font-family: var(--font-mono);
  font-size: 0.6875rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--color-text-muted); white-space: nowrap;
}

.v3-features__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  grid-template-rows: auto auto auto;
  gap: var(--space-md);
}
.v3-feature {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  text-decoration: none;
  color: var(--color-text);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}
.v3-feature:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.v3-feature--big {
  grid-column: 1; grid-row: 1 / 4;
  background: linear-gradient(180deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  color: #fff;
  padding: var(--space-3xl);
  border-color: var(--color-primary-dark);
}
.v3-feature--big:hover { border-color: var(--color-accent); }
.v3-feature__num {
  font-family: var(--font-mono);
  font-size: 0.6875rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
  display: inline-block;
}
.v3-feature--big .v3-feature__num { color: rgba(255,255,255,0.6); }
.v3-feature__title {
  font-family: var(--font-heading);
  font-size: 1.875rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 var(--space-md);
}
.v3-feature--big .v3-feature__title {
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  margin-bottom: var(--space-xl);
}
.v3-feature--big .v3-feature__title em { font-style: italic; color: var(--color-accent); display: block; }
.v3-feature__body {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-lg);
}
.v3-feature--big .v3-feature__body { color: rgba(255,255,255,0.78); font-size: 1.0625rem; max-width: 380px; }
.v3-feature__arrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-body); font-weight: 500; font-size: 0.875rem;
  color: var(--color-primary);
}
.v3-feature--big .v3-feature__arrow { color: var(--color-accent); }

/* HORIZONTAL STATS STRIP */
.v3-stats {
  background: var(--color-primary-dark);
  color: #fff;
  padding: var(--space-2xl) 0;
  position: relative;
  overflow: hidden;
}
.v3-stats::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 50% 60% at 50% 100%, rgba(201,169,97,0.12), transparent 60%);
}
.v3-stats__row {
  position: relative;
  display: grid; grid-template-columns: repeat(4, 1fr);
  align-items: center;
}
.v3-stats__cell {
  padding: 0 var(--space-xl);
  border-left: 1px solid rgba(255,255,255,0.15);
  text-align: left;
}
.v3-stats__cell:first-child { border-left: none; }
.v3-stats__num {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--color-accent);
}
.v3-stats__num em { font-style: italic; }
.v3-stats__label {
  font-family: var(--font-mono);
  font-size: 0.6875rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(255,255,255,0.65);
  margin-top: var(--space-sm);
}

/* QUOTE BLOCK — full-width editorial pull-quote */
.v3-quote {
  padding: var(--space-4xl) 0;
  background: var(--color-bg);
  text-align: center;
}
.v3-quote__mark {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 6rem;
  line-height: 0.5;
  color: var(--color-accent);
  display: block;
  margin-bottom: var(--space-md);
}
.v3-quote__body {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--color-text);
  max-width: 820px;
  margin: 0 auto var(--space-xl);
}
.v3-quote__attr {
  font-family: var(--font-mono);
  font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--color-text-muted);
}

/* SIDE-BY-SIDE CTA */
.v3-cta {
  padding: var(--space-4xl) 0;
  background: var(--color-surface-alt);
}
.v3-cta__grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3xl);
  align-items: center;
  max-width: var(--container-max); margin: 0 auto; padding: 0 var(--space-lg);
}
.v3-cta__title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--color-text);
  margin: 0 0 var(--space-md);
}
.v3-cta__title em { font-style: italic; color: var(--color-primary); }
.v3-cta__lede {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  max-width: 460px;
  margin: 0 0 var(--space-xl);
}
.v3-cta__card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-md);
}
.v3-cta__card-row {
  display: flex; align-items: center; gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border-light);
  font-size: 0.9375rem;
}
.v3-cta__card-row:last-child { border-bottom: none; }
.v3-cta__card-row .icon {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: var(--color-accent-light); color: var(--color-primary-dark);
  display: grid; place-items: center; flex: 0 0 32px;
}
.v3-cta__card-row .icon svg { width: 16px; height: 16px; }

/* Responsive */
@media (max-width: 960px) {
  .v3-hero__grid { grid-template-columns: 1fr; gap: var(--space-2xl); }
  .v3-gen-grid { max-width: 380px; }
  .v3-features__grid { grid-template-columns: 1fr; grid-template-rows: auto; }
  .v3-feature--big { grid-column: 1; grid-row: auto; }
  .v3-stats__row { grid-template-columns: repeat(2, 1fr); gap: var(--space-xl); }
  .v3-stats__cell { padding: 0 var(--space-md); border-left: none; }
  .v3-stats__cell:nth-child(odd) { border-left: none; }
  .v3-cta__grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .v3-features__head { flex-direction: column; align-items: flex-start; gap: var(--space-md); }
  .v3-stats__row { grid-template-columns: 1fr 1fr; }
}

/* ===========================
   FEATURE CARDS (Homepage)
   =========================== */
.feature-card {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
}

.feature-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
  border-color: var(--color-primary);
}

.feature-card__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-lg);
  background: rgba(27,94,32,0.08);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  font-size: 1.75rem;
}

.feature-card__title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
}

.feature-card__text {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* ===========================
   BIRTHDAY WIDGET
   =========================== */
.birthday-widget {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
}

.birthday-widget:hover {
  box-shadow: var(--shadow-sm);
}

.birthday-widget__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent-light), var(--color-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  color: var(--color-primary-dark);
  font-weight: 700;
}

.birthday-widget__info {
  flex: 1;
  min-width: 0;
}

.birthday-widget__name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 2px;
}

.birthday-widget__date {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.birthday-widget__badge {
  flex-shrink: 0;
  padding: 0.25rem 0.75rem;
  background: rgba(200,169,81,0.15);
  color: var(--color-accent-dark);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
}

/* ===========================
   STATS BAR
   =========================== */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  padding: var(--space-2xl) 0;
}

.stat-item {
  text-align: center;
}

.stat-item__number {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.stat-item__label {
  font-size: 0.9375rem;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

@media (max-width: 640px) {
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .stat-item__number { font-size: 2rem; }
}

/* ===========================
   EVENTS
   =========================== */
.event-card {
  display: flex;
  gap: var(--space-lg);
  padding: var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
}

.event-card:hover {
  box-shadow: var(--shadow-md);
}

.event-card__date-block {
  flex-shrink: 0;
  width: 72px;
  text-align: center;
  padding: var(--space-md);
  background: var(--color-primary);
  border-radius: var(--radius-md);
  color: #fff;
}

.event-card__date-month {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.9;
}

.event-card__date-day {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.event-card__date-year {
  font-size: 0.6875rem;
  opacity: 0.7;
}

.event-card__info {
  flex: 1;
}

.event-card__title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  margin-bottom: var(--space-xs);
}

.event-card__location,
.event-card__time {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: 2px;
}

.event-card__rsvp {
  margin-top: var(--space-md);
}

.event-card__attendees {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.avatar-stack {
  display: flex;
}

.avatar-stack__item {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--color-surface);
  margin-left: -8px;
  background: var(--color-surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.avatar-stack__item:first-child {
  margin-left: 0;
}

@media (max-width: 640px) {
  .event-card { flex-direction: column; }
  .event-card__date-block {
    width: 100%;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
  }
  .event-card__date-day { font-size: 1.25rem; }
}

/* ===========================
   GALLERY
   =========================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-md);
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1;
  background: var(--color-surface-alt);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition-base);
  display: flex;
  align-items: flex-end;
  padding: var(--space-lg);
}

.gallery-item:hover .gallery-item__overlay {
  opacity: 1;
}

.gallery-item__caption {
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
}

.lightbox.active {
  display: flex;
}

.lightbox__close {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  color: #fff;
  font-size: 1.5rem;
  z-index: 2001;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
}

.lightbox__close:hover {
  background: rgba(255,255,255,0.2);
}

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius-md);
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 2rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
}

.lightbox__nav:hover {
  background: rgba(255,255,255,0.2);
}

.lightbox__prev { left: var(--space-lg); }
.lightbox__next { right: var(--space-lg); }

/* ===========================
   FAMILY TREE
   =========================== */
.tree-container {
  width: 100%;
  min-height: 600px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}

.tree-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-border-light);
  background: var(--color-surface-alt);
}

.tree-canvas {
  width: 100%;
  height: 550px;
  overflow: auto;
  padding: var(--space-2xl);
}

.tree-node {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-md);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  min-width: 140px;
}

.tree-node:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.tree-node__photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--color-surface-alt);
  margin-bottom: var(--space-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--color-text-muted);
}

.tree-node__name {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 2px;
}

.tree-node__dates {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* ===========================
   FORMS
   =========================== */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.form-label--required::after {
  content: ' *';
  color: var(--color-error);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(27,94,32,0.12);
}

.form-input::placeholder {
  color: var(--color-text-muted);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-hint {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}

.form-error {
  font-size: 0.8125rem;
  color: var(--color-error);
  margin-top: var(--space-xs);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
}

.form-divider {
  margin: var(--space-2xl) 0;
  border: 0;
  border-top: 1px solid var(--color-border-light);
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}

.form-check input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--color-primary);
}

/* Auth form wrapper */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  margin-top: var(--header-height);
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-3xl);
  box-shadow: var(--shadow-xl);
}

.auth-card--wide {
  max-width: 640px;
}

.auth-card__header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.auth-card__logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--color-primary-dark);
  margin-bottom: var(--space-sm);
}

.auth-card__title {
  font-size: 1.5rem;
  margin-bottom: var(--space-xs);
}

.auth-card__subtitle {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
}

.auth-card__footer {
  text-align: center;
  margin-top: var(--space-xl);
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
}

/* ===========================
   PAGE HEADER (inner pages)
   =========================== */
.page-header {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  padding: var(--space-4xl) 0 var(--space-3xl);
  margin-top: var(--header-height);
  text-align: center;
}

.page-header__title {
  font-family: var(--font-heading);
  font-size: 2.75rem;
  color: #fff;
  margin-bottom: var(--space-sm);
}

.page-header__subtitle {
  color: rgba(255,255,255,0.8);
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto;
}

.page-header__breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  font-size: 0.875rem;
  color: rgba(255,255,255,0.6);
}

.page-header__breadcrumb a {
  color: rgba(255,255,255,0.6);
}

.page-header__breadcrumb a:hover {
  color: rgba(255,255,255,0.9);
}

/* ===========================
   CALENDAR
   =========================== */
.calendar {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.calendar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  background: var(--color-primary);
  color: #fff;
}

.calendar__title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
}

.calendar__nav {
  color: #fff;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.calendar__nav:hover {
  background: rgba(255,255,255,0.15);
}

.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar__day-name {
  padding: var(--space-sm);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.calendar__day {
  padding: var(--space-sm);
  text-align: center;
  font-size: 0.875rem;
  border-top: 1px solid var(--color-border-light);
  min-height: 48px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.calendar__day:hover {
  background: var(--color-surface-alt);
}

.calendar__day--today {
  background: rgba(27,94,32,0.08);
  font-weight: 700;
  color: var(--color-primary);
}

.calendar__day--has-event::after {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  margin: 4px auto 0;
}

.calendar__day--other-month {
  color: var(--color-text-muted);
  opacity: 0.4;
}

/* ===========================
   BIRTHDAY PAGE
   =========================== */
.birthday-card {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
}

.birthday-card__avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent-light), var(--color-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
}

.birthday-card__info h4 {
  margin-bottom: 2px;
}

.birthday-card__info p {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

.birthday-card__actions {
  margin-left: auto;
  flex-shrink: 0;
}

/* ===========================
   ABOUT PAGE
   =========================== */
.about-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
}

.about-hero__image {
  border-radius: var(--radius-xl);
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--color-surface-alt);
}

.about-values {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.value-card {
  text-align: center;
  padding: var(--space-2xl);
}

.value-card__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-md);
  color: var(--color-primary);
  font-size: 2rem;
}

@media (max-width: 768px) {
  .about-hero { grid-template-columns: 1fr; }
  .about-values { grid-template-columns: 1fr; }
}

/* ===========================
   CONTACT
   =========================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
}

.contact-info-item {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.contact-info-item__icon {
  width: 48px;
  height: 48px;
  background: rgba(27,94,32,0.08);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  flex-shrink: 0;
  font-size: 1.25rem;
}

@media (max-width: 768px) {
  .contact-grid { grid-template-columns: 1fr; }
}

/* ===========================
   FOOTER
   =========================== */
.footer {
  background: linear-gradient(180deg, var(--color-accent-dark) 0%, #200505 100%);
  color: rgba(255,255,255,0.78);
  padding: var(--space-4xl) 0 var(--space-xl);
  border-top: 1px solid rgba(27,58,111,0.15);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-3xl);
  margin-bottom: var(--space-3xl);
}

.footer__brand {
  max-width: 320px;
}

.footer__logo {
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: #fff;
  margin-bottom: var(--space-md);
}

.footer__tagline {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.6);
}

.footer__heading {
  font-family: var(--font-heading);
  font-size: 1.0625rem;
  color: #fff;
  margin-bottom: var(--space-lg);
}

.footer__links a {
  display: block;
  color: rgba(255,255,255,0.6);
  font-size: 0.9375rem;
  padding: var(--space-xs) 0;
  transition: color var(--transition-fast);
}

.footer__links a:hover {
  color: #fff;
}

.footer__bottom {
  padding-top: var(--space-xl);
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.4);
}

.footer__social {
  display: flex;
  gap: var(--space-md);
}

.footer__social a {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6);
  transition: all var(--transition-fast);
}

.footer__social a:hover {
  background: #fff;
  color: var(--color-primary-dark);
}

@media (max-width: 768px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer__brand {
    grid-column: 1 / -1;
  }
  .footer__bottom {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }
}

@media (max-width: 480px) {
  .footer__grid { grid-template-columns: 1fr; }
}

/* ===========================
   TABS / FILTERS
   =========================== */
.tabs {
  display: flex;
  gap: var(--space-xs);
  border-bottom: 2px solid var(--color-border-light);
  margin-bottom: var(--space-xl);
  overflow-x: auto;
}

.tab {
  padding: var(--space-md) var(--space-lg);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.tab:hover {
  color: var(--color-text);
}

.tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.filter-pills {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-xl);
}

.filter-pill {
  padding: 0.375rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border-light);
  transition: all var(--transition-fast);
}

.filter-pill:hover,
.filter-pill.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* ===========================
   ALBUM CARDS
   =========================== */
.album-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  transition: all var(--transition-base);
}

.album-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.album-card__preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  aspect-ratio: 16/10;
  overflow: hidden;
}

.album-card__preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--color-surface-alt);
}

.album-card__body {
  padding: var(--space-md) var(--space-lg);
}

.album-card__title {
  font-weight: 600;
  margin-bottom: 2px;
}

.album-card__count {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

/* ===========================
   NOTIFICATION BAR
   =========================== */
.notification-bar {
  background: var(--color-accent);
  color: var(--color-primary-dark);
  text-align: center;
  padding: var(--space-sm) var(--space-lg);
  font-size: 0.875rem;
  font-weight: 500;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1001;
}

.notification-bar + .header {
  top: 36px;
}

.notification-bar + .header + main .hero,
.notification-bar + .header + main .page-header,
.notification-bar + .header + main .auth-page {
  margin-top: calc(var(--header-height) + 36px);
}

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

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

/* ===========================
   ANIMATIONS
   =========================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeInUp 0.6s ease forwards;
  opacity: 0;
}

.animate-in:nth-child(2) { animation-delay: 0.1s; }
.animate-in:nth-child(3) { animation-delay: 0.2s; }
.animate-in:nth-child(4) { animation-delay: 0.3s; }
.animate-in:nth-child(5) { animation-delay: 0.4s; }
.animate-in:nth-child(6) { animation-delay: 0.5s; }

/* ===========================
   PAGINATION
   =========================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.pagination__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 var(--space-sm);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border-light);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.pagination__link:hover {
  background: var(--color-surface-alt);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.pagination__link--active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.pagination__link--active:hover {
  background: var(--color-primary-light);
  color: #fff;
}

@media (max-width: 600px) {
  .pagination-wrap { justify-content: center; }
  .pagination-info { width: 100%; text-align: center; }
}

/* ===========================
   DATA TABLES
   =========================== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.data-table th {
  text-align: left;
  padding: var(--space-md) var(--space-md);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  border-bottom: 2px solid var(--color-border-light);
  white-space: nowrap;
}

.data-table td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: var(--color-surface-alt);
}

.data-table .actions {
  display: flex;
  gap: var(--space-xs);
  white-space: nowrap;
}

/* Sortable table headers */
table th[data-sort-dir] { color: var(--color-primary); }
table th .sort-arrow { transition: opacity 0.15s; }
table th:hover .sort-arrow { opacity: 0.8 !important; }

@media (max-width: 768px) {
  .data-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ===========================
   WISHES WALL
   =========================== */
.wish-card {
  padding: var(--space-md) var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
}

.wish-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.wish-card__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 600;
  flex-shrink: 0;
}

.wish-card__name {
  font-weight: 600;
  font-size: 0.875rem;
}

.wish-card__time {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-left: auto;
}

.wish-card__message {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* ===========================
   EMPTY STATE
   =========================== */
.empty-state {
  text-align: center;
  padding: var(--space-4xl) var(--space-xl);
  color: var(--color-text-muted);
}

.empty-state__icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.empty-state__title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
}

.empty-state__text {
  font-size: 0.9375rem;
  max-width: 400px;
  margin: 0 auto;
}

/* ===========================
   EVENT DETAIL
   =========================== */
.event-detail {
  max-width: 800px;
  margin: 0 auto;
}

.event-detail__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xl);
  margin: var(--space-xl) 0;
  padding: var(--space-xl);
  background: var(--color-surface-alt);
  border-radius: var(--radius-lg);
}

.event-detail__meta-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}

.event-detail__meta-icon {
  color: var(--color-primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.event-detail__description {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2xl);
}

.event-detail__attendees {
  margin-top: var(--space-2xl);
}

.attendee-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
}

.attendee-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
}

.attendee-item__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 600;
  flex-shrink: 0;
}

/* ===========================
   PROFILE PAGE
   =========================== */
.profile-header {
  display: flex;
  align-items: center;
  gap: var(--space-2xl);
  margin-bottom: var(--space-3xl);
}

.profile-header__avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #fff;
  flex-shrink: 0;
}

.profile-header__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.profile-header__name {
  font-family: var(--font-heading);
  font-size: 2rem;
  margin-bottom: var(--space-xs);
}

.profile-header__meta {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
}

.profile-section {
  margin-bottom: var(--space-3xl);
}

.profile-section__title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-border-light);
}

@media (max-width: 640px) {
  .profile-header {
    flex-direction: column;
    text-align: center;
  }
  .profile-header__avatar { width: 96px; height: 96px; font-size: 2.5rem; }
}

/* ===========================
   DRAG & DROP FILE UPLOAD
   =========================== */
.upload-zone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--color-surface);
  overflow: hidden;
}

.upload-zone:hover {
  border-color: var(--color-primary);
  background: rgba(27,94,32,0.02);
}

.upload-zone--dragover {
  border-color: var(--color-primary);
  background: rgba(27,94,32,0.06);
  box-shadow: 0 0 0 3px rgba(27,94,32,0.1);
}

.upload-zone--error {
  border-color: var(--color-error);
  background: rgba(46,91,184,0.04);
}

.upload-zone--has-file {
  border-style: solid;
  border-color: var(--color-primary);
}

.upload-zone__content {
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
}

.upload-zone__icon {
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

.upload-zone__text {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xs);
}

.upload-zone__browse {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: underline;
}

.upload-zone__hint {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.upload-zone__preview {
  position: relative;
  text-align: center;
  background: var(--color-surface-alt);
}

.upload-zone__img {
  max-height: 240px;
  max-width: 100%;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border-radius: var(--radius-md);
}

.upload-zone__remove {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.upload-zone__remove:hover {
  background: var(--color-error);
}

.upload-zone__file-info {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.8125rem;
  background: var(--color-surface-alt);
  border-top: 1px solid var(--color-border-light);
  text-align: center;
}

.upload-zone__filename {
  font-weight: 500;
  color: var(--color-text);
}

.upload-zone__size {
  color: var(--color-text-muted);
}

/* ===========================
   ACCESSIBILITY CLASSES
   =========================== */

/* Large text — 120% base font */
body.a11y-large-text {
  font-size: 120%;
}

/* High contrast — darker text, stronger borders */
body.a11y-high-contrast {
  --color-text: #000000;
  --color-text-secondary: #333333;
  --color-text-muted: #555555;
  --color-border: #666666;
  --color-border-light: #999999;
  --color-bg: #ffffff;
  --color-surface-alt: #f0f0f0;
}

body.a11y-high-contrast a {
  text-decoration: underline;
}

body.a11y-high-contrast .btn {
  border-width: 2px;
}

/* Reduced motion — disable animations and transitions */
body.a11y-reduced-motion,
body.a11y-reduced-motion *,
body.a11y-reduced-motion *::before,
body.a11y-reduced-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

/* Dyslexia-friendly font */
body.a11y-dyslexia-font {
  --font-body: 'OpenDyslexic', 'Comic Sans MS', -apple-system, sans-serif;
  letter-spacing: 0.05em;
  word-spacing: 0.12em;
  line-height: 1.8;
}

body.a11y-dyslexia-font h1,
body.a11y-dyslexia-font h2,
body.a11y-dyslexia-font h3,
body.a11y-dyslexia-font h4,
body.a11y-dyslexia-font h5,
body.a11y-dyslexia-font h6 {
  font-family: var(--font-body);
  letter-spacing: 0.03em;
}

/* ===========================
   ACCESSIBILITY FAB & PANEL
   =========================== */
.a11y-fab {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9999;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  transition: background 0.2s, transform 0.2s;
}

.a11y-fab:hover {
  background: var(--color-primary-light);
  transform: scale(1.08);
}

.a11y-fab:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.a11y-panel {
  position: fixed;
  bottom: 80px;
  left: 20px;
  z-index: 9999;
  width: 280px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  overflow: hidden;
}

.a11y-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--color-surface-alt);
  border-bottom: 1px solid var(--color-border-light);
  font-size: 0.9375rem;
}

.a11y-panel__close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--color-text-secondary);
  padding: 0;
  line-height: 1;
}

.a11y-panel__close:hover {
  color: var(--color-text);
}

.a11y-panel__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-lg);
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border-light);
  transition: background 0.15s;
}

.a11y-panel__option:last-child {
  border-bottom: none;
}

.a11y-panel__option:hover {
  background: var(--color-surface-alt);
}

.a11y-panel__option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

/* ===========================
   COUNTDOWN WIDGET
   =========================== */
.countdown-widget {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  color: #fff;
  padding: var(--space-xl) var(--space-2xl);
  border-radius: var(--radius-lg);
  text-align: center;
}

.countdown-widget__label {
  display: inline-block;
  padding: 0.2rem 0.75rem;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-md);
}

.countdown-widget__title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.countdown-widget__date {
  font-size: 0.9375rem;
  opacity: 0.85;
  margin-bottom: var(--space-xs);
}

.countdown-widget__venue {
  font-size: 0.8125rem;
  opacity: 0.7;
  margin-bottom: var(--space-lg);
}

.countdown-widget__timer {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  margin-top: var(--space-md);
}

.countdown-widget__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 64px;
}

.countdown-widget__number {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-accent);
}

.countdown-widget__unit-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
  margin-top: var(--space-xs);
}

@media (max-width: 480px) {
  .countdown-widget { padding: var(--space-lg); }
  .countdown-widget__title { font-size: 1.25rem; }
  .countdown-widget__number { font-size: 1.75rem; }
  .countdown-widget__unit { min-width: 50px; }
  .countdown-widget__timer { gap: var(--space-md); }
}

/* ===========================
   PRINT STYLES — COOKBOOK
   =========================== */
@media print {
  /* Hide non-content elements */
  .header, .footer, .a11y-fab, .a11y-panel,
  .menu-toggle, .header__actions, .mobile-auth,
  .btn, nav, .flash, .notif-badge { display: none !important; }

  body {
    background: #fff;
    color: #000;
    font-size: 12pt;
    line-height: 1.5;
  }

  main { padding: 0; }

  .container { max-width: 100%; padding: 0; }

  a { color: #000; text-decoration: none; }

  /* Cookbook-specific */
  .recipe-card {
    break-inside: avoid;
    page-break-inside: avoid;
    border: 1px solid #ccc;
    margin-bottom: 1rem;
    padding: 1rem;
  }

  .card {
    break-inside: avoid;
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }

  img { max-width: 100%; }
}

/* ===========================
   MOBILE RESPONSIVE OVERHAUL
   =========================== */

/* Calendar grid classes */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.calendar-grid-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

/* Detail layout (sidebar + content) */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--space-2xl);
  align-items: start;
}

/* Two-column form grid */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

/* Name fields grid (keep multi-column on mobile) */
.name-fields-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 2fr 1fr;
  gap: var(--space-md);
}

/* --- Tablet: 768px --- */
@media (max-width: 768px) {
  /* Stack all detail layouts */
  .detail-layout {
    grid-template-columns: 1fr !important;
  }

  /* Contact grid */
  .contact-grid {
    grid-template-columns: 1fr !important;
  }

  /* Reduce page header */
  .page-header__title { font-size: 1.5rem; }
  .page-header__subtitle { font-size: 0.9375rem; }

  /* Touch-friendly buttons */
  .btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .btn--sm { min-height: 36px; }
  .btn--lg { min-height: 48px; }

  /* Calendar: smaller cells */
  .calendar-grid > div {
    min-height: 60px !important;
    padding: 2px !important;
    font-size: 0.75rem;
  }
  .calendar-grid .event-dot {
    font-size: 0.5625rem !important;
  }

  /* Tables scrollable */
  .table-scroll-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Reduce section padding */
  .section { padding: var(--space-xl) 0; }

  /* Social icons touch area */
  .header-social a {
    min-width: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* --- Small phone: 640px --- */
@media (max-width: 640px) {
  /* Universal grid collapse — catches ALL inline grid styles */
  [style*="grid-template-columns"]:not(.calendar-grid):not(.calendar-grid-header):not(.name-fields-grid) {
    grid-template-columns: 1fr !important;
  }

  /* Form grid collapse */
  .form-grid-2 {
    grid-template-columns: 1fr !important;
  }

  /* Name fields: 2 columns on small phones */
  .name-fields-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  /* Calendar: switch to list view */
  .calendar-grid {
    grid-template-columns: 1fr !important;
  }
  .calendar-grid-header {
    display: none !important;
  }
  .calendar-grid .calendar-day-empty {
    display: none !important;
  }
  .calendar-grid .calendar-day {
    min-height: auto !important;
    padding: var(--space-sm) var(--space-md) !important;
    border-bottom: 1px solid var(--color-border-light);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
  }
  .calendar-grid .calendar-day .day-number {
    font-weight: 700;
    font-size: 1rem;
    min-width: 32px;
  }
  .calendar-grid .calendar-day .event-dot {
    font-size: 0.75rem !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  /* Header compact */
  .header__inner {
    padding: var(--space-sm) var(--space-md);
  }

  /* Card compact */
  .card {
    padding: var(--space-md);
  }

  /* Reduce body text slightly */
  body { font-size: 0.9375rem; }

  /* Hero section compact */
  .hero { padding: var(--space-2xl) var(--space-md); }
  .hero h1 { font-size: 1.75rem; }
  .hero p { font-size: 1rem; }

  /* Filter pills scroll */
  .filter-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--space-xs);
  }
  .filter-pills::-webkit-scrollbar { display: none; }

  /* Form inputs full width */
  .form-input, .form-select, select, textarea, input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="url"], input[type="number"], input[type="password"] {
    width: 100%;
    box-sizing: border-box;
  }

  /* Stats bar compact */
  .stats-bar {
    gap: var(--space-sm);
  }
  .stats-bar .stat-item {
    padding: var(--space-sm);
  }
}

/* --- Extra small phone: 480px --- */
@media (max-width: 480px) {
  /* Name fields: single column */
  .name-fields-grid {
    grid-template-columns: 1fr !important;
  }

  /* Smaller page titles */
  .page-header__title { font-size: 1.25rem; }
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.1rem; }

  /* Compact cards */
  .card { border-radius: var(--radius-sm); }

  /* Full-width buttons */
  .btn--lg {
    width: 100%;
    text-align: center;
  }

  /* Photo grid: 2 columns minimum */
  .photo-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* --- Touch-friendly nav dropdowns on mobile --- */
@media (max-width: 900px) {
  /* Dropdown trigger styling in mobile menu */
  .nav-dropdown__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    cursor: pointer;
  }
  .nav-dropdown__trigger::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid currentColor;
    transition: transform 0.2s;
    margin-left: var(--space-sm);
    flex-shrink: 0;
  }
  .nav-dropdown.open .nav-dropdown__trigger::after {
    transform: rotate(180deg);
  }
  /* In mobile slide-out nav: hide menus by default, show on tap */
  .header__nav .nav-dropdown__menu {
    display: none;
    position: static;
    box-shadow: none;
    border: none;
    padding: 0 0 0 var(--space-lg);
    background: transparent;
  }
  .header__nav .nav-dropdown.open .nav-dropdown__menu {
    display: block;
  }
  .header__nav .nav-dropdown__menu a {
    padding: var(--space-sm) var(--space-md);
  }
}


/* ============================================================
   Intent grid — homepage "What would you like to do?" section
   ============================================================ */
.intent-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}
@media (max-width: 760px) {
  .intent-grid { grid-template-columns: 1fr; gap: var(--space-md); }
}
.intent-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg, 14px);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  display: flex; flex-direction: column;
  position: relative;
  overflow: hidden;
}
.intent-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  opacity: .85;
}
.intent-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(27,94,32,0.10), 0 4px 12px rgba(0,0,0,0.05);
  border-color: var(--color-accent);
}
.intent-card__head {
  display: flex; align-items: center; gap: var(--space-md);
  margin-bottom: var(--space-md);
}
.intent-card__icon {
  width: 48px; height: 48px;
  background: var(--color-accent-light, #f5ecd2);
  color: var(--color-primary);
  border-radius: 12px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.intent-card__icon svg { width: 26px; height: 26px; }
.intent-card__title {
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--color-primary);
  line-height: 1.2;
  margin: 0;
}
.intent-card__sub {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  margin-top: 2px;
}
.intent-card__desc {
  color: var(--color-text);
  font-size: 0.9375rem;
  line-height: 1.55;
  margin-bottom: var(--space-md);
}
.intent-card__features {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: auto;
  padding-top: var(--space-sm);
  border-top: 1px dashed var(--color-border-light);
}
.intent-card__features a {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-primary);
  text-decoration: none;
  background: var(--color-accent-light, #f5ecd2);
  padding: 6px 11px;
  border-radius: 100px;
  transition: background .12s ease, color .12s ease;
  line-height: 1.4;
}
.intent-card__features a:hover {
  background: var(--color-primary);
  color: #fff;
}
.intent-grid + .intent-grid__footer {
  margin-top: var(--space-xl);
  padding-top: var(--space-md);
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  text-align: center;
}
.intent-grid__footer a {
  color: var(--color-primary);
  font-weight: 500;
}
/* Dark mode */
[data-theme="dark"] .intent-card { background: #16213e; border-color: #2a2a4a; }
[data-theme="dark"] .intent-card__icon { background: #1a1a2e; color: var(--color-accent); }
[data-theme="dark"] .intent-card__title { color: var(--color-accent); }
[data-theme="dark"] .intent-card__features a { background: #1a1a2e; color: var(--color-accent); }
[data-theme="dark"] .intent-card__features a:hover { background: var(--color-accent); color: #1a1a2e; }


/* ============================================================
   Welcome-back panel — logged-in homepage greeting + nudge
   ============================================================ */
.welcome-back {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-lg); flex-wrap: wrap;
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
}
.welcome-back__hello {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  margin-bottom: 2px;
}
.welcome-back__name {
  font-family: var(--font-heading);
  font-size: 1.875rem;
  color: var(--color-primary);
  font-weight: 600;
  line-height: 1.1;
}
.welcome-back__nudge {
  display: inline-flex; align-items: center; gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md, 10px);
  text-decoration: none; color: var(--color-text);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
  min-width: 280px;
}
.welcome-back__nudge:hover {
  border-color: var(--color-accent);
  box-shadow: 0 6px 16px rgba(27,94,32,0.07);
  transform: translateY(-1px);
}
.welcome-back__nudge--primary {
  background: var(--color-accent-light, #f5ecd2);
  border-color: var(--color-accent);
}
.welcome-back__nudge-title {
  font-weight: 600;
  color: var(--color-primary);
  font-size: 0.9375rem;
  line-height: 1.3;
}
.welcome-back__nudge-sub {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-top: 2px;
}
@media (max-width: 640px) {
  .welcome-back { flex-direction: column; align-items: flex-start; gap: var(--space-md); }
  .welcome-back__nudge { width: 100%; justify-content: space-between; min-width: 0; }
}
[data-theme="dark"] .welcome-back { border-bottom-color: #2a2a4a; }
[data-theme="dark"] .welcome-back__name { color: var(--color-accent); }
[data-theme="dark"] .welcome-back__nudge { background: #16213e; border-color: #2a2a4a; }
[data-theme="dark"] .welcome-back__nudge--primary { background: #1a1a2e; border-color: var(--color-accent); }
[data-theme="dark"] .welcome-back__nudge-title { color: var(--color-accent); }


/* ============================================================
   Empty-state cards — used for first-run feature prompts
   ============================================================ */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  background: var(--color-surface);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg, 14px);
  max-width: 560px;
  margin: var(--space-xl) auto;
}
.empty-state__icon {
  width: 64px; height: 64px;
  background: var(--color-accent-light, #f5ecd2);
  border-radius: 50%;
  display: grid; place-items: center;
  margin: 0 auto var(--space-lg);
  color: var(--color-primary);
}
.empty-state__icon svg { width: 32px; height: 32px; }
.empty-state__title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}
.empty-state__text {
  color: var(--color-text-secondary);
  max-width: 380px;
  margin: 0 auto var(--space-xl);
  line-height: 1.5;
  font-size: 0.9375rem;
}
[data-theme="dark"] .empty-state { background: #16213e; border-color: #2a2a4a; }
[data-theme="dark"] .empty-state__icon { background: #1a1a2e; color: var(--color-accent); }
[data-theme="dark"] .empty-state__title { color: var(--color-accent); }


/* ============================================================
   Toast notifications — bottom-right, auto-dismiss, accessible
   ============================================================ */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 12px;
  max-width: 360px;
  pointer-events: none;
}
.toast {
  background: var(--color-surface);
  border-radius: var(--radius-md, 10px);
  padding: 14px 14px 14px 16px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  display: flex; align-items: flex-start; gap: 12px;
  border-left: 4px solid var(--color-info, #2563eb);
  transform: translateX(420px); opacity: 0;
  transition: transform .3s ease, opacity .3s ease;
  pointer-events: auto;
}
.toast.is-visible { transform: translateX(0); opacity: 1; }
.toast--success { border-left-color: var(--color-success, #2E7D32); }
.toast--success .toast__icon { color: var(--color-success, #2E7D32); }
.toast--error   { border-left-color: var(--color-error, #DC2626); }
.toast--error   .toast__icon { color: var(--color-error, #DC2626); }
.toast--warning { border-left-color: var(--color-warning, #F59E0B); }
.toast--warning .toast__icon { color: var(--color-warning, #F59E0B); }
.toast--info    { border-left-color: var(--color-info, #2563eb); }
.toast--info    .toast__icon { color: var(--color-info, #2563eb); }
.toast__icon {
  flex-shrink: 0;
  display: grid; place-items: center;
  width: 22px; height: 22px;
}
.toast__body {
  flex: 1;
  font-size: 0.9375rem;
  color: var(--color-text);
  line-height: 1.45;
  word-wrap: break-word;
}
.toast__close {
  background: none; border: none;
  font-size: 1.25rem; line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  margin: -2px -4px 0 0;
  transition: background .12s ease, color .12s ease;
}
.toast__close:hover { background: var(--color-surface-alt); color: var(--color-text); }
.toast__close:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 1px; }
@media (max-width: 640px) {
  .toast-container { left: 12px; right: 12px; bottom: 12px; max-width: none; }
}
[data-theme="dark"] .toast { background: #16213e; }
[data-theme="dark"] .toast__body { color: #e0e0e0; }
[data-theme="dark"] .toast__close:hover { background: #1a1a2e; color: #fff; }
.flash-toast { display: none; } /* Hidden placeholder — js/toast.js consumes and removes */

/* ============================================================
   Activity feed — compact list of recent family social activity
   ============================================================ */
.activity-feed {
  list-style: none; padding: 0; margin: var(--space-xl) 0 0;
  max-width: 720px; margin-left: auto; margin-right: auto;
  display: flex; flex-direction: column; gap: var(--space-sm);
}
.activity-feed__item {
  display: flex; align-items: center; gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md, 10px);
  transition: border-color .15s ease, transform .15s ease;
}
.activity-feed__item:hover {
  border-color: var(--color-accent);
  transform: translateX(2px);
}
.activity-feed__avatar {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--color-accent-light, #f5ecd2);
  color: var(--color-primary);
  display: grid; place-items: center;
  overflow: hidden;
  font-size: 0.875rem; font-weight: 600; letter-spacing: 0.04em;
}
.activity-feed__avatar img { width: 100%; height: 100%; object-fit: cover; }
.activity-feed__body {
  flex: 1; min-width: 0;
  display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--space-sm);
}
.activity-feed__text {
  color: var(--color-text);
  font-size: 0.9375rem;
  line-height: 1.4;
  text-decoration: none;
}
a.activity-feed__text:hover { color: var(--color-primary); }
.activity-feed__text strong { font-weight: 600; color: var(--color-primary); }
.activity-feed__time {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
  margin-left: auto;
}
[data-theme="dark"] .activity-feed__item { background: #16213e; border-color: #2a2a4a; }
[data-theme="dark"] .activity-feed__avatar { background: #1a1a2e; color: var(--color-accent); }
[data-theme="dark"] .activity-feed__text { color: #e0e0e0; }
[data-theme="dark"] .activity-feed__text strong { color: var(--color-accent); }

/* ============================================================
   Lightbox (js/lightbox.js builds the DOM on demand)
   ============================================================ */
.kf-lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 10000;
  display: none;
  align-items: center; justify-content: center;
  padding: 60px 64px;
  cursor: zoom-out;
}
.kf-lightbox.is-open { display: flex; }
.kf-lightbox__stage {
  max-width: 100%; max-height: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  cursor: default;
}
.kf-lightbox__stage img {
  max-width: 100%; max-height: calc(100vh - 160px);
  object-fit: contain;
  border-radius: var(--radius-md, 10px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  cursor: zoom-out;
}
.kf-lightbox__caption {
  color: #fff;
  font-size: 0.9375rem;
  text-align: center;
  max-width: 700px;
  line-height: 1.4;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.kf-lightbox__close,
.kf-lightbox__prev,
.kf-lightbox__next {
  position: absolute;
  background: rgba(0,0,0,0.4);
  border: none;
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  display: grid; place-items: center;
  transition: background .15s ease, transform .15s ease;
}
.kf-lightbox__close {
  top: 18px; right: 18px;
  width: 44px; height: 44px;
  font-size: 1.75rem; line-height: 1;
}
.kf-lightbox__prev,
.kf-lightbox__next {
  top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px;
  font-size: 1.5rem; line-height: 1;
}
.kf-lightbox__prev { left: 18px; }
.kf-lightbox__next { right: 18px; }
.kf-lightbox__close:hover,
.kf-lightbox__prev:hover,
.kf-lightbox__next:hover { background: rgba(0,0,0,0.7); }
.kf-lightbox__close:focus-visible,
.kf-lightbox__prev:focus-visible,
.kf-lightbox__next:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.kf-lightbox__counter {
  position: absolute;
  bottom: 18px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.5);
  color: #fff;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.8125rem;
  letter-spacing: 0.03em;
}
@media (max-width: 640px) {
  .kf-lightbox { padding: 40px 8px; }
  .kf-lightbox__prev,
  .kf-lightbox__next { width: 44px; height: 44px; font-size: 1.25rem; }
  .kf-lightbox__prev { left: 8px; }
  .kf-lightbox__next { right: 8px; }
}

/* ============================================================
   Family-tree viz (hierarchy / tree / network views)
   ============================================================ */
.viz-canvas {
  width: 100%;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg, 14px);
  overflow: hidden;
  min-height: 600px;
}
.viz-canvas .tree-svg { display: block; }

.hier-view {
  background: var(--color-surface-alt);
  border-radius: var(--radius-lg, 14px);
  padding: var(--space-2xl);
  display: flex; flex-direction: column; align-items: center; gap: 0;
}
.hier-row {
  display: flex; align-items: center; justify-content: center;
  gap: var(--space-md); flex-wrap: wrap;
}
.hier-row--parents { margin-bottom: 0; }
.hier-row--children { margin-top: 0; }
.hier-row--focal { margin: 0; }
.hier-connector {
  width: 2px; height: 32px;
  background: linear-gradient(to bottom, var(--color-accent), var(--color-primary));
}
.hier-node {
  display: flex; flex-direction: column; align-items: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md, 10px);
  padding: var(--space-md);
  text-decoration: none;
  color: var(--color-text);
  width: 160px;
  text-align: center;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.hier-node:hover {
  transform: translateY(-2px);
  border-color: var(--color-accent);
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}
.hier-node img,
.hier-node__initials {
  width: 56px; height: 56px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: var(--space-sm);
}
.hier-node__initials {
  background: var(--color-accent-light, #f5ecd2);
  color: var(--color-primary);
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 1.125rem;
}
.hier-node__name {
  font-weight: 600;
  color: var(--color-primary);
  font-size: 0.9375rem;
  line-height: 1.2;
}
.hier-node__sub {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}
.hier-node--focal {
  border-color: var(--color-accent);
  background: var(--color-accent-light, #f5ecd2);
  transform: scale(1.05);
}
.hier-node--focal:hover { transform: scale(1.05) translateY(-2px); }
.hier-node--spouse {
  border-style: dashed;
}
[data-theme="dark"] .viz-canvas { background: #16213e; border-color: #2a2a4a; }
[data-theme="dark"] .hier-view { background: #16213e; }
[data-theme="dark"] .hier-node { background: #1a1a2e; border-color: #2a2a4a; }
[data-theme="dark"] .hier-node__name { color: var(--color-accent); }
[data-theme="dark"] .hier-node--focal { background: #0f3460; border-color: var(--color-accent); }
[data-theme="dark"] .hier-node__initials { background: #0f3460; color: var(--color-accent); }

/* ============================================================
   Mobile bottom navigation — only ≤900px, only for logged-in users
   ============================================================ */
.mobile-bottom-nav { display: none; }

@media (max-width: 900px) {
  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border-light);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
    z-index: 9990;
    padding-bottom: env(safe-area-inset-bottom, 0px); /* iPhone notch */
  }
  .mobile-bottom-nav__item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px;
    padding: 10px 4px;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.6875rem;
    font-weight: 500;
    min-height: 56px;
    position: relative;
    transition: color .12s ease;
  }
  .mobile-bottom-nav__item svg {
    width: 22px; height: 22px;
    stroke-width: 2;
  }
  .mobile-bottom-nav__item.is-active {
    color: var(--color-primary);
  }
  .mobile-bottom-nav__item.is-active svg {
    stroke-width: 2.4;
  }
  .mobile-bottom-nav__item:hover {
    color: var(--color-primary);
  }
  .mobile-bottom-nav__badge {
    position: absolute;
    top: 4px; right: 50%; margin-right: -22px;
    min-width: 18px; height: 18px;
    background: var(--color-error, #DC2626);
    color: #fff;
    border-radius: 9px;
    padding: 0 5px;
    font-size: 0.625rem;
    font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
    line-height: 1;
  }

  /* Body needs bottom padding so nothing hides under the nav */
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }

  /* Push floating widgets above the bottom nav on mobile */
  #helpBtn { bottom: calc(80px + 60px + env(safe-area-inset-bottom, 0px)) !important; }
  .toast-container { bottom: calc(12px + 60px + env(safe-area-inset-bottom, 0px)) !important; }
}

[data-theme="dark"] .mobile-bottom-nav {
  background: #0f3460;
  border-top-color: #2a2a4a;
}
[data-theme="dark"] .mobile-bottom-nav__item { color: #888; }
[data-theme="dark"] .mobile-bottom-nav__item.is-active { color: var(--color-accent); }

/* ============================================================
   Home 2.0 — modern editorial redesign for logged-in homepage
   ============================================================ */

/* HERO (split layout) */
.home2-hero { padding: var(--space-2xl) 0 var(--space-xl); }
.home2-hero__grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
}
.home2-hero__greeting {
  font-size: 0.8125rem;
  color: var(--color-accent);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}
.home2-hero__title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  line-height: 1.05;
  color: var(--color-primary-dark);
  font-weight: 700;
  margin: 0 0 var(--space-md);
  letter-spacing: -0.02em;
}
.home2-hero__title em { color: var(--color-accent); font-style: normal; }
.home2-hero__sub {
  font-size: 1.0625rem;
  color: var(--color-text-secondary);
  max-width: 480px;
  margin: 0 0 var(--space-xl);
  line-height: 1.55;
}
.home2-hero__actions { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.home2-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 22px;
  border-radius: 100px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer; border: none;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.home2-btn--primary {
  background: var(--color-primary); color: #fff;
  box-shadow: 0 2px 8px rgba(27,94,32,0.15);
}
.home2-btn--primary:hover { background: var(--color-primary-dark); transform: translateY(-1px); }
.home2-btn--ghost {
  background: transparent; color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
}
.home2-btn--ghost:hover { background: rgba(27,94,32,0.06); }

/* Hero visual: featured photo */
.home2-hero__visual {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(27,94,32,0.06), rgba(200,169,81,0.12));
  box-shadow: 0 16px 48px rgba(27,94,32,0.10), 0 6px 16px rgba(0,0,0,0.06);
}
.home2-hero__photo-link {
  display: block;
  position: relative;
  width: 100%; height: 100%;
  text-decoration: none; color: inherit;
}
.home2-hero__photo-link img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.home2-hero__photo-link::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55), transparent 50%);
  pointer-events: none;
}
.home2-hero__photo-link--empty {
  background:
    radial-gradient(circle at 30% 40%, rgba(200,169,81,0.4), transparent 60%),
    radial-gradient(circle at 70% 60%, rgba(27,94,32,0.6), transparent 60%),
    linear-gradient(135deg, #2d4f2d, #5a3a1a);
}
.home2-hero__caption {
  position: absolute; bottom: 22px; left: 22px; right: 22px;
  color: #fff; z-index: 2;
}
.home2-hero__caption-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.9;
  font-weight: 600;
  margin-bottom: 4px;
}
.home2-hero__caption-text {
  font-family: var(--font-heading);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.3;
}
.home2-hero__pin {
  position: absolute; top: 18px; right: 18px;
  background: rgba(255,255,255,0.95);
  color: var(--color-primary);
  padding: 6px 12px;
  border-radius: 100px;
  font-size: 0.75rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  z-index: 2;
}
.home2-hero__pin-dot {
  width: 6px; height: 6px;
  background: var(--color-primary);
  border-radius: 50%;
  animation: home2-pulse 2s infinite;
}
@keyframes home2-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* TODAY STRIP */
.home2-today { padding: var(--space-md) 0 0; }
.home2-today__strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
}
.home2-today-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex; align-items: flex-start; gap: 12px;
  text-decoration: none; color: inherit;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.home2-today-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
  border-color: var(--color-accent);
}
.home2-today-card__icon {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center; flex-shrink: 0;
  background: rgba(200,169,81,0.18); color: var(--color-primary);
}
.home2-today-card__icon svg { width: 18px; height: 18px; }
.home2-today-card--birthday .home2-today-card__icon { background: rgba(233,30,140,0.10); color: #e91e8c; }
.home2-today-card--event    .home2-today-card__icon { background: rgba(37,99,235,0.10); color: #2563eb; }
.home2-today-card--memorial .home2-today-card__icon { background: rgba(123,31,162,0.10); color: #7b1fa2; }
.home2-today-card--story    .home2-today-card__icon { background: rgba(245,124,0,0.10); color: #f57c00; }
.home2-today-card__label {
  font-size: 0.6875rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--color-text-muted);
  font-weight: 600; margin-bottom: 2px;
}
.home2-today-card__text {
  font-size: 0.9375rem; color: var(--color-text);
  font-weight: 500; line-height: 1.3;
}

/* MAIN GRID */
.home2-main { padding: var(--space-2xl) 0; }
.home2-main__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: var(--space-2xl);
}
.home2-section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
.home2-section-head__title {
  font-family: var(--font-heading);
  font-size: 1.5rem; font-weight: 700;
  color: var(--color-primary-dark);
  margin: 0;
}
.home2-section-head__link {
  font-size: 0.875rem; font-weight: 500;
  color: var(--color-primary);
  text-decoration: none;
  white-space: nowrap;
}
.home2-section-head__link:hover { text-decoration: underline; }

/* Activity stack */
.home2-activity {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.home2-act {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex; align-items: center; gap: 14px;
  transition: border-color .15s ease, transform .15s ease;
}
.home2-act:hover { border-color: var(--color-accent); transform: translateX(2px); }
.home2-act__avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent), var(--color-primary));
  color: #fff; font-weight: 600; font-size: 0.8125rem;
  display: grid; place-items: center; flex-shrink: 0;
  overflow: hidden;
}
.home2-act__avatar img { width: 100%; height: 100%; object-fit: cover; }
.home2-act__body { flex: 1; min-width: 0; }
.home2-act__line {
  font-size: 0.9375rem; line-height: 1.4;
  text-decoration: none; color: var(--color-text); display: block;
}
.home2-act__line strong { color: var(--color-primary); font-weight: 600; }
a.home2-act__line:hover strong { text-decoration: underline; }
.home2-act__meta {
  font-size: 0.75rem; color: var(--color-text-muted); margin-top: 3px;
}

/* Sidebar */
.home2-aside { display: flex; flex-direction: column; gap: var(--space-lg); }
.home2-spotlight,
.home2-quote-card {
  background: var(--color-surface);
  border-radius: 18px;
  padding: 26px;
  box-shadow: 0 2px 8px rgba(27,94,32,0.04);
  border: 1px solid var(--color-border-light);
  display: flex; flex-direction: column; gap: 16px;
}
.home2-spotlight__badge {
  display: inline-block; align-self: flex-start;
  background: rgba(200,169,81,0.18);
  color: var(--color-primary);
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.home2-spotlight__badge--gold { background: var(--color-accent); color: #fff; }
.home2-spotlight__photo {
  width: 100%; aspect-ratio: 1;
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 35%, rgba(255,255,255,0.3), transparent 50%),
    linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
  display: grid; place-items: center;
  color: #fff; font-family: var(--font-heading);
  font-size: 3.5rem; font-weight: 700;
  overflow: hidden;
}
.home2-spotlight__photo--img {
  display: block; object-fit: cover;
}
.home2-spotlight__title {
  font-family: var(--font-heading);
  font-size: 1.375rem; font-weight: 700;
  color: var(--color-primary-dark);
  margin: 0 0 4px;
}
.home2-spotlight__role {
  font-size: 0.8125rem;
  color: var(--color-accent);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.home2-spotlight__bio {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  line-height: 1.55;
  margin: 0;
}
.home2-spotlight__link {
  font-size: 0.875rem;
  color: var(--color-primary);
  font-weight: 500;
  text-decoration: none;
  margin-top: auto;
}
.home2-spotlight__link:hover { text-decoration: underline; }
.home2-quote {
  border-left: 3px solid var(--color-accent);
  padding-left: 16px;
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.0625rem;
  color: var(--color-text);
  line-height: 1.5;
  margin: 0;
}
.home2-quote__attr {
  font-size: 0.875rem;
  color: var(--color-primary);
  font-weight: 500;
}
.home2-quote__context {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* Announcements */
.home2-announcements { display: flex; flex-direction: column; gap: 10px; }
.home2-announcement {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-left: 3px solid var(--color-accent);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex; align-items: flex-start; gap: 12px;
}
.home2-announcement__pin {
  flex-shrink: 0;
  width: 30px; height: 30px;
  background: rgba(200,169,81,0.18);
  color: var(--color-accent-dark);
  border-radius: 8px;
  display: grid; place-items: center;
}
.home2-announcement__title {
  font-weight: 600;
  color: var(--color-primary-dark);
  font-size: 0.9375rem;
  margin-bottom: 4px;
}
.home2-announcement__text {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.45;
  margin-bottom: 4px;
}
.home2-announcement__meta {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* STATS — modern light card with red numerals (was dark gradient panel) */
.home2-stats {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 48px 56px;
  margin: var(--space-xl) 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  color: var(--color-text);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.home2-stats::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 80% at 100% 0%, rgba(27,58,111,0.04), transparent 50%);
  pointer-events: none;
}
.home2-stat { position: relative; }
.home2-stat__num {
  font-family: var(--font-heading);
  font-size: 3rem; font-weight: 400; line-height: 1;
  letter-spacing: -0.03em;
  color: var(--color-primary);
}
.home2-stat__label {
  font-size: 0.75rem; color: var(--color-text-muted); margin-top: 10px;
  letter-spacing: 0.12em; text-transform: uppercase; font-weight: 500;
}

/* INTENT GRID — borderless tiles, big icons, modern spacing */
.home2-intent-section { padding: var(--space-3xl) 0 var(--space-4xl); }
.home2-intent-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}
.home2-intent {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-decoration: none; color: var(--color-text);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
  position: relative;
  overflow: hidden;
}
.home2-intent:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(27,58,111,0.18);
}
.home2-intent__icon {
  width: 52px; height: 52px; border-radius: var(--radius-md);
  background: var(--color-accent-light);
  color: var(--color-primary);
  display: grid; place-items: center;
  margin-bottom: var(--space-lg);
  transition: background var(--transition-base);
}
.home2-intent:hover .home2-intent__icon { background: var(--color-primary); color: #fff; }
.home2-intent__icon svg { width: 24px; height: 24px; }
.home2-intent__title {
  font-family: var(--font-heading);
  font-weight: 500; color: var(--color-text);
  font-size: 1.25rem; margin-bottom: 6px;
  letter-spacing: -0.015em;
}
.home2-intent__sub {
  font-size: 0.9375rem; color: var(--color-text-secondary);
  line-height: 1.5;
}

/* RESPONSIVE */
@media (max-width: 980px) {
  .home2-hero__grid { grid-template-columns: 1fr; gap: var(--space-xl); }
  .home2-main__grid { grid-template-columns: 1fr; gap: var(--space-xl); }
  .home2-stats { grid-template-columns: repeat(2, 1fr); padding: 28px 24px; gap: 20px; }
  .home2-stat__num { font-size: 2.25rem; }
  .home2-intent-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .home2-today__strip { grid-template-columns: 1fr; }
  .home2-stats { grid-template-columns: 1fr 1fr; padding: 24px 20px; }
  .home2-intent-grid { grid-template-columns: 1fr; }
}

/* DARK MODE */
[data-theme="dark"] .home2-hero__title { color: var(--color-accent); }
[data-theme="dark"] .home2-hero__title em { color: var(--color-accent-light); }
[data-theme="dark"] .home2-today-card,
[data-theme="dark"] .home2-act,
[data-theme="dark"] .home2-spotlight,
[data-theme="dark"] .home2-quote-card,
[data-theme="dark"] .home2-announcement,
[data-theme="dark"] .home2-intent { background: #16213e; border-color: #2a2a4a; }
[data-theme="dark"] .home2-act__line { color: #e0e0e0; }
[data-theme="dark"] .home2-spotlight__title,
[data-theme="dark"] .home2-section-head__title,
[data-theme="dark"] .home2-intent__title,
[data-theme="dark"] .home2-announcement__title { color: var(--color-accent); }
[data-theme="dark"] .home2-intent__icon { background: rgba(200,169,81,0.18); color: var(--color-accent); }

/* ============================================================
   Header search bar (logged-in users, ≥901px)
   ============================================================ */
.header-search {
  display: inline-flex; align-items: center;
  position: relative;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border-light);
  border-radius: 100px;
  padding: 0 14px 0 12px;
  height: 36px;
  min-width: 220px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.header-search:focus-within {
  border-color: var(--color-accent);
  background: var(--color-surface);
  box-shadow: 0 0 0 3px rgba(200,169,81,0.15);
}
.header-search__icon {
  color: var(--color-text-muted);
  margin-right: 6px;
  flex-shrink: 0;
}
.header-search__input {
  border: none; outline: none; background: transparent;
  font-size: 0.875rem;
  color: var(--color-text);
  width: 100%; padding: 0;
}
.header-search__input::placeholder { color: var(--color-text-muted); }
@media (max-width: 900px) {
  .header-search { display: none; }
}
[data-theme="dark"] .header-search {
  background: #1a1a2e;
  border-color: #2a2a4a;
}
[data-theme="dark"] .header-search:focus-within { background: #0f3460; }
[data-theme="dark"] .header-search__input { color: #e0e0e0; }

/* ============================================================
   Skip-link (accessibility) — only visible when focused
   ============================================================ */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  z-index: 100000;
  background: var(--color-primary);
  color: #fff;
  padding: 10px 18px;
  border-radius: 0 0 8px 8px;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.875rem;
}
.skip-link:focus,
.skip-link:focus-visible {
  left: 16px; top: 0;
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ============================================================
   Universal focus-visible styles (a11y baseline)
   ============================================================ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.btn:focus-visible,
.filter-pill:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
