/* =============================================
   ART DIRECTION: Family heritage site
   Tone: Warm, personal, timeless — earthy amber/terracotta + dark ink surfaces
   Display: Zodiak (editorial serif) · Body: Satoshi (clean sans)
   Density: Spacious, generous breathing room
   ============================================= */

/* ── Tokens ── */
:root {
  --font-display: 'Zodiak', Georgia, serif;
  --font-body:    'Satoshi', system-ui, sans-serif;

  /* Type scale */
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-hero: clamp(2.8rem,   1rem    + 5.5vw,  6rem);

  /* Spacing */
  --sp-1: .25rem;  --sp-2: .5rem;   --sp-3: .75rem;  --sp-4: 1rem;
  --sp-5: 1.25rem; --sp-6: 1.5rem;  --sp-8: 2rem;    --sp-10: 2.5rem;
  --sp-12: 3rem;   --sp-16: 4rem;   --sp-20: 5rem;   --sp-24: 6rem;

  /* Radius */
  --r-sm: 6px;  --r-md: 12px;  --r-lg: 18px;  --r-xl: 26px;  --r-full: 9999px;

  /* Transition */
  --ease: cubic-bezier(.16,1,.3,1);
  --t-fast: 160ms;  --t-med: 260ms;

  /* Width */
  --max-w: 1100px;
}

/* ── Dark palette (default) ── */
:root, [data-theme="dark"] {
  --bg:         #100e0b;
  --surf:       #181410;
  --surf-2:     #1f1b16;
  --surf-3:     #262018;
  --border:     oklch(0.85 0.02 60 / 0.1);
  --border-hi:  oklch(0.85 0.02 60 / 0.22);
  --text:       #e8e0d4;
  --text-muted: #9a9183;
  --text-faint: #5c5549;
  --primary:    #d4894a;
  --primary-hi: #e8a870;
  --primary-dim: oklch(0.68 0.1 50 / 0.12);
  --gold:       #c4a453;
  --gold-dim:   oklch(0.72 0.08 75 / 0.12);
  --sh-sm: 0 1px 3px oklch(0 0 0 / 0.35);
  --sh-md: 0 4px 16px oklch(0 0 0 / 0.45);
  --sh-lg: 0 16px 48px oklch(0 0 0 / 0.55);
}

/* ── Light palette ── */
[data-theme="light"] {
  --bg:         #faf7f2;
  --surf:       #f5f1ea;
  --surf-2:     #ede8df;
  --surf-3:     #e4ddd2;
  --border:     oklch(0.35 0.02 60 / 0.1);
  --border-hi:  oklch(0.35 0.02 60 / 0.2);
  --text:       #201c16;
  --text-muted: #7a6f62;
  --text-faint: #b0a699;
  --primary:    #b5601a;
  --primary-hi: #c97226;
  --primary-dim: oklch(0.55 0.1 50 / 0.1);
  --gold:       #9a7a2a;
  --gold-dim:   oklch(0.58 0.08 75 / 0.1);
  --sh-sm: 0 1px 3px oklch(0.2 0.02 60 / 0.1);
  --sh-md: 0 4px 16px oklch(0.2 0.02 60 / 0.12);
  --sh-lg: 0 16px 48px oklch(0.2 0.02 60 / 0.14);
}

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 68px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  transition: background-color var(--t-med) var(--ease), color var(--t-med) var(--ease);
}
img { display: block; max-width: 100%; height: auto; }
h1,h2,h3,h4,h5,h6 { text-wrap: balance; line-height: 1.2; }
p, li { text-wrap: pretty; }
a, button { transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); }
button { cursor: pointer; background: none; border: none; font: inherit; color: inherit; }
::selection { background: oklch(from var(--primary) l c h / 0.25); color: var(--text); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: var(--r-sm); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

/* ── Skip link ── */
.skip { position: absolute; top: -100%; left: var(--sp-4); background: var(--primary); color: var(--bg); padding: var(--sp-2) var(--sp-4); border-radius: var(--r-sm); font-weight: 700; font-size: var(--text-sm); z-index: 9999; text-decoration: none; }
.skip:focus { top: var(--sp-2); }

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-6);
  background: oklch(from var(--bg) l c h / 0.88);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.logo {
  display: flex; align-items: center; gap: var(--sp-3);
  font-family: var(--font-display);
  font-size: 1.1rem; font-weight: 700;
  letter-spacing: .02em; color: var(--text);
  text-decoration: none;
}
.logo-mark {
  width: 34px; height: 34px; flex-shrink: 0;
}
.header-right { display: flex; align-items: center; gap: var(--sp-2); }
.main-nav { display: flex; gap: var(--sp-1); }
.main-nav a {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-full);
  font-size: var(--text-sm); font-weight: 500;
  text-decoration: none; color: var(--text-muted);
}
.main-nav a:hover { background: var(--primary-dim); color: var(--text); }
.theme-btn {
  width: 36px; height: 36px; border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); border: 1px solid var(--border);
  background: var(--surf);
}
.theme-btn:hover { color: var(--text); border-color: var(--border-hi); }
.sun-icon, .moon-icon { width: 17px; height: 17px; }
[data-theme="dark"]  .sun-icon  { display: block; }
[data-theme="dark"]  .moon-icon { display: none; }
[data-theme="light"] .sun-icon  { display: none; }
[data-theme="light"] .moon-icon { display: block; }

