/* ============================================================
   Oscar Tomkins — CV site
   Dark, sleek, McLaren-inspired. No external requests.
   ============================================================ */

:root {
    --charcoal: #1a1a1e;
    --charcoal-deep: #17171b;
    --panel: #121215;
    --panel-raised: #202024;
    --papaya: #ff8000;
    --papaya-soft: #ff9a33;
    --papaya-glow: rgba(255, 128, 0, 0.14);
    --text: #ececef;
    --text-muted: #9a9aa2;
    --text-faint: #6b6b70;
    --hairline: rgba(255, 255, 255, 0.08);
    --hairline-strong: rgba(255, 255, 255, 0.14);

    --font-body: "Avenir Next", Avenir, "Helvetica Neue", "Segoe UI", Arial, sans-serif;
    --font-display: "Avenir Next Condensed", "Helvetica Neue", "Arial Narrow", Arial, sans-serif;
    --font-mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;

    --chamfer: 14px;
    --nav-h: 4rem;
    --pad-x: clamp(1.25rem, 5vw, 3rem);
    --section-max: 68rem;
}

/* ---------- reset / base ---------- */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 1rem);
}

body {
    background: linear-gradient(var(--charcoal), var(--charcoal-deep));
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

/* film grain — static texture, sits over everything, never intercepts input */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 90;
    pointer-events: none;
    opacity: 0.045;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--papaya-soft);
    text-decoration: none;
}

a:hover {
    color: var(--papaya);
}

ul,
ol {
    list-style: none;
}

::selection {
    background: var(--papaya);
    color: var(--charcoal);
}

:focus-visible {
    outline: 2px solid var(--papaya);
    outline-offset: 3px;
}

.mono {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    top: -3rem;
    left: 1rem;
    z-index: 100;
    background: var(--papaya);
    color: var(--charcoal);
    padding: 0.5rem 1rem;
    font-weight: 600;
}

.skip-link:focus {
    top: 0.5rem;
    color: var(--charcoal);
}

/* ---------- kerb stripe ---------- */

.kerb {
    height: 3px;
    background: repeating-linear-gradient(90deg,
            var(--papaya) 0 2.5rem,
            transparent 2.5rem 5rem);
    opacity: 0.85;
}

/* the header kerb quietly runs like track passing under the car */
.site-nav .kerb {
    animation: kerb-run 1.4s linear infinite;
}

@keyframes kerb-run {
    to {
        background-position: 5rem 0;
    }
}

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

.btn {
    position: relative;
    overflow: hidden;
    display: inline-block;
    font-weight: 600;
    font-size: 0.92rem;
    letter-spacing: 0.03em;
    padding: 0.7rem 1.5rem;
    border: 1px solid transparent;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-solid {
    background: var(--papaya);
    color: var(--charcoal);
}

.btn-solid:hover {
    background: var(--papaya-soft);
    color: var(--charcoal);
}

/* sheen sweep */
.btn-solid::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 40%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: translateX(-160%) skewX(-20deg);
    pointer-events: none;
}

.btn-solid:hover::after {
    transform: translateX(320%) skewX(-20deg);
    transition: transform 0.55s ease;
}

.btn-ghost {
    border-color: var(--hairline-strong);
    color: var(--text);
}

.btn-ghost:hover {
    border-color: var(--papaya);
    color: var(--papaya-soft);
}

.btn-lg {
    padding: 0.9rem 2.2rem;
    font-size: 1rem;
}

/* ---------- nav ---------- */

.site-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(18, 18, 21, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: box-shadow 0.3s ease;
}

