/* ==========================================================================
   marvincerdas.dev — public site
   ==========================================================================
   Dark by default. The theme lives on <html data-theme="...">, written by the
   inline script in the head before first paint and toggled from the nav, so
   there is no flash of the wrong theme and no theme at all is needed from JS.

   Every colour is a token declared in :root first, then overridden for the
   light theme, so no component rule ever hard-codes a colour that only works
   in one of the two.
   ========================================================================== */

/* ==================== Fonts ====================
   IBM Plex, self-hosted, latin subset only — it covers English plus every
   accented character Spanish needs, so latin-ext would be dead weight. */

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/ibm-plex-sans-400.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/fonts/ibm-plex-sans-600.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/ibm-plex-sans-700.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/ibm-plex-mono-400.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/fonts/ibm-plex-mono-500.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==================== Tokens ==================== */

:root {
    /* Dark — the site's default world. */
    --ink: #000000;
    --paper: #080b10;
    --line: #1b2433;
    --text: #eaf0f8;
    --dim: #94a7be;
    --accent: #4da3ff;
    --accent2: #7cc4ff;
    --on-accent: #00060d;
    --glow: rgba(77, 163, 255, .16);
    --grid: rgba(124, 196, 255, .055);

    --t-xs: .8125rem;
    --t-base: 1rem;
    --t-md: 1.125rem;
    --t-lg: 1.375rem;
    --t-xl: 1.75rem;
    --t-2xl: 2.25rem;

    --nav-h: 60px;
    --gut: 1.25rem;
    --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
}

[data-theme="light"] {
    --ink: #f6f8fb;
    --paper: #ffffff;
    --line: #d5dee9;
    --text: #0a1220;
    --dim: #4a5a70;
    --accent: #1d4ed8;
    --accent2: #1239a8;
    --on-accent: #ffffff;
    --glow: rgba(29, 78, 216, .10);
    --grid: rgba(29, 78, 216, .07);
}

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

body {
    margin: 0;
    background: var(--ink);
    color: var(--text);
    font-family: var(--sans);
    font-size: var(--t-base);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: clip;
}

a { color: var(--accent); }

img { max-width: 100%; }

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

/* A drafting grid under everything, with one diffuse glow over it. Both are
   fixed, so the page slides across the grid instead of dragging it along. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 2rem 2rem,
        linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 2rem 2rem,
        radial-gradient(70rem 48rem at 18% 18%, var(--glow), transparent 72%);
}

.container {
    width: 100%;
    max-width: 76rem;
    margin-inline: auto;
    padding-inline: var(--gut);
}

.section {
    padding-block: clamp(3.5rem, 11vw, 7rem);
    /* Every in-page jump lands below the fixed bar instead of under it. */
    scroll-margin-top: calc(var(--nav-h) + 1rem);
}

.section-title {
    margin: 0 0 clamp(2rem, 5vw, 3rem);
    font-size: clamp(1.75rem, 7vw, 2.75rem);
    font-weight: 600;
    letter-spacing: -.02em;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
    text-wrap: balance;
}

/* Running prose is justified so both edges line up. Hyphenation comes with
   it: without it, justifying a narrow column (a project card, or anything at
   phone width) stretches the word spaces into rivers. */
.hero-description,
.about-text p,
.timeline-content > p,
.project-content > p,
.contact-info > p {
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
}

/* ==================== Navigation ==================== */

