/* ============================================================
   Nitya Jhaveri — portfolio
   The page is one lap. Chart-paper base, ink type, papaya car.
   ============================================================ */

:root {
    --paper: #F7F6F0;
    --paper-deep: #EFEDE4;
    --ink: #16191E;
    --ink-soft: #3A4048;
    --muted: #6A7280;
    --grid: #E3E1D6;
    --line: #D8D5C8;
    --papaya: #F25912;
    --papaya-soft: #FCE4D6;

    --rg-foundation: #8A93A3;
    --rg-data: #2E8F77;
    --rg-build: #D99A1B;
    --rg-analyst: #F25912;
    --rg-launch: #4E64D9;

    --display: 'Archivo', sans-serif;
    --body: 'Instrument Sans', sans-serif;
    --mono: 'IBM Plex Mono', monospace;

    --maxw: 1060px;
    --radius: 10px;
    --shadow: 0 10px 30px rgba(22, 25, 30, 0.08);
    --rail-w: 110px; /* desktop racing-line gutter */
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--body);
    background-color: var(--paper);
    background-image:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 56px 56px;
    color: var(--ink);
    line-height: 1.65;
    font-size: 16.5px;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 1.5rem;
}

a { color: var(--ink); text-decoration: none; }
img { max-width: 100%; height: auto; }
button { font-family: inherit; cursor: pointer; }

::selection { background: var(--papaya); color: #fff; }
.paddock ::selection, .paddock::selection { background: var(--paper); color: var(--ink); }

/* ============================================================
   The racing line — desktop left rail + compact top track
   ============================================================ */

.track-rail {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--rail-w);
    height: 100vh;
    z-index: 50;
    pointer-events: none;
    display: none; /* JS + media query enable */
}

.track-rail svg { width: 100%; height: 100%; display: block; }

.track-top {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    height: 34px;
    z-index: 90;
    pointer-events: none;
    display: none;
}

.track-top svg { width: 100%; height: 100%; display: block; }

@media (min-width: 1340px) {
    .track-rail { display: block; }
}

@media (max-width: 1339.98px) {
    .track-top { display: block; }
    main { padding-top: 34px; }
}

/* track drawing */
.track-asphalt {
    fill: none;
    stroke: var(--ink);
    stroke-opacity: 0.08;
    stroke-width: 26;
    stroke-linecap: round;
}

.track-center {
    fill: none;
    stroke: var(--ink);
    stroke-opacity: 0.35;
    stroke-width: 1.5;
    stroke-dasharray: 7 9;
}

