/* ===================================================================
   TuxCorp — vertical project timeline (home page, below the hero)
   One point per project. The active point re-centres the rail, swaps the
   blurred background and shows that project's 2 text pages.
   Add projects in src/data/projects.json — no CSS/JS changes needed.
   =================================================================== */

.timeline {
    --tl-row: 84px;
    --tl-stage-h: 520px;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    color: #fff;
    background: var(--navy-dark);
}

/* Blurred, cross-fading background (one layer per project) */
.tl-bgs { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: -2; }
.tl-bg {
    position: absolute;
    top: -48px; right: -48px; bottom: -48px; left: -48px; /* bleed hides blur edges */
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    -webkit-filter: blur(18px) saturate(1.05);
    filter: blur(18px) saturate(1.05);
    opacity: 0;
    transition: opacity .9s ease;
    will-change: opacity;
}
.tl-bg.is-active { opacity: 1; }
.tl-shade {
    position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: -1;
    background:
        linear-gradient(90deg, rgba(6,26,50,.82) 0%, rgba(6,26,50,.55) 55%, rgba(6,26,50,.72) 100%);
}

.tl-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 5%;
}
.tl-heading {
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    margin-bottom: 2rem;
    color: #fff;
}

.tl-stage {
    display: grid;
    grid-template-columns: minmax(170px, 34%) minmax(0, 1fr);
    align-items: center;
    min-height: var(--tl-stage-h);
}

/* ---- Rail ---- */
.tl-rail {
    position: relative;
    height: var(--tl-stage-h);
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 16%, #000 84%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 16%, #000 84%, transparent 100%);
}
.tl-line {
    position: absolute; top: 0; bottom: 0; right: 20px;
    width: 2px;
    background: rgba(255,255,255,.72);
}
.tl-track {
    position: absolute; top: 0; left: 0; right: 0;
    transform: translateY(var(--ty, 0px));
    transition: transform .6s cubic-bezier(.25,.8,.25,1);
    will-change: transform;
}
.tl-dot {
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    display: flex; align-items: center; justify-content: flex-end;
    width: 100%; height: var(--tl-row);
    padding: 0; margin: 0;
    background: none; border: 0;
    color: inherit; font: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.tl-dot:focus-visible { outline-offset: -4px; }
.tl-label {
    margin-right: 38px;
    font-size: .85rem;
    font-weight: 600;
    line-height: 1;
    color: rgba(255,255,255,.62);
    transition: color .3s, font-size .4s ease, margin .4s ease;
}
.tl-dot:hover .tl-label { color: #fff; }
.tl-point {
    position: absolute; right: 14px; top: 50%;
    width: 14px; height: 14px; margin-top: -7px;
    border-radius: 50%;
    background: rgba(255,255,255,.6);
    transition: width .3s, height .3s, margin .3s, right .3s, background .3s, box-shadow .3s;
}
.tl-dot.is-active .tl-label {
    margin-right: 48px;
    font-size: clamp(2.75rem, 6vw, 4.5rem);
    font-style: italic;
    font-weight: 800;
    letter-spacing: -.02em;
    color: #fff;
}
.tl-dot.is-active .tl-point {
    right: 11px;
    width: 20px; height: 20px; margin-top: -10px;
    background: #fff;
    box-shadow: 0 0 0 7px rgba(255,255,255,.16);
}

/* ---- Panels (all panels share one grid cell and cross-fade) ---- */
.tl-panels {
    display: grid;
    align-items: center;
    padding-left: clamp(1.5rem, 4vw, 3.5rem);
}
.tl-panel {
    grid-area: 1 / 1;
    opacity: 0; visibility: hidden;
    transform: translateY(10px);
    transition: opacity .45s ease, transform .45s ease, visibility 0s linear .45s;
}
.tl-panel.is-active {
    opacity: 1; visibility: visible; transform: none;
    transition-delay: .12s, .12s, 0s;
}
.tl-pager {
    display: flex; align-items: center; gap: .9rem;
    margin-bottom: .75rem;
    font-size: .85rem; font-weight: 600;
    color: rgba(255,255,255,.9);
}
.tl-pager button {
    -webkit-appearance: none; appearance: none;
    background: none; border: 0; color: #fff;
    font: inherit; font-size: 1.3rem; line-height: 1;
    padding: .25rem .5rem; border-radius: 6px;
    cursor: pointer;
    transition: background .2s, opacity .2s;
}
.tl-pager button:hover:not(:disabled) { background: rgba(255,255,255,.14); }
.tl-pager button:disabled { opacity: .3; cursor: default; }
.tl-title {
    margin: 0 0 1.25rem;
    font-size: clamp(1.7rem, 3.8vw, 3rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #fff;
    overflow-wrap: anywhere;
}
.tl-pages { display: grid; }
.tl-page {
    grid-area: 1 / 1;
    opacity: 0; visibility: hidden;
    transition: opacity .35s ease, visibility 0s linear .35s;
}
.tl-page.is-active { opacity: 1; visibility: visible; transition-delay: 0s; }
.tl-page p {
    max-width: 62ch;
    font-size: clamp(1rem, 1.5vw, 1.1rem);
    line-height: 1.7;
    color: rgba(255,255,255,.92);
}

/* ---- Without JavaScript: plain, fully readable list ---- */
.no-js .tl-rail { display: none; }
.no-js .tl-stage { display: block; min-height: 0; }
.no-js .tl-panels { display: block; padding-left: 0; }
.no-js .tl-panel,
.no-js .tl-page {
    opacity: 1; visibility: visible; transform: none;
}
.no-js .tl-panel { margin-bottom: 2.5rem; }
.no-js .tl-pager { display: none; }

/* ---- Phones ---- */
@media (max-width: 720px) {
    .timeline { --tl-row: 64px; --tl-stage-h: 460px; }
    .tl-inner { padding: 3rem 5%; }
    .tl-stage { grid-template-columns: 108px minmax(0, 1fr); }
    .tl-label { margin-right: 36px; font-size: .75rem; }
    .tl-dot.is-active .tl-label { margin-right: 44px; font-size: 1.15rem; }
    .tl-title { letter-spacing: .05em; font-size: clamp(1.4rem, 6vw, 1.9rem); }
    .tl-panels { padding-left: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
    .tl-track, .tl-panel, .tl-page, .tl-bg, .tl-label, .tl-point { transition: none !important; }
}
