/* ==========================================================================
   JOURNEY — cinematic archive timeline (About page)
   Scoped design system: everything lives under .journey
   Aesthetic: motorsport editorial / industrial archive instrument
   ========================================================================== */

.journey {
    /* local palette override — darker, more neutral than the site tokens */
    --j-bg: #06080C;
    --j-surface: #0B1018;
    --j-text: #E8EDF0;
    --j-muted: #7C8794;
    --j-accent: #00D9E8;
    --j-hairline: rgba(232, 237, 240, 0.08);
    --j-hairline-strong: rgba(232, 237, 240, 0.16);
    --j-mono: ui-monospace, 'SF Mono', 'Cascadia Code', 'Consolas', monospace;

    background: var(--j-bg);
    color: var(--j-text);
    position: relative;
    overflow: clip;
}

.journey *,
.journey *::before,
.journey *::after {
    box-sizing: border-box;
}

/* ---------- shared technical label ---------- */
.j-label {
    font-family: var(--j-mono);
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--j-muted);
    white-space: nowrap;
}

/* ==========================================================================
   1. INTRO — full-viewport editorial entry
   ========================================================================== */
.j-intro {
    position: relative;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 140px 6vw 90px;
    overflow: clip;
}

.j-intro-meta-top,
.j-intro-meta-bottom {
    position: absolute;
    left: 6vw;
    right: 6vw;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    z-index: 3;
}

.j-intro-meta-top { top: 110px; }
.j-intro-meta-bottom { bottom: 64px; }

.j-intro-meta-bottom .j-label:last-child { color: var(--j-text); }

/* oversized editorial title — three lines, clip-masked */
.j-intro-title {
    font-family: 'Kanit', sans-serif;
    font-weight: 800;
    font-size: clamp(64px, 13.5vw, 220px);
    line-height: 0.92;
    letter-spacing: -0.025em;
    text-transform: uppercase;
    margin: 0;
    position: relative;
    z-index: 2;
}

.j-line {
    display: block;
    overflow: hidden; /* clip mask */
}

.j-line-inner {
    display: block;
    transform: translateY(110%); /* JS reveals on load */
    will-change: transform;
}

.j-line:nth-child(3) .j-line-inner {
    color: transparent;
    -webkit-text-stroke: 1.5px rgba(232, 237, 240, 0.55); /* outlined period line */
}

/* faint archive index behind the title */
.j-intro-index {
    position: absolute;
    right: 6vw;
    top: 50%;
    transform: translateY(-50%);
    text-align: right;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* intro hairline frame */
.j-intro::after {
    content: '';
    position: absolute;
    left: 6vw;
    right: 6vw;
    bottom: 120px;
    height: 1px;
    background: var(--j-hairline);
    z-index: 1;
}

/* ==========================================================================
   2. STAGE — pinned scroll sequence
   ========================================================================== */
.j-stage {
    position: relative;
    height: 100svh;
    overflow: clip;
}

/* ---------- background instrument: grid / scanlines / coords ---------- */
.j-bg {
    position: absolute;
    inset: -5% 0;
    z-index: 0;
    pointer-events: none;
    will-change: transform;
}

.j-bg::before { /* technical grid */
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(232, 237, 240, 0.045) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(232, 237, 240, 0.045) 1px, transparent 1px);
    background-size: 12vw 12vw;
    mask-image: radial-gradient(ellipse 90% 80% at 50% 50%, black 30%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 50%, black 30%, transparent 100%);
}

.j-bg::after { /* scanlines, extremely low opacity */
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0 3px,
        rgba(232, 237, 240, 0.012) 3px 4px
    );
}

.j-bg-mark {
    position: absolute;
    font-family: var(--j-mono);
    font-size: 9px;
    letter-spacing: 0.2em;
    color: rgba(124, 135, 148, 0.4);
    text-transform: uppercase;
}

.j-bg-cross {
    position: absolute;
    width: 14px;
    height: 14px;
    color: rgba(232, 237, 240, 0.14);
    font-family: var(--j-mono);
    font-size: 14px;
    line-height: 14px;
}

/* ---------- central axis — the engineering instrument line ---------- */
.j-axis {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: var(--j-hairline);
    transform: translateX(-50%);
    z-index: 1;
}

.j-axis-fill {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 217, 232, 0), var(--j-accent) 12%, var(--j-accent) 88%, rgba(0, 217, 232, 0));
    transform: scaleY(0);
    transform-origin: top center;
    box-shadow: 0 0 14px rgba(0, 217, 232, 0.35);
    will-change: transform;
}

.j-axis-node {
    position: absolute;
    left: 50%;
    width: 7px;
    height: 7px;
    border: 1px solid var(--j-hairline-strong);
    background: var(--j-bg);
    transform: translate(-50%, -50%) rotate(45deg);
    transition: border-color 0.5s, background 0.5s, box-shadow 0.5s;
    z-index: 2;
}

