/* ============================================================
   Noah Gallego — shared page system.
   The home page is the source of truth. Everything here exists to
   extend index.css's language across the rest of the site:
   Apple light ground (#fbfbfd), SF/Inter system type, pill buttons,
   glass nav, soft shadows, generous whitespace.
   Used by about, portfolio, contact, resume.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* ---- ground + ink: identical values to index.css ---- */
    --bg:         #fbfbfd;
    --surface:    #ffffff;
    --surface-2:  #f5f5f7;
    --ink:        #1d1d1f;
    --soft:       #6e6e73;
    --faint:      #86868b;
    --line:       rgba(0, 0, 0, 0.09);
    --line-2:     rgba(0, 0, 0, 0.16);
    --glass:      rgba(251, 251, 253, 0.72);

    /* ---- accents: one per role, used for that role and nothing else ---- */
    --ch1: #1d7a4c;   /* Apple          — battery state of charge   */
    --ch2: #c0392f;   /* LLNL           — ECG                       */
    --ch3: #a8348f;   /* Beats by Dre   — review polarity           */
    --ch4: #0f7f96;   /* Stanford       — detection confidence      */
    --ch5: #94690a;   /* Capital One    — ledger                    */
    --ch6: #2563a8;   /* CSU Bakersfield— training loss             */
    --ch6-val: #c2410c;
    --ecg-paper: #fdf5f3;
    --ecg-minor: #f5cec8;
    --ecg-major: #e7a49b;
    --accent: #0071e3;          /* Apple's interactive blue, links only */

    /* ---- type: the home page's stack, verbatim ---- */
    --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
            "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

    --radius:    18px;
    --radius-sm: 12px;
    --radius-lg: 26px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.04), 0 2px 10px rgba(0,0,0,.04);
    --shadow:    0 10px 30px rgba(0,0,0,.07), 0 2px 6px rgba(0,0,0,.05);
    --shadow-lg: 0 24px 60px rgba(0,0,0,.12);

    --maxw:  1080px;
    --nav-h: 66px;
    --ease:  cubic-bezier(.22, 1, .36, 1);
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.6;
    letter-spacing: -0.011em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

img, video, svg { max-width: 100%; display: block; }
a { color: var(--ink); text-decoration: none; }
::selection { background: rgba(0, 113, 227, 0.16); }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 6px;
}

/* ---------- Type ---------- */
.h-display {
    font-size: clamp(2.6rem, 6.4vw, 4.6rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.04em;
    margin: 0;
}

.h-title {
    font-size: clamp(1.9rem, 4vw, 2.9rem);
    font-weight: 650;
    line-height: 1.08;
    letter-spacing: -0.03em;
    margin: 0;
}

.h-section {
    font-size: clamp(1.3rem, 2.4vw, 1.85rem);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.022em;
    margin: 0;
}

.lead {
    font-size: clamp(1.05rem, 2vw, 1.28rem);
    line-height: 1.55;
    color: var(--soft);
    letter-spacing: -0.014em;
}

.muted { color: var(--soft); }

/* Eyebrow: a quiet label, not instrument silkscreen. */
.eyebrow {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--faint);
    margin: 0 0 0.9rem;
}

/* Readout: for genuinely technical values (units, axes, parameters) only. */
.readout {
    display: inline-block;
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    font-size: 0.72rem;
    letter-spacing: 0;
    color: var(--soft);
    background: var(--surface-2);
    border-radius: 999px;
    padding: 5px 12px;
}

.tick { font-family: var(--mono); font-size: 0.7rem; color: var(--faint); }
.trailer { font-size: 0.85rem; color: var(--faint); }

/* ---------- Layout ---------- */
.container {
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: clamp(20px, 5vw, 40px);
}

main { position: relative; z-index: 1; }

.section { position: relative; padding-block: clamp(56px, 8vw, 104px); }
.section--soft { background: var(--surface-2); }
.section--tight { padding-block: clamp(40px, 5vw, 68px); }

.page-hero {
    position: relative;
    padding-top: calc(var(--nav-h) + clamp(52px, 8vw, 100px));
    padding-bottom: clamp(44px, 6vw, 78px);
}

/* ---------- Nav: the home page header, verbatim in behaviour ---------- */
.site-nav {
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--nav-h);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-inline: clamp(20px, 5vw, 40px);
    background: var(--glass);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--line);
}

.site-nav__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.site-nav__brand img { width: 30px; height: 30px; border-radius: 8px; }

.site-nav__links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav__links a {
    display: block;
    color: rgba(29, 29, 31, 0.88);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    transition: background-color .2s ease, color .2s ease;
}

