:root {
    --bg-color: #0e1a12;
    --text-primary: #e0d8c0;
    --text-accent: #c5a059;
    --gold-accent: #8b7355;
    --card-bg: transparent;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at center, transparent 0%, #000000 100%),
        linear-gradient(#1a221a 1px, transparent 1px),
        linear-gradient(90deg, #1a221a 1px, transparent 1px);
    background-size: 100% 100%, 20px 20px, 20px 20px;
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: 'Cormorant Garamond', serif;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Remove old stars */
.stars,
.twinkling {
    display: none;
}

#tree-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* --- Typography --- */
h1,
h2,
h3 {
    font-family: 'Cinzel', serif;
    color: var(--text-accent);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* --- Hero Section --- */
.hero-section {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 1;
}

.title {
    font-size: 4rem;
    text-shadow: 0 0 10px #000;
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.5rem;
    font-style: italic;
    color: var(--gold-accent);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.8;
    animation: bounce 2s infinite;
}

.arrow {
    width: 15px;
    height: 15px;
    border-right: 2px solid var(--text-primary);
    border-bottom: 2px solid var(--text-primary);
    transform: rotate(45deg);
}

/* --- Tree Container --- */
.tree-container {
    padding: 0 2rem;
    position: relative;
    width: 100%;
    max-width: 1600px;
    /* Wider for full tree */
    margin: 0 auto;
}

/* --- Generation Section --- */
.generation {
    margin-bottom: 250px;
    /* More space for gnarly branches */
    text-align: center;
    position: relative;
    z-index: 1;
}

.generation-title {
    font-size: 2rem;
    margin-bottom: 3rem;
    color: var(--gold-accent);
    text-shadow: 0 2px 4px #000;
}

.group-container {
    display: flex;
    justify-content: center;
    gap: 6rem;
    flex-wrap: wrap;
}

/* --- Family Groups --- */
.family-group,
.family-branch {
    display: flex;
    gap: 2rem;
    justify-content: center;
    position: relative;
}

.siblings-group {
    display: flex;
    gap: 2rem;
    margin-left: 2rem;
}

/* --- Member Card --- */
.member-card {
    background: var(--card-bg);
    /* Transparent */
    padding: 1rem;
    width: 200px;
    text-align: center;
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease-in, transform 1s ease-in;
}

/* Placeholders (roots with no parents) are visible by default */
.member-card.placeholder {
    opacity: 1;
    transform: translateY(0);
}

.member-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.member-card:hover {
    transform: scale(1.05) translateY(0);
    z-index: 10;
}

.portrait {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #000;
    margin: 0 auto 1rem;
    border: 3px solid var(--gold-accent);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.8);
}

.member-card.main-line .portrait {
    width: 130px;
    height: 130px;
    border-color: var(--text-accent);
}

.member-card.deceased {
    filter: sepia(0.5) grayscale(0.5);
    opacity: 0.9;
}

.member-card.deceased .portrait {
    border-color: #554a3a;
}

.info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    text-shadow: 0 2px 4px #000;
}

.dates {
    font-size: 0.9rem;
    color: #999;
    font-style: italic;
}

/* --- Footer --- */
footer {
    padding: 2rem;
    text-align: center;
    color: #666;
    margin-top: 4rem;
    position: relative;
    z-index: 1;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .group-container {
        gap: 3rem;
    }

    .member-card {
        width: 150px;
    }
}