.site-nav.is-scrolled {
    --nav-h: 3.3rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

.nav-inner {
    max-width: var(--section-max);
    margin: 0 auto;
    padding: 0 var(--pad-x);
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: height 0.3s ease;
}

.scroll-progress {
    height: 2px;
    background: linear-gradient(90deg, var(--papaya), var(--papaya-soft));
    transform-origin: left;
    transform: scaleX(0);
}

.monogram {
    display: flex;
    align-items: baseline;
    gap: 0.7rem;
    color: var(--text);
}

.monogram-mark {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.05em;
    color: var(--papaya);
}

.monogram-name {
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

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

.nav-links a:not(.btn) {
    color: var(--text-muted);
    font-size: 0.88rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.3rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-links a:not(.btn):hover,
.nav-links a.active {
    color: var(--text);
    border-bottom-color: var(--papaya);
}

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--hairline-strong);
    padding: 0.6rem 0.55rem;
    cursor: pointer;
}

.nav-toggle-bar {
    display: block;
    width: 1.3rem;
    height: 2px;
    background: var(--text);
    transition: transform 0.2s ease;
}

.nav-toggle-bar+.nav-toggle-bar {
    margin-top: 0.35rem;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:first-child {
    transform: translateY(0.27rem) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:last-child {
    transform: translateY(-0.27rem) rotate(-45deg);
}

/* ---------- hero ---------- */

.hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse 60% 55% at 18% 25%, rgba(255, 128, 0, 0.1), transparent 70%),
        radial-gradient(ellipse 50% 60% at 88% 85%, rgba(90, 130, 255, 0.05), transparent 70%),
        var(--panel);
    border-bottom: 1px solid var(--hairline);
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--hairline) 1px, transparent 1px),
        linear-gradient(90deg, var(--hairline) 1px, transparent 1px);
    background-size: 3.5rem 3.5rem;
    mask-image: radial-gradient(ellipse 90% 80% at 65% 40%, black 0%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 90% 80% at 65% 40%, black 0%, transparent 75%);
    opacity: 0.5;
}

.hero-inner {
    position: relative;
    max-width: var(--section-max);
    margin: 0 auto;
    padding: clamp(3.5rem, 9vw, 6.5rem) var(--pad-x);
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
}

.eyebrow {
    color: var(--papaya);
    margin-bottom: 1.2rem;
}

/* speed-line tick ahead of eyebrows and card tags */
.eyebrow::before,
.card-tag::before {
    content: "";
    display: inline-block;
    width: 1.3rem;
    height: 0.55em;
    margin-right: 0.55rem;
    background: repeating-linear-gradient(-55deg,
            var(--papaya) 0 2px,
            transparent 2px 6px);
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(3.4rem, 11vw, 7rem);
    line-height: 0.92;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-transform: uppercase;
}

.h1-outline {
    color: transparent;
    -webkit-text-stroke: 1.5px var(--text);
}

@supports not ((-webkit-text-stroke: 1px black) or (text-stroke: 1px black)) {
    .h1-outline {
        color: var(--text);
    }
}

.hero-role {
    margin-top: 1.1rem;
    font-size: clamp(1rem, 2.4vw, 1.25rem);
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--papaya);
}

.hero-hook {
    margin-top: 1.4rem;
    max-width: 34rem;
    font-size: 1.08rem;
    color: var(--text-muted);
}

.hero-ctas {
    margin-top: 2.2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.hero-portrait {
    justify-self: center;
    position: relative;
    max-width: 22rem;
    width: 100%;
}

.hero-portrait img {
    width: 100%;
    height: auto;
    border: 1px solid var(--hairline-strong);
    clip-path: polygon(0 0, calc(100% - var(--chamfer)) 0, 100% var(--chamfer), 100% 100%, 0 100%);
}

/* diagonal speed lines offset behind the portrait, fading in toward the corner */
.hero-portrait::before {
    content: "";
    position: absolute;
    inset: 1.1rem -1.1rem 1rem 1.1rem;
    background: repeating-linear-gradient(-55deg,
            var(--hairline-strong) 0 1px,
            transparent 1px 9px);
    mask-image: linear-gradient(135deg, transparent 30%, black 100%);
    -webkit-mask-image: linear-gradient(135deg, transparent 30%, black 100%);
    z-index: -1;
    pointer-events: none;
}

/* papaya corner brackets on the image itself */
.hero-portrait::after {
    content: "";
    position: absolute;
    inset: -0.55rem -0.55rem 1.5rem -0.55rem;
    background:
        linear-gradient(var(--papaya), var(--papaya)) left top / 1.5rem 2px,
        linear-gradient(var(--papaya), var(--papaya)) left top / 2px 1.5rem,
        linear-gradient(var(--papaya), var(--papaya)) right bottom / 1.5rem 2px,
        linear-gradient(var(--papaya), var(--papaya)) right bottom / 2px 1.5rem;
    background-repeat: no-repeat;
    pointer-events: none;
}

.hero-portrait figcaption {
    margin-top: 0.8rem;
    text-align: right;
}

/* ---------- speed strip (marquee) ---------- */

.speed-strip {
    position: relative;
    overflow: hidden;
    border-top: 1px solid var(--hairline);
}

.speed-strip-track {
    display: flex;
    white-space: nowrap;
    width: max-content;
    padding: 0.7rem 0;
    animation: strip-run 32s linear infinite;
}

@keyframes strip-run {
    to {
        transform: translateX(-50%);
    }
}

/* ---------- sections ---------- */

.section {
    border-bottom: 1px solid var(--hairline);
}

.section-alt {
    background: var(--panel);
}

.section-inner {
    max-width: var(--section-max);
    margin: 0 auto;
    padding: clamp(3rem, 7vw, 5rem) var(--pad-x);
}

.section-compact .section-inner {
    padding-top: clamp(2.2rem, 5vw, 3.5rem);
    padding-bottom: clamp(2.2rem, 5vw, 3.5rem);
}

.section-title {
    position: relative;
    z-index: 0;
    display: flex;
    align-items: baseline;
    gap: 1rem;
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin-bottom: clamp(1.8rem, 4vw, 2.8rem);
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--hairline);
}