/* ── Hero ── */
.hero {
  padding: clamp(var(--sp-12), 8vw, var(--sp-24)) var(--sp-6) clamp(var(--sp-10), 6vw, var(--sp-20));
  max-width: var(--max-w); margin: 0 auto;
}
.hero-layout {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: var(--sp-8);
  border-bottom: 1px solid var(--border);
  padding-bottom: clamp(var(--sp-8), 5vw, var(--sp-16));
}
.hero-text {}
.hero-eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: var(--sp-4);
  display: flex; align-items: center; gap: var(--sp-2);
}
.hero-eyebrow::before {
  content: '';
  display: inline-block;
  width: 24px; height: 2px;
  background: var(--primary);
  flex-shrink: 0;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: 700;
  color: var(--text);
  line-height: 1.05;
  letter-spacing: -.02em;
  margin-bottom: var(--sp-6);
}
.hero h1 em {
  font-style: italic;
  color: var(--primary);
}
.hero-desc {
  font-size: var(--text-base);
  color: var(--text-muted);
  max-width: 52ch;
  line-height: 1.7;
}
.hero-meta {
  text-align: right;
  flex-shrink: 0;
}
.hero-stat {
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 700;
  color: var(--text-faint);
  line-height: 1;
  letter-spacing: -.04em;
}
.hero-stat-label {
  font-size: var(--text-xs);
  color: var(--text-faint);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-top: var(--sp-1);
}

/* hero divider stats row */
.hero-stats-row {
  display: flex; gap: var(--sp-10);
  padding-top: var(--sp-8);
}
.hero-stats-row .stat-item {}
.hero-stats-row .stat-num {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
  line-height: 1;
}
.hero-stats-row .stat-lbl {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--sp-1);
  letter-spacing: .08em;
}

/* ── Section wrapper ── */
.section {
  max-width: var(--max-w); margin: 0 auto;
  padding: clamp(var(--sp-10), 6vw, var(--sp-20)) var(--sp-6);
}
.section + .section {
  border-top: 1px solid var(--border);
}
.section-eyebrow {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: var(--sp-3);
  display: flex; align-items: center; gap: var(--sp-2);
}
.section-eyebrow::before {
  content: '';
  display: inline-block;
  width: 18px; height: 2px;
  background: var(--primary);
  flex-shrink: 0;
}
.section-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
  line-height: 1.1;
  margin-bottom: var(--sp-2);
}
.section-sub {
  font-size: var(--text-base);
  color: var(--text-muted);
  margin-bottom: clamp(var(--sp-8), 4vw, var(--sp-12));
  max-width: 56ch;
}