.track-turn-dot { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.track-turn-dot.passed { fill: var(--papaya); stroke: var(--papaya); }

.track-turn-label {
    font-family: var(--mono);
    font-size: 10px;
    fill: var(--muted);
}

.track-finish { opacity: 0.9; }

/* the car */
.car .tyre { fill: var(--ink); rx: 1.5; }
.car .body { fill: var(--papaya); }
.car .wing { fill: var(--ink); }
.car .cockpit { fill: var(--ink); }
.car { filter: drop-shadow(0 2px 3px rgba(22,25,30,0.35)); }

/* ---------- shared text styles ---------- */

.turn {
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1rem;
}

.turn--center { justify-content: center; }

.turn-num { color: var(--papaya); font-weight: 600; }

.turn-num::before {
    content: "";
    display: inline-block;
    width: 22px;
    height: 2px;
    background: var(--papaya);
    vertical-align: middle;
    margin-right: 0.6rem;
}

.section-title {
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(1.9rem, 4vw, 2.7rem);
    letter-spacing: -0.025em;
    line-height: 1.12;
    margin-bottom: 0.9rem;
}

.section-sub { color: var(--muted); max-width: 620px; margin-bottom: 2.4rem; }

.section { padding: 5.5rem 0; }
.section--ruled { border-top: 1px solid var(--line); }

/* ---------- buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.8rem 1.45rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.97rem;
    border: 1.5px solid var(--ink);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.btn-primary { background: var(--ink); color: var(--paper); }

.btn-primary:hover {
    background: var(--papaya);
    border-color: var(--papaya);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(242, 89, 18, 0.28);
}

.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); transform: translateY(-2px); }

.link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: none;
    border: none;
    font-family: var(--mono);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ink);
    padding: 0.2rem 0;
    border-bottom: 1.5px solid var(--papaya);
    transition: color 0.15s ease, gap 0.15s ease;
}

.link-btn:hover { color: var(--papaya); gap: 0.7rem; }

/* ---------- navigation ---------- */

.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(247, 246, 240, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.nav-brand {
    font-family: var(--display);
    font-weight: 900;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-tick {
    width: 10px;
    height: 10px;
    background: var(--papaya);
    display: inline-block;
    transform: skewX(-12deg);
}

.brand-no {
    font-family: var(--mono);
    font-weight: 500;
    font-size: 0.72rem;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0.06rem 0.4rem;
}

.nav-links { display: flex; align-items: center; gap: 1.7rem; }

.nav-link {
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--ink-soft);
    letter-spacing: 0.02em;
    position: relative;
    transition: color 0.15s ease;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0; bottom: -4px;
    width: 0; height: 2px;
    background: var(--papaya);
    transition: width 0.2s ease;
}

.nav-link:hover { color: var(--ink); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

.nav-link--cta {
    border: 1.5px solid var(--ink);
    border-radius: 8px;
    padding: 0.42rem 0.9rem;
    color: var(--ink);
}

.nav-link--cta::after { display: none; }
.nav-link--cta:hover { background: var(--ink); color: var(--paper); }

.nav-toggle {
    display: none;
    background: none;
    border: none;
    width: 40px; height: 40px;
    position: relative;
}

.nav-toggle span {
    position: absolute;
    left: 8px; right: 8px;
    height: 2px;
    background: var(--ink);
    transition: transform 0.2s ease, top 0.2s ease;
}

.nav-toggle span:nth-child(1) { top: 15px; }
.nav-toggle span:nth-child(2) { top: 23px; }
.nav.menu-open .nav-toggle span:nth-child(1) { top: 19px; transform: rotate(45deg); }
.nav.menu-open .nav-toggle span:nth-child(2) { top: 19px; transform: rotate(-45deg); }

/* ============================================================
   Hero — lights out
   ============================================================ */

.hero { padding: 4.5rem 0 4rem; }

.start-lights {
    display: flex;
    gap: 0.7rem;
    margin-bottom: 0.9rem;
}

.start-light {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--paper-deep);
    border: 1.5px solid var(--line);
    transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.start-light.on {
    background: #E0312E;
    border-color: #B3201E;
    box-shadow: 0 0 14px rgba(224, 49, 46, 0.55);
}

.hero-eyebrow {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 2.2rem;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.hero.go .hero-eyebrow { opacity: 1; }

.hero-grid {
    display: grid;
    grid-template-columns: 1.55fr 1fr;
    gap: 3.5rem;
    align-items: start;
}

.hero-title {
    font-family: var(--display);
    font-weight: 900;
    font-size: clamp(3rem, 8.5vw, 5.6rem);
    line-height: 0.96;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    margin-bottom: 1.1rem;
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.hero.go .hero-title { opacity: 1; transform: translateY(0); }

.hero-role {
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(1.15rem, 2.5vw, 1.5rem);
    letter-spacing: -0.015em;
    margin-bottom: 1.1rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.55s ease 0.12s, transform 0.55s cubic-bezier(0.2, 0.9, 0.3, 1) 0.12s;
}

.hero.go .hero-role { opacity: 1; transform: translateY(0); }

.accent-underline { position: relative; z-index: 0; white-space: nowrap; }

.accent-underline::after {
    content: "";
    position: absolute;
    left: 0; right: 0;
    bottom: 0.06em;
    height: 0.18em;
    background: var(--papaya);
    z-index: -1;
    transform: skewX(-12deg);
}

.hero-sub {
    max-width: 560px;
    color: var(--ink-soft);
    font-size: 1.05rem;
    margin-bottom: 1.9rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.55s ease 0.24s, transform 0.55s cubic-bezier(0.2, 0.9, 0.3, 1) 0.24s;
}

.hero.go .hero-sub { opacity: 1; transform: translateY(0); }

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.55s ease 0.36s, transform 0.55s cubic-bezier(0.2, 0.9, 0.3, 1) 0.36s;
}

.hero.go .hero-actions { opacity: 1; transform: translateY(0); }

/* driver card */
.driver-card {
    background: #fff;
    border: 1.5px solid var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.55s ease 0.45s, transform 0.55s cubic-bezier(0.2, 0.9, 0.3, 1) 0.45s;
}

.hero.go .driver-card { opacity: 1; transform: translateY(0); }

.dc-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.2rem;
    background: var(--ink);
    color: var(--paper);
}

.dc-no {
    font-family: var(--display);
    font-weight: 900;
    font-size: 2.1rem;
    line-height: 1;
    color: var(--papaya);
    letter-spacing: -0.03em;
}

.dc-flag {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: rgba(247, 246, 240, 0.75);
}

.dc-rows { padding: 0.4rem 0; }

.dc-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.55rem 1.2rem;
    border-bottom: 1px solid var(--grid);
}

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

.dc-row span {
    font-family: var(--mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
    white-space: nowrap;
}

.dc-row strong {
    font-family: var(--mono);
    font-size: 0.76rem;
    font-weight: 600;
    text-align: right;
}

.dc-row--hot strong { color: var(--papaya); }

.dc-note {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--muted);
    padding: 0.7rem 1.2rem 0.9rem;
    border-top: 1px dashed var(--line);
}

.hero-hint {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 3rem;
    opacity: 0;
    transition: opacity 0.6s ease 0.7s;
}

.hero.go .hero-hint { opacity: 1; }

.hero-hint i { color: var(--papaya); margin-left: 0.4rem; animation: bob 1.6s ease infinite; display: inline-block; }

@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}

/* ---------- regime timeline ---------- */

.regime-band {
    display: flex;
    width: 100%;
    border: 1.5px solid var(--ink);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 2.6rem 0 1.4rem;
    background: #fff;
}

.regime {
    flex: 1;
    border: none;
    background: transparent;
    padding: 1rem 0.6rem 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    position: relative;
    transition: background 0.15s ease;
    border-left: 1px solid var(--line);
}

.regime:first-child { border-left: none; }

.regime::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 7px;
    background: var(--rg, var(--muted));
    transition: height 0.18s ease;
}