.j-axis-node.is-active {
    border-color: var(--j-accent);
    background: var(--j-accent);
    box-shadow: 0 0 12px rgba(0, 217, 232, 0.5);
}

/* ---------- progress instrument (left rail) ---------- */
.j-instrument {
    position: absolute;
    left: 48px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    display: flex;
    gap: 18px;
}

.j-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.j-rail-line {
    width: 1px;
    height: 34px;
    background: var(--j-hairline);
}

.j-rail-node {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: 1px solid var(--j-muted);
    background: transparent;
    padding: 0;
    cursor: pointer;
    transition: background 0.4s, border-color 0.4s, box-shadow 0.4s;
}

.j-rail-node.is-active {
    background: var(--j-accent);
    border-color: var(--j-accent);
    box-shadow: 0 0 10px rgba(0, 217, 232, 0.55);
}

.j-readout {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 2px;
}

.j-readout-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 148px;
}

.j-readout-value {
    font-family: var(--j-mono);
    font-size: 13px;
    letter-spacing: 0.08em;
    color: var(--j-text);
}

.j-readout-value.j-accent { color: var(--j-accent); }

/* ==========================================================================
   3. CHAPTERS — each milestone is a full-viewport composition
   ========================================================================== */
.j-chapters {
    position: relative;
    z-index: 2;
    height: 100%;
}

.j-chapter {
    position: absolute;
    inset: 0;
    visibility: hidden;
    opacity: 0;
    padding: 110px 6vw 80px;
    will-change: transform, opacity;
}

.j-chapter.is-first { visibility: visible; opacity: 1; }

.j-chapter-inner {
    position: relative;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: auto 1fr auto;
    column-gap: 2vw;
}

/* ---------- massive year typography ---------- */
.j-year {
    font-family: 'Kanit', sans-serif;
    font-weight: 800;
    font-size: clamp(150px, 26vw, 420px);
    line-height: 0.82;
    letter-spacing: -0.03em;
    color: var(--j-text);
    margin: 0;
    white-space: nowrap;
    will-change: transform;
}

.j-year .j-year-tick {
    font-size: 0.22em;
    font-weight: 600;
    letter-spacing: 0.05em;
    vertical-align: top;
    color: var(--j-accent);
}

/* faint next-year ghost — depth cue */
.j-year-ghost {
    position: absolute;
    font-family: 'Kanit', sans-serif;
    font-weight: 800;
    font-size: clamp(120px, 20vw, 320px);
    line-height: 0.82;
    letter-spacing: -0.03em;
    color: rgba(232, 237, 240, 0.045);
    white-space: nowrap;
    pointer-events: none;
    z-index: -1;
}

/* ---------- milestone content panel ---------- */
.j-panel {
    align-self: end;
    max-width: 420px;
    padding-top: 22px;
    border-top: 1px solid var(--j-hairline-strong);
    will-change: transform, clip-path;
}

.j-panel-kicker {
    display: flex;
    gap: 18px;
    margin-bottom: 14px;
}

.j-chapter-title {
    font-family: 'Kanit', sans-serif;
    font-weight: 600;
    font-size: clamp(24px, 3.2vw, 46px);
    line-height: 1.04;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    margin: 0 0 16px;
}

.j-desc {
    font-family: 'Numans', sans-serif;
    font-size: 15px;
    line-height: 1.75;
    color: var(--j-muted);
    margin: 0;
    max-width: 40ch;
}

/* ---------- technical data list ---------- */
.j-data {
    display: flex;
    flex-direction: column;
    margin-top: 20px;
}