.navbar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 60;
    height: var(--nav-h);
    background: color-mix(in srgb, var(--ink) 82%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

.navbar .container {
    height: 100%;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.nav-brand a {
    display: inline-flex;
    align-items: center;
    /* Flex items swallow the whitespace between the name and the surname
       span, so the word space has to be put back as a gap. */
    gap: .3em;
    min-height: 44px;
    font-weight: 600;
    font-size: var(--t-base);
    letter-spacing: -.01em;
    text-decoration: none;
    color: var(--text);
    white-space: nowrap;
}
.nav-brand .brand-last { color: var(--accent); }

.nav-menu {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-toggle,
.theme-toggle {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    font-size: var(--t-base);
    cursor: pointer;
    flex: none;
}

/* One auto margin, on the brand, pushes every other control to the right —
   two competing auto margins would split the free space between them and
   strand the theme button in the middle of the bar. */
.nav-brand { margin-right: auto; }

/* The menu panel, used below the desktop breakpoint. */
.nav-menu.active {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    z-index: 70;
    padding: 1rem var(--gut) 1.5rem;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.nav-menu.active .nav-link,
.nav-menu.active .nav-resume {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: .6rem;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--line);
}

.nav-menu.active .nav-social {
    display: flex;
    gap: .5rem;
    margin-top: 1rem;
}

.nav-menu.active .nav-social a {
    min-width: 44px;
    min-height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
}

/* ==================== Rail and corner actions ==================== */

/* Both stay out of the way until the reader is past the second section. */
.social-rail,
.corner-actions {
    opacity: 0;
    visibility: hidden;
    transition: opacity .35s ease, visibility .35s ease;
}
.social-rail.is-visible,
.corner-actions.is-visible { opacity: 1; visibility: visible; }

.social-rail { display: none; }

.corner-actions {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 55;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .6rem;
}

.scroll-top-btn {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper);
    color: var(--text);
    font-size: var(--t-base);
    cursor: pointer;
}

.cv-corner {
    display: none;
    align-items: center;
    gap: .5rem;
    min-height: 48px;
    padding-inline: 1.1rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper);
    color: var(--text);
    font-size: var(--t-xs);
    font-weight: 600;
    text-decoration: none;
}
.cv-corner i { color: var(--accent); }

/* ==================== Hero ==================== */

.hero {
    padding-top: calc(var(--nav-h) + clamp(3rem, 10vw, 6rem));
    padding-bottom: clamp(3rem, 10vw, 6rem);
    scroll-margin-top: calc(var(--nav-h) + 1rem);
}

/* The greeting is part of the sentence the name finishes, so it is set to be
   read, not to be a caption. */
.hero-greeting {
    margin: 0 0 1rem;
    font-size: clamp(1.0625rem, 3.4vw, 1.375rem);
    color: var(--text);
    letter-spacing: -.01em;
}

.hero-name {
    margin: 0;
    font-size: clamp(2.75rem, 14vw, 7rem);
    line-height: .95;
    font-weight: 700;
    letter-spacing: -.04em;
    text-wrap: balance;
}
.hero-name .name-last { color: var(--accent); }

.hero-title {
    margin: 1.25rem 0 0;
    font-size: clamp(1.125rem, 4.5vw, var(--t-xl));
    font-weight: 400;
    color: var(--dim);
    line-height: 1.25;
    letter-spacing: -.01em;
    max-width: 30ch;
}

.hero-description {
    margin: 2rem 0 0;
    max-width: 58ch;
    color: var(--dim);
    font-size: var(--t-md);
    line-height: 1.75;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 2rem;
}

.btn {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding-inline: 1.25rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    font-family: var(--sans);
    font-size: var(--t-base);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}

.hero-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1rem;
    margin-top: 2rem;
    color: var(--dim);
}

.hero-status .is-open {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    color: var(--text);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
    flex: none;
}

.social-links {
    display: flex;
    gap: .5rem;
    margin-top: 1.75rem;
}

.social-links a {
    min-width: 44px;
    min-height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    font-size: var(--t-md);
    text-decoration: none;
}
.social-links a:hover { color: var(--accent); border-color: var(--accent); }

/* ==================== About ==================== */

.about-content { display: grid; gap: clamp(2rem, 5vw, 3rem); }
.about-content > * { min-width: 0; }

.about-text { max-width: 62ch; font-size: var(--t-md); line-height: 1.75; }
.about-text p { margin: 0 0 1rem; }
.about-text strong { color: var(--text); font-weight: 600; }

.about-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem 2.5rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
}

.stat h3 {
    margin: 0;
    font-size: var(--t-2xl);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
}

