:root {
    --gh-font-heading: 'Playfair Display', serif;
    --gh-font-body: 'Karla', sans-serif;

    /* Type scale */
    --font-size-xs: 0.6875rem;   /* 11px — meta, dates */
    --font-size-sm: 0.8125rem;   /* 13px — secondary */
    --font-size-base: 1rem;      /* 16px — body */
    --font-size-md: 1.0625rem;   /* 17px — lead text */
    --font-size-lg: 1.1875rem;   /* 19px — card titles */
    --font-size-xl: clamp(1.75rem, 4vw, 2.375rem);

    --line-height-tight: 1.25;
    --line-height-snug: 1.45;
    --line-height-body: 1.65;
    --line-height-relaxed: 1.75;

    --space-section: 3rem;
    --space-block: 1.5rem;
    --space-text: 1rem;

    /* Text — tuned for WCAG-friendly contrast on warm off-white */
    --text: #1a1a18;
    --text-muted: #45443f;
    --text-very-muted: #5c5a54;
    --text-label: #6f6c65;
    --text-on-dark: #FAFAF8;

    /* Borders */
    --border: #B8B5AD;
    --border-light: #C9C6BE;
    --border-faint: #E0DED8;

    /* Backgrounds */
    --bg: #FAFAF8;
    --bg-surface: #ffffff;
    --bg-subtle: #F1EFE8;
    --bg-card: #F3F1EC;

    /* Accents */
    --accent-blue: #2B7BC7;
    --accent-blue-dark: #1A5FA3;
    --accent-blue-pale: #D8EAFB;
    --accent-green: #178564;
    --accent-green-dark: #0F6E56;
    --accent-purple: #4A42A8;
    --accent-purple-pale: #EAE8F8;
    --accent-purple-border: #9B94D4;

    /* Build log types — slightly deeper text on tinted backgrounds */
    --log-schema-bg: #E1F5EE;
    --log-schema-text: #064A3D;
    --log-schema-border: #7DD4B5;
    --log-agent-bg: #EEEDFE;
    --log-agent-text: #322B7A;
    --log-agent-border: #AFA9EC;
    --log-decision-bg: #FAEEDA;
    --log-decision-text: #523004;
    --log-decision-border: #E8B45A;
    --log-planning-bg: #F3F1EC;
    --log-planning-text: #5c5a54;
    --log-planning-border: #C9C6BE;

    /* Interactive */
    --link-underline: var(--border);
    --focus-ring: 2px solid var(--accent-blue);
    --focus-offset: 2px;
}

/* TIMELINE — horizontal layout (desktop) / vertical spine (mobile) */
.timeline-horizontal .h-timeline {
    width: 100%;
}

.timeline-horizontal .h-track-block {
    margin-bottom: 0;
}

.timeline-horizontal .h-track-block .track-label {
    font-size: var(--font-size-xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    font-weight: 500;
}

.timeline-horizontal .h-track-block--evolution .track-label {
    color: var(--accent-green-dark);
}

.timeline-horizontal .h-track-block--agentic .track-label {
    color: var(--accent-purple);
}

.timeline-horizontal .h-track-rule {
    border: none;
    border-top: 0.5px solid var(--border);
    margin: 2.5rem 0;
}

/* Mobile-first: vertical spine */
.timeline-horizontal .h-track {
    display: flex;
    flex-direction: column;
}

.timeline-horizontal .h-phase {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 0.875rem;
    align-items: start;
}

.timeline-horizontal .h-phase-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100%;
}

.timeline-horizontal .h-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1.5px solid var(--border-light);
    background: var(--bg);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.timeline-horizontal .h-dot.now,
.timeline-horizontal .h-dot.active {
    background: var(--accent-green);
    border-color: var(--accent-green);
}

.timeline-horizontal .h-dot.end {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
}

.timeline-horizontal .h-segment {
    width: 1px;
    flex: 1;
    min-height: 1.25rem;
    background: var(--border-faint);
    margin: 4px 0;
}

.timeline-horizontal .h-phase:last-child .h-segment {
    display: none;
}

.timeline-horizontal .h-phase-body {
    padding-bottom: 1.5rem;
}

.timeline-horizontal .h-timeline .converge {
    margin-top: 2.5rem;
    padding: 1rem 1.25rem;
    border: 0.5px solid var(--accent-purple-border);
    background: var(--bg);
    width: 100%;
    box-sizing: border-box;
}

/* Desktop: horizontal spine per track */
@media (min-width: 768px) {
    .timeline-horizontal .h-track {
        display: grid;
        gap: 1.5rem;
        position: relative;
        padding-top: 0.25rem;
    }

    .timeline-horizontal .h-track--4 {
        grid-template-columns: repeat(4, 1fr);
    }

    .timeline-horizontal .h-track--3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .timeline-horizontal .h-track::before {
        content: '';
        position: absolute;
        top: 4px;
        left: 4px;
        right: 4px;
        height: 1px;
        background: var(--border-faint);
        z-index: 0;
    }

    .timeline-horizontal .h-phase {
        display: flex;
        flex-direction: column;
        grid-template-columns: unset;
        gap: 0;
        min-width: 0;
    }

    .timeline-horizontal .h-phase-marker {
        flex-direction: row;
        align-items: center;
        width: 100%;
        margin-bottom: 0.75rem;
        min-height: unset;
    }

    /* Spine line is .h-track::before; segments only used on mobile vertical */
    .timeline-horizontal .h-segment {
        display: none;
    }

    .timeline-horizontal .h-phase-body {
        padding-bottom: 0;
    }
}
