:root {
    --bg: #f6f1e8;
    --bg-soft: #fbf7f1;
    --card: rgba(255, 255, 255, 0.92);
    --card-solid: #ffffff;
    --text: #2f312c;
    --muted: #6d6a61;
    --accent: #8d6a3b;
    --accent-deep: #2f4a3f;
    --border: rgba(103, 87, 61, 0.12);
    --shadow: 0 24px 60px rgba(74, 57, 33, 0.10);
    --shadow-hover: 0 30px 80px rgba(58, 45, 28, 0.16);
    --radius-lg: 24px;
    --radius-md: 18px;
    --container: 1240px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    min-height: 100%;
    background:
        radial-gradient(circle at top left, rgba(154, 127, 78, 0.12), transparent 30%),
        radial-gradient(circle at bottom right, rgba(52, 83, 70, 0.12), transparent 30%),
        var(--bg);
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: "Manrope", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(154, 127, 78, 0.12), transparent 30%),
        radial-gradient(circle at bottom right, rgba(52, 83, 70, 0.12), transparent 30%),
        var(--bg);
    color: var(--text);
}

.welcome-body .site-header {
    margin-bottom: 28px;
}

.tree-page-body .page-shell {
    max-width: none;
    padding: 20px 24px 28px;
}

.tree-page-body .site-header {
    margin-bottom: 20px;
}

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

img {
    display: block;
    width: 100%;
    height: auto;
}

.page-shell {
    position: relative;
    max-width: var(--container);
    margin: 0 auto;
    padding: 28px 24px 96px;
}

.page-glow {
    position: fixed;
    width: 320px;
    height: 320px;
    border-radius: 999px;
    filter: blur(40px);
    pointer-events: none;
    opacity: 0.45;
}

.page-glow-left {
    background: rgba(164, 138, 90, 0.12);
    left: -120px;
    top: 40px;
}

.page-glow-right {
    background: rgba(56, 80, 72, 0.10);
    right: -80px;
    bottom: 0;
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 18px 22px;
    margin-bottom: 44px;
    background: rgba(255, 251, 246, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 999px;
    backdrop-filter: blur(18px);
    box-shadow: 0 8px 28px rgba(69, 54, 31, 0.08);
}

.brand-mark,
h1,
h2,
h3 {
    font-family: "Cormorant Garamond", serif;
    letter-spacing: 0.01em;
}

.brand-mark {
    font-size: 1.35rem;
    font-weight: 700;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 18px;
}

.site-nav a {
    color: var(--muted);
    transition: color 0.25s ease, transform 0.25s ease;
}

.site-nav a:hover {
    color: var(--accent-deep);
    transform: translateY(-1px);
}

.hero,
.person-hero,
.panel,
.story-card,
.person-card {
    box-shadow: var(--shadow);
}

.hero {
    padding: 64px;
    border-radius: 36px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 248, 239, 0.92));
    border: 1px solid rgba(255, 255, 255, 0.8);
    margin-bottom: 34px;
}

.welcome-stage {
    position: relative;
    overflow: hidden;
    padding: 52px;
    border-radius: 36px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 248, 239, 0.94));
    border: 1px solid rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow);
}

.confetti-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.welcome-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 36px;
    align-items: center;
}

.welcome-copy h1 {
    font-size: clamp(3rem, 7vw, 5.2rem);
    line-height: 0.95;
    margin: 0 0 22px;
    max-width: 760px;
}

.welcome-note {
    margin-top: 28px;
    padding: 24px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(103, 87, 61, 0.08);
}

.welcome-note h2 {
    margin: 0 0 12px;
    font-size: 2rem;
}

.welcome-note p {
    margin: 0;
    color: var(--muted);
    line-height: 1.75;
}

.welcome-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 28px;
}

.welcome-media {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.welcome-photo-card {
    width: min(100%, 420px);
    padding: 16px;
    border-radius: 34px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(103, 87, 61, 0.08);
    box-shadow: 0 22px 48px rgba(74, 57, 33, 0.10);
}

.welcome-photo-card img,
.welcome-photo-placeholder {
    width: 100%;
    aspect-ratio: 0.88 / 1;
    object-fit: cover;
    border-radius: 28px;
}

.welcome-photo-placeholder {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(141, 106, 59, 0.16), rgba(47, 74, 63, 0.12));
    color: var(--accent-deep);
    font-family: "Cormorant Garamond", serif;
    font-size: 5rem;
}

.welcome-caption {
    color: var(--muted);
    text-align: center;
    max-width: 360px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 28px;
}