.j-data-row {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 9px 0;
    border-bottom: 1px solid var(--j-hairline);
    font-family: var(--j-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.j-data-row:last-child { border-bottom: none; }

.j-data-row .j-data-value {
    color: var(--j-text);
}

.j-data-row .j-data-value.j-accent { color: var(--j-accent); }

/* ---------- media — cropped archival imagery ---------- */
.j-media-mask {
    position: absolute;
    overflow: hidden;
    z-index: -1;
    will-change: transform, clip-path;
}

.j-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(0.4) contrast(1.06) brightness(0.72);
    will-change: transform;
}

/* ==========================================================================
   CHAPTER COMPOSITIONS — bespoke layout per milestone
   ========================================================================== */

/* 2010 — minimal, negative space, the beginning */
.j-ch-2010 .j-year {
    grid-column: 1 / span 11;
    grid-row: 2;
    align-self: center;
    margin-bottom: -0.05em;
}

.j-ch-2010 .j-panel {
    grid-column: 8 / span 5;
    grid-row: 3;
    text-align: right;
    border-top-color: var(--j-hairline);
}

.j-ch-2010 .j-desc { margin-left: auto; }
.j-ch-2010 .j-panel-kicker { justify-content: flex-end; }
.j-ch-2010 .j-year-ghost { bottom: 8vh; left: 6vw; }

/* 2012 — year left, data panel + archival image right */
.j-ch-2012 .j-year {
    grid-column: 1 / span 7;
    grid-row: 2;
    align-self: center;
}

.j-ch-2012 .j-media-mask {
    top: 12%;
    right: -6vw;                 /* extends beyond the grid */
    width: 34vw;
    height: 62vh;
    clip-path: inset(8% 0 8% 0);
}

.j-ch-2012 .j-panel {
    grid-column: 9 / span 4;
    grid-row: 3;
    align-self: end;
}

.j-ch-2012 .j-year-ghost { bottom: 4vh; right: 8vw; }

/* 2019 — full-bleed archive photograph, peak achievement */
.j-ch-2019 .j-media-mask {
    inset: 0;
    clip-path: inset(0 0 0 0);
}

.j-ch-2019 .j-media { filter: grayscale(0.75) contrast(1.1) brightness(0.5); }

.j-ch-2019 .j-year {
    grid-column: 1 / span 8;
    grid-row: 2;
    align-self: center;
    z-index: 2;
    mix-blend-mode: difference;
}

.j-ch-2019 .j-air {
    grid-column: 1 / span 4;
    grid-row: 2;
    align-self: end;
    margin-bottom: 6vh;
    z-index: 2;
}

.j-air-number {
    font-family: 'Kanit', sans-serif;
    font-weight: 800;
    font-size: clamp(72px, 9vw, 150px);
    line-height: 0.9;
    color: var(--j-accent);
    letter-spacing: -0.02em;
}

.j-ch-2019 .j-panel {
    grid-column: 9 / span 4;
    grid-row: 3;
    z-index: 2;
    border-top-color: rgba(232, 237, 240, 0.3);
}

/* 2022 — mirrored: year right, panel left, image band bleeding off left edge */
.j-ch-2022 .j-year {
    grid-column: 5 / span 8;
    grid-row: 2;
    align-self: center;
    text-align: right;
}

.j-ch-2022 .j-media-mask {
    top: 16%;
    left: -8vw;                  /* bleeds off the left edge */
    width: 30vw;
    height: 58vh;
    clip-path: inset(6% 0 6% 0);
}

.j-ch-2022 .j-panel {
    grid-column: 1 / span 4;
    grid-row: 3;
    align-self: end;
}

.j-ch-2022 .j-year-ghost { top: 10vh; right: 6vw; }

/* 2024 — engineering spec sheet composition */
.j-ch-2024 .j-year {
    grid-column: 1 / span 9;
    grid-row: 2;
    align-self: start;
    margin-top: 4vh;
    font-size: clamp(120px, 19vw, 300px);
}

.j-ch-2024 .j-spec {
    grid-column: 9 / span 4;
    grid-row: 2;
    align-self: start;
    margin-top: 10vh;
    display: flex;
    flex-direction: column;
}

.j-ch-2024 .j-spec-row {
    padding: 14px 0;
    border-top: 1px solid var(--j-hairline-strong);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.j-ch-2024 .j-spec-row:last-child { border-bottom: 1px solid var(--j-hairline-strong); }

.j-spec-name {
    font-family: 'Kanit', sans-serif;
    font-weight: 600;
    font-size: 17px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.j-ch-2024 .j-panel {
    grid-column: 1 / span 5;
    grid-row: 3;
}

.j-ch-2024 .j-media-mask {
    bottom: -10vh;
    right: 2vw;
    width: 26vw;
    height: 44vh;
    clip-path: inset(10% 0 0 0);
}

/* 2025 — present: NEXUS index, strongest accent */
.j-ch-2025 .j-year {
    grid-column: 1 / span 7;
    grid-row: 2;
    align-self: center;
    color: var(--j-accent);
}

.j-ch-2025 .j-dept-index {
    grid-column: 8 / span 5;
    grid-row: 2;
    align-self: center;
    display: flex;
    flex-direction: column;
}

.j-dept-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 0;
    border-bottom: 1px solid var(--j-hairline);
    font-family: 'Kanit', sans-serif;
    font-weight: 500;
    font-size: clamp(15px, 1.4vw, 21px);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--j-text);
    transition: padding-left 0.4s, color 0.4s;
}

.j-dept-row:first-child { border-top: 1px solid var(--j-hairline-strong); }

.j-dept-row .j-label { flex-shrink: 0; }

.j-ch-2025 .j-panel {
    grid-column: 1 / span 6;
    grid-row: 3;
    border-top-color: rgba(0, 217, 232, 0.4);
}

/* ==========================================================================
   4. OUTRO — data index (restyled achievements, no cards)
   ========================================================================== */
.j-outro {
    position: relative;
    padding: 18vh 6vw 12vh;
    border-top: 1px solid var(--j-hairline);
}

.j-outro-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 48px;
}