.site-nav__links a:hover { background-color: rgba(0, 0, 0, 0.06); color: #000; }
.site-nav__links a[aria-current="page"] { color: #000; background-color: rgba(0, 0, 0, 0.05); }

/* The checkbox must stay reachable by keyboard: `hidden` or display:none at
   mobile width drops it from the tab order and locks keyboard users out. */
.nav-toggle { display: none; }
.nav-toggle-label { display: none; }

@media (max-width: 760px) {
    .nav-toggle-label {
        display: flex;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
        padding: 8px;
        margin-right: -8px;
    }

    .nav-toggle {
        display: block;
        position: absolute;
        width: 1px; height: 1px;
        margin: -1px; padding: 0;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .nav-toggle:focus-visible ~ .nav-toggle-label {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
        border-radius: 6px;
    }

    .nav-toggle-label span {
        width: 22px;
        height: 2px;
        background: var(--ink);
        border-radius: 2px;
        transition: transform .25s var(--ease), opacity .2s var(--ease);
    }

    .site-nav__links {
        position: fixed;
        inset: var(--nav-h) 0 auto 0;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        background: rgba(251, 251, 253, 0.96);
        backdrop-filter: saturate(180%) blur(20px);
        -webkit-backdrop-filter: saturate(180%) blur(20px);
        padding: 12px 20px 18px;
        border-bottom: 1px solid var(--line);
        transform: translateY(-130%);
        transition: transform .3s var(--ease);
    }

    .site-nav__links a { padding: 11px 4px; font-size: 1.05rem; border-radius: 10px; }
    .nav-toggle:checked ~ .site-nav__links { transform: translateY(0); }
    .nav-toggle:checked ~ .nav-toggle-label span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-toggle:checked ~ .nav-toggle-label span:nth-child(2) { opacity: 0; }
    .nav-toggle:checked ~ .nav-toggle-label span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ---------- Buttons: the home page pills ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.85rem 1.75rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: transform .15s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background-color: var(--ink); color: #fff; }
.btn--primary:hover { background-color: #000; color: #fff; }
.btn--ghost { background-color: rgba(255, 255, 255, .6); color: var(--ink); border-color: var(--line-2); }
.btn--ghost:hover { background-color: #fff; border-color: rgba(0, 0, 0, .34); color: #000; }
.btn--sm { padding: 0.55rem 1.1rem; font-size: 0.9rem; }
.btn__arrow { transition: transform .18s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(3px); }

/* ---------- Cards: soft, rounded, lightly shadowed ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}

.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card__media { aspect-ratio: 16 / 10; background: var(--surface-2); overflow: hidden; }
.card__media img, .card__media video { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 20px 22px 22px; }

.pill {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: -0.005em;
    color: var(--soft);
    background: var(--surface-2);
    border-radius: 999px;
    padding: 5px 12px;
}

/* ---------- Org labels: a soft tinted chip, not an instrument block ---------- */
.ch-label {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--soft);
}

.ch-label__id {
    font-family: var(--mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0;
    padding: 3px 9px;
    border-radius: 999px;
    color: var(--chip, var(--ink));
    background: color-mix(in srgb, var(--chip, var(--ink)) 12%, transparent);
}

.ch-label--ch1 { --chip: var(--ch1); }
.ch-label--ch2 { --chip: var(--ch2); }
.ch-label--ch3 { --chip: var(--ch3); }
.ch-label--ch4 { --chip: var(--ch4); }
.ch-label--ch5 { --chip: var(--ch5); }
.ch-label--ch6 { --chip: var(--ch6); }

/* ---------- Footer ---------- */
.site-footer {
    position: relative;
    z-index: 1;
    background: var(--bg);
    border-top: 1px solid var(--line);
    padding-block: 40px;
    color: var(--faint);
    font-size: 0.9rem;
}

.site-footer .container {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
}

.site-footer a { color: var(--soft); }
.site-footer a:hover { color: var(--ink); }
.social-row { display: flex; gap: 18px; font-size: 1.2rem; }
.social-row a { color: var(--soft); transition: color .2s var(--ease), transform .2s var(--ease); }
.social-row a:hover { color: var(--ink); transform: translateY(-2px); }

/* ---------- Reveal ----------
   Gated on `.js`: without the gate a JS-disabled visitor, or a print job
   (which never fires IntersectionObserver), gets a blank page below the fold. */
.reveal { transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal { opacity: 0; transform: translateY(20px); }
.reveal.in { opacity: 1; transform: none; }

.fa-icon {
    width: 1em;
    height: 1em;
    fill: currentColor;
    vertical-align: -0.125em;
    display: inline-block;
    flex-shrink: 0;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 200;
    background: var(--ink);
    color: #fff;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 12px 22px;
}

.skip-link:focus { left: 12px; top: 12px; }

@media (prefers-reduced-motion: reduce) {
    .js .reveal { opacity: 1; transform: none; transition: none; }
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
