:root {
    color-scheme: dark;
    --background: #242528;
    --surface: #1e1f22;
    --line: #46484e;
    --ink: #f3f3f4;
    --muted: #c0c1c5;
    --accent: #e4e5e7;
    font-family: "Segoe UI", system-ui, sans-serif;
    line-height: 1.6;
}
*, *::before, *::after { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: radial-gradient(ellipse 62rem 34rem at 80% 7%, #505156, transparent 74%), var(--background);
    color: var(--ink);
}
main { flex: 1; min-inline-size: 0; }
a { color: inherit; text-underline-offset: .25em; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
p, h1, h2, h3, h4, ul { margin: 0; }
h1, h2, h3 { line-height: 1.08; }
h1 { font-size: clamp(2.9rem, 8vw, 6.3rem); letter-spacing: -.065em; overflow-wrap: anywhere; }
h1 span { color: var(--accent); }
h2 { font-size: clamp(1.75rem, 4vw, 2.7rem); letter-spacing: -.04em; margin-bottom: 1.15rem; }
h3, .card-title { font-size: 1.35rem; letter-spacing: -.025em; }
img { display: block; max-width: 100%; }
.wrap { width: min(66rem, calc(100% - 3rem)); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); background: #202124f2; }
.nav, .footer, .actions, .nav-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .75rem;
}
.nav, .footer { justify-content: space-between; }
.nav { padding-block: 1rem; }
.brand, .nav a, .button, .tile { text-decoration: none; }
.brand { display: inline-flex; align-items: center; gap: .7rem; font-weight: 700; }
.monogram {
    display: grid;
    place-items: center;
    width: 2rem;
    aspect-ratio: 1;
    border: 1px solid #686a71;
    border-radius: .5rem;
    color: var(--accent);
    background: #34363b;
}
.nav-links, .skills { list-style: none; padding: 0; }
.nav-links a { display: block; border-radius: .5rem; padding: .42rem .7rem; color: var(--muted); }
.nav-links a:hover, .nav-links [aria-current] { color: var(--ink); background: #34363b; }

.eyebrow { color: var(--accent); font-size: .875rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-bottom: .9rem; }
.intro { max-width: 55ch; margin-top: 1.15rem; font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--muted); }
.hero .actions { margin-top: 1.55rem; }
.back { display: inline-block; margin-bottom: clamp(1rem, 3vw, 1.75rem); color: var(--muted); }
.button {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: .5rem .95rem;
    border: 1px solid var(--line);
    border-radius: .55rem;
    font-weight: 650;
}
.button:hover { border-color: var(--accent); }
.primary { background: var(--accent); border-color: var(--accent); color: #242528; }
.primary:hover { background: #f3f3f4; color: #242528; }
.section { border-top: 1px solid var(--line); padding-block: clamp(1.4rem, 3.5vw, 2.5rem); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.project-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: .45rem; }
.tile, .card-body { padding: clamp(1rem, 3vw, 1.5rem); }
.tile { display: flex; flex-direction: column; align-items: start; gap: .65rem; }
.tile:hover { border-color: var(--accent); background: #2c2d31; color: var(--ink); transform: translateY(-3px); }
.tile p, .card-body p, .reading p, .study p { color: var(--muted); }
.tile .detail { color: var(--accent); margin: 0; }
.detail { margin-block: .5rem; }
.link-label { color: var(--accent); margin-top: auto; padding-top: .4rem; font-weight: 650; }
.tile, .button, .nav-links a { transition: background-color .16s ease, color .16s ease, border-color .16s ease, transform .16s ease; }
.tile:active, .button:active { transform: translateY(1px); }
.project-card { overflow: hidden; }
.project-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #151619; border-bottom: 1px solid var(--line); }
.project-card .actions, .reading .button { margin-top: 1rem; }
.card-title { margin-bottom: .5rem; }
.reading p { max-width: 68ch; }
.skills { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .75rem; }
.skills li { border: 1px solid var(--line); border-radius: .45rem; padding: .15rem .55rem; }
.footer { color: var(--muted); border-top: 1px solid var(--line); padding-block: 1.25rem; }
.visually-hidden, .skip-link:not(:focus) {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.skip-link:focus { position: absolute; z-index: 1; top: .5rem; left: .5rem; padding: .5rem 1rem; background: var(--background); }
@media (max-width: 50rem) {
    .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 36rem) {
    .wrap { width: calc(100% - 2rem); }
    .grid, .project-grid { grid-template-columns: 1fr; }
    .nav-links { width: 100%; gap: .25rem; }
    .nav-links a { padding-inline: .55rem; }
}
@media (prefers-reduced-motion: reduce) {
    .tile, .button, .nav-links a { transition: none; transform: none; }
}

/* Collection cards give Projects and the home page the same navigation. */
.collection-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}
.collection {
    display: flex;
    flex-direction: column;
    align-items: start;
    min-height: 13rem;
    padding: clamp(1.25rem, 3.5vw, 2.4rem);
    background: radial-gradient(ellipse at top right, #35363c, transparent 65%), var(--surface);
    text-decoration: none;
    transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}
.collection h2 { margin-bottom: .5rem; }
.collection p { color: var(--muted); }
.collection .link-label { padding-top: 1.2rem; }
.collection:hover, .collection:focus-visible {
    color: var(--ink);
    border-color: var(--accent);
    background-color: #292b30;
}
.collection:hover { transform: translateY(-3px); }
.collection:active { transform: translateY(1px); }

.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding-inline: clamp(0rem, 5vw, 3.5rem);
}
.hero::before {
    position: absolute;
    z-index: -1;
    inset: 0;
    content: "";
    background: radial-gradient(ellipse at 50% 4%, #bcbec724, transparent 66%);
    pointer-events: none;
}
.hero h1 { font-size: clamp(3rem, 9vw, 7.5rem); }
.nav-links [aria-current] { box-shadow: inset 0 -2px var(--accent); }
.tile { border-top-color: #5b5e66; }

.resume-trigger { margin-top: 1.25rem; }
button.button { font: inherit; font-weight: 650; cursor: pointer; }
body:has(.resume[open]) { overflow: hidden; }
.resume {
    width: min(49rem, calc(100% - 2rem));
    max-height: min(85dvh, 53rem);
    overflow: auto;
    overscroll-behavior: contain;
    padding: 0;
    border: 1px solid #686a71;
    border-radius: .45rem;
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 1.5rem 5rem #000a;
}
.resume::backdrop { background: #141519de; backdrop-filter: blur(4px); }
.resume-header {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    padding: 1rem clamp(1rem, 4vw, 2rem);
    border-bottom: 1px solid var(--line);
    background: #242529;
}
.resume-header h2 { font-size: clamp(1.25rem, 3vw, 1.7rem); margin: 0; }
.resume-content { padding: 1rem clamp(1rem, 4vw, 2rem) 2rem; }
.resume-content h3 { margin-block: 1.5rem .55rem; color: var(--accent); }
.resume-content h4 { margin: .9rem 0 .25rem; }
.resume-content p + p { margin-top: .4rem; }

@media (max-width: 36rem) {
    .collection-grid { grid-template-columns: 1fr; }
    .collection { min-height: 10rem; }
}
@media (prefers-reduced-motion: reduce) {
    .collection { transition: none; }
    .collection:hover, .collection:active { transform: none; }
}


.achievement-list { margin-top: .65rem; padding-inline-start: 1.2rem; color: var(--muted); }
.achievement-list li + li { margin-top: .3rem; }

.other-work-details {
    border: 1px solid var(--line);
    border-radius: .8rem;
    background: var(--surface);
}
.other-work-details summary {
    padding: 1rem 1.15rem;
    cursor: pointer;
    font-weight: 650;
}
.other-work-details summary:hover, .other-work-details summary::marker { color: var(--accent); }
.other-work-details summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.other-work-content { padding-inline: clamp(.75rem, 3vw, 1.5rem); }
.other-work-content > .section > h3 { margin-bottom: 1rem; }
.other-work-content h4 { font-size: 1.125rem; line-height: 1.2; }
.other-work-content .collection-grid { margin-bottom: 0; }
.other-work-content .collection { min-height: 0; }
.other-work-content .grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.study {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .45rem 1.25rem;
    padding: 1rem clamp(1rem, 3vw, 1.5rem);
    border: 1px solid var(--line);
    border-radius: .8rem;
    background: var(--surface);
}
.study h3 { margin-bottom: .35rem; }
.study-date { font-size: .9375rem; }
.skills-grid .card-body { padding-block: 1.1rem; }
.skills-grid h3 { font-size: 1.125rem; }


.app-card { padding: 0; overflow: hidden; gap: 0; align-items: stretch; }
.app-preview {
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    padding: .6rem;
    color: var(--muted);
    background: radial-gradient(ellipse at 85% 15%, #313237, transparent 70%), #151619;
    text-align: center;
}
.app-preview img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.app-card-body { display: flex; flex: 1; flex-direction: column; gap: .55rem; padding: 1rem 1.2rem 1.2rem; border-top: 1px solid var(--line); }
.app-card-body .card-title { margin: 0; }
.app-actions { margin-top: 1.25rem; }
.app-video { display: block; width: min(100%, 44rem); height: auto; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: .8rem; background: #000; margin-bottom: .65rem; }
.screenshot-grid a { display: grid; place-items: center; min-height: 0; padding: .6rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--surface); }
.screenshot-grid a:hover { border-color: var(--accent); }
.screenshot-grid img { max-height: 18rem; width: 100%; object-fit: contain; }
.media-pending { max-width: 28rem; aspect-ratio: auto; min-height: 6rem; border: 1px dashed var(--line); border-radius: .8rem; }


.preview-controls:not([hidden]) { display: flex; justify-content: end; margin-bottom: .75rem; }
.preview-controls .button { min-height: 2.25rem; padding-block: .25rem; font-size: .875rem; }
.app-preview[data-preview-images] { position: relative; }
.app-preview[data-preview-images] img {
    position: absolute;
    inset: .6rem;
    width: calc(100% - 1.2rem);
    height: calc(100% - 1.2rem);
    opacity: 0;
    transition: opacity 1.25s ease-in-out;
}
.app-preview[data-preview-images] .is-visible { opacity: 1; }
button.button:disabled { opacity: .65; cursor: default; transform: none; border-color: var(--line); }
.play-status { color: var(--muted); font-size: .9375rem; }
@media (prefers-reduced-motion: reduce) {
    .app-preview[data-preview-images] img { transition: none; }
}

/* Display typography and quiet rules give the projects the focus. */
:root {
    --background: #151515;
    --surface: #1d1d1d;
    --line: #404040;
    --ink: #f3f2ed;
    --muted: #c4c3bf;
    --accent: #efeee8;
    font-family: "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
}
body { background: var(--background); }
.wrap { width: min(78rem, calc(100% - 4rem)); }
.site-header { background: var(--background); }
.nav { padding-block: .85rem; }
.monogram { border-color: var(--line); border-radius: 0; background: none; }
.nav-links a { border-radius: 0; }
.nav-links a:hover, .nav-links [aria-current] { background: #292929; }
.button, .card, .collection, .study, .other-work-details { border-radius: .2rem; }
.primary { color: #181818; }
.primary:hover { color: #181818; background: #fff; }

.hero {
    position: relative;
    isolation: isolate;
    container-type: inline-size;
    padding: clamp(1.1rem, 2.7vw, 2.25rem) clamp(1rem, 3.1vw, 2.8rem) clamp(1.5rem, 3.5vw, 3rem);
    margin-block: clamp(1rem, 2.7vw, 2.25rem);
    border: 1px solid var(--line);
    background: radial-gradient(ellipse at 53% 47%, #363636 0, #232323 37%, #191919 73%);
}
.hero h1 {
    position: relative;
    z-index: 1;
    font-size: clamp(2rem, min(8vw, 8.5cqi), 7rem);
    text-transform: uppercase;
    font-weight: 850;
    letter-spacing: -.08em;
    text-wrap: balance;
    line-height: .98;
}
.hero h1 span { color: var(--ink); }
.hero-stage {
    position: relative;
    display: grid;
    justify-items: center;
    gap: .85rem;
    padding-block: clamp(1.5rem, 3vw, 2.75rem);
}
.hero-discipline {
    justify-self: start;
    margin: 0;
    color: var(--muted);
}
.hero-showcase {
    display: grid;
    justify-items: center;
    width: min(100%, 40rem);
    min-width: 0;
    margin-inline: auto;
}
.hero-device {
    position: relative;
    isolation: isolate;
    display: grid;
    width: 100%;
    padding: .5rem;
    border: 1px solid #747474;
    border-radius: .65rem;
    background: linear-gradient(160deg, #4a4a4a, #111 50%);
    box-shadow: 0 .9rem 2.35rem #000b;
}
.hero-device::after {
    content: "";
    position: absolute;
    inset: auto -2% -.65rem;
    height: .5rem;
    border-radius: 0 0 45% 45%;
    background: linear-gradient(#888, #333);
    z-index: -1;
}
.hero-slide {
    position: relative;
    grid-area: 1 / 1;
    display: grid;
    min-width: 0;
    min-height: 0;
    aspect-ratio: 16 / 9;
    place-items: center;
    overflow: hidden;
    opacity: 0;
    text-align: center;
    background: radial-gradient(ellipse at 50% 22%, #353535, #111 75%);
    text-decoration: none;
    pointer-events: none;
    transition: opacity .9s ease;
}
.hero-slide.is-current { opacity: 1; pointer-events: auto; }
.hero-slide img {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: contain;
    filter: grayscale(1);
}
.hero-showcase-label {
    position: absolute;
    inset: auto 0 0;
    padding: .35rem .5rem;
    overflow-wrap: anywhere;
    background: #141414eb;
    color: var(--ink);
    font-size: .875rem;
    text-decoration: underline;
    text-underline-offset: .2em;
}
.hero-showcase-progress:not([hidden]) {
    display: block;
    width: min(45%, 10rem);
    height: 3px;
    margin-top: 1.15rem;
    overflow: hidden;
    border-radius: 1rem;
    background: #555;
}
.hero-showcase-progress span {
    display: block;
    height: 100%;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left center;
}
.hero-showcase-controls:not([hidden]) {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .35rem;
    margin-top: 1.05rem;
}
.hero-showcase-controls .button { min-height: 2.25rem; padding-block: .2rem; font-size: .875rem; }
.hero-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, .95fr);
    align-items: end;
    gap: 1.25rem;
    padding-top: clamp(1rem, 2.6vw, 1.8rem);
    border-top: 1px solid var(--line);
}
.hero-summary .intro { grid-column: 2; margin: 0; font-size: clamp(1rem, 1.9vw, 1.35rem); }
.hero-summary .actions { grid-row: 1; margin: 0; }
.page-lead {
    margin-block: clamp(1rem, 2.7vw, 2.25rem);
    padding: clamp(1.25rem, 3.4vw, 3rem) clamp(1rem, 3.1vw, 2.8rem);
    border: 1px solid var(--line);
    background: radial-gradient(ellipse at 64% 28%, #303030, #191919 78%);
}
.page-lead h1 {
    max-width: 19ch;
    font-size: clamp(2.25rem, 7.5vw, 6rem);
    font-weight: 850;
    line-height: .94;
    letter-spacing: -.065em;
    text-transform: uppercase;
    text-wrap: balance;
}
.page-lead-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 1rem 2rem;
    margin-top: clamp(1rem, 3vw, 1.85rem);
    padding-top: clamp(.9rem, 2vw, 1.35rem);
    border-top: 1px solid var(--line);
}
.page-lead-summary .intro { margin: 0; font-size: clamp(1rem, 1.9vw, 1.35rem); }
.page-lead-summary .actions, .page-lead-summary .resume-trigger { margin: 0; }
.reading, .contact {
    margin-bottom: clamp(.85rem, 2vw, 1.4rem);
    padding-inline: clamp(1rem, 3.1vw, 2.8rem);
    border: 1px solid var(--line);
    background: var(--surface);
}
main > .reading:last-child, main > .contact:last-child { margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.page-lead .eyebrow, .tile .detail { color: var(--muted); }
.section { border-top-color: var(--line); }
.home-work h2 { margin-bottom: 1.3rem; }
.work-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.work-index p { color: var(--muted); margin-top: .55rem; }
.work-index {
    display: grid;
    align-content: center;
    padding: 1.2rem;
    min-height: 9rem;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    transition: background-color .2s ease;
}
.work-index + .work-index { border-left: 1px solid var(--line); }
.work-index h3 { font-size: clamp(1.45rem, 2.6vw, 2.45rem); }
.work-index:hover, .tile:hover, .collection:hover {
    color: var(--ink);
    border-color: #959595;
    background-color: #272727;
}
.collection { background-image: linear-gradient(150deg, #303030, transparent 70%); }
.app-preview { background: radial-gradient(ellipse at 50% 25%, #303030, transparent 74%), #171717; }
.tile { border-top-color: var(--line); }
@media (max-width: 50rem) {
    .wrap { width: calc(100% - 2rem); }
    .hero-discipline br { display: none; }
}
@media (max-width: 36rem) {
    .hero h1 { font-size: clamp(2rem, 11cqi, 4rem); }
    .hero h1 span { display: block; }
    .hero-summary, .work-links { grid-template-columns: 1fr; }
    .hero-summary .intro { grid-column: 1; }
    .hero-summary .actions { grid-row: auto; }
    .work-index + .work-index { border-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .hero-slide, .work-index { transition: none; }
}

.project-catalog {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    gap: 1rem;
    margin-bottom: clamp(1.5rem, 4vw, 3rem);
}
.catalog-card {
    display: grid;
    grid-template-rows: auto 1fr;
    min-width: 0;
    border: 1px solid var(--line);
    background: var(--surface);
    text-decoration: none;
    transition: border-color .22s ease, background-color .22s ease;
}
.catalog-card:hover, .catalog-card:focus-visible {
    border-color: #979797;
    background: #272727;
    color: var(--ink);
}
.catalog-art {
    position: relative;
    isolation: isolate;
    display: grid;
    place-items: center;
    height: clamp(13rem, 24vw, 21rem);
    overflow: hidden;
    border-bottom: 1px solid var(--line);
    background: radial-gradient(ellipse at 48% 22%, #3d3d3d, #161616 72%);
}
.catalog-art img {
    border: 1px solid #666;
    background: #151515;
    box-shadow: 0 1rem 2rem #0009;
    filter: grayscale(.85);
    transition: transform .35s ease, filter .35s ease;
}
.catalog-card:hover img, .catalog-card:focus-visible img { filter: grayscale(.15); }
.catalog-apps-art {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    padding: clamp(.75rem, 3vw, 2rem);
}
.catalog-apps-art img { grid-area: 1 / 1; }
.catalog-apps-art img:first-child {
    width: 69%;
    max-height: 85%;
    object-fit: contain;
    transform: translateX(-14%) rotate(-5deg);
}
.catalog-apps-art img:last-child {
    width: 25%;
    max-height: 94%;
    object-fit: contain;
    justify-self: end;
    margin-right: 7%;
    transform: translateY(8%) rotate(7deg);
}
.catalog-reports-art { grid-template-rows: minmax(0, 1fr); }
.catalog-reports-art img {
    width: 80%;
    max-height: 78%;
    object-fit: contain;
    transform: rotate(-5deg);
}
.catalog-card:hover .catalog-art img, .catalog-card:focus-visible .catalog-art img { transform: none; }
.catalog-copy {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    padding: clamp(1rem, 2.7vw, 2rem);
}
.catalog-copy h2 { margin-bottom: .4rem; text-transform: uppercase; }
.catalog-copy p { color: var(--muted); }
@media (max-width: 43rem) {
    .project-catalog { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
    .catalog-card, .catalog-art img { transition: none; }
    .catalog-card:is(:hover, :focus-visible) .catalog-apps-art img:first-child { transform: translateX(-14%) rotate(-5deg); }
    .catalog-card:is(:hover, :focus-visible) .catalog-apps-art img:last-child { transform: translateY(8%) rotate(7deg); }
    .catalog-card:is(:hover, :focus-visible) .catalog-reports-art img { transform: rotate(-5deg); }
}


.contact-layout {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: clamp(1.5rem, 4vw, 3rem);
}
.contact-card {
    display: flex;
    flex-direction: column;
    align-items: start;
    justify-content: space-between;
    gap: 1.25rem;
    min-width: 0;
    padding: clamp(1rem, 2.75vw, 1.6rem);
    border: 1px solid var(--line);
    background: var(--surface);
    text-decoration: none;
    transition: border-color .22s ease, background-color .22s ease;
}
.contact-card:hover, .contact-card:focus-visible {
    color: var(--ink);
    border-color: #979797;
    background-color: #292929;
}
.contact-card h2 { margin-bottom: .4rem; font-size: clamp(1.45rem, 3vw, 2rem); }
.contact-card p { color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 48rem) {
    .contact-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
    .contact-card { transition: none; }
}

/* Keep long labels and nested cards inside their available column. */
.card, .card-body, .app-card-body, .contact-card > div, .catalog-copy > div,
.page-lead-summary > *, .hero-summary > *, .study > *, .resume-header h2 {
    min-inline-size: 0;
    overflow-wrap: anywhere;
}
.skills li { max-inline-size: 100%; overflow-wrap: anywhere; }
.screenshot-grid img { height: auto; }
.hero-slide:focus-visible { outline-offset: -3px; z-index: 1; }

@media (max-width: 42rem) {
    .nav { gap: .6rem; }
    .nav-links { width: 100%; column-gap: .15rem; row-gap: .15rem; }
    .nav-links a { font-size: .9rem; padding-inline: .5rem; }
    .page-lead h1 { font-size: clamp(2rem, 9vw, 3.5rem); }
}
@media (max-width: 23rem) {
    .hero, .page-lead, .reading { padding-inline: .8rem; }
    .hero-slide { aspect-ratio: 4 / 3; }
    .hero-showcase-label { font-size: .75rem; }
    .other-work-content { padding-inline: .55rem; }
}

.hero-showcase-label { z-index: 1; }

.engineering-nav { margin-bottom: 1rem; }
.engineering-case p + p { margin-top: .65rem; }
.engineering-gallery { margin-top: 1.25rem; }
.engineering-gallery a {
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 0;
    padding: .5rem;
    border: 1px solid var(--line);
    background: #151515;
}
.engineering-gallery a:hover { border-color: var(--accent); }
.engineering-gallery img { width: 100%; max-height: 24rem; object-fit: contain; }

/* Dark glass surfaces share a soft rim, a cool highlight, and a readable tint. */
:root {
    --glass-radius: clamp(1rem, 2.2vw, 1.75rem);
    --glass-rim: #e9edf13d;
    --glass-sheen: linear-gradient(145deg, #e3ebf419, transparent 53%);
    --glass-tint: #24272de0;
    --glass-shadow: inset 0 1px 0 #f2f7ff29, inset 0 -1px 0 #e9edf10d, 0 .8rem 2rem #0005;
}

body {
    background:
        radial-gradient(ellipse at 15% 6%, #40464e 0, transparent 44rem),
        radial-gradient(ellipse at 92% 34%, #2c3039 0, transparent 42rem),
        #151619;
}

.hero, .page-lead, .card, .catalog-card, .contact-card, .reading,
.study, .other-work-details, .resume {
    border: 1px solid var(--glass-rim);
    border-radius: var(--glass-radius);
    background: var(--glass-sheen), var(--glass-tint);
    box-shadow: var(--glass-shadow);
}

.hero, .page-lead {
    background:
        radial-gradient(ellipse at 20% 0%, #d9e2ef21, transparent 67%),
        linear-gradient(160deg, #51565c38, #1b1e26a8 72%),
        #24272dd4;
}

@supports (backdrop-filter: blur(1px)) {
    .hero, .page-lead, .resume {
        backdrop-filter: blur(18px) saturate(115%);
    }
}

.catalog-art {
    border-start-start-radius: calc(var(--glass-radius) - 1px);
    border-start-end-radius: calc(var(--glass-radius) - 1px);
    background: radial-gradient(ellipse at 44% 0%, #59616b65, transparent 75%), #181a20ad;
}

.hero-device {
    border-radius: 1rem;
    border-color: #d7e2f268;
    background: linear-gradient(150deg, #a7afba85, #232831e8 44%, #111318f5);
    box-shadow: inset 0 1px 0 #fff5, 0 .9rem 2.35rem #0009;
}
.hero-slide { border-radius: .6rem; }

a.card:hover, a.card:focus-visible, .catalog-card:hover, .catalog-card:focus-visible,
.contact-card:hover, .contact-card:focus-visible {
    border-color: #e8f0ff92;
    background: linear-gradient(145deg, #e1ecfc27, transparent 68%), #2d323ae8;
    color: var(--ink);
}

.button {
    border-radius: .7rem;
    border-color: #e8edf34a;
    background: linear-gradient(180deg, #e5ecf418, #e5ecf406);
    box-shadow: inset 0 1px 0 #fff2, 0 2px 6px #0003;
}
.button.primary {
    border-color: #f3f7ff;
    background: linear-gradient(180deg, #fafbff, #cbd2de);
    color: #181b22;
}
.button.primary:hover { background: #f9faff; }

.resume {
    background: linear-gradient(145deg, #353c47df, #1d2027ed 72%);
    box-shadow: var(--glass-shadow), 0 1.5rem 4rem #0009;
    scrollbar-color: #727985 #292e37;
}
.resume-header {
    border-bottom-color: #e9edf12b;
    background: linear-gradient(135deg, #424953, #2b3039);
}
.resume::backdrop { background: #101218a8; backdrop-filter: blur(6px); }

@media (prefers-reduced-transparency: reduce) {
    .hero, .page-lead, .card, .catalog-card, .contact-card, .reading,
    .study, .other-work-details, .resume {
        --glass-tint: #23262c;
        background-color: var(--glass-tint);
        backdrop-filter: none;
    }
    .resume::backdrop { background: #12141a; backdrop-filter: none; }
}

/* Covers use actual project screens or typographic artwork where media is pending. */
.project-cover {
    display: grid;
    place-items: center;
    overflow: hidden;
    min-width: 0;
    aspect-ratio: 16 / 9;
}
.project-cover img {
    position: static;
    inset: auto;
    height: auto;
    opacity: 1;
    object-fit: contain;
}
.cover-title {
    padding: 1rem;
    background: radial-gradient(ellipse at 25% 0%, #414b59, #151820 72%);
    color: #f4f4f4;
    text-align: center;
}
.cover-title span {
    font-size: clamp(1.45rem, 5cqi, 3rem);
    line-height: 1.05;
    font-weight: 820;
    letter-spacing: -.05em;
}
.cover-game { background: #0b1221; }
.cover-game img { width: 100%; }
.bitblast-play .cover-game img, .project-screenshot-cover img { height: 100%; min-height: 0; object-fit: contain; }

.cover-food {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: minmax(0, 1fr);
    gap: 6%;
    padding: 4% 16%;
    background: radial-gradient(ellipse at 74% 7%, #64706a, #272f2c 58%, #151917);
}
.cover-food img {
    width: 100%;
    max-height: 100%;
    min-height: 0;
    border: 2px solid #222b26;
    border-radius: .45rem;
    box-shadow: 0 .7rem 1.4rem #0008;
}
.cover-food img:first-child { transform: translateY(-3%); }
.cover-food img:last-child { transform: translateY(5%); }
.cover-detector { grid-template-rows: minmax(0, 1fr); padding: 5%; background: radial-gradient(ellipse at 35% 0%, #515362, #15161b 78%); }
.cover-detector img { width: 100%; max-height: 100%; min-height: 0; border: 1px solid #ffffff35; border-radius: .35rem; }
.app-preview.has-cover { padding: 0; }
.has-cover .project-cover { position: absolute; inset: 0; opacity: 0; transition: opacity 1.25s ease-in-out; }
.has-cover .project-cover.is-visible { opacity: 1; }
.app-preview.has-cover .project-cover img { position: static; width: 100%; height: auto; opacity: 1; }
.hero-slide .project-cover { position: absolute; inset: 0; aspect-ratio: auto; padding-bottom: 2.1rem; }
.hero-slide .project-cover img { filter: none; }
main > .cover-title { margin-bottom: 1rem; max-height: 17rem; border-radius: var(--glass-radius); border: 1px solid var(--glass-rim); }

.reading, .card-body.card, .study {
    background: #23262b;
    box-shadow: none;
    border-color: #42474f;
}
.project-demo .app-video { width: min(100%, 55rem); }
@media (prefers-reduced-motion: reduce) {
    .has-cover .project-cover { transition: none; }
}

.bitblast-play .project-cover, .project-screenshot-cover {
    margin-bottom: 1rem;
    max-height: 24rem;
    border: 1px solid var(--glass-rim);
    border-radius: var(--glass-radius);
}
.bitblast-play h3 { margin-top: 1.4rem; }
.game-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
    gap: .65rem;
    margin: .8rem 0 0;
}
.game-controls > div { padding: .65rem .8rem; border: 1px solid var(--line); border-radius: .65rem; }
.game-controls dd { margin: .4rem 0 0; color: var(--muted); overflow-wrap: anywhere; }
.game-controls kbd { display: inline-block; padding: .05rem .4rem; border: 1px solid var(--glass-rim); border-radius: .25rem; }

/* Preserve the full phone screen inside the landscape project frames. */
.runi-preview {
    position: relative;
    isolation: isolate;
    grid-template-rows: minmax(0, 1fr);
    background: #15191e;
}
.runi-preview::before {
    content: "";
    position: absolute;
    inset: -1rem;
    z-index: -1;
    background: url("images/runi/route-progress.jpg") center / cover no-repeat;
    filter: blur(18px) brightness(.35);
    pointer-events: none;
}
.runi-preview > img,
.runi-preview.has-cover .project-cover img {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: contain;
}
.runi-preview.has-cover .project-cover { grid-template-rows: minmax(0, 1fr); }
.runi-preview[data-preview-images] > img {
    width: calc(100% - 1.2rem);
    height: calc(100% - 1.2rem);
}