/* ── Generation label ── */
.gen-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: var(--sp-6) 0 var(--sp-3);
  border-top: 1px solid var(--border);
  margin-top: var(--sp-6);
}
.gen-label:first-child { border-top: none; margin-top: 0; padding-top: 0; }

/* ── Card grid ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: var(--sp-4);
}
.card {
  background: var(--surf);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-5) var(--sp-6);
  display: flex; flex-direction: column; gap: var(--sp-2);
  box-shadow: var(--sh-sm);
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease), border-color var(--t-med) var(--ease);
  position: relative; overflow: hidden;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-md);
  border-color: var(--border-hi);
}
.card::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--primary-dim) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--t-med) var(--ease);
  pointer-events: none;
  border-radius: inherit;
}
.card:hover::after { opacity: 1; }
.card-avatar {
  width: 44px; height: 44px; border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .78rem;
  letter-spacing: .04em;
  flex-shrink: 0; margin-bottom: var(--sp-2);
  position: relative; z-index: 1;
}
.av-amber  { background: oklch(0.68 0.1  50 / 0.18); color: var(--primary-hi); }
.av-gold   { background: oklch(0.72 0.08 75 / 0.18); color: var(--gold); }
.av-stone  { background: oklch(0.6  0.02 60 / 0.2);  color: var(--text-muted); }
.av-sage   { background: oklch(0.65 0.07 150 / 0.16); color: #7bba8e; }
.card h3 {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  position: relative; z-index: 1;
}
.card p {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 100%;
  position: relative; z-index: 1;
}
.rip-tag {
  display: inline-flex; align-items: center;
  font-size: .68rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  padding: .1rem .45rem;
  border-radius: var(--r-full);
  background: oklch(0.68 0.06 60 / 0.14);
  color: var(--gold);
  border: 1px solid oklch(0.72 0.06 75 / 0.2);
  margin-left: var(--sp-2);
  vertical-align: middle;
}
.member-links {
  display: flex; flex-wrap: wrap; gap: var(--sp-2);
  margin-top: var(--sp-3);
  position: relative; z-index: 1;
}
.member-links a {
  font-size: .75rem; font-weight: 500;
  text-decoration: none;
  padding: .22rem .6rem;
  border-radius: var(--r-full);
  border: 1px solid var(--border-hi);
  color: var(--primary);
  background: var(--primary-dim);
}
.member-links a:hover {
  background: var(--primary);
  color: var(--bg);
  border-color: var(--primary);
}

/* ── Featured card (spans 2 cols) ── */
.card-featured {
  grid-column: span 2;
  background: var(--surf-2);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-6);
  align-items: start;
  padding: var(--sp-6);
}
.card-featured .card-avatar { width: 52px; height: 52px; font-size: .85rem; }
@media (max-width: 600px) {
  .card-featured { grid-column: span 1; grid-template-columns: 1fr; }
}

/* ── Tree section ── */
.tree-wrap {
  background: var(--surf);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--sh-md);
}
.tree-wrap:hover { box-shadow: var(--sh-lg); }
.tree-img {
  display: block; width: 100%;
  max-height: 580px; object-fit: contain;
  background: var(--surf-3);
}
.tree-caption {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: var(--sp-3);
}
.tree-caption p {
  font-size: var(--text-xs);
  color: var(--text-faint);
  max-width: 100%;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--sp-10) var(--sp-6);
  max-width: var(--max-w); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  flex-wrap: wrap;
}
.footer-brand {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-faint);
  letter-spacing: -.01em;
}
.footer-copy {
  font-size: var(--text-xs);
  color: var(--text-faint);
}

/* ── Responsive ── */
@media (max-width: 700px) {
  .main-nav { display: none; }
  .hero-layout { grid-template-columns: 1fr; }
  .hero-meta { text-align: left; }
  .hero-stats-row { flex-wrap: wrap; gap: var(--sp-6); }
  .site-footer { flex-direction: column; align-items: flex-start; }
}

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .65s var(--ease), transform .65s var(--ease);
}
.reveal.visible { opacity: 1; transform: translateY(0); }