.r-foundation { --rg: var(--rg-foundation); }
.r-data { --rg: var(--rg-data); }
.r-build { --rg: var(--rg-build); }
.r-analyst { --rg: var(--rg-analyst); }
.r-launch { --rg: var(--rg-launch); }

.r-launch::before {
    background: repeating-linear-gradient(-45deg, var(--rg-launch) 0 8px, transparent 8px 14px);
}

.regime:hover { background: var(--paper-deep); }
.regime.is-active::before { height: 12px; }
.regime.is-active { background: var(--paper-deep); }

.regime-years {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--muted);
    margin-top: 0.5rem;
}

.regime-name {
    font-family: var(--display);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.regime-detail {
    background: #fff;
    border: 1px solid var(--line);
    border-left: 4px solid var(--rg-active, var(--papaya));
    border-radius: var(--radius);
    padding: 1.4rem 1.6rem;
    box-shadow: var(--shadow);
    min-height: 120px;
    transition: border-color 0.2s ease;
}

.regime-detail h3 {
    font-family: var(--display);
    font-weight: 800;
    font-size: 1.15rem;
    margin-bottom: 0.4rem;
    letter-spacing: -0.015em;
}

.regime-detail .rd-prob {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--muted);
    display: block;
    margin-bottom: 0.6rem;
}

.regime-detail p { color: var(--ink-soft); margin: 0; }

.regime-footnote {
    font-family: var(--mono);
    font-size: 0.74rem;
    color: var(--muted);
    margin-top: 0.9rem;
}

/* ---------- about ---------- */

.about-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 3rem;
    align-items: start;
}

.about-text p { margin-bottom: 1.2rem; color: var(--ink-soft); font-size: 1.05rem; }
.about-text em { color: var(--ink); font-style: italic; }

