:root {
  --ink: #172033;
  --muted: #526071;
  --brand: #1f4f66;
  --brand-dark: #153947;
  --accent: #a85f20;
  --paper: #ffffff;
  --soft: #f3f6f7;
  --line: #d8e0e4;
  --focus: #ffbf47;
  --max: 1180px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; color: var(--ink); background: var(--paper); line-height: 1.6; }
a { color: #0b5675; text-underline-offset: .18em; }
a:hover { color: #7c3e0b; }
a:focus-visible, button:focus-visible { outline: 4px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
img { max-width: 100%; height: auto; display: block; }
.skip-link { position: absolute; left: .75rem; top: -5rem; z-index: 999; background: #000; color: #fff; padding: .75rem 1rem; }
.skip-link:focus { top: .75rem; }
.site-header { background: rgba(255,255,255,.98); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.nav-wrap { max-width: var(--max); margin: auto; padding: .85rem 1.2rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { color: var(--ink); text-decoration: none; font-size: 1.2rem; font-weight: 800; letter-spacing: .02em; }
.brand span { color: var(--accent); }
nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; }
nav a { display: inline-block; padding: .58rem .72rem; color: var(--ink); text-decoration: none; font-weight: 700; border-radius: 8px; }
nav a:hover, nav a[aria-current="page"] { background: var(--soft); color: var(--brand-dark); }
.hero { background: linear-gradient(135deg, #e9f0f3 0%, #fff 55%, #f7eee5 100%); }
.hero-grid { max-width: var(--max); margin: auto; padding: clamp(3rem,7vw,6rem) 1.2rem; display: grid; grid-template-columns: 1.2fr .8fr; align-items: center; gap: clamp(2rem,5vw,4.5rem); }
.eyebrow { color: var(--accent); font-weight: 800; text-transform: uppercase; letter-spacing: .12em; font-size: .82rem; }
h1, h2, h3 { line-height: 1.15; margin-top: 0; }
h1 { font-size: clamp(2.4rem,6vw,4.8rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.8rem,4vw,2.7rem); }
h3 { font-size: 1.25rem; }
.lead { font-size: clamp(1.08rem,2vw,1.3rem); color: var(--muted); max-width: 63ch; }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }
.button { display: inline-block; padding: .78rem 1.05rem; border-radius: 9px; background: var(--brand); color: #fff; text-decoration: none; font-weight: 800; border: 2px solid var(--brand); }
.button:hover { background: var(--brand-dark); color: #fff; }
.button.secondary { background: transparent; color: var(--brand-dark); }
.button.secondary:hover { background: #e8eff2; }
.portrait { width: min(100%, 430px); aspect-ratio: 1 / 1; object-fit: cover; border-radius: 28px; box-shadow: 0 22px 50px rgba(23,32,51,.18); justify-self: center; }
.section { max-width: var(--max); margin: auto; padding: clamp(3.2rem,7vw,5.5rem) 1.2rem; }
.section.soft { max-width: none; background: var(--soft); }
.section.soft > .inner { max-width: var(--max); margin: auto; }
.intro { max-width: 760px; margin-bottom: 2rem; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1.2rem; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 1.35rem; box-shadow: 0 8px 25px rgba(20,35,45,.06); }
.card p:last-child { margin-bottom: 0; }
.gallery { display: grid; grid-template-columns: repeat(12,1fr); gap: 1rem; }
.figure { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 8px 22px rgba(20,35,45,.06); grid-column: span 6; }
.figure.wide { grid-column: span 12; }
.figure img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.figure.wide img { aspect-ratio: 2.5/1; }
figcaption { padding: .9rem 1rem 1rem; color: var(--muted); }
.tree-card { display: grid; grid-template-columns: minmax(220px,.7fr) 1.3fr; align-items: center; gap: 2rem; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 1.3rem; }
.tree-card img { border-radius: 12px; }
.contact-band { background: var(--brand-dark); color: #fff; }
.contact-band a { color: #fff; }
.contact-grid { max-width: var(--max); margin: auto; padding: 2.6rem 1.2rem; display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.contact-grid p { margin: 0; }
.site-footer { background: #101821; color: #e8edf1; }
.footer-grid { max-width: var(--max); margin: auto; padding: 2rem 1.2rem; display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.footer-grid p { margin: 0; }
.footer-grid a { color: #fff; }
.re-hero { background: linear-gradient(120deg, #173f51, #245f77); color: #fff; }
.re-hero .lead { color: #e5f0f4; }
.re-hero .eyebrow { color: #ffd1a8; }
.re-hero .button { background: #fff; color: var(--brand-dark); border-color: #fff; }
.re-hero .button.secondary { background: transparent; color: #fff; }
.stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; margin-top: 2rem; }
.stat { border-left: 4px solid #d08b4b; padding-left: 1rem; }
.stat strong { display: block; font-size: 1.35rem; }
.profile { display: grid; grid-template-columns: .7fr 1.3fr; gap: clamp(2rem,5vw,4rem); align-items: center; }
.profile img { width: min(100%,380px); aspect-ratio: 1/1; object-fit: cover; border-radius: 22px; }
.checks { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .85rem 1.4rem; padding: 0; list-style: none; }
.checks li { position: relative; padding-left: 1.8rem; }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 900; }
.notice { border-left: 5px solid var(--accent); background: #fff8f1; padding: 1rem 1.15rem; }
.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; }
@media (max-width: 820px) {
  .hero-grid, .profile, .tree-card { grid-template-columns: 1fr; }
  .cards, .stats { grid-template-columns: 1fr; }
  .figure, .figure.wide { grid-column: span 12; }
  .figure.wide img { aspect-ratio: 16/10; }
  .nav-wrap { align-items: flex-start; flex-direction: column; }
  .site-header { position: static; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
@media print {
  .site-header, .actions, .contact-band { display: none; }
  body { color: #000; }
  a { color: #000; text-decoration: none; }
}

/* Family-tree viewer */
.tree-page { max-width: 1500px; }
.tree-toolbar { display: flex; flex-wrap: wrap; gap: .65rem; align-items: center; margin: 1.5rem 0 1rem; }
.tree-control { font: inherit; cursor: pointer; }
.tree-viewer {
  width: 100%;
  min-height: 360px;
  max-height: 72vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(20,35,45,.08);
  padding: 1rem;
  overscroll-behavior: contain;
}
.tree-viewer:focus-visible { outline: 4px solid var(--focus); outline-offset: 3px; }
.tree-viewer img { width: 100%; max-width: none; height: auto; transition: width .15s ease; }
.viewer-help { color: var(--muted); font-size: .95rem; }
.tree-card img { width: 100%; aspect-ratio: 3.8 / 1; object-fit: contain; background: #fff; border: 1px solid var(--line); }
@media (max-width: 620px) {
  .tree-toolbar .button { width: 100%; text-align: center; }
  .tree-viewer { min-height: 300px; padding: .5rem; }
}
