/* ─── KI-tidslinje – digidutter-lite palette, modern vertical scroll ─── */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Instrument+Serif:ital@0;1&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --bg: #F4EFE6;
    --paper: #FAF6EC;
    --ink: #1A1815;
    --muted: rgba(26,24,21,.58);
    --line: rgba(26,24,21,.16);
    --red: #B8412C;
    --yellow: #D9A441;
    --blue: #1E4FA8;
    --accent: #2F6E5C;

    --display: 'Space Grotesk', system-ui, sans-serif;
    --body: 'Space Grotesk', system-ui, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, monospace;
    --serif: 'Instrument Serif', Georgia, serif;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--body);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-image:
        radial-gradient(rgba(0,0,0,.028) 1px, transparent 1px),
        radial-gradient(rgba(0,0,0,.018) 1px, transparent 1px);
    background-size: 3px 3px, 7px 7px;
    background-position: 0 0, 1px 2px;
}

a { color: var(--ink); }
a:hover { color: var(--red); }

/* ─── header ─── */
.tl-header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 56px 40px 32px;
    border-bottom: 1.5px solid var(--ink);
}

.tl-kicker {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 14px;
}

.tl-header h1 {
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(2.25rem, 6vw, 4.25rem);
    line-height: .95;
    letter-spacing: -.03em;
    margin-bottom: 10px;
}

.tl-header h1 .dot { color: var(--red); }

.tl-subtitle {
    font-family: var(--serif);
    font-style: italic;
    font-size: clamp(1.1rem, 1.8vw, 1.4rem);
    color: var(--muted);
    max-width: 560px;
    margin-bottom: 18px;
}

.tl-meta {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    align-items: center;
}

.tl-meta span + span {
    position: relative;
    padding-left: 30px;
    margin-left: 2px;
}

.tl-meta span + span::before {
    content: "";
    position: absolute;
    left: 12px;
    top: 50%;
    width: 4px;
    height: 4px;
    margin-top: -2px;
    background: var(--red);
    border-radius: 50%;
}

/* ─── body layout ─── */
.tl-body {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 40px;
    padding: 48px 40px 80px;
}

/* ─── era rail ─── */
.tl-rail {
    position: relative;
}

.tl-rail-inner {
    position: sticky;
    top: 28px;
    padding-top: 8px;
    border-left: 1.5px solid var(--ink);
    padding-left: 18px;
}

.tl-rail-title {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .24em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 20px;
}

.tl-rail-item {
    display: block;
    padding: 8px 0 8px 12px;
    margin-left: -18px;
    border-left: 2px solid transparent;
    color: var(--muted);
    text-decoration: none;
    transition: color .2s, border-color .2s;
    cursor: pointer;
}

.tl-rail-item:hover {
    color: var(--ink);
    border-left-color: var(--line);
}

.tl-rail-item.active {
    color: var(--ink);
    border-left-color: var(--red);
}

.tl-rail-decade {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .02em;
    line-height: 1.2;
}

.tl-rail-label {
    font-family: var(--body);
    font-size: 11.5px;
    line-height: 1.35;
    margin-top: 3px;
    font-weight: 400;
    opacity: .78;
}

.tl-rail-item.active .tl-rail-label { opacity: 1; }