.about-facts { display: grid; gap: 1rem; }

.fact {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
    display: grid;
    gap: 0.25rem;
}

.fact-label {
    font-family: var(--mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--papaya);
    font-weight: 600;
}

.fact-value { font-size: 0.95rem; color: var(--ink-soft); }

/* ---------- experience ---------- */

.xp-list { display: grid; gap: 0; border-top: 1px solid var(--line); }

.xp {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 2rem;
    padding: 1.9rem 0.4rem;
    border-bottom: 1px solid var(--line);
    transition: background 0.15s ease;
}

.xp:hover { background: rgba(255, 255, 255, 0.7); }

.xp-dates {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--muted);
    padding-top: 0.35rem;
    display: block;
}

.xp-role {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.18rem;
    letter-spacing: -0.015em;
    margin-bottom: 0.1rem;
}

.xp-org {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--papaya);
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.xp-desc { color: var(--ink-soft); margin-bottom: 0.8rem; max-width: 680px; }

/* ---------- projects ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 2.2rem; }

.filter {
    font-family: var(--mono);
    font-size: 0.8rem;
    padding: 0.45rem 1rem;
    border: 1.5px solid var(--line);
    border-radius: 50px;
    background: transparent;
    color: var(--ink-soft);
    transition: all 0.15s ease;
}

.filter:hover { border-color: var(--ink); color: var(--ink); }
.filter.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.4rem;
}

.project {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.6rem 1.7rem 1.4rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.project:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: var(--ink);
}

.project-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.9rem;
}

.project-id {
    font-family: var(--mono);
    font-size: 0.74rem;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0.12rem 0.5rem;
}

.project-tagline {
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 600;
    color: #fff;
    background: var(--papaya);
    border-radius: 4px;
    padding: 0.14rem 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.project-title {
    font-family: var(--display);
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.018em;
    margin-bottom: 0.35rem;
}

.project-q {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--papaya);
    margin-bottom: 0.65rem;
}

.project-q::before { content: "q: "; color: var(--muted); }

.project-desc {
    color: var(--ink-soft);
    font-size: 0.96rem;
    margin-bottom: 1.1rem;
    flex-grow: 1;
}

.project-tags { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 1.1rem; }

.project-tags span {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--ink-soft);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0.15rem 0.5rem;
}

.project-links { display: flex; gap: 1.4rem; }

/* ---------- skills ---------- */

.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.3rem;
}

.skill-group {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
}

.skill-group-title {
    font-family: var(--mono);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--line);
}

.pills { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.pill {
    font-size: 0.84rem;
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
    border: 1px solid var(--line);
    color: var(--ink-soft);
    background: var(--paper);
    transition: all 0.15s ease;
}

.pill:hover { border-color: var(--ink); color: var(--ink); transform: translateY(-2px); }

.pill--hot {
    background: var(--papaya-soft);
    border-color: rgba(242, 89, 18, 0.45);
    color: #B0420C;
    font-weight: 600;
}

/* ---------- achievements ---------- */

.ach-list { border-top: 1px solid var(--line); }
.ach { border-bottom: 1px solid var(--line); }

.ach summary {
    list-style: none;
    display: grid;
    grid-template-columns: 90px 1fr auto;
    align-items: center;
    gap: 1.5rem;
    padding: 1.3rem 0.4rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.ach summary::-webkit-details-marker { display: none; }
.ach summary:hover { background: rgba(255, 255, 255, 0.7); }

.ach-year { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }

.ach-title {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}

.ach-chev { color: var(--muted); font-size: 0.8rem; transition: transform 0.2s ease; }
.ach[open] .ach-chev { transform: rotate(180deg); color: var(--papaya); }

.ach-body {
    padding: 0 0.4rem 1.4rem calc(90px + 1.9rem);
    color: var(--ink-soft);
    max-width: 800px;
}

.certs {
    margin-top: 2.6rem;
    display: grid;
    grid-template-columns: auto repeat(4, 1fr);
    align-items: stretch;
    gap: 0.7rem;
}

.certs-label {
    font-family: var(--mono);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--paper);
    background: var(--papaya);
    border-radius: 6px;
    padding: 0.5rem 0.8rem;
    display: flex;
    align-items: center;
    font-weight: 600;
}

.cert {
    font-family: var(--mono);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--paper);
    background: var(--ink);
    border: 1.5px solid var(--ink);
    border-radius: 6px;
    padding: 0.5rem 0.8rem;
    display: flex;
    align-items: center;
    line-height: 1.45;
    transition: transform 0.15s ease, background 0.15s ease;
}

