:root {
    --bg-primary: #0a1628;
    --bg-secondary: #0f1f35;
    --text-primary: #c2cfe0;
    --text-secondary: #8fa3bf;
    --text-tertiary: #4a6178;
    --accent-warm: #d4a574;
    --accent-cool: #6d8a96;
    --highlight: #e8f0ff;
    --ink-wash: #2a3f5c;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    font-family: 'Recursive', monospace, sans-serif;
    font-variation-settings: 'wght' 400, 'CASL' 0.3, 'slnt' 0, 'MONO' 0;
    font-size: clamp(16px, 1.8vw, 20px);
    line-height: 1.72;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    position: relative;
}

/* Eave Bar */
.eave {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 15vh;
    background-color: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8vw;
    z-index: 100;
    border-bottom: 1px solid var(--ink-wash);
}

.docket {
    font-variation-settings: 'wght' 800, 'CASL' 0, 'slnt' 0, 'MONO' 0.5;
    font-size: clamp(36px, 5.5vw, 72px);
    color: var(--text-primary);
    letter-spacing: 0.03em;
    line-height: 1.05;
    opacity: 0;
    transform: translateY(-20px);
    animation: bounceEnter 600ms cubic-bezier(0.34, 1.56, 0.64, 1) 1100ms forwards;
}

.timestamp {
    font-variation-settings: 'wght' 300, 'CASL' 0, 'slnt' 0, 'MONO' 1;
    font-size: clamp(11px, 1.2vw, 14px);
    color: var(--text-tertiary);
    letter-spacing: 0.08em;
}

/* Opening Compass Rose */
.opening {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 15vh;
}

.compass-rose {
    opacity: 0;
    animation: fadeIn 800ms ease-in-out 300ms forwards;
}

/* Clearing: Main content area */
.clearing {
    max-width: 780px;
    padding: 0 8vw;
    padding-bottom: 10vh;
    position: relative;
    z-index: 1;
}

/* Sections */
.section {
    padding: clamp(3rem, 6vh, 5rem) 0;
}

.bg-primary {
    background-color: transparent;
}

.bg-secondary {
    background-color: transparent;
    position: relative;
}

.bg-secondary::before {
    content: '';
    position: absolute;
    left: -8vw;
    top: 0;
    width: 100vw;
    height: 100%;
    background-color: var(--bg-secondary);
    z-index: -1;
}

/* Transcript entries */
.transcript-entry {
    margin-bottom: 1.5rem;
}

.meta {
    font-variation-settings: 'wght' 300, 'CASL' 0, 'slnt' 0, 'MONO' 1;
    font-size: clamp(11px, 1.2vw, 14px);
    color: var(--text-tertiary);
    letter-spacing: 0.08em;
    display: block;
    margin-bottom: 0.5rem;
}

.headline {
    font-variation-settings: 'wght' 800, 'CASL' 0, 'slnt' 0, 'MONO' 0.5;
    font-size: clamp(36px, 5.5vw, 72px);
    color: var(--text-primary);
    letter-spacing: 0.03em;
    line-height: 1.05;
}

/* Transcript blocks */
.transcript-block {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.transcript-block p {
    flex: 1;
}

.pull-quote {
    font-variation-settings: 'wght' 600, 'CASL' 0.8, 'slnt' -8, 'MONO' 0;
    font-size: clamp(22px, 3vw, 34px);
    color: var(--accent-warm);
    line-height: 1.5;
}

.footnote {
    font-variation-settings: 'wght' 300, 'CASL' 0, 'slnt' 0, 'MONO' 1;
    font-size: clamp(11px, 1.2vw, 14px);
    color: var(--text-tertiary);
    letter-spacing: 0.08em;
    line-height: 1.8;
}

/* Icons */
.icon {
    color: var(--accent-cool);
    flex-shrink: 0;
    transition: color 400ms ease-out;
}

.icon:hover {
    color: var(--accent-warm);
}

/* Dividers */
.divider {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 0;
}

.rule-line {
    width: 100%;
    height: 4px;
}

/* Ghost branches (desktop only) */
.ghost-branches {
    position: fixed;
    top: 15vh;
    right: 5vw;
    display: flex;
    flex-direction: column;
    z-index: 0;
    pointer-events: none;
    transform: translateY(var(--scroll-offset, 0px));
    transition: transform 0.3s ease-out;
}

/* Bounce Enter Animation */
@keyframes bounceEnter {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Bounce enter for scroll-triggered elements */
.bounce-enter {
    opacity: 0;
    transform: translateY(-16px);
}

.bounce-enter.visible {
    animation: bounceReveal 500ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes bounceReveal {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Lightning flash */
.bounce-enter.flash {
    box-shadow: 0 0 0 1px var(--highlight);
}

.bounce-enter.flash-fade {
    box-shadow: 0 0 0 1px transparent;
    transition: box-shadow 300ms ease-out;
}

/* Responsive: below 768px */
@media (max-width: 768px) {
    .eave {
        height: 10vh;
        padding: 0 5vw;
    }

    .opening {
        padding-top: 10vh;
    }

    .clearing {
        padding: 0 5vw;
        max-width: 100%;
    }

    .ghost-branches {
        display: none;
    }

    .headline {
        font-size: clamp(28px, 8vw, 48px);
    }

    .docket {
        font-size: clamp(24px, 7vw, 40px);
    }
}

@media (min-width: 1200px) {
    .clearing {
        width: 45%;
    }
}