.stat p {
    margin: .4rem 0 0;
    font-size: var(--t-xs);
    color: var(--dim);
}

/* The three code-snippet fields, as a specification list. */
.about-spec { border-top: 1px solid var(--line); }

.spec-row {
    display: grid;
    gap: .25rem;
    padding-block: 1rem;
    border-bottom: 1px solid var(--line);
}

.spec-key { color: var(--accent); }
.spec-value { display: flex; flex-wrap: wrap; gap: .4rem; color: var(--dim); }
.spec-value span:not(:last-child)::after { content: ","; }

/* ==================== Experience ==================== */

.timeline-item {
    display: grid;
    gap: .5rem;
    padding-block: 2.25rem;
    border-top: 1px solid var(--line);
}

.timeline-date {
    font-size: var(--t-lg);
    font-weight: 600;
    color: var(--text);
    letter-spacing: -.01em;
    font-variant-numeric: tabular-nums;
}

.timeline-content h3 {
    margin: 0;
    font-size: var(--t-lg);
    font-weight: 600;
    letter-spacing: -.01em;
}

.timeline-content h4 {
    margin: .15rem 0 0;
    font-size: var(--t-base);
    font-weight: 400;
    color: var(--dim);
}

.timeline-content > p {
    margin: .75rem 0 0;
    color: var(--dim);
    max-width: 68ch;
}

.experience-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin: .75rem 0 0;
    padding: 0;
    list-style: none;
    color: var(--dim);
}
.experience-tags li:not(:last-child)::after { content: " ·"; }

/* ==================== Skills ==================== */

.skills-grid { display: grid; gap: 1rem; }
.skills-grid > * { min-width: 0; }

.skill-category {
    border-top: 1px solid var(--line);
    padding: 1.5rem 0;
}

.skill-category h3 {
    margin: 0;
    font-size: var(--t-lg);
    font-weight: 600;
    letter-spacing: -.01em;
}

.category-head {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .9rem;
}

.category-icon { color: var(--accent); font-size: var(--t-md); }

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem .9rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ==================== Projects ====================
   A strip of columns split by hairlines, each headed by its own colour rule.
   The rule is the project's stored gradient, so it stays admin-controlled. */

.projects-grid { display: grid; gap: 0; }
.projects-grid > * { min-width: 0; }

.project-card {
    display: grid;
    gap: .85rem;
    align-content: start;
    padding-block: 1.75rem;
}

.project-rule {
    height: 3px;
    border-radius: 2px;
    background: var(--cover, var(--accent));
}

/* Shown only when a project actually has an uploaded image. */
.project-image img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 4px;
    display: block;
}

.project-head { display: flex; align-items: center; gap: .65rem; }

.project-icon {
    width: 30px;
    height: 30px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 4px;
    background: var(--cover, var(--accent));
    color: #fff;
    font-size: .8125rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .55);
}

.project-content h3 {
    margin: 0;
    font-size: var(--t-md);
    font-weight: 600;
    letter-spacing: -.015em;
}

.project-content > p {
    margin: 0;
    color: var(--dim);
    max-width: 46ch;
}

.project-tags {
    font-family: var(--mono);
    font-size: var(--t-xs);
    color: var(--dim);
    overflow-wrap: anywhere;
}
.project-tags span:not(:last-child)::after { content: " · "; }

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

.project-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding-inline: .8rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    font-size: var(--t-xs);
    color: var(--text);
    text-decoration: none;
}
.project-link i { color: var(--accent); }
.project-link:hover { border-color: var(--accent); }

/* ==================== Contact ==================== */

.contact-content { display: grid; gap: clamp(2rem, 5vw, 3rem); }
.contact-content > * { min-width: 0; }

.contact-info h3 {
    margin: 0 0 .75rem;
    font-size: var(--t-lg);
    font-weight: 600;
    letter-spacing: -.01em;
}

.contact-info > p {
    margin: 0;
    max-width: 62ch;
    color: var(--dim);
    font-size: var(--t-md);
    line-height: 1.75;
}