.cert::before {
    content: "✓";
    color: var(--papaya);
    font-weight: 700;
    margin-right: 0.55rem;
}

.cert:hover { transform: translateY(-2px); background: #232830; }

@media (max-width: 900px) {
    .certs { grid-template-columns: 1fr 1fr; }
    .certs-label { grid-column: 1 / -1; justify-content: center; }
}

@media (max-width: 560px) {
    .certs { grid-template-columns: 1fr; }
}

/* ---------- kerb + paddock ---------- */

.kerb {
    height: 10px;
    background: repeating-linear-gradient(-45deg, var(--papaya) 0 22px, var(--paper) 22px 44px);
    border-top: 1px solid var(--line);
}

.paddock {
    background: var(--ink);
    background-image:
        linear-gradient(rgba(247, 246, 240, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(247, 246, 240, 0.05) 1px, transparent 1px);
    background-size: 56px 56px;
    color: var(--paper);
    padding: 4rem 0;
}

.paddock .turn { color: rgba(247, 246, 240, 0.6); }

.paddock-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.8rem 3rem;
    margin-top: 1.5rem;
}

.paddock-item { display: grid; gap: 0.3rem; }

.paddock-key { font-family: var(--mono); font-size: 0.76rem; color: var(--papaya); }
.paddock-key::before { content: "» "; }

.paddock-val {
    font-size: 1rem;
    color: rgba(247, 246, 240, 0.85);
    line-height: 1.5;
}

/* ---------- contact / finish line ---------- */

.contact { padding: 6.5rem 0 5rem; text-align: center; }

.contact-title {
    font-family: var(--display);
    font-weight: 900;
    font-size: clamp(2.4rem, 6vw, 3.8rem);
    letter-spacing: -0.03em;
    margin-bottom: 0.9rem;
}

.contact-sub { color: var(--muted); max-width: 560px; margin: 0 auto 2.2rem; }

.contact-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.9rem;
}

/* checkered finish line */
.contact-finish {
    margin: 3.5rem auto 0;
    max-width: 420px;
    height: 22px;
    background:
        repeating-conic-gradient(var(--ink) 0% 25%, var(--paper) 0% 50%) 0 0 / 22px 22px;
    border: 1.5px solid var(--ink);
    border-radius: 4px;
}

/* ---------- footer ---------- */

.footer { border-top: 1px solid var(--line); padding: 1.6rem 0; }

.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }

.footer-mono { font-family: var(--mono); font-size: 0.74rem; color: var(--muted); }

/* ---------- modal ---------- */

.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}

.modal.active { visibility: visible; opacity: 1; transition: opacity 0.2s ease; }

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(22, 25, 30, 0.45);
    backdrop-filter: blur(3px);
}

.modal-box {
    position: relative;
    background: var(--paper);
    border: 1.5px solid var(--ink);
    border-radius: var(--radius);
    width: min(92%, 760px);
    max-height: 86vh;
    overflow-y: auto;
    box-shadow: 0 30px 70px rgba(22, 25, 30, 0.3);
    transform: translateY(14px) scale(0.985);
    transition: transform 0.2s ease;
}

.modal.active .modal-box { transform: translateY(0) scale(1); }

.modal-head {
    position: sticky;
    top: 0;
    background: var(--paper);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 1.6rem;
    border-bottom: 1px solid var(--line);
}

.modal-title {
    font-family: var(--display);
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.015em;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.7rem;
    line-height: 1;
    color: var(--muted);
    transition: color 0.15s ease;
}

.modal-close:hover { color: var(--papaya); }

.modal-body { padding: 1.5rem 1.6rem 1.8rem; }

