@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;600;700&family=Source+Sans+3:wght@300;400;600&display=swap');

:root {
  color-scheme: light;
  --bg: #f4efe6;
  --paper: #fff8ec;
  --ink: #2b221b;
  --muted: #6b5b4a;
  --accent: #8a6a3d;
  --accent-2: #3f5a4d;
  --leaf: #5e7b64;
  --border: #d8c9b5;
  --shadow: 0 18px 40px rgba(61, 44, 29, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 20% 20%, #efe3cf 0%, transparent 55%),
    radial-gradient(circle at 80% 0%, #e7d9c0 0%, transparent 40%),
    linear-gradient(180deg, #f7f2e9 0%, #efe7db 40%, #f5efe6 100%);
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: 'Cormorant Garamond', 'Times New Roman', serif;
  margin: 0 0 0.6rem 0;
  letter-spacing: 0.5px;
}

p {
  margin: 0 0 1rem 0;
  line-height: 1.65;
  color: var(--muted);
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--accent-2);
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(244, 239, 230, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-family: 'Cormorant Garamond', 'Times New Roman', serif;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.nav-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-weight: 600;
  font-size: 0.95rem;
}

.nav-links a {
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.nav-links a.active,
.nav-links a:hover {
  border-color: var(--border);
  background: var(--paper);
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  align-items: center;
  padding: 2rem;
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.hero img {
  width: 100%;
  max-width: 320px;
  justify-self: center;
  border-radius: 16px;
  border: 6px solid #f2e6d2;
  box-shadow: 0 12px 28px rgba(65, 44, 22, 0.18);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
}

.section {
  margin-top: 3rem;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.section-header h2 {
  font-size: 2rem;
}

.grid {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.card {
  padding: 1.4rem;
  border-radius: 18px;
  background: var(--paper);
  border: 1px solid var(--border);
  box-shadow: 0 10px 24px rgba(55, 39, 23, 0.12);
}

.card h3 {
  font-size: 1.3rem;
}

.card small {
  color: var(--accent-2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.badge {
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: #f1e7d5;
  color: #6a4b2a;
  font-size: 0.75rem;
  font-weight: 600;
}

.footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

.tree-wrapper {
  margin-top: 2.5rem;
  padding: 1.5rem;
  background: var(--paper);
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.tree {
  display: flex;
  justify-content: center;
  min-width: 760px;
  font-family: 'Cormorant Garamond', 'Times New Roman', serif;
}

.tree ul {
  padding-top: 20px;
  position: relative;
  padding-left: 0;
  display: flex;
  justify-content: center;
}

.tree li {
  list-style-type: none;
  text-align: center;
  position: relative;
  padding: 20px 10px 0 10px;
}

.tree li::before,
.tree li::after {
  content: '';
  position: absolute;
  top: 0;
  right: 50%;
  border-top: 1px solid var(--border);
  width: 50%;
  height: 20px;
}

.tree li::after {
  right: auto;
  left: 50%;
  border-left: 1px solid var(--border);
}

.tree li:only-child::before,
.tree li:only-child::after {
  display: none;
}

.tree li:only-child {
  padding-top: 0;
}

.tree li:first-child::before,
.tree li:last-child::after {
  border: 0 none;
}

.tree li:last-child::before {
  border-right: 1px solid var(--border);
  border-radius: 0 5px 0 0;
}

.tree li:first-child::after {
  border-radius: 5px 0 0 0;
}

.tree ul ul::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  border-left: 1px solid var(--border);
  width: 0;
  height: 20px;
}

.node {
  display: inline-flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.7rem 1rem;
  min-width: 140px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fbf4e6;
  font-weight: 600;
  color: var(--ink);
  box-shadow: 0 6px 16px rgba(55, 39, 23, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.node span {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
}

.node:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 20px rgba(55, 39, 23, 0.2);
}

.branch-label {
  display: inline-block;
  margin-bottom: 0.8rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: #f0e0c7;
  color: #6b4b2a;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

.couple {
  display: inline-flex;
  gap: 0.4rem;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  min-width: 220px;
}

.couple a {
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  transition: background 0.2s ease;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

.couple a .year {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
}

.couple a:hover {
  background: #efe2cf;
}

.heart {
  color: #a14a4a;
}

.tree-note {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.person-hero {
  padding: 2rem;
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.person-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.person-meta .card {
  background: #fbf4e6;
}

@media (max-width: 720px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero {
    padding: 1.5rem;
  }

  .tree {
    min-width: 620px;
  }
}