.j-outro-title {
    font-family: 'Kanit', sans-serif;
    font-weight: 700;
    font-size: clamp(28px, 4vw, 56px);
    letter-spacing: -0.01em;
    text-transform: uppercase;
    margin: 0;
}

.j-index-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--j-hairline-strong);
}

.j-index-cell {
    padding: 30px 24px 34px 0;
    border-right: 1px solid var(--j-hairline);
    border-bottom: 1px solid var(--j-hairline-strong);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.j-index-cell:last-child { border-right: none; }

.j-index-number {
    font-family: 'Kanit', sans-serif;
    font-weight: 800;
    font-size: clamp(56px, 7vw, 110px);
    line-height: 0.9;
    letter-spacing: -0.02em;
    color: var(--j-text);
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   5. RESPONSIVE — mobile is its own composition, not a shrunken desktop
   ========================================================================== */
@media (max-width: 960px) {
    .j-intro { padding: 130px 7vw 100px; }
    .j-intro-meta-top { top: 96px; }
    .j-intro-title { font-size: clamp(56px, 17.5vw, 120px); }
    .j-intro-index { display: none; }

    /* stage becomes a vertical editorial flow — no pin */
    .j-stage { height: auto; overflow: visible; }

    .j-chapters { display: block; height: auto; }

    .j-chapter {
        position: relative;
        inset: auto;
        visibility: visible;
        opacity: 1;
        min-height: 92svh;
        padding: 90px 7vw 40px 17vw;
        border-bottom: 1px solid var(--j-hairline);
    }

    .j-chapter-inner {
        display: block;
        height: auto;
    }

    .j-year { font-size: clamp(96px, 24vw, 190px); }

    .j-panel {
        max-width: none;
        margin-top: 26px;
    }

    /* axis runs down the left edge */
    .j-axis { left: 8vw; }
    .j-axis-node { left: 8vw; }

    .j-bg::before { background-size: 24vw 24vw; }

    /* instrument collapses to a minimal top strip inside each chapter */
    .j-instrument { display: none; }

    .j-chapter-meta {
        position: absolute;
        top: 60px;
        left: 17vw;
        right: 7vw;
        display: flex;
        justify-content: space-between;
    }

    /* compositions simplify to a single column rhythm */
    .j-ch-2012 .j-media-mask,
    .j-ch-2022 .j-media-mask,
    .j-ch-2024 .j-media-mask {
        position: relative;
        inset: auto;
        width: 100%;
        height: 42vh;
        right: auto;
        left: auto;
        top: auto;
        bottom: auto;
        margin: 26px 0 8px;
        order: 3;
        clip-path: inset(0 0 0 0);
    }

    .j-ch-2019 .j-media-mask {
        position: absolute;
        inset: 0;
    }

    .j-ch-2019 .j-year { mix-blend-mode: normal; color: var(--j-text); }

    .j-year-ghost { display: none; }

    .j-index-grid { grid-template-columns: repeat(2, 1fr); }
    .j-index-cell:nth-child(2) { border-right: none; }
    .j-index-cell:nth-child(-n+2) { border-bottom: 1px solid var(--j-hairline-strong); }
}

/* very small phones */
@media (max-width: 520px) {
    .j-index-grid { grid-template-columns: 1fr; }
    .j-index-cell { border-right: none; }
}

/* ==========================================================================
   6. REDUCED MOTION — full content, zero scroll choreography
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .j-line-inner { transform: none; }

    .j-stage { height: auto; overflow: visible; }
    .j-chapters { display: block; height: auto; }

    .j-chapter {
        position: relative;
        inset: auto;
        visibility: visible;
        opacity: 1;
        min-height: 80vh;
        padding: 100px 8vw 60px;
        border-bottom: 1px solid var(--j-hairline);
    }

    .j-chapter-inner { display: block; height: auto; }
    .j-year { font-size: clamp(90px, 18vw, 200px); }
    .j-panel { max-width: none; margin-top: 24px; }
    .j-axis { display: none; }
    .j-axis-node { display: none; }
    .j-instrument { display: none; }
    .j-year-ghost { display: none; }
    .j-bg { display: none; }

    .j-ch-2012 .j-media-mask,
    .j-ch-2024 .j-media-mask {
        position: relative;
        inset: auto;
        width: 100%;
        height: 40vh;
        margin-top: 24px;
        clip-path: none;
    }
    .j-ch-2022 .j-media-mask {
        position: relative;
        left: auto;
        width: 100%;
        height: 40vh;
        margin-top: 24px;
        clip-path: none;
    }
    .j-ch-2019 .j-media-mask { position: absolute; inset: 0; }

    .j-axis-fill { transform: scaleY(1); }
}