/* ─── era accent palette (subtle per-decade tint) ─── */
.tl-event[data-era="1940s"] .tl-year,
.tl-era-break[data-era="1940s"] { --era: #2C3E50; }

.tl-event[data-era="1950s"] .tl-year,
.tl-era-break[data-era="1950s"] { --era: #8B5A2B; }

.tl-event[data-era="1960s"] .tl-year,
.tl-era-break[data-era="1960s"] { --era: #C27A1F; }

.tl-event[data-era="1970s"] .tl-year,
.tl-era-break[data-era="1970s"] { --era: #6B7B3A; }

.tl-event[data-era="1980s"] .tl-year,
.tl-era-break[data-era="1980s"] { --era: #A8316C; }

.tl-event[data-era="1990s"] .tl-year,
.tl-era-break[data-era="1990s"] { --era: #2F6E5C; }

.tl-event[data-era="2000s"] .tl-year,
.tl-era-break[data-era="2000s"] { --era: #2E5B8A; }

.tl-event[data-era="2010s"] .tl-year,
.tl-era-break[data-era="2010s"] { --era: #6B4A9C; }

.tl-event[data-era="2020s"] .tl-year,
.tl-era-break[data-era="2020s"] { --era: #B8412C; }

.tl-event .tl-year { color: var(--era, var(--red)); }

.tl-era-break {
    border-left-color: var(--era, var(--red));
}
.tl-era-break .tl-era-decade {
    color: var(--era, var(--red));
}

/* rail item color picks up era via attribute */
.tl-rail-item[data-era="1940s"].active { border-left-color: #2C3E50; }
.tl-rail-item[data-era="1950s"].active { border-left-color: #8B5A2B; }
.tl-rail-item[data-era="1960s"].active { border-left-color: #C27A1F; }
.tl-rail-item[data-era="1970s"].active { border-left-color: #6B7B3A; }
.tl-rail-item[data-era="1980s"].active { border-left-color: #A8316C; }
.tl-rail-item[data-era="1990s"].active { border-left-color: #2F6E5C; }
.tl-rail-item[data-era="2000s"].active { border-left-color: #2E5B8A; }
.tl-rail-item[data-era="2010s"].active { border-left-color: #6B4A9C; }
.tl-rail-item[data-era="2020s"].active { border-left-color: #B8412C; }

/* mobile rail accent moves to bottom-border */
@media (max-width: 900px) {
    .tl-rail-item[data-era="1940s"].active { border-bottom-color: #2C3E50; }
    .tl-rail-item[data-era="1950s"].active { border-bottom-color: #8B5A2B; }
    .tl-rail-item[data-era="1960s"].active { border-bottom-color: #C27A1F; }
    .tl-rail-item[data-era="1970s"].active { border-bottom-color: #6B7B3A; }
    .tl-rail-item[data-era="1980s"].active { border-bottom-color: #A8316C; }
    .tl-rail-item[data-era="1990s"].active { border-bottom-color: #2F6E5C; }
    .tl-rail-item[data-era="2000s"].active { border-bottom-color: #2E5B8A; }
    .tl-rail-item[data-era="2010s"].active { border-bottom-color: #6B4A9C; }
    .tl-rail-item[data-era="2020s"].active { border-bottom-color: #B8412C; }
}

/* event marker dot gets era color on border */
.tl-event::before { border-color: var(--era, var(--ink)); }

/* tiny motif after era name — per-decade character */
.tl-era-break .tl-era-name::after {
    content: "";
    display: inline-block;
    margin-left: 14px;
    vertical-align: middle;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .25em;
    color: var(--era, var(--muted));
    opacity: .7;
}

.tl-era-break[data-era="1940s"] .tl-era-name::after { content: "// punchcards"; }
.tl-era-break[data-era="1950s"] .tl-era-name::after { content: "// teletype"; }
.tl-era-break[data-era="1960s"] .tl-era-name::after { content: "// timesharing"; }
.tl-era-break[data-era="1970s"] .tl-era-name::after { content: "// winter"; }
.tl-era-break[data-era="1980s"] .tl-era-name::after { content: "// CRT"; }
.tl-era-break[data-era="1990s"] .tl-era-name::after { content: "// www"; }
.tl-era-break[data-era="2000s"] .tl-era-name::after { content: "// gpu"; }
.tl-era-break[data-era="2010s"] .tl-era-name::after { content: "// transformers"; }
.tl-era-break[data-era="2020s"] .tl-era-name::after { content: "// now"; }

/* ─── events ─── */
.tl-events {
    position: relative;
    padding-left: 26px;
    border-left: 1.5px solid var(--line);
}

.tl-era-break {
    margin: 64px 0 38px -29px;
    padding-left: 29px;
    border-left: 3px solid var(--red);
    position: relative;
}

.tl-era-break:first-child { margin-top: 0; }

.tl-era-decade {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--red);
    margin-bottom: 4px;
}

.tl-era-name {
    font-family: var(--display);
    font-weight: 600;
    font-size: 1.3rem;
    letter-spacing: -.01em;
    color: var(--ink);
}

.tl-event {
    position: relative;
    margin-bottom: 44px;
    scroll-margin-top: 24px;
}

.tl-event::before {
    content: "";
    position: absolute;
    left: -35px;
    top: 18px;
    width: 13px;
    height: 13px;
    background: var(--bg);
    border: 1.5px solid var(--ink);
    border-radius: 50%;
}

.tl-event-head {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.tl-year {
    font-family: var(--mono);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--red);
    line-height: 1;
}

.tl-title {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.45rem;
    letter-spacing: -.015em;
    line-height: 1.2;
    color: var(--ink);
}

.tl-description {
    font-family: var(--serif);
    font-style: italic;
    font-size: 1.15rem;
    line-height: 1.5;
    color: var(--ink);
    margin-bottom: 14px;
    max-width: 70ch;
}

.tl-media {
    margin: 18px 0;
    max-width: 680px;
}

.tl-media img {
    max-width: 100%;
    height: auto;
    display: block;
    border: 1.5px solid var(--ink);
    border-radius: 2px;
}

.tl-video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    max-width: 100%;
    border: 1.5px solid var(--ink);
    border-radius: 2px;
    overflow: hidden;
    background: var(--ink);
}

.tl-video-wrapper iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}

.tl-caption {
    font-family: var(--body);
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--muted);
    margin-top: 8px;
    max-width: 70ch;
}

/* ─── details / read more ─── */
.tl-details {
    margin-top: 10px;
    border: none;
    max-width: 70ch;
}

.tl-details > summary {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
    cursor: pointer;
    padding: 6px 0;
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--line);
}

.tl-details > summary::-webkit-details-marker { display: none; }

.tl-details > summary::after {
    content: "+";
    font-family: var(--mono);
    font-size: 14px;
    font-weight: 400;
    color: var(--muted);
    margin-left: 4px;
    transition: transform .2s;
}

.tl-details[open] > summary::after { content: "−"; }

.tl-details > summary:hover {
    color: var(--ink);
    border-bottom-color: var(--ink);
}

.tl-details-body {
    padding: 16px 0 4px;
    font-size: 1rem;
    line-height: 1.7;
    max-width: 70ch;
}

.tl-details-body p { margin-bottom: 12px; }

.tl-impact {
    font-family: var(--serif);
    font-style: italic;
    font-size: 1.02rem;
    padding-top: 14px;
    margin-top: 14px;
    border-top: 1px dashed var(--line);
}

.tl-impact-label {
    font-family: var(--mono);
    font-style: normal;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--red);
    margin-right: 8px;
}

/* ─── further reading (inside Les mer-accordion) ─── */
.tl-further {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px dashed var(--line);
    font-family: var(--body);
    font-size: 0.92rem;
}

.tl-further a {
    color: var(--blue);
    text-decoration: none;
    border-bottom: 1px solid currentColor;
    padding-bottom: 1px;
}

.tl-further a:hover {
    color: var(--red);
}

.tl-further::before {
    content: attr(data-kicker);
    display: block;
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 4px;
}

/* ─── discussion prompt ─── */
.tl-discuss {
    margin-top: 18px;
    border: 1.5px solid var(--ink);
    border-left: 4px solid var(--yellow);
    border-radius: 2px;
    background: var(--paper);
    max-width: 70ch;
}

.tl-discuss > summary {
    padding: 10px 16px;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--ink);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.tl-discuss > summary::-webkit-details-marker { display: none; }

.tl-discuss > summary::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--yellow);
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
}

.tl-discuss > summary::after {
    content: "+";
    font-size: 16px;
    color: var(--muted);
    margin-left: auto;
}

.tl-discuss[open] > summary::after { content: "−"; }

.tl-discuss-body {
    padding: 4px 16px 18px;
    border-top: 1px dashed var(--line);
}

.tl-discuss-body p {
    font-size: .98rem;
    line-height: 1.65;
    margin-bottom: 10px;
}

.tl-discuss-body p:first-child { margin-top: 14px; }

.tl-discuss-body .tl-discuss-link {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-top: 8px;
    display: block;
}

/* ─── top progress bar ─── */
.tl-progress {
    position: fixed;
    top: 0; left: 0;
    height: 2px;
    background: var(--red);
    width: 0%;
    z-index: 100;
    transition: width .1s;
}

/* ─── footer ─── */
.tl-footer {
    max-width: 1200px;
    margin: 40px auto 0;
    padding: 24px 40px 40px;
    border-top: 1px dashed var(--line);
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.tl-footer a { color: var(--muted); }
.tl-footer a:hover { color: var(--ink); }

/* ─── responsive ─── */
@media (max-width: 900px) {
    .tl-header { padding: 40px 22px 26px; }
    .tl-body {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 28px 22px 60px;
    }
    .tl-rail {
        border-left: none;
        margin-left: 0;
        position: relative;
    }
    .tl-rail-inner {
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        padding: 0;
        border-left: none;
        border-top: 1.5px solid var(--line);
        border-bottom: 1.5px solid var(--line);
        padding: 12px 0;
    }
    .tl-rail-title { display: none; }
    .tl-rail-item {
        display: inline-flex;
        flex-direction: column;
        padding: 4px 10px;
        margin: 0;
        border-left: none;
        border-bottom: 2px solid transparent;
        min-width: 84px;
    }
    .tl-rail-item.active {
        border-left: none;
        border-bottom-color: var(--red);
    }
    .tl-rail-label { font-size: 10.5px; }

    .tl-events { padding-left: 20px; }
    .tl-event::before { left: -29px; }
    .tl-era-break { margin-left: -23px; padding-left: 23px; }
    .tl-title { font-size: 1.25rem; }
    .tl-description { font-size: 1.05rem; }
    .tl-year { font-size: 1.35rem; }
    .tl-footer { padding: 20px 22px 30px; flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
    .tl-header h1 { font-size: 2.25rem; }
    .tl-meta { flex-direction: column; gap: 6px; align-items: flex-start; }
    .tl-meta span + span { padding-left: 0; margin-left: 0; }
    .tl-meta span + span::before { display: none; }
    .tl-era-break .tl-era-name::after { display: none; }
}

/* ─── language switch ─── */
.tl-langswitch {
    position: fixed;
    top: 18px;
    right: 24px;
    z-index: 101;
    display: flex;
    gap: 4px;
    background: var(--paper);
    border: 1px solid var(--ink);
    border-radius: 2px;
    padding: 2px;
}

.tl-langswitch button {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .1em;
    padding: 4px 10px;
    border: none;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    border-radius: 1px;
    transition: background .15s, color .15s;
}

.tl-langswitch button:hover { background: var(--bg); }

.tl-langswitch button.active {
    background: var(--ink);
    color: var(--paper);
}

@media (max-width: 900px) {
    .tl-langswitch { top: 14px; right: 14px; }
    .tl-langswitch button { padding: 3px 8px; font-size: 10.5px; }
}
