:root {
  --bg: #f6f3ef;
  --paper: #fffdfa;
  --text: #2f2a28;
  --muted: #817a74;
  --accent: #b08a53;
  --accent-dark: #8a6a3e;
  --line: #e8dfd3;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background: var(--bg);
}
h1,h2,h3,h4 { font-family: "Cormorant Garamond", serif; margin: 0 0 12px; }
.container { width: min(1180px, 92%); margin: 0 auto; }
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255,253,250,.96); border-bottom: 1px solid var(--line); }
.nav-wrap { display: flex; align-items: center; justify-content: space-between; min-height: 72px; }
.menu-toggle { display: none; border: 1px solid var(--line); background: #fff; padding: 8px 12px; border-radius: 8px; }
.primary-nav ul { margin: 0; padding: 0; list-style: none; display: flex; gap: 22px; }
.primary-nav a { text-decoration: none; color: var(--text); font-weight: 500; }
.hero { position: relative; min-height: 72vh; display: grid; align-items: center; }
.hero-bg {
  position: absolute; inset: 0;
  background:
    linear-gradient(rgba(246,243,239,.62), rgba(246,243,239,.78)),
    radial-gradient(circle at 20% 20%, #e7ddcf 0 2px, transparent 2px 100%),
    linear-gradient(120deg, #d6c7ae 0%, #f4efe7 70%);
  background-size: auto, 28px 28px, auto;
}
.hero-content { position: relative; max-width: 640px; padding: 80px 0; }
.hero h1 { font-size: clamp(42px, 5vw, 76px); line-height: .95; }
.hero p { color: #49423f; font-size: 18px; max-width: 58ch; }
.btn-primary {
  display: inline-block; border: 0; background: var(--accent); color: #fff;
  padding: 12px 22px; border-radius: 10px; text-decoration: none; transition: .3s ease;
}
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-2px); }
.quote-section { padding: 44px 0 14px; text-align: center; font-style: italic; color: var(--muted); }
.about-section { text-align: center; padding: 20px 0 50px; }
.about-section h2 { font-size: 42px; }
.about-section p { max-width: 70ch; margin: 0 auto; color: #5f5855; }
.stats-section { background: #ece5dd; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; padding: 28px 0; text-align: center; }
.stats-grid strong { display: block; font-size: 42px; font-family: "Cormorant Garamond", serif; }
.stats-grid span { color: var(--muted); }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.family-showcase,.gallery,.contact,.tree-page { padding: 56px 0; }
.member-cards { display: grid; grid-template-columns: repeat(auto-fill,minmax(200px,1fr)); gap: 14px; }
.member-card {
  display: block; background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  text-decoration: none; color: inherit; padding: 14px; transition: .2s ease;
}
.member-card:hover { transform: translateY(-4px); box-shadow: 0 10px 26px rgba(30,20,10,.08); }
.member-card h3 { margin-bottom: 4px; font-size: 26px; }
.member-card p { margin: 0; color: var(--muted); font-size: 14px; }
.avatar img { width: 100%; height: 160px; object-fit: cover; border-radius: 10px; margin-bottom: 10px; }
.simple-slider { position: relative; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.slides { display: flex; transition: transform .35s ease; }
.slide { min-width: 100%; }
.slide img { width: 100%; height: clamp(220px,35vw,420px); object-fit: cover; display: block; }
.slider-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  border: 0; border-radius: 999px; width: 40px; height: 40px; background: rgba(255,255,255,.95); cursor: pointer;
}
.slider-btn.prev { left: 12px; }
.slider-btn.next { right: 12px; }
.contact-form { display: grid; gap: 12px; max-width: 680px; }
.contact-form input,.contact-form textarea,.contact-form select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.tree-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; align-items: center; }
.tree-tab {
  border: 1px solid #ebe5dc;
  background: #fbfaf8;
  color: #574d47;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.1;
}
.tree-tab.active {
  background: #eee6d8;
  border-color: #dac9b0;
  color: #3f3530;
  box-shadow: 0 1px 2px rgba(30, 20, 10, .05);
}
.tree-toolbar input {
  margin-inline-start: auto;
  min-width: 250px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #ece4d8;
  background: #fbfaf8;
}
.tree-view { display: none; }
.tree-view.active { display: block; }
.tree-graph-wrap {
  position: relative;
  padding: 16px 8px 28px;
  min-height: 240px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,.1));
}
.tree-generation-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 42px; margin: 34px 0; }
.tree-node {
  min-width: 210px;
  position: relative;
  z-index: 2;
  background: #fff;
  border: 1px solid #ede7de;
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 8px 18px rgba(30, 20, 10, .045);
}
.tree-node h3 { font-size: 22px; margin: 0; font-family: "Inter", sans-serif; font-weight: 500; }
.tree-node p { margin-top: 4px; color: #978d84; font-size: 12px; }
.tree-connectors { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.tree-connectors path {
  stroke: #d9d0c4;
  stroke-width: 1.05;
  fill: none;
  opacity: .95;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tree-connectors text { font-family: "Inter", sans-serif; letter-spacing: 1.1px; text-transform: uppercase; }
.relation-badge {
  position: absolute;
  z-index: 5;
  transform: translate(-50%, -50%);
  background: #f7f1e7;
  color: #705937;
  border: 1px solid #ddc7a1;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.2;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(30, 20, 10, .08);
}
.focus-empty { background: #fff; border: 1px dashed var(--line); border-radius: 12px; padding: 24px; color: var(--muted); text-align: center; }
.focus-title { text-align: center; margin: 12px 0 20px; }
.focus-breadcrumb { text-align: center; color: var(--muted); margin: 0; }
.focus-group { margin: 14px 0 24px; }
.focus-label { text-align: center; letter-spacing: 2px; text-transform: uppercase; font-size: 11px; color: #978d84; margin-bottom: 8px; }
.focus-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.focus-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; text-decoration: none; color: var(--text);
  min-width: 190px; text-align: center;
}
.focus-card.is-self { border-color: #cfb17f; background: #fcf6ec; font-weight: 600; }
.focus-card.muted { color: var(--muted); }
.focus-card .relation-tag { display: block; margin-top: 4px; font-size: 10px; letter-spacing: 1px; color: #988a7a; text-transform: uppercase; }
.group-title { margin: 26px 0 12px; border-left: 4px solid var(--accent); padding-left: 10px; }
.timeline { display: grid; gap: 10px; }
.timeline-item { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.member-single { padding: 40px 0 70px; }
.member-header { display: grid; grid-template-columns: 320px 1fr; gap: 24px; margin-bottom: 28px; }
.member-photo img { width: 100%; height: auto; border-radius: 12px; }
.family-blocks { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.family-blocks > div { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.site-footer { background: #f1ebe3; border-top: 1px solid var(--line); margin-top: 50px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 20px; padding: 34px 0; }
.copyright { border-top: 1px solid var(--line); padding: 12px 0; font-size: 13px; color: var(--muted); }
.basic-content { padding: 36px 0; }
@media (max-width: 900px) {
  .menu-toggle { display: inline-block; }
  .primary-nav { display: none; width: 100%; }
  .primary-nav.is-open { display: block; }
  .nav-wrap { flex-wrap: wrap; padding: 8px 0; }
  .primary-nav ul { flex-direction: column; gap: 10px; padding-bottom: 12px; }
  .stats-grid,.family-blocks,.footer-grid,.member-header { grid-template-columns: 1fr; }
  .tree-toolbar input { margin-inline-start: 0; width: 100%; }
}
