/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --midnight-deep: #1a2836;
    --midnight-ink: #2c3e50;
    --periwinkle: #7ba7c9;
    --sage: #a8c5a0;
    --muted-rose: #c4a0a0;
    --frost: #e4ecf3;
    --cloud: #f0f4f8;
    --slate: #607d8b;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--midnight-deep);
    color: var(--frost);
    font-family: 'Karla', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    overflow-x: hidden;
}

h1, h2, h3 {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    letter-spacing: 0.04em;
}

h2 {
    font-weight: 400;
}

code {
    font-family: 'Inconsolata', monospace;
    font-size: 0.9em;
    color: var(--sage);
    background: rgba(168, 197, 160, 0.1);
    padding: 0.1em 0.4em;
    border-radius: 3px;
}

/* === Gate Section === */
.gate-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: radial-gradient(ellipse at 50% 80%, rgba(123, 167, 201, 0.08) 0%, transparent 60%),
                var(--midnight-deep);
    position: relative;
}

.gate-content {
    max-width: 600px;
    padding: 2rem;
}

.gate-botanical {
    width: 120px;
    height: 180px;
    margin-bottom: 2rem;
    opacity: 0.7;
}

.gate-botanical path {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    animation: drawLine 3s ease forwards;
}

@keyframes drawLine {
    to { stroke-dashoffset: 0; }
}

.gate-title {
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--cloud);
    margin-bottom: 0.5rem;
    opacity: 0;
    animation: fadeIn 1.5s ease 1s forwards;
}

.gate-subtitle {
    font-family: 'Karla', sans-serif;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: var(--slate);
    letter-spacing: 0.06em;
    margin-bottom: 3rem;
    opacity: 0;
    animation: fadeIn 1.5s ease 1.8s forwards;
}

.gate-scroll-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--slate);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: lowercase;
    opacity: 0;
    animation: fadeIn 1.5s ease 2.5s forwards, floatDown 2s ease-in-out 3s infinite;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

@keyframes floatDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* === Timeline Section === */
.timeline-section {
    position: relative;
    padding: 6rem 0 8rem;
    min-height: 100vh;
}

.timeline-spine {
    position: absolute;
    left: 30%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        var(--periwinkle) 5%,
        var(--periwinkle) 95%,
        transparent 100%
    );
    opacity: 0.3;
}

/* === Timeline Nodes === */
.timeline-node {
    position: relative;
    margin-bottom: 6rem;
    display: flex;
    align-items: flex-start;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.timeline-node.visible {
    opacity: 1;
    transform: translateY(0);
}

.node-dot {
    position: absolute;
    left: 30%;
    top: 1.5rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--midnight-deep);
    border: 2px solid var(--periwinkle);
    transform: translateX(-50%);
    z-index: 2;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.timeline-node.visible .node-dot {
    background: var(--periwinkle);
    box-shadow: 0 0 12px rgba(123, 167, 201, 0.4);
}

.node-card {
    width: 45%;
    padding: 2rem;
    background: rgba(26, 40, 54, 0.6);
    border: 1px solid rgba(123, 167, 201, 0.12);
    border-radius: 4px;
    position: relative;
    backdrop-filter: blur(4px);
}

.node-left .node-card {
    margin-left: calc(30% + 2rem);
}

.node-right .node-card {
    margin-left: calc(30% - 47%);
    text-align: right;
}

.node-era {
    font-family: 'Inconsolata', monospace;
    font-size: 0.75rem;
    color: var(--periwinkle);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.5rem;
}

.node-card h2 {
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    color: var(--cloud);
    margin-bottom: 1rem;
}

.node-quote {
    font-family: 'Nunito', sans-serif;
    font-style: italic;
    font-size: 0.95rem;
    color: var(--muted-rose);
    border-left: 2px solid var(--muted-rose);
    padding-left: 1rem;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.node-right .node-quote {
    border-left: none;
    border-right: 2px solid var(--muted-rose);
    padding-left: 0;
    padding-right: 1rem;
}

.node-author {
    font-size: 0.8rem;
    color: var(--slate);
    margin-bottom: 1rem;
}

.node-body {
    font-size: 0.92rem;
    color: var(--frost);
    line-height: 1.8;
}

.node-botanical {
    width: 80px;
    height: 80px;
    position: absolute;
    bottom: -20px;
    right: -10px;
    opacity: 0.4;
}

.node-right .node-botanical {
    right: auto;
    left: -10px;
}

/* === Roots Section === */
.roots-section {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
    background: radial-gradient(ellipse at 50% 20%, rgba(123, 167, 201, 0.06) 0%, transparent 60%),
                var(--midnight-deep);
}

.roots-content {
    max-width: 500px;
}

.roots-botanical {
    width: 200px;
    height: 140px;
    margin-bottom: 2rem;
    opacity: 0.5;
}

.roots-content h2 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: var(--cloud);
    margin-bottom: 1rem;
}

.roots-content p {
    color: var(--slate);
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.roots-code code {
    font-size: 1rem;
    color: var(--periwinkle);
    background: transparent;
}

/* === Responsive === */
@media (max-width: 768px) {
    .timeline-spine {
        left: 1.5rem;
    }

    .node-dot {
        left: 1.5rem;
    }

    .node-card {
        width: calc(100% - 4rem);
    }

    .node-left .node-card,
    .node-right .node-card {
        margin-left: 3.5rem;
        text-align: left;
    }

    .node-right .node-quote {
        border-right: none;
        border-left: 2px solid var(--muted-rose);
        padding-right: 0;
        padding-left: 1rem;
    }
}