.eyebrow,
.section-kicker {
    display: inline-block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--accent);
    margin-bottom: 18px;
}

.hero h1,
.person-hero h1 {
    font-size: clamp(3rem, 7vw, 5.75rem);
    line-height: 0.94;
    margin: 0 0 20px;
    max-width: 760px;
}

.hero-copy,
.lead,
.section-heading p,
.story-card p,
.file-card span,
.person-card p,
.unlock-card p,
.empty-state {
    color: var(--muted);
    line-height: 1.7;
    font-size: 1rem;
}

.panel {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 34px;
    border: 1px solid var(--border);
    backdrop-filter: blur(16px);
}

.tree-panel {
    margin-bottom: 38px;
}

.promo-panel {
    margin-bottom: 38px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: end;
    margin-bottom: 28px;
}

.section-heading h2,
.panel h2 {
    margin: 0;
    font-size: clamp(2rem, 3vw, 3rem);
}

.tree-canvas {
    height: 680px;
    border-radius: 22px;
    background: radial-gradient(circle at top, rgba(255, 255, 255, 0.92), rgba(248, 242, 234, 0.96));
    border: 1px solid rgba(96, 75, 41, 0.08);
    overflow: hidden;
}

.tree-canvas-large {
    height: 78vh;
    min-height: 760px;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.94), rgba(248, 242, 234, 0.98)),
        linear-gradient(180deg, rgba(141, 106, 59, 0.02), rgba(47, 74, 63, 0.03));
}

.tree-canvas-immersive {
    height: calc(100vh - 132px);
    min-height: 700px;
    width: 100%;
    border-radius: 34px;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.96), rgba(248, 242, 234, 0.98)),
        linear-gradient(180deg, rgba(141, 106, 59, 0.015), rgba(47, 74, 63, 0.02));
    box-shadow: 0 28px 80px rgba(74, 57, 33, 0.10);
    cursor: default;
    transition: box-shadow 0.25s ease;
}

.tree-stage {
    width: 100%;
}

.tree-canvas-immersive.tree-hovering {
    box-shadow: 0 34px 92px rgba(74, 57, 33, 0.14);
    cursor: pointer;
}

.promo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    align-items: center;
}

.promo-copy {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.promo-stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.promo-stat {
    min-width: 180px;
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(103, 87, 61, 0.10);
    border-radius: 20px;
}

.promo-stat strong {
    display: block;
    font-family: "Cormorant Garamond", serif;
    font-size: 2.1rem;
    margin-bottom: 4px;
}

.promo-stat span {
    color: var(--muted);
}

.tree-preview-card {
    padding: 24px;
    border-radius: 30px;
    background:
        radial-gradient(circle at top left, rgba(141, 106, 59, 0.08), transparent 35%),
        rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(103, 87, 61, 0.10);
}

.tree-preview-grid {
    position: relative;
    min-height: 360px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
    align-items: start;
}

.tree-preview-grid::before,
.tree-preview-grid::after {
    content: "";
    position: absolute;
    background: rgba(109, 92, 64, 0.36);
    border-radius: 999px;
}

.tree-preview-grid::before {
    top: 122px;
    left: calc(25% + 34px);
    width: calc(50% - 68px);
    height: 2px;
}

.tree-preview-grid::after {
    top: 124px;
    left: 50%;
    width: 2px;
    height: 84px;
}

.tree-preview-node {
    position: relative;
    z-index: 1;
    padding: 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(103, 87, 61, 0.12);
    box-shadow: 0 20px 44px rgba(74, 57, 33, 0.08);
    text-align: center;
}

.preview-bottom {
    grid-column: 1 / -1;
    max-width: 240px;
    margin: 72px auto 0;
}

.tree-preview-avatar {
    width: 72px;
    height: 72px;
    margin: 0 auto 14px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(141, 106, 59, 0.18), rgba(47, 74, 63, 0.14));
    color: var(--accent-deep);
    font-family: "Cormorant Garamond", serif;
    font-size: 2rem;
}

.tree-preview-node strong,
.tree-preview-node span {
    display: block;
}

.tree-preview-node span {
    color: var(--muted);
    margin-top: 6px;
}

.highlight-node {
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(249, 242, 232, 0.94));
}

.people-grid,
.story-grid,
.gallery-grid {
    display: grid;
    gap: 22px;
}

.people-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.person-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 24px;
    border-radius: var(--radius-md);
    background: var(--card-solid);
    border: 1px solid rgba(86, 68, 39, 0.08);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.person-card:hover,
