/* Resume page. Fonts, base colors and the page background come from
   mainStyles.css; this file only lays out resume.html. Screen is dark like
   the rest of the site; print (and the PDF built from it) is light. */

:root {
    --bg: #191d1e;
    --surface: #1e2426;
    --line: #2c3538;
    --text: #e6ecee;
    --muted: #9aa9ae;
    --accent: #4fd6ea;
    --accent-soft: rgba(79, 214, 234, 0.1);
    --maxw: 70rem;
    --gutter: clamp(1rem, 4vw, 2.5rem);
}

html:has(body.resume),
body.resume {
    height: auto;
}

body.resume {
    min-height: 100%;
    font-weight: 400;
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--text);
    background:
        radial-gradient(ellipse 70% 28rem at 50% -6rem, rgba(12, 219, 243, 0.09), transparent 70%),
        var(--bg);
    background-repeat: no-repeat;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.resume a {
    color: var(--accent);
    text-decoration: none;
    text-underline-offset: 0.2em;
}

.resume a:hover {
    text-decoration: underline;
}

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

.resume h1,
.resume h2,
.resume h3,
.resume p,
.resume ul,
.resume dl {
    margin: 0;
}

/* ---- top bar ---------------------------------------------------------- */

.topbar {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 1.25rem var(--gutter) 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.topbar .home {
    color: var(--muted);
    font-size: 0.875rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

.topbar .home:hover {
    color: var(--text);
    text-decoration: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--accent);
    border-radius: 999px;
    font-size: 0.9375rem;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.resume .btn:hover {
    background: var(--accent-soft);
    text-decoration: none;
}

.btn svg {
    width: 1em;
    height: 1em;
}

/* ---- masthead --------------------------------------------------------- */

.masthead {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: clamp(2.5rem, 7vw, 4.5rem) var(--gutter) 2rem;
    border-bottom: 1px solid var(--line);
}

.masthead .name {
    font-weight: 600;
    font-size: clamp(2.25rem, 6vw, 3.5rem);
    line-height: 1.05;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin-right: -0.22em;
}

.masthead .headline {
    margin-top: 0.75rem;
    font-size: clamp(1.125rem, 2.4vw, 1.375rem);
    font-weight: 400;
    color: var(--text);
}

.masthead .headline strong {
    font-weight: 600;
    color: var(--accent);
}

.contact {
    list-style: none;
    padding: 0;
    margin-top: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.5rem;
    font-size: 0.9688rem;
    color: var(--muted);
}

/* ---- layout ----------------------------------------------------------- */

.layout {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 2.25rem var(--gutter) 3rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 19rem;
    gap: 3rem;
}

.primary > section + section {
    margin-top: 2.75rem;
}

.secondary > section + section {
    margin-top: 2rem;
}

.label {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
}

.label::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

.summary p {
    font-size: 1.1875rem;
    line-height: 1.6;
}

/* ---- roles ------------------------------------------------------------ */

.role + .role {
    margin-top: 1.9rem;
}

.role-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 1rem;
    align-items: baseline;
}

.role h3 {
    font-size: 1.1875rem;
    font-weight: 600;
    line-height: 1.3;
}

/* A hyphenated word kept whole: split at a line end, the PDF's text reads
   "open-" + "source", which applicant-tracking parsers join wrongly. */
.nobr {
    white-space: nowrap;
}

.role .when {
    font-size: 0.9375rem;
    color: var(--muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.role .org {
    grid-column: 1 / -1;
    color: var(--muted);
}

.role .org strong {
    font-weight: 600;
    color: var(--text);
}

.role .intro {
    margin-top: 0.6rem;
}

.role ul {
    margin-top: 0.6rem;
    padding-left: 1.15rem;
}

.role li {
    padding-left: 0.25rem;
}

.role li + li {
    margin-top: 0.35rem;
}

.role li::marker {
    color: var(--accent);
}

.role li strong {
    font-weight: 600;
}

/* ---- toolkit ---------------------------------------------------------- */

/* A full-width band under both columns, on the same two-column rhythm:
   the story on the left, the numbers in the sidebar column. */
.toolkit {
    grid-column: 1 / -1;
}

.toolkit-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 19rem;
    grid-template-areas:
        "main side"
        "list side";
    column-gap: 3rem;
    align-items: start;
}

.tk-main {
    grid-area: main;
}

.tk-side {
    grid-area: side;
}

.tk-list {
    grid-area: list;
}

.stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.stats > div {
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-end;
    padding: 0.85rem 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0.5rem;
}

.stats dt {
    font-size: 0.8438rem;
    line-height: 1.35;
    color: var(--muted);
}

.stats dd {
    margin: 0 0 0.15rem;
    font-size: 1.625rem;
    font-weight: 600;
    line-height: 1.15;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.packages {
    margin-top: 1rem;
    font-size: 0.9688rem;
    color: var(--muted);
}

/* ---- sidebar ---------------------------------------------------------- */

.skills h3,
.edu h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
}

.skills p,
.edu p,
.also p {
    font-size: 0.9688rem;
    color: var(--muted);
}

.skills > div + div,
.edu > div + div {
    margin-top: 0.85rem;
}

.print-only {
    display: none;
}

.site-foot {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 1.5rem var(--gutter) 2.5rem;
    border-top: 1px solid var(--line);
    font-size: 0.875rem;
    color: var(--muted);
}

/* ---- narrow screens --------------------------------------------------- */

@media (max-width: 860px) {
    .layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 2.75rem;
    }

    .toolkit-grid {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "main"
            "side"
            "list";
    }

    .tk-side {
        margin-top: 1rem;
    }
}

/* One column: the toolkit follows Experience instead of trailing the
   sidebar. Screen only; print keeps its own two-column placement. */
@media screen and (max-width: 860px) {
    .toolkit {
        order: 1;
    }

    .secondary {
        order: 2;
    }
}

@media (max-width: 520px) {
    body.resume {
        font-size: 1rem;
    }

    .masthead .name {
        letter-spacing: 0.14em;
        margin-right: -0.14em;
    }

    .role-head {
        grid-template-columns: minmax(0, 1fr);
    }

    .role .when {
        order: 3;
    }

    .contact {
        flex-direction: column;
    }
}

/* ---- print / PDF ------------------------------------------------------ */

@page {
    size: Letter;
    margin: 0.5in 0.55in;
}

@media print {
    :root {
        --bg: #ffffff;
        --surface: #f4f7f8;
        --line: #d3dbde;
        --text: #15191a;
        --muted: #4a5457;
        --accent: #0b6c7c;
    }

    html,
    body.resume {
        background: #ffffff;
    }

    body.resume {
        font-size: 9.6pt;
        line-height: 1.4;
        /* Ligature glyphs ("fi", "fl") extract as garbage in some PDF and
           ATS text parsers; plain letters always extract. */
        font-variant-ligatures: none;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .topbar,
    .site-foot .web-only {
        display: none;
    }

    .print-only {
        display: inline;
    }

    .resume a {
        color: inherit;
    }

    .masthead {
        padding: 0 0 0.9rem;
    }

    /* Wide tracking extracts letter by letter ("R Y A N"), which breaks
       name and heading parsing in ATS; print keeps it tight. */
    .masthead .name {
        font-size: 24pt;
        letter-spacing: 0.03em;
        margin-right: 0;
    }

    .masthead .headline {
        margin-top: 0.3rem;
        font-size: 12pt;
    }

    .contact {
        margin-top: 0.55rem;
        font-size: 9.4pt;
        gap: 0.2rem 1.1rem;
    }

    .layout {
        padding: 1rem 0 0;
        grid-template-columns: minmax(0, 1fr) 13.5rem;
        gap: 1.6rem;
    }

    .primary > section + section {
        margin-top: 1.15rem;
    }

    .secondary > section + section {
        margin-top: 1rem;
    }

    .label {
        margin-bottom: 0.55rem;
        font-size: 8.8pt;
        letter-spacing: 0.04em;
    }

    .summary p {
        font-size: 10.4pt;
        line-height: 1.45;
    }

    .role + .role {
        margin-top: 0.85rem;
    }

    .role h3 {
        font-size: 10.6pt;
    }

    .role .when {
        font-size: 9pt;
    }

    .role ul,
    .role .intro {
        margin-top: 0.3rem;
    }

    .role li + li {
        margin-top: 0.12rem;
    }

    .role,
    .stats,
    .skills > div,
    .role li {
        break-inside: avoid;
    }

    /* The toolkit band opens page 2 whole, on the page's two columns. */
    .toolkit {
        break-before: page;
    }

    .toolkit-grid {
        grid-template-columns: minmax(0, 1fr) 13.5rem;
        grid-template-areas:
            "main side"
            "list side";
        column-gap: 1.6rem;
    }

    .tk-side {
        margin-top: 0;
    }

    .label {
        break-after: avoid;
    }

    .stats {
        gap: 0.45rem;
    }

    .stats > div {
        padding: 0.4rem 0.6rem;
        border-radius: 0.3rem;
    }

    .stats dd {
        font-size: 13pt;
    }

    .stats dt {
        font-size: 8pt;
    }

    .packages {
        margin-top: 0.5rem;
        font-size: 9pt;
    }

    .skills h3,
    .edu h3 {
        font-size: 9.4pt;
    }

    .skills p,
    .edu p,
    .also p {
        font-size: 9pt;
    }

    .skills > div + div,
    .edu > div + div {
        margin-top: 0.4rem;
    }

    .site-foot {
        padding: 0.6rem 0 0;
        margin-top: 0.8rem;
        font-size: 8pt;
    }
}