/* oversized ghost numeral behind the title — timing-board aesthetic */
.section-title::after {
    content: attr(data-num);
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: -1;
    font-family: var(--font-display);
    font-size: clamp(3.2rem, 9vw, 5.5rem);
    font-weight: 800;
    line-height: 0.8;
    letter-spacing: 0.02em;
    color: transparent;
    -webkit-text-stroke: 1px var(--hairline-strong);
    pointer-events: none;
}

@supports not ((-webkit-text-stroke: 1px black) or (text-stroke: 1px black)) {
    .section-title::after {
        color: rgba(255, 255, 255, 0.05);
    }
}

.section-num {
    color: var(--papaya);
    font-size: 0.85rem;
}

.section-num::after {
    content: " /";
    color: var(--text-faint);
}

/* ---------- profile ---------- */

.profile-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.2rem;
}

.profile-lead {
    font-size: 1.15rem;
    line-height: 1.75;
    color: var(--text);
    max-width: 38rem;
}

.profile-pull {
    border-left: 3px solid var(--papaya);
    padding: 0.4rem 0 0.4rem 1.4rem;
    align-self: center;
}

.profile-pull p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-muted);
}

.profile-pull strong {
    color: var(--papaya);
    font-weight: 700;
}

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

.timeline {
    position: relative;
}

.timeline-entry {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
    padding: 0 0 2.4rem 1.6rem;
    border-left: 1px solid var(--hairline-strong);
}

.timeline-entry:last-child {
    padding-bottom: 0.4rem;
}

/* rotated-square marker — sharper than a dot */
.timeline-entry::before {
    content: "";
    position: absolute;
    left: -0.28rem;
    top: 0.42rem;
    width: 0.5rem;
    height: 0.5rem;
    background: var(--papaya);
    transform: rotate(45deg);
    transition: box-shadow 0.2s ease;
}

.timeline-entry:hover::before {
    box-shadow: 0 0 0 5px var(--papaya-glow);
}

/* papaya segment fading down the rule at each entry (mobile: rule is on the entry) */
.timeline-entry::after {
    content: "";
    position: absolute;
    left: -1px;
    top: 0.42rem;
    width: 1px;
    height: 2rem;
    background: linear-gradient(var(--papaya), transparent);
}

.entry-secondary::before {
    background: var(--panel-raised);
    border: 1px solid var(--papaya);
}

.entry-dates {
    color: var(--papaya-soft);
    transition: color 0.2s ease;
}

.timeline-entry:hover .entry-dates {
    color: var(--papaya);
}

.entry-body {
    position: relative;
}

.entry-body h3 {
    font-size: 1.12rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.entry-org {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.95rem;
    font-style: italic;
}

.entry-body ul li {
    position: relative;
    padding-left: 1.1rem;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
    font-size: 0.97rem;
}

.entry-body ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 0.45rem;
    height: 2px;
    background: var(--papaya);
}

.entry-secondary .entry-body h3 {
    font-size: 1.02rem;
}

.entry-secondary .entry-body ul li {
    font-size: 0.93rem;
    color: var(--text-faint);
}

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