.story-card:hover,
.gallery-card:hover,
.mini-card:hover,
.file-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.person-avatar,
.avatar-placeholder {
    width: 84px;
    height: 84px;
    border-radius: 999px;
}

.person-avatar {
    overflow: hidden;
}

.avatar-placeholder,
.hero-photo-placeholder {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(141, 106, 59, 0.18), rgba(47, 74, 63, 0.14));
    color: var(--accent-deep);
    font-family: "Cormorant Garamond", serif;
    font-size: 2rem;
}

.person-card h3,
.story-card h3 {
    margin: 0 0 8px;
    font-size: 1.9rem;
}

.person-card p {
    margin: 0;
}

.person-hero {
    display: grid;
    grid-template-columns: minmax(280px, 400px) 1fr;
    gap: 34px;
    padding: 34px;
    border-radius: 32px;
    background: linear-gradient(135deg, rgba(255,255,255,0.88), rgba(250,244,235,0.92));
    border: 1px solid rgba(92, 73, 42, 0.10);
    margin-bottom: 28px;
}

.person-hero-media img,
.hero-photo-placeholder {
    border-radius: 28px;
    height: 100%;
    object-fit: cover;
    min-height: 440px;
}

.meta-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.meta-chip,
.mini-card,
.file-card {
    border-radius: 999px;
    border: 1px solid rgba(80, 64, 37, 0.10);
    background: rgba(255, 255, 255, 0.84);
}

.meta-chip {
    padding: 10px 16px;
    color: var(--accent-deep);
}

.detail-grid {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 24px;
    margin-bottom: 28px;
}

.relationship-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.relationship-columns h3 {
    margin: 0 0 14px;
    font-size: 1.5rem;
}

.mini-cards,
.file-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mini-card,
.file-card {
    padding: 14px 18px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.file-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-radius: 18px;
}

.gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.gallery-card {
    margin: 0;
    overflow: hidden;
    border-radius: 22px;
    background: var(--card-solid);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.gallery-card img {
    aspect-ratio: 1 / 1.1;
    object-fit: cover;
}

.gallery-card figcaption {
    padding: 16px 18px 18px;
    color: var(--muted);
}

.story-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.story-card {
    padding: 28px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(249, 243, 234, 0.88));
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.story-quote {
    color: var(--accent);
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.story-date {
    margin: 0 0 10px;
    font-size: 0.92rem;
}

.unlock-screen {
    min-height: calc(100vh - 180px);
    display: grid;
    place-items: center;
}

.unlock-card {
    max-width: 520px;
    width: 100%;
    text-align: center;
}

.unlock-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 20px;
    text-align: left;
}

.unlock-form input {
    width: 100%;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid rgba(83, 67, 38, 0.14);
    background: rgba(255, 255, 255, 0.84);
    font: inherit;
}

.primary-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: none;
    border-radius: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--accent-deep), #3d5b4c);
    color: #fffdf8;
    font: inherit;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 18px 34px rgba(47, 74, 63, 0.22);
}

.primary-button:hover {
    transform: translateY(-2px);
}

.secondary-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 16px 20px;
    border-radius: 16px;
    border: 1px solid rgba(80, 64, 37, 0.12);
    background: rgba(255, 255, 255, 0.68);
    color: var(--text);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.secondary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 28px rgba(74, 57, 33, 0.08);
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards;
}

.delay-1 {
    animation-delay: 0.12s;
}

.delay-2 {
    animation-delay: 0.24s;
}

.delay-3 {
    animation-delay: 0.36s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 980px) {
    .person-hero,
    .detail-grid,
    .relationship-columns,
    .promo-grid,
    .welcome-grid {
        grid-template-columns: 1fr;
    }

    .section-heading {
        flex-direction: column;
        align-items: start;
    }

    .tree-canvas {
        height: 560px;
    }

    .hero,
    .panel,
    .person-hero,
    .welcome-stage {
        padding: 26px;
    }
}

@media (max-width: 640px) {
    .page-shell {
        padding: 18px 16px 72px;
    }

    .site-header {
        flex-direction: column;
        border-radius: 28px;
    }

    .tree-canvas {
        height: 460px;
    }

    .tree-page-body .page-shell {
        padding: 16px 16px 20px;
    }

    .tree-page-body .site-header {
        margin-bottom: 16px;
    }

    .tree-canvas-immersive {
        height: calc(100vh - 156px);
        min-height: 560px;
        border-radius: 24px;
    }

    .preview-bottom {
        margin-top: 56px;
    }
}