.contact-details {
    display: grid;
    margin-top: 1.75rem;
    border-top: 1px solid var(--line);
}

.contact-item {
    display: flex;
    gap: .9rem;
    padding-block: .9rem;
    border-bottom: 1px solid var(--line);
}

.contact-item > i {
    color: var(--accent);
    margin-top: .4rem;
    flex: none;
    width: 1.125rem;
    text-align: center;
}

.contact-item h4 {
    margin: 0;
    font-size: var(--t-xs);
    font-weight: 400;
    color: var(--dim);
}

.contact-item a,
.contact-item p {
    margin: 0;
    color: var(--text);
    overflow-wrap: anywhere;
}

/* These are the only tappable things in the details list, so they carry a
   full-size touch target rather than being 20px-tall text links. */
.contact-item a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--line);
}

.social-links-contact {
    display: flex;
    gap: .5rem;
    margin-top: 1.5rem;
}

.social-links-contact a {
    min-width: 44px;
    min-height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    font-size: var(--t-md);
}
.social-links-contact a:hover { color: var(--accent); border-color: var(--accent); }

/* ==================== Contact form ==================== */

.contact-form { display: grid; gap: 1rem; }

.form-group { display: grid; gap: .4rem; }

.contact-form label {
    font-size: var(--t-base);
    color: var(--text);
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    min-height: 48px;
    padding: .7rem .85rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--text);
    font-family: var(--sans);
    font-size: var(--t-base);
    line-height: 1.5;
}

.contact-form textarea { min-height: 7rem; resize: vertical; }

.contact-form input:focus-visible,
.contact-form textarea:focus-visible { border-color: var(--accent); }

/* The honeypot must never be visible or reachable; the bots this catches do
   not evaluate CSS. */
.form-hp { display: none; }

.form-error,
.form-flash {
    margin: 0;
    padding: .75rem 1rem;
    border-radius: 4px;
    border: 1px solid var(--line);
    font-size: var(--t-xs);
}

.form-error,
.form-flash-error {
    border-color: #f56565;
    color: #f56565;
}

.form-flash-success {
    border-color: var(--accent);
    color: var(--text);
}

/* Replaces the form once the server confirms the mail went out. */
.form-sent {
    display: grid;
    align-content: start;
    gap: .75rem;
    padding: 1.5rem 0 0;
    border-top: 2px solid var(--accent);
}

.form-sent h3 {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: 0;
    font-size: var(--t-lg);
    font-weight: 600;
    letter-spacing: -.01em;
}
.form-sent h3 i { color: var(--accent); }

.form-sent p { margin: 0; color: var(--dim); max-width: 46ch; }

.form-sent .btn { justify-self: start; min-height: 44px; font-size: var(--t-xs); }

/* ==================== Footer ==================== */

.footer {
    padding-block: 2.5rem 3rem;
    border-top: 1px solid var(--line);
}

.footer .container {
    display: grid;
    gap: .3rem;
    justify-items: center;
    text-align: center;
}

.footer p {
    margin: 0;
    color: var(--dim);
    font-size: var(--t-xs);
    line-height: 1.5;
}

.footer .footer-name {
    color: var(--text);
    font-size: var(--t-base);
    font-weight: 600;
}

.footer-social {
    display: flex;
    gap: .5rem;
    margin-top: .9rem;
}

.footer-social a {
    min-width: 44px;
    min-height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    font-size: var(--t-md);
}
.footer-social a:hover { color: var(--accent); border-color: var(--accent); }

/* ==================== Breakpoints ==================== */