.project-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.project-card {
    background: linear-gradient(160deg, #232328, var(--panel-raised));
    border: 1px solid var(--hairline);
    border-top: 3px solid var(--papaya);
    padding: 1.8rem 1.7rem;
    clip-path: polygon(0 0, calc(100% - var(--chamfer)) 0, 100% var(--chamfer), 100% 100%, 0 100%);
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

/* clip-path swallows outer shadows, so the hover glow is an inner wash */
.project-card:hover {
    border-color: var(--hairline-strong);
    border-top-color: var(--papaya-soft);
    transform: translateY(-3px);
    box-shadow: inset 0 0 60px rgba(255, 128, 0, 0.07);
}

.card-tag {
    color: var(--papaya);
    margin-bottom: 0.7rem;
    transition: letter-spacing 0.3s ease;
}

.project-card:hover .card-tag {
    letter-spacing: 0.14em;
}

.project-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.project-card ul li {
    position: relative;
    padding-left: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.97rem;
}

.project-card ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 0.45rem;
    height: 2px;
    background: var(--papaya);
}

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

.skills-grid {
    counter-reset: skill;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
}

.skills-grid li {
    counter-increment: skill;
    border: 1px solid var(--hairline-strong);
    padding: 0.85rem 3.2rem 0.85rem 2.1rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    position: relative;
    background-image: linear-gradient(90deg, var(--papaya-glow), transparent 65%);
    background-size: 0% 100%;
    background-repeat: no-repeat;
    transition: border-color 0.2s ease, color 0.2s ease, background-size 0.3s ease;
}

.skills-grid li::before {
    content: "";
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0.5rem;
    height: 2px;
    background: var(--papaya);
}

/* telemetry tag: S01…S08 */
.skills-grid li::after {
    content: "S" counter(skill, decimal-leading-zero);
    position: absolute;
    right: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    color: var(--text-faint);
    transition: color 0.2s ease;
}

.skills-grid li:hover {
    border-color: var(--papaya);
    color: var(--text);
    background-size: 100% 100%;
}

.skills-grid li:hover::after {
    color: var(--papaya);
}

/* ---------- education ---------- */

.education-block {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.2rem;
    background: var(--panel);
    border: 1px solid var(--hairline);
    padding: 1.8rem 1.7rem;
    clip-path: polygon(0 0, calc(100% - var(--chamfer)) 0, 100% var(--chamfer), 100% 100%, 0 100%);
}

.education-block h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.education-note {
    color: var(--text-muted);
    font-size: 0.97rem;
    align-self: center;
}

/* ---------- interests ---------- */

.interests-lead {
    color: var(--text-muted);
    max-width: 38rem;
    margin-bottom: 1.4rem;
}

.interests-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.interests-strip li {
    border: 1px solid var(--hairline-strong);
    padding: 0.45rem 1rem;
    color: var(--text-muted);
    background-image: linear-gradient(var(--papaya), var(--papaya));
    background-size: 0% 100%;
    background-repeat: no-repeat;
    background-position: left center;
    transition: background-size 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.interests-strip li:hover {
    background-size: 100% 100%;
    color: var(--charcoal);
    border-color: var(--papaya);
}

/* ---------- contact ---------- */

.section-contact {
    background: var(--panel);
}

.contact-lead {
    color: var(--text-muted);
    margin-bottom: 2.2rem;
    font-size: 1.05rem;
}

/* throttle-trace divider, drawn on reveal */
.telemetry {
    display: block;
    width: 100%;
    height: 3.2rem;
    margin-bottom: 2.4rem;
}

.telemetry path {
    stroke: var(--papaya);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    transition: stroke-dashoffset 1.8s ease 0.2s;
}

.is-visible .telemetry path {
    stroke-dashoffset: 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.2rem;
    margin-bottom: 2.6rem;
}

.contact-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    border: 1px solid var(--hairline);
    background: var(--panel-raised);
    padding: 1.3rem 1.4rem;
    color: var(--text);
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

a.contact-item:hover {
    border-color: var(--papaya);
    color: var(--text);
    transform: translateY(-2px);
    box-shadow: 0 14px 34px -18px rgba(255, 128, 0, 0.35);
}

.contact-label {
    color: var(--papaya);
}

.contact-value {
    font-size: 1.05rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

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

/* low-contrast carbon-fibre weave */
.site-footer {
    background-color: #141417;
    background-image:
        radial-gradient(rgba(255, 255, 255, 0.05) 15%, transparent 16%),
        radial-gradient(rgba(255, 255, 255, 0.035) 15%, transparent 16%);
    background-size: 9px 9px;
    background-position: 0 0, 4.5px 4.5px;
}

.footer-inner {
    max-width: var(--section-max);
    margin: 0 auto;
    padding: 1.6rem var(--pad-x);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.footer-inner a:hover {
    color: var(--papaya);
}

/* ---------- reveal animation ---------- */

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

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* staggered cascade for grid children inside a revealed container */
.reveal:not(.is-visible) :is(.skills-grid, .interests-strip, .contact-grid)>* {
    opacity: 0;
}

.reveal.is-visible :is(.skills-grid, .interests-strip, .contact-grid)>* {
    animation: rise 0.55s ease backwards;
}

.reveal.is-visible :is(.skills-grid, .interests-strip, .contact-grid)>*:nth-child(2) {
    animation-delay: 70ms;
}

.reveal.is-visible :is(.skills-grid, .interests-strip, .contact-grid)>*:nth-child(3) {
    animation-delay: 140ms;
}

.reveal.is-visible :is(.skills-grid, .interests-strip, .contact-grid)>*:nth-child(4) {
    animation-delay: 210ms;
}

.reveal.is-visible :is(.skills-grid, .interests-strip, .contact-grid)>*:nth-child(5) {
    animation-delay: 280ms;
}

.reveal.is-visible :is(.skills-grid, .interests-strip, .contact-grid)>*:nth-child(6) {
    animation-delay: 350ms;
}

.reveal.is-visible :is(.skills-grid, .interests-strip, .contact-grid)>*:nth-child(7) {
    animation-delay: 420ms;
}

.reveal.is-visible :is(.skills-grid, .interests-strip, .contact-grid)>*:nth-child(8) {
    animation-delay: 490ms;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(0.8rem);
    }
}

/* no-JS and reduced-motion: content always visible */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .reveal:not(.is-visible) :is(.skills-grid, .interests-strip, .contact-grid)>*,
    .reveal.is-visible :is(.skills-grid, .interests-strip, .contact-grid)>* {
        opacity: 1;
        animation: none;
    }

    .site-nav .kerb,
    .speed-strip-track {
        animation: none;
    }

    .btn-solid::after {
        display: none;
    }

    .telemetry path {
        stroke-dashoffset: 0;
        transition: none;
    }

    .nav-inner {
        transition: none;
    }

    .project-card,
    .project-card:hover,
    a.contact-item:hover {
        transform: none;
    }
}

/* ---------- breakpoints ---------- */

@media (min-width: 640px) {
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .timeline-entry {
        grid-template-columns: 9.5rem 1fr;
        gap: 1.6rem;
        padding-left: 0;
        border-left: none;
    }

    .entry-dates {
        text-align: right;
        padding-top: 0.2rem;
    }

    .timeline-entry .entry-body {
        border-left: 1px solid var(--hairline-strong);
        padding-left: 1.7rem;
        margin-left: 1.15rem;
    }

    /* marker sits centred on the entry-body border line */
    .timeline-entry::before {
        left: calc(9.5rem + 1.6rem + 1.15rem - 0.26rem);
    }

    /* papaya segment moves to the entry-body rule */
    .timeline-entry::after {
        display: none;
    }

    .timeline-entry .entry-body::before {
        content: "";
        position: absolute;
        left: -1px;
        top: 0.42rem;
        width: 1px;
        height: 2rem;
        background: linear-gradient(var(--papaya), transparent);
    }
}

@media (min-width: 820px) {
    .hero-inner {
        grid-template-columns: 1.25fr 0.75fr;
        gap: 4rem;
    }

    .hero-portrait {
        justify-self: end;
    }

    .profile-layout {
        grid-template-columns: 1.1fr 0.9fr;
        gap: 3.5rem;
    }

    .project-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .education-block {
        grid-template-columns: auto 1fr;
        gap: 3rem;
    }

    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* mobile nav */
@media (max-width: 719px) {
    .monogram-name {
        display: none;
    }

    .nav-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: var(--nav-h);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--panel);
        border-bottom: 1px solid var(--hairline-strong);
        padding: 0.5rem 0 1rem;
    }

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

    .nav-links li a:not(.btn) {
        display: block;
        padding: 0.85rem var(--pad-x);
        border-bottom: none;
    }

    .nav-cta {
        padding: 0.8rem var(--pad-x) 0;
    }

    .nav-cta .btn {
        display: block;
        text-align: center;
    }
}