.modal-body h4 {
    font-family: var(--mono);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--papaya);
    margin: 1.4rem 0 0.55rem;
}

.modal-body h4:first-child { margin-top: 0; }
.modal-body p { color: var(--ink-soft); margin-bottom: 0.6rem; }
.modal-body ul { list-style: none; }

.modal-body li {
    position: relative;
    padding-left: 1.2rem;
    margin-bottom: 0.45rem;
    color: var(--ink-soft);
}

.modal-body li::before { content: "▸"; position: absolute; left: 0; color: var(--papaya); }

.modal-body img {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 0.4rem 0 0.2rem;
    background: #fff;
}

.modal-body .img-caption {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--muted);
    margin-bottom: 0.8rem;
}

.modal-tags { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 1.1rem; }

.modal-tags span {
    font-family: var(--mono);
    font-size: 0.72rem;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 4px;
    padding: 0.15rem 0.5rem;
    color: var(--ink-soft);
}

.modal-gh { margin-bottom: 1.2rem; display: inline-flex; }

body.modal-open { overflow: hidden; }

/* ---------- reveal on scroll ---------- */

.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- focus / a11y ---------- */

a:focus-visible, button:focus-visible, summary:focus-visible {
    outline: 2.5px solid var(--papaya);
    outline-offset: 3px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .hero .hero-eyebrow, .hero .hero-title, .hero .hero-role,
    .hero .hero-sub, .hero .hero-actions, .hero .driver-card, .hero .hero-hint {
        opacity: 1; transform: none; transition: none;
    }
    .track-rail, .track-top { display: none !important; }
    main { padding-top: 0 !important; }
    * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1000px) {
    .hero-grid { grid-template-columns: 1fr; gap: 2.4rem; }
    .driver-card { max-width: 460px; }
}

@media (max-width: 900px) {
    .projects-grid { grid-template-columns: 1fr; }
    .skills-grid { grid-template-columns: repeat(2, 1fr); }
    .about-grid { grid-template-columns: 1fr; gap: 2.2rem; }
    .paddock-row { grid-template-columns: 1fr; gap: 1.4rem; }
}

@media (max-width: 700px) {
    body { background-size: 42px 42px; font-size: 16px; }

    .section { padding: 4rem 0; }
    .hero { padding: 3rem 0 3rem; }

    .start-light { width: 20px; height: 20px; }

    .nav-toggle { display: block; }

    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0; right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--paper);
        border-bottom: 1.5px solid var(--ink);
        padding: 0.6rem 1.5rem 1.2rem;
    }

    .nav.menu-open .nav-links { display: flex; }

    .nav-link {
        padding: 0.85rem 0;
        border-bottom: 1px solid var(--line);
        font-size: 0.92rem;
    }

    .nav-link::after { display: none; }

    .nav-link--cta {
        border: none;
        padding: 0.85rem 0;
        border-bottom: none;
        color: var(--papaya);
        font-weight: 600;
    }

    .nav-link--cta:hover { background: none; color: var(--papaya); }

    .regime-band { flex-direction: column; }

    .regime {
        flex-direction: row;
        justify-content: flex-start;
        gap: 1rem;
        padding: 0.95rem 1rem 0.95rem 1.3rem;
        border-left: none;
        border-top: 1px solid var(--line);
    }

    .regime:first-child { border-top: none; }

    .regime::before {
        top: 0; bottom: 0; left: 0;
        right: auto;
        width: 7px;
        height: auto;
    }

    .regime.is-active::before { height: auto; width: 12px; }
    .regime-years { margin-top: 0; min-width: 64px; text-align: left; }

    .xp { grid-template-columns: 1fr; gap: 0.4rem; padding: 1.5rem 0.2rem; }
    .xp-dates { padding-top: 0; }

    .skills-grid { grid-template-columns: 1fr; }

    .ach summary { grid-template-columns: 1fr auto; gap: 0.8rem; }
    .ach-year { grid-column: 1 / -1; margin-bottom: -0.5rem; }
    .ach-body { padding-left: 0.4rem; }

    .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
    .contact-actions .btn { width: 100%; justify-content: center; }
}