@media (min-width: 48rem) {
    :root { --gut: 2rem; }

    .about-content { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
    .skills-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2.5rem; }
    .contact-content { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

    .projects-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .project-card { padding-inline: 1.5rem; }
    .project-card:nth-child(odd) { padding-left: 0; border-right: 1px solid var(--line); }
    .project-card:nth-child(even) { padding-right: 0; }

    .timeline-item { grid-template-columns: 10rem minmax(0, 1fr); column-gap: 2rem; }
    .timeline-item > .timeline-date { grid-row: 1 / span 2; }
    .timeline-item > .timeline-content { grid-column: 2; }

    .corner-actions { right: 1.5rem; bottom: 1.5rem; }
}

@media (min-width: 64rem) {
    /* The wordmark sits close to the edge rather than lining up with the text
       column, so the nav reads as chrome and not as content. */
    .navbar .container { max-width: none; padding-inline: clamp(1rem, 2.5vw, 1.75rem); }

    .nav-toggle { display: none; }

    /* The markup puts the theme button before the menu so it stays reachable
       next to the burger on phones; on desktop `order` moves it after. */
    .nav-menu {
        display: flex;
        align-items: center;
        gap: .25rem;
        order: 1;
    }

    .theme-toggle { order: 2; }

    .nav-menu .nav-link {
        padding: .5rem .7rem;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        font-family: var(--mono);
        font-size: var(--t-xs);
        color: var(--dim);
        text-decoration: none;
        border-bottom: 2px solid transparent;
    }

    .nav-menu .nav-link.active {
        color: var(--text);
        border-bottom-color: var(--accent);
    }

    /* These belong to the mobile panel only. */
    .nav-menu .nav-resume,
    .nav-menu .nav-social { display: none; }

    .container { padding-inline: clamp(2rem, 6vw, 5rem); }

    /* Social rail, threaded on a line that fills with reading progress. */
    .social-rail {
        display: grid;
        gap: .6rem;
        justify-items: center;
        position: fixed;
        left: 1.5rem;
        bottom: 0;
        z-index: 55;
        padding-bottom: 1.5rem;
    }

    .social-rail a {
        width: 44px;
        height: 44px;
        display: grid;
        place-items: center;
        color: var(--dim);
        font-size: var(--t-md);
        text-decoration: none;
        border-radius: 999px;
    }
    .social-rail a:hover { color: var(--accent); }

    .rail-line {
        width: 1px;
        height: 7rem;
        margin-top: .4rem;
        background: var(--line);
        position: relative;
        overflow: hidden;
    }

    .rail-line::after {
        content: "";
        position: absolute;
        inset: 0 0 auto 0;
        height: var(--progress, 0%);
        background: var(--accent);
    }

    .cv-corner { display: inline-flex; }

    .projects-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .project-card:nth-child(odd) { padding-left: 1.5rem; border-right: 0; }
    .project-card:not(:nth-child(3n)) { border-right: 1px solid var(--line); }
    .project-card:nth-child(3n + 1) { padding-left: 0; }
    .project-card:nth-child(3n) { padding-right: 0; }

    .about-content { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); column-gap: 4rem; }
    .contact-content { column-gap: 4rem; }
}

@media (min-width: 80rem) {
    .hero { padding-top: calc(var(--nav-h) + 7rem); }
}

/* ==================== Motion ====================
   Nothing is hidden unless the `js` class says a script is present to reveal
   it again, so the page reads in full with JavaScript off or motion reduced. */

@media (prefers-reduced-motion: no-preference) {
    /* Nav links, hero buttons and the mobile menu travel to their section
       rather than cutting to it, matching the back-to-top button. */
    html { scroll-behavior: smooth; }

    .hero-content > * {
        animation: rise .5s cubic-bezier(.2, .7, .3, 1) backwards;
    }
    .hero-greeting { animation-delay: .02s; }
    .hero-name { animation-delay: .08s; }
    .hero-title { animation-delay: .16s; }
    .hero-description { animation-delay: .22s; }
    .hero-buttons { animation-delay: .28s; }
    .hero-status { animation-delay: .34s; }
    .social-links { animation-delay: .4s; }

    html.js .reveal {
        opacity: 0;
        transform: translateY(18px);
        transition: opacity .6s cubic-bezier(.2, .7, .3, 1),
                    transform .6s cubic-bezier(.2, .7, .3, 1);
    }
    html.js .reveal.is-in { opacity: 1; transform: none; }
}

@keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}
