/* =========================================================
   PORTFOLIO — standalone black theme
   Oswald (display) + Helvetica (body)
   ========================================================= */

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

:root {
    --bg:        #000000;
    --ink:       #f4f4f4;
    --muted:     #7c7c7c;
    --line:      rgba(255, 255, 255, 0.13);
    --line-soft: rgba(255, 255, 255, 0.06);
    --ease:      cubic-bezier(.22, 1, .36, 1);
    --display:   "Oswald", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --body:      "Helvetica Neue", Helvetica, Arial, sans-serif;
}

html, body { height: 100%; }

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--body);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

/* soft vignette so the black never reads as flat */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 60;
    background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .75) 100%);
}

a { color: inherit; text-decoration: none; }

/* =========================================================
   HUB — 2x2 grid with the circle sitting on the crosshair
   ========================================================= */

.hub {
    position: relative;
    height: 100vh;
    height: 100dvh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

/* the cross that splits the four quadrants, drawn outwards on load */
.hub::before,
.hub::after {
    content: "";
    position: absolute;
    background: var(--line);
    z-index: 5;
    pointer-events: none;
}

.hub::before {
    left: 50%;
    top: 0;
    width: 1px;
    height: 100%;
    transform: translateX(-50%) scaleY(0);
    animation: drawY 1.1s var(--ease) .15s forwards;
}

.hub::after {
    top: 50%;
    left: 0;
    height: 1px;
    width: 100%;
    transform: translateY(-50%) scaleX(0);
    animation: drawX 1.1s var(--ease) .15s forwards;
}

@keyframes drawY { to { transform: translateX(-50%) scaleY(1); } }
@keyframes drawX { to { transform: translateY(-50%) scaleX(1); } }

/* ---------- tiles ---------- */

.tile {
    position: relative;
    overflow: hidden;
    display: flex;
    padding: clamp(28px, 5vw, 72px);
    isolation: isolate;
    transition: background-color .6s var(--ease);
}

/* pointer-following glow */
.tile__glow {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0;
    transition: opacity .5s var(--ease);
    background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%),
                rgba(255, 255, 255, .10), transparent 70%);
}

.tile:hover .tile__glow,
.tile:focus-visible .tile__glow { opacity: 1; }

/* corner sweep fill - inset and rounded so the edges stay soft */
.tile::before {
    content: "";
    position: absolute;
    inset: 10px;
    z-index: -1;
    border-radius: 26px;
    background: #ffffff;
    transform: scale(0);
    transform-origin: var(--origin, center);
    transition: transform .75s var(--ease);
}

.tile:hover::before,
.tile:focus-visible::before { transform: scale(1); }

.tile__inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transform: translateY(26px);
    opacity: 0;
    animation: riseIn .9s var(--ease) forwards;
    animation-delay: calc(.45s + var(--i) * .12s);
}

@keyframes riseIn { to { transform: none; opacity: 1; } }

.tile__title {
    font-family: var(--display);
    font-weight: 500;
    text-transform: uppercase;
    font-size: clamp(34px, 5.4vw, 76px);
    line-height: .94;
    letter-spacing: .02em;
    transition: color .45s var(--ease), letter-spacing .6s var(--ease);
}

.tile:hover .tile__title { letter-spacing: .05em; }

.tile__sub {
    font-size: clamp(11px, 1vw, 13px);
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--muted);
    max-width: 30ch;
    transition: color .45s var(--ease);
}

.tile__go {
    margin-top: 14px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--display);
    font-weight: 300;
    font-size: 12px;
    letter-spacing: .3em;
    text-transform: uppercase;
    color: var(--muted);
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity .5s var(--ease), transform .5s var(--ease), color .45s var(--ease);
}

.tile__go span {
    display: block;
    width: 34px;
    height: 1px;
    background: currentColor;
    transition: width .5s var(--ease);
}

.tile:hover .tile__go,
.tile:focus-visible .tile__go { opacity: 1; transform: none; }
.tile:hover .tile__go span { width: 56px; }

/* ---------- a tile with a cover picture behind it ---------- */

.tile__cover {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    transform: scale(1.02);
    filter: grayscale(.45);
    transition: transform 1s var(--ease), filter .7s var(--ease);
}

/* the semi transparent layer that keeps the words readable */
.tile__cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .68);
    transition: background-color .6s var(--ease);
}

.tile--cover:hover .tile__cover,
.tile--cover:focus-visible .tile__cover {
    transform: scale(1.07);
    filter: grayscale(0);
}

/* hovering darkens the picture rather than sweeping white over it, so the
   words never end up fighting a bright background */
.tile--cover:hover .tile__cover::after,
.tile--cover:focus-visible .tile__cover::after { background: rgba(0, 0, 0, .8); }

.tile--cover::before { display: none; }

/* the words stay white, and carry a glow so they read over any picture */
.tile--cover .tile__title,
.tile--cover .tile__sub,
.tile--cover .tile__go { text-shadow: 0 2px 18px rgba(0, 0, 0, .95); }

.tile--cover:hover .tile__title,
.tile--cover:focus-visible .tile__title {
    color: #ffffff;
    text-shadow: 0 0 12px rgba(255, 255, 255, .65),
                 0 0 34px rgba(255, 255, 255, .4),
                 0 2px 20px rgba(0, 0, 0, 1);
}

.tile--cover:hover .tile__sub,
.tile--cover:hover .tile__go,
.tile--cover:focus-visible .tile__sub,
.tile--cover:focus-visible .tile__go {
    color: #ffffff;
    text-shadow: 0 0 16px rgba(255, 255, 255, .3), 0 2px 14px rgba(0, 0, 0, 1);
}

.tile--cover .tile__ghost { color: rgba(255, 255, 255, .07); }
.tile--cover:hover .tile__ghost { color: rgba(255, 255, 255, .11); }

/* ghost numeral pinned to the outer corner of each quadrant */
.tile__ghost {
    position: absolute;
    z-index: 1;
    font-family: var(--display);
    font-weight: 200;
    font-size: clamp(120px, 19vw, 280px);
    line-height: .8;
    color: rgba(255, 255, 255, .045);
    user-select: none;
    pointer-events: none;
    transition: color .55s var(--ease), transform .9s var(--ease);
}

.tile:hover .tile__ghost {
    color: rgba(0, 0, 0, .07);
    transform: scale(1.06);
}

/* everything flips to black under the white sweep - only on the tiles that
   have no cover picture, since those keep their white text instead */
.tile:not(.tile--cover):hover .tile__title,
.tile:not(.tile--cover):focus-visible .tile__title { color: #000; }

.tile:not(.tile--cover):hover .tile__sub,
.tile:not(.tile--cover):hover .tile__go,
.tile:not(.tile--cover):focus-visible .tile__sub,
.tile:not(.tile--cover):focus-visible .tile__go { color: rgba(0, 0, 0, .62); }

/* ---------- per-quadrant placement ---------- */

.q1 { --origin: top left;     align-items: flex-start; justify-content: flex-start; }
.q2 { --origin: top right;    align-items: flex-start; justify-content: flex-end;   text-align: right; }
.q3 { --origin: bottom left;  align-items: flex-end;   justify-content: flex-start; }
.q4 { --origin: bottom right; align-items: flex-end;   justify-content: flex-end;   text-align: right; }

.q2 .tile__inner, .q4 .tile__inner { align-items: flex-end; }
.q2 .tile__go,    .q4 .tile__go    { flex-direction: row-reverse; }

.q1 .tile__ghost { top: -.08em;    left: clamp(14px, 3vw, 46px);  }
.q2 .tile__ghost { top: -.08em;    right: clamp(14px, 3vw, 46px); }
.q3 .tile__ghost { bottom: -.14em; left: clamp(14px, 3vw, 46px);  }
.q4 .tile__ghost { bottom: -.14em; right: clamp(14px, 3vw, 46px); }

/* =========================================================
   CORE — the circle on the crosshair
   ========================================================= */

.core {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 20;
    width: clamp(190px, 25vmin, 290px);
    aspect-ratio: 1;
    transform: translate(-50%, -50%) scale(.6);
    opacity: 0;
    pointer-events: none;              /* hover passes straight through to the tiles */
    animation: coreIn 1.2s var(--ease) .5s forwards;
}

@keyframes coreIn { to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }

/* the profile picture — and the way back to the main site */
.core__disc {
    position: absolute;
    inset: 12%;
    border-radius: 50%;
    overflow: hidden;
    background: #000;
    border: 1px solid var(--line);
    z-index: 1;
    pointer-events: auto;              /* the disc is the only clickable part */
    box-shadow: 0 0 0 8px #000, 0 0 50px 12px rgba(0, 0, 0, .9);
    transition: border-color .5s var(--ease), transform .6s var(--ease);
}

.core__disc:hover,
.core__disc:focus-visible {
    border-color: rgba(255, 255, 255, .5);
    transform: scale(1.04);
}

.core__photo {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .9s var(--ease);
}

.core__disc:hover .core__photo,
.core__disc:focus-visible .core__photo { transform: scale(1.07); }

/* dotted inner orbit, riding above the photo */
.core__disc::after {
    content: "";
    position: absolute;
    inset: 9px;
    z-index: 4;
    border-radius: 50%;
    border: 1px dashed rgba(255, 255, 255, .18);
    pointer-events: none;
    opacity: 0;
    transition: opacity .5s var(--ease);
    animation: spin 24s linear infinite reverse;
}

.core.is-over .core__disc::after { opacity: 1; }

/* scrim + caption, only shown when there is something to say */
.core__overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 16px;
    background: rgba(0, 0, 0, .76);
    opacity: 0;
    transition: opacity .45s var(--ease);
}

.core.is-active .core__overlay,
.core__disc:hover .core__overlay,
.core__disc:focus-visible .core__overlay { opacity: 1; }

.core__ring {
    position: absolute;
    inset: 0;
    z-index: 2;                        /* above the disc glow, never under it */
    overflow: visible;
    opacity: 0;                        /* at rest the circle is just the icon */
    transition: opacity .55s var(--ease);
    animation: spin 34s linear infinite;
}

.core.is-over .core__ring { opacity: 1; }

.core__ring text {
    font-family: var(--display);
    font-weight: 300;
    font-size: 10px;
    letter-spacing: .2em;
    text-transform: uppercase;
    fill: rgba(255, 255, 255, .45);
}

@keyframes spin { to { transform: rotate(360deg); } }

.core__eyebrow {
    display: block;
    font-family: var(--display);
    font-weight: 200;
    font-size: 9px;
    letter-spacing: .4em;
    text-transform: uppercase;
    color: var(--muted);
}

.core__label {
    display: block;
    font-family: var(--display);
    font-weight: 500;
    text-transform: uppercase;
    font-size: clamp(14px, 1.9vmin, 20px);
    letter-spacing: .1em;
    line-height: 1.15;
    margin-top: 6px;
    transition: opacity .28s var(--ease), transform .28s var(--ease);
}

.core__label.is-swapping { opacity: 0; transform: translateY(-7px); }

.core__dot {
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #fff;
    margin: 10px auto 0;
    animation: pulse 2.6s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: .25; transform: scale(1); }
    50%      { opacity: 1;   transform: scale(1.45); }
}

/* =========================================================
   Floating chrome (back link / corner meta)
   ========================================================= */

.chrome {
    position: fixed;
    z-index: 40;
    font-family: var(--display);
    font-weight: 300;
    font-size: 11px;
    letter-spacing: .3em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .92);
    text-shadow: 0 0 14px rgba(0, 0, 0, .9);
    mix-blend-mode: difference;
    opacity: 0;
    animation: fadeIn 1s var(--ease) 1.1s forwards;
}

.chrome--tl { top: clamp(16px, 2.4vh, 26px); left: clamp(18px, 3vw, 40px); }
.chrome--br { bottom: clamp(18px, 3vh, 34px); right: clamp(18px, 3vw, 40px); }

@keyframes fadeIn { to { opacity: 1; } }

a.chrome { transition: color .35s var(--ease), letter-spacing .35s var(--ease); }
a.chrome:hover { color: #fff; letter-spacing: .38em; }

/* the back link is a button so it reads as one */
a.chrome--tl {
    padding: 9px 18px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 50px;
    font-weight: 400;
}

a.chrome--tl:hover { border-color: #fff; letter-spacing: .3em; }

/* =========================================================
   SECTION PAGES
   every one is a single fixed screen - the header, the highlights and
   the footer share the height between them and nothing ever scrolls
   ========================================================= */

.page {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.page__head {
    position: relative;
    flex: 0 0 auto;
    padding: clamp(72px, 12vh, 132px) clamp(30px, 5vw, 96px) clamp(22px, 4vh, 44px);
    border-bottom: 1px solid var(--line);
}

.page__head::before {
    content: "";
    position: absolute;
    top: -60%;
    left: -8%;
    width: 50vw;
    height: 180%;
    background: radial-gradient(circle, rgba(255, 255, 255, .08), transparent 66%);
    pointer-events: none;
}

/* the title carries the page, so it is the heaviest weight Oswald has */
.page__title {
    position: relative;
    font-family: var(--display);
    font-weight: 700;
    text-transform: uppercase;
    font-size: clamp(40px, 9vmin, 118px);
    line-height: .9;
    letter-spacing: .005em;
    color: #ffffff;
    text-shadow: 0 2px 30px rgba(0, 0, 0, .9);
}

/* ---------- highlights ---------- */

.page__body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: clamp(22px, 4vh, 44px) clamp(30px, 5vw, 96px) clamp(22px, 4vh, 44px);
}

.highlights__head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: clamp(12px, 2vh, 20px);
    border-bottom: 1px solid var(--line-soft);
    margin-bottom: clamp(16px, 3vh, 34px);
}

.section__label {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(11px, 1.1vmin, 13px);
    letter-spacing: .4em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .85);
}

/* the way through to the full list - wired up later */
.viewMore {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(10px, 1vmin, 12px);
    letter-spacing: .3em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .9);
    background: transparent;
    padding: 10px 22px;
    border: 1px solid var(--line);
    border-radius: 50px;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .4s var(--ease), color .4s var(--ease),
                border-color .4s var(--ease), letter-spacing .4s var(--ease);
}

.viewMore:hover,
.viewMore:focus-visible {
    background: #ffffff;
    border-color: #ffffff;
    color: #000000;
    letter-spacing: .34em;
}

/* three boxes of exactly the same width and height, filling what is left */
.workGrid {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 1fr;
    gap: clamp(12px, 1.6vw, 26px);
}

.work {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    padding: clamp(20px, 2.4vw, 38px);
    background: #060606;
    border: 1px solid var(--line-soft);
    border-radius: 22px;
    transition: background-color .5s var(--ease), border-color .5s var(--ease),
                transform .5s var(--ease);
}

.work:hover {
    background: #0c0c0c;
    border-color: rgba(255, 255, 255, .22);
    transform: translateY(-4px);
}

.work__tag {
    font-family: var(--display);
    font-weight: 300;
    font-size: clamp(9px, .95vmin, 11px);
    letter-spacing: .36em;
    text-transform: uppercase;
    color: var(--muted);
}

.work__title {
    font-family: var(--display);
    font-weight: 500;
    text-transform: uppercase;
    font-size: clamp(19px, 2.4vmin, 32px);
    line-height: 1.05;
    margin: clamp(12px, 2vh, 22px) 0 clamp(8px, 1.4vh, 14px);
    transition: transform .5s var(--ease);
}

.work:hover .work__title { transform: translateX(6px); }

.work__text {
    font-size: clamp(11px, 1.2vmin, 13px);
    line-height: 1.7;
    color: #a2a2a2;
}

.page__foot {
    flex: 0 0 auto;
    padding: clamp(14px, 2.4vh, 26px) clamp(30px, 5vw, 96px);
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    font-family: var(--display);
    font-weight: 300;
    font-size: clamp(10px, 1vmin, 12px);
    letter-spacing: .28em;
    text-transform: uppercase;
    color: var(--muted);
}

.page__foot a { transition: color .35s var(--ease); }
.page__foot a:hover { color: #fff; }

/* =========================================================
   GAME CARDS — the picture is the card, built by js/games.js
   ========================================================= */

.gameCard {
    justify-content: space-between;    /* year at the top, title at the bottom */
    padding: clamp(18px, 2.2vw, 30px);
    background: #060606;
}

.gameCard__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    transform: scale(1.02);
    filter: grayscale(.35) brightness(.6);
    transition: transform .9s var(--ease), filter .6s var(--ease);
}

.gameCard:hover .gameCard__bg {
    transform: scale(1.08);
    filter: grayscale(0) brightness(.78);
}

/* the picture is darkened towards the bottom so the words always read */
.gameCard__scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    /* dark at the bottom for the title, and again at the top for the year */
    background: linear-gradient(to top,
                rgba(0, 0, 0, .92) 0%,
                rgba(0, 0, 0, .5) 34%,
                rgba(0, 0, 0, .22) 64%,
                rgba(0, 0, 0, .62) 100%);
}

.gameCard__body {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gameCard__year {
    position: relative;
    z-index: 2;
    font-family: var(--display);
    font-weight: 300;
    font-size: clamp(10px, 1.05vmin, 12px);
    letter-spacing: .34em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .65);
}

.gameCard__title {
    font-family: var(--display);
    font-weight: 600;
    text-transform: uppercase;
    font-size: clamp(20px, 2.6vmin, 34px);
    line-height: 1.02;
    color: #fff;
    text-shadow: 0 2px 18px rgba(0, 0, 0, .8);
    transition: transform .5s var(--ease);
}

.gameCard:hover .gameCard__title { transform: translateX(5px); }

.gameCard__go {
    margin-top: 8px;
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(10px, 1.05vmin, 12px);
    letter-spacing: .3em;
    text-transform: uppercase;
    color: #fff;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .45s var(--ease), transform .45s var(--ease);
}

.gameCard:hover .gameCard__go,
.gameCard:focus-visible .gameCard__go { opacity: 1; transform: none; }

.gamesError {
    grid-column: 1 / -1;
    align-self: center;
    text-align: center;
    font-size: clamp(12px, 1.3vmin, 14px);
    line-height: 1.7;
    color: var(--muted);
}

/* ---------- the opening statement, sat alongside the game cards ---------- */

.statement {
    justify-content: space-between;
    background: linear-gradient(155deg, #141414 0%, #070707 72%);
    border-color: rgba(255, 255, 255, .13);
}

.statement:hover {
    border-color: rgba(255, 255, 255, .26);
    transform: translateY(-4px);
}

/* the year sat behind it all, the same trick the hub tiles use */
.statement__ghost {
    position: absolute;
    right: -.04em;
    bottom: -.14em;
    z-index: 0;
    font-family: var(--display);
    font-weight: 200;
    font-size: clamp(84px, 13vmin, 180px);
    line-height: .78;
    color: rgba(255, 255, 255, .045);
    user-select: none;
    pointer-events: none;
    transition: color .6s var(--ease), transform .9s var(--ease);
}

.statement:hover .statement__ghost {
    color: rgba(255, 255, 255, .07);
    transform: scale(1.05);
}

.statement .work__tag,
.statement__body,
.statement__meta { position: relative; z-index: 1; }

.statement__body {
    display: flex;
    align-items: center;
    flex: 1;
    padding: clamp(14px, 2vh, 24px) 0;
}

.statement__text {
    font-family: var(--display);
    font-weight: 300;
    font-size: clamp(15px, 2.05vmin, 25px);
    line-height: 1.34;
    letter-spacing: .01em;
    color: rgba(255, 255, 255, .68);
}

/* the parts worth reading first */
.statement__text em {
    font-style: normal;
    font-weight: 600;
    color: #fff;
}

.statement__meta {
    font-family: var(--display);
    font-weight: 300;
    font-size: clamp(9px, .95vmin, 11px);
    letter-spacing: .34em;
    text-transform: uppercase;
    color: var(--muted);
}

/* =========================================================
   VIDEO PROJECTS — built by js/other.js
   ========================================================= */

#projectView {
    position: fixed;
    inset: 0;
    width: 100vw;
    max-width: none;
    height: 100vh;
    max-height: none;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: #000;
    overflow: hidden;
    animation: listIn .35s var(--ease);
}

#projectView::backdrop { background: #000; }

.projectBody {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: clamp(20px, 3.4vh, 40px) clamp(30px, 5vw, 96px) clamp(34px, 6vh, 70px);
}

.projectBody::-webkit-scrollbar { width: 10px; }
.projectBody::-webkit-scrollbar-track { background: transparent; }
.projectBody::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .16);
    border-radius: 50px;
}

.projectText {
    max-width: none;
    margin-bottom: clamp(22px, 4vh, 44px);
    font-size: clamp(12px, 1.3vmin, 15px);
    line-height: 1.8;
    color: #a8a8a8;
}

/* one row per video - the player on the left, what it is on the right */
.videoList {
    display: flex;
    flex-direction: column;
    gap: clamp(18px, 3vh, 34px);
}

.video {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    align-items: center;
    gap: clamp(18px, 2.5vw, 40px);
}

.video__frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #0a0a0a;
    border: 1px solid var(--line-soft);
    overflow: hidden;
}

/* the picture that stands in until the video is asked for */
.video__thumb {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
}

.video__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(.3) brightness(.72);
    transition: filter .5s var(--ease), transform .8s var(--ease);
}

.video__thumb:hover img,
.video__thumb:focus-visible img {
    filter: none;
    transform: scale(1.04);
}

/* the play triangle in the middle */
.video__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    width: clamp(48px, 5vmin, 68px);
    height: clamp(48px, 5vmin, 68px);
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 50%;
    background: rgba(0, 0, 0, .45);
    transition: background-color .35s var(--ease), border-color .35s var(--ease);
}

.video__play::after {
    content: "";
    width: 0;
    height: 0;
    margin-left: 4px;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-left: 15px solid #fff;
    transition: border-left-color .35s var(--ease);
}

.video__thumb:hover .video__play,
.video__thumb:focus-visible .video__play {
    background: #fff;
    border-color: #fff;
}

.video__thumb:hover .video__play::after { border-left-color: #000; }

/* a website preview gets a cross of arrows rather than a play triangle */
.video__play--site::after {
    width: 16px;
    height: 16px;
    margin: 0;
    border: 2px solid #fff;
    border-left: 2px solid #fff;
    border-radius: 3px;
    transition: border-color .35s var(--ease);
}

.video__thumb:hover .video__play--site::after { border-color: #000; }

.video__player {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.video__title {
    font-family: var(--display);
    font-weight: 600;
    text-transform: uppercase;
    font-size: clamp(17px, 2.2vmin, 28px);
    line-height: 1.05;
    letter-spacing: .03em;
    color: #fff;
}

.video__date {
    display: block;
    margin-top: 10px;
    font-family: var(--display);
    font-weight: 300;
    font-size: clamp(10px, 1.05vmin, 12px);
    letter-spacing: .3em;
    text-transform: uppercase;
    color: var(--muted);
}

.video__links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: clamp(14px, 2vh, 22px);
}

.videoLink {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(10px, 1.05vmin, 12px);
    letter-spacing: .28em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .9);
    padding: 10px 20px;
    border: 1px solid var(--line);
    border-radius: 50px;
    white-space: nowrap;
    transition: background-color .4s var(--ease), color .4s var(--ease),
                border-color .4s var(--ease);
}

.videoLink:hover {
    background: #fff;
    border-color: #fff;
    color: #000;
}

/* =========================================================
   MUSIC — album directory and preview player, built by js/music.js
   ========================================================= */

/* ---------- the shelf of albums ---------- */

#albumDirectory {
    position: fixed;
    inset: 0;
    width: 100vw;
    max-width: none;
    height: 100vh;
    max-height: none;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: #000;
    overflow: hidden;
    animation: listIn .35s var(--ease);
}

#albumDirectory::backdrop { background: #000; }

.albumShelf {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(clamp(150px, 15vw, 230px), 1fr));
    gap: clamp(16px, 2vw, 34px);
    padding: clamp(22px, 4vh, 44px) clamp(30px, 5vw, 96px) clamp(34px, 6vh, 70px);
    align-content: start;
}

.albumShelf::-webkit-scrollbar { width: 10px; }
.albumShelf::-webkit-scrollbar-track { background: transparent; }
.albumShelf::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .16);
    border-radius: 50px;
}

.albumTile {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.albumTile__art {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: #101010;
    border: 1px solid var(--line-soft);
    margin-bottom: 12px;
    filter: grayscale(.3) brightness(.85);
    transition: filter .5s var(--ease), transform .6s var(--ease),
                border-color .5s var(--ease);
}

.albumTile:hover .albumTile__art,
.albumTile:focus-visible .albumTile__art {
    filter: none;
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, .3);
}

.albumTile__name {
    font-family: var(--display);
    font-weight: 500;
    text-transform: uppercase;
    font-size: clamp(13px, 1.5vmin, 18px);
    letter-spacing: .05em;
    line-height: 1.1;
    color: #fff;
}

.albumTile__meta {
    font-family: var(--display);
    font-weight: 300;
    font-size: clamp(9px, .95vmin, 11px);
    letter-spacing: .28em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ---------- one album open ---------- */

#albumView {
    position: fixed;
    inset: 0;
    width: 100vw;
    max-width: none;
    height: 100vh;
    max-height: none;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: #000;
    overflow: hidden;
    animation: listIn .35s var(--ease);
}

#albumView::backdrop { background: #000; }

.albumViewInner {
    display: grid;
    grid-template-columns: clamp(280px, 32vw, 460px) 1fr;
    height: 100vh;
}

/* the cover and the album name, held on the left */
.albumSide {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
    padding: clamp(30px, 5vh, 60px) clamp(26px, 3vw, 54px);
    border-right: 1px solid var(--line);
    background: #050505;
}

.albumSide__art {
    display: block;
    width: 100%;
    max-width: 340px;
    aspect-ratio: 1;
    object-fit: cover;
    background: #101010;
    border: 1px solid var(--line-soft);
    margin-bottom: clamp(16px, 2.6vh, 28px);
}

.albumSide__title {
    font-family: var(--display);
    font-weight: 700;
    text-transform: uppercase;
    font-size: clamp(24px, 3.6vmin, 44px);
    line-height: .96;
    color: #fff;
}

.albumSide__meta {
    font-family: var(--display);
    font-weight: 300;
    font-size: clamp(10px, 1.05vmin, 12px);
    letter-spacing: .34em;
    text-transform: uppercase;
    color: var(--muted);
}

.albumSide__note {
    margin-top: 14px;
    max-width: 32ch;
    font-size: clamp(11px, 1.15vmin, 13px);
    line-height: 1.7;
    color: #7d7d7d;
}

.albumSide__close { margin-top: clamp(18px, 3vh, 32px); }

/* ---------- the tracks ---------- */

.trackList {
    min-height: 0;
    overflow-y: auto;
    padding: clamp(24px, 5vh, 60px) clamp(26px, 4vw, 80px);
}

.trackList::-webkit-scrollbar { width: 10px; }
.trackList::-webkit-scrollbar-track { background: transparent; }
.trackList::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .16);
    border-radius: 50px;
}

.track {
    display: flex;
    align-items: center;
    gap: clamp(14px, 1.6vw, 22px);
    padding: clamp(10px, 1.4vh, 15px) clamp(10px, 1vw, 16px);
    border-bottom: 1px solid var(--line-soft);
    transition: background-color .3s var(--ease), padding-left .3s var(--ease);
}

.track:hover { background: #0d0d0d; padding-left: clamp(16px, 1.6vw, 24px); }

.track.is-playing { background: #121212; }

/* the play and pause button, the only control there is */
.track__play {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: clamp(34px, 3.4vmin, 44px);
    height: clamp(34px, 3.4vmin, 44px);
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: background-color .3s var(--ease), border-color .3s var(--ease);
}

.track__play:hover,
.track__play:focus-visible { background: #fff; border-color: #fff; }

/* the two shapes are drawn in css, so there is no icon file to load */
.icon {
    grid-area: 1 / 1;
    display: block;
    transition: border-color .3s var(--ease), background-color .3s var(--ease);
}

.icon--play {
    width: 0;
    height: 0;
    margin-left: 3px;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 10px solid #fff;
}

.icon--pause {
    width: 10px;
    height: 12px;
    border-left: 3px solid #fff;
    border-right: 3px solid #fff;
}

.track__play:hover .icon--play { border-left-color: #000; }
.track__play:hover .icon--pause { border-left-color: #000; border-right-color: #000; }

/* whichever one belongs is the one showing */
.icon--pause { visibility: hidden; }
.track.is-playing .icon--play { visibility: hidden; }
.track.is-playing .icon--pause { visibility: visible; }

.track.is-playing .track__play { border-color: #fff; }

.track__number {
    flex: 0 0 auto;
    font-family: var(--display);
    font-weight: 300;
    font-size: clamp(10px, 1.05vmin, 12px);
    letter-spacing: .2em;
    color: var(--muted);
}

.track__title {
    flex: 1;
    min-width: 0;
    font-family: var(--display);
    font-weight: 400;
    text-transform: uppercase;
    font-size: clamp(14px, 1.7vmin, 20px);
    letter-spacing: .04em;
    color: rgba(255, 255, 255, .88);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.track.is-playing .track__title { color: #fff; }

.track__time {
    flex: 0 0 auto;
    font-family: var(--display);
    font-weight: 300;
    font-size: clamp(10px, 1.05vmin, 12px);
    letter-spacing: .2em;
    color: var(--muted);
}

/* a bar that creeps across the row while the preview plays */
.track.is-playing {
    background-image: linear-gradient(to right, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02));
}

/* =========================================================
   3D GALLERY — built by js/models.js
   the page stays fixed, only the gallery itself scrolls
   ========================================================= */

.page__lede {
    position: relative;
    margin-top: clamp(12px, 2vh, 20px);
    max-width: 68ch;
    font-size: clamp(11px, 1.25vmin, 14px);
    line-height: 1.75;
    color: #a8a8a8;
}

.section__note {
    font-family: var(--display);
    font-weight: 300;
    font-size: clamp(9px, 1vmin, 11px);
    letter-spacing: .3em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}

.gallery {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1vw, 14px);
    padding: clamp(16px, 2.6vh, 30px) clamp(30px, 5vw, 96px) clamp(30px, 5vh, 60px);
}

.gallery::-webkit-scrollbar { width: 10px; }
.gallery::-webkit-scrollbar-track { background: transparent; }
.gallery::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .16);
    border-radius: 50px;
}

/* a row is however many pictures it was given */
.galleryRow {
    display: grid;
    grid-template-columns: repeat(var(--cols, 3), 1fr);
    gap: clamp(8px, 1vw, 14px);
}

/* a highlight box can be a button, so it needs the browser styling off */
button.work,
button.gameCard {
    font: inherit;
    text-align: left;
    cursor: pointer;
}

/* ---------- the gallery, opened by view more ---------- */

#galleryView {
    position: fixed;
    inset: 0;
    width: 100vw;
    max-width: none;
    height: 100vh;
    max-height: none;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: #000;
    overflow: hidden;
    animation: listIn .35s var(--ease);
}

#galleryView::backdrop { background: #000; }

.galleryViewInner {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ---------- one picture ---------- */

.shot {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: #080808;
    overflow: hidden;
    cursor: zoom-in;
    aspect-ratio: 2 / 1;
}

.shot img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: grayscale(.25) brightness(.9);
    transform: scale(1.01);
    transition: transform .9s var(--ease), filter .6s var(--ease);
}

.shot:hover img,
.shot:focus-visible img {
    transform: scale(1.06);
    filter: none;
}

/* the one massive picture at the top */
.shot--hero {
    aspect-ratio: 2 / 1;
    max-height: 58vh;
}

.shot__label {
    position: absolute;
    left: clamp(14px, 1.6vw, 26px);
    bottom: clamp(12px, 1.4vw, 22px);
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 5px;
    text-align: left;
    font-family: var(--display);
    font-weight: 500;
    text-transform: uppercase;
    font-size: clamp(12px, 1.5vmin, 19px);
    letter-spacing: .08em;
    color: #fff;
    text-shadow: 0 2px 16px rgba(0, 0, 0, .95);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .45s var(--ease), transform .45s var(--ease);
}

.shot:hover .shot__label,
.shot:focus-visible .shot__label { opacity: 1; transform: none; }

/* the big one keeps its caption showing */
.shot--hero .shot__label { opacity: 1; transform: none; }

.shot__label small {
    font-family: var(--body);
    font-weight: 400;
    font-size: clamp(10px, 1.1vmin, 12px);
    letter-spacing: .04em;
    text-transform: none;
    color: rgba(255, 255, 255, .72);
}

.galleryHeading {
    margin-top: clamp(10px, 1.6vh, 20px);
    padding-top: clamp(12px, 2vh, 20px);
    border-top: 1px solid var(--line-soft);
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(10px, 1.1vmin, 12px);
    letter-spacing: .4em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .8);
}

/* ---------- the car folders ---------- */

.folderRow {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(clamp(150px, 15vw, 220px), 1fr));
    gap: clamp(8px, 1vw, 14px);
    padding-bottom: clamp(20px, 3vh, 34px);
}

.folder {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: #080808;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4 / 3;
    outline: 1px solid transparent;
    outline-offset: -1px;
    transition: outline-color .4s var(--ease);
}

.folder:hover,
.folder:focus-visible { outline-color: rgba(255, 255, 255, .4); }

.folder img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(.4) brightness(.5);
    transform: scale(1.02);
    transition: transform .9s var(--ease), filter .6s var(--ease);
}

.folder:hover img,
.folder:focus-visible img {
    transform: scale(1.08);
    filter: grayscale(0) brightness(.66);
}

.folder__body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: clamp(12px, 1.2vw, 20px);
    text-align: left;
    background: linear-gradient(to top, rgba(0, 0, 0, .92), rgba(0, 0, 0, 0));
}

.folder__name {
    font-family: var(--display);
    font-weight: 600;
    text-transform: uppercase;
    font-size: clamp(13px, 1.5vmin, 19px);
    line-height: 1.05;
    letter-spacing: .04em;
    color: #fff;
}

.folder__meta {
    font-family: var(--display);
    font-weight: 300;
    font-size: clamp(9px, .95vmin, 11px);
    letter-spacing: .28em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .6);
}

/* ---------- a folder opened ---------- */

#folderView {
    position: fixed;
    inset: 0;
    width: 100vw;
    max-width: none;
    height: 100vh;
    max-height: none;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: #000;
    overflow: hidden;
    animation: listIn .35s var(--ease);
}

#folderView::backdrop { background: #000; }

.folderViewInner {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.folderViewTop {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: clamp(30px, 6vh, 60px) clamp(30px, 5vw, 96px) clamp(18px, 2.6vh, 28px);
    border-bottom: 1px solid var(--line);
}

.folderViewTitle {
    font-family: var(--display);
    font-weight: 700;
    text-transform: uppercase;
    font-size: clamp(26px, 5vmin, 62px);
    line-height: .94;
    color: #fff;
}

.folderViewYear {
    display: block;
    margin-top: 10px;
    font-family: var(--display);
    font-weight: 300;
    font-size: clamp(10px, 1.05vmin, 12px);
    letter-spacing: .34em;
    text-transform: uppercase;
    color: var(--muted);
}

/* two wide, as asked - the rows carry on if there are more than four */
.folderViewGrid {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(var(--cols, 2), 1fr);
    gap: 0;
    padding: 0 0 clamp(30px, 5vh, 60px);
    align-content: start;
}

/* every box is the shape of the pictures themselves, so none is cropped */
.folderViewGrid .shot { aspect-ratio: 2 / 1; }

/* a set that fits on one row sits in the middle of the screen and gets a
   taller crop, rather than being stretched so far that the picture is
   mostly cropped away */
.folderViewGrid--single {
    align-content: center;
    padding-bottom: 0;
}

.folderViewGrid--single .shot { aspect-ratio: 2 / 1; }

.folderViewGrid::-webkit-scrollbar { width: 10px; }
.folderViewGrid::-webkit-scrollbar-track { background: transparent; }
.folderViewGrid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .16);
    border-radius: 50px;
}

/* ---------- one picture, full size ---------- */

#shotViewer {
    position: fixed;
    inset: 0;
    width: 100vw;
    max-width: none;
    height: 100vh;
    max-height: none;
    margin: 0;
    padding: clamp(20px, 4vh, 54px) clamp(20px, 3vw, 60px);
    border: none;
    background: rgba(0, 0, 0, .96);
    animation: listIn .3s var(--ease);
}

/* a closed dialog is hidden by the browser with display none, so the
   layout only goes on when it is actually open - setting display on the
   dialog itself would leave it covering the page the whole time */
#shotViewer[open] {
    display: flex;
    align-items: center;
    justify-content: center;
}

#shotViewer::backdrop { background: rgba(0, 0, 0, .96); }

#shotViewerImage {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.shotViewerClose {
    position: absolute;
    top: clamp(20px, 3vh, 34px);
    right: clamp(22px, 3vw, 40px);
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(10px, 1.05vmin, 12px);
    letter-spacing: .3em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .9);
    background: transparent;
    padding: 11px 24px;
    border: 1px solid var(--line);
    border-radius: 50px;
    cursor: pointer;
    transition: background-color .4s var(--ease), color .4s var(--ease),
                border-color .4s var(--ease);
}

.shotViewerClose:hover { background: #fff; border-color: #fff; color: #000; }

/* =========================================================
   ALL GAMES — the full record, a page of its own
   ========================================================= */

#gamesList {
    position: fixed;
    inset: 0;
    width: 100vw;
    max-width: none;
    height: 100vh;
    max-height: none;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: #000;
    overflow: hidden;
    animation: listIn .35s var(--ease);
}

#gamesList::backdrop { background: #000; }

@keyframes listIn {
    from { opacity: 0; transform: scale(1.015); }
    to   { opacity: 1; transform: none; }
}

.gamesListInner {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.gamesListTop {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: clamp(34px, 7vh, 70px) clamp(30px, 5vw, 96px) clamp(20px, 3vh, 32px);
    border-bottom: 1px solid var(--line);
}

.gamesListTitle {
    font-family: var(--display);
    font-weight: 700;
    text-transform: uppercase;
    font-size: clamp(30px, 6vmin, 76px);
    line-height: .92;
    color: #fff;
}

.gamesListCount {
    display: block;
    margin-top: 12px;
    font-family: var(--display);
    font-weight: 300;
    font-size: clamp(10px, 1.05vmin, 12px);
    letter-spacing: .34em;
    text-transform: uppercase;
    color: var(--muted);
}

.gamesListClose {
    flex: 0 0 auto;
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(10px, 1.05vmin, 12px);
    letter-spacing: .3em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .9);
    background: transparent;
    padding: 12px 26px;
    border: 1px solid var(--line);
    border-radius: 50px;
    cursor: pointer;
    transition: background-color .4s var(--ease), color .4s var(--ease),
                border-color .4s var(--ease), letter-spacing .4s var(--ease);
}

.gamesListClose:hover,
.gamesListClose:focus-visible {
    background: #fff;
    border-color: #fff;
    color: #000;
    letter-spacing: .34em;
}

/* the record pans sideways - one strip of panels, edge to edge */
.gamesListStrip {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 0;

    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
}

/* each panel fills the height and sits flush against the next one */
.gamesListStrip .gameCard {
    flex: 0 0 auto;
    width: clamp(250px, 25vw, 400px);
    height: 100%;
    min-height: 0;
    aspect-ratio: auto;
    border: none;
    border-right: 1px solid rgba(255, 255, 255, .1);
    border-radius: 0;
    scroll-snap-align: start;
}

/* nothing lifts, or the panels would come apart */
.gamesListStrip .gameCard:hover { transform: none; }

.gamesListStrip::-webkit-scrollbar { height: 10px; }
.gamesListStrip::-webkit-scrollbar-track { background: transparent; }
.gamesListStrip::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .16);
    border-radius: 50px;
}

/* the edge fades so it reads as carrying on past the screen */
.gamesListInner::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: clamp(40px, 6vw, 90px);
    height: 100%;
    pointer-events: none;
    background: linear-gradient(to right, transparent, rgba(0, 0, 0, .85));
}

/* =========================================================
   RETURN POPUP — asks before leaving the portfolio
   built by js/portfolio.js
   ========================================================= */

#returnPopup {
    margin: auto;
    width: min(30em, calc(100vw - 3em));
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: #0a0a0a;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .9);
    animation: popIn .28s var(--ease);
}

#returnPopup::backdrop {
    background: rgba(0, 0, 0, .75);
}

@keyframes popIn {
    from { opacity: 0; transform: translateY(10px) scale(.97); }
    to   { opacity: 1; transform: none; }
}

.returnInner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: clamp(28px, 4vh, 44px) clamp(24px, 3vw, 44px);
}

.returnTitle {
    font-family: var(--display);
    font-weight: 700;
    text-transform: uppercase;
    font-size: clamp(22px, 3.4vmin, 34px);
    line-height: 1.05;
    letter-spacing: .02em;
    color: #fff;
}

.returnText {
    margin-top: 14px;
    max-width: 34ch;
    font-size: clamp(12px, 1.3vmin, 14px);
    line-height: 1.7;
    color: #9a9a9a;
}

.returnButtons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: clamp(22px, 3vh, 32px);
}

.returnBtn {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(10px, 1.1vmin, 12px);
    letter-spacing: .3em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .9);
    background: transparent;
    padding: 13px 26px;
    border: 1px solid var(--line);
    border-radius: 50px;
    cursor: pointer;
    transition: background-color .4s var(--ease), color .4s var(--ease),
                border-color .4s var(--ease), letter-spacing .4s var(--ease);
}

.returnBtn:hover,
.returnBtn:focus-visible {
    background: #fff;
    border-color: #fff;
    color: #000;
    letter-spacing: .34em;
}

/* the one that actually leaves reads as the primary choice */
.returnBtn--go {
    background: #fff;
    border-color: #fff;
    color: #000;
}

.returnBtn--go:hover,
.returnBtn--go:focus-visible {
    background: transparent;
    border-color: #fff;
    color: #fff;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 780px) {

    /* the desktop pages are pinned to the screen - on a phone they scroll */
    body {
        overflow-x: hidden;
        overflow-y: auto;
    }

    /* the vignette is sized to the window, so it has to stay put */
    body::after { position: fixed; }

    /* ---------- hub ---------- */

    .hub {
        height: auto;
        min-height: 100dvh;
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        padding-top: calc(clamp(170px, 46vw, 220px) + clamp(90px, 16vw, 130px));
        padding-bottom: clamp(28px, 8vw, 48px);
    }

    .hub::before,
    .hub::after { display: none; }

    .core {
        width: clamp(170px, 46vw, 220px);
        top: calc(clamp(170px, 46vw, 220px) / 2 + clamp(44px, 11vw, 66px));
    }

    /* a phone has no hover, so the caption stays off and the ring stays on */
    .core__overlay { opacity: 0; }
    .core__ring { opacity: 1; }
    .core__disc::after { opacity: 1; }

    .tile {
        min-height: clamp(150px, 34vw, 210px);
        padding: clamp(22px, 6vw, 34px);
        align-items: center;
        justify-content: flex-start;
        text-align: left;
    }

    /* full width and square cornered on a phone */
    .tile::before {
        inset: 0;
        border-radius: 0;
    }

    /* a hairline between the sections, drawn inside the padding */
    .tile + .tile::after {
        content: "";
        position: absolute;
        top: 0;
        left: clamp(22px, 6vw, 34px);
        right: clamp(22px, 6vw, 34px);
        height: 1px;
        background: var(--line);
    }

    .q2, .q4 { text-align: left; }
    .q2 .tile__inner, .q4 .tile__inner { align-items: flex-start; }
    .q2 .tile__go, .q4 .tile__go { flex-direction: row; }

    /* nothing hovers on a phone, so the arrow is always showing */
    .tile__go {
        opacity: 1;
        transform: none;
        margin-top: 10px;
    }

    .tile__title { font-size: clamp(30px, 9vw, 46px); }
    .tile__sub { font-size: clamp(10px, 2.8vw, 12px); }

    .tile__ghost {
        top: 50%;
        bottom: auto;
        left: auto;
        right: clamp(10px, 4vw, 26px);
        transform: translateY(-50%);
        font-size: 30vw;
    }

    .tile:hover .tile__ghost { transform: translateY(-50%) scale(1.06); }

    /* the corner labels would float over the page as it scrolls */
    .chrome--br { display: none; }

    .chrome--tl {
        top: clamp(14px, 4vw, 22px);
        left: clamp(14px, 4vw, 22px);
        font-size: 10px;
    }

    /* ---------- section pages ---------- */

    .page {
        height: auto;
        min-height: 100dvh;
        overflow: visible;
    }

    .page__head {
        padding: clamp(80px, 20vw, 120px) clamp(22px, 6vw, 40px) clamp(22px, 6vw, 34px);
    }

    .page__title { font-size: clamp(38px, 13vw, 68px); }

    .page__body {
        padding: clamp(24px, 7vw, 40px) clamp(22px, 6vw, 40px) clamp(34px, 9vw, 54px);
    }

    .highlights__head {
        flex-wrap: wrap;
        gap: 14px;
    }

    .section__label { font-size: 11px; }
    .viewMore { font-size: 10px; padding: 9px 18px; }

    /* one box under the other, each as tall as it needs to be */
    .workGrid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 12px;
    }

    .work,
    .gameCard,
    .statement {
        min-height: clamp(150px, 38vw, 200px);
        padding: clamp(20px, 5.5vw, 30px);
        border-radius: 0;
    }

    .gamesListStrip .gameCard { min-height: 0; }

    .work__title { font-size: clamp(20px, 6vw, 26px); }
    .work__text { font-size: 12px; }

    .page__foot {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        padding: clamp(20px, 6vw, 30px) clamp(22px, 6vw, 40px);
    }

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

    .video { grid-template-columns: 1fr; gap: 14px; }

    .projectBody {
        padding: clamp(18px, 5vw, 28px) clamp(22px, 6vw, 40px) clamp(34px, 9vw, 54px);
    }

    .videoLink { font-size: 10px; padding: 9px 16px; }

    /* ---------- music ---------- */

    .albumShelf {
        grid-template-columns: 1fr 1fr;
        gap: 14px;
        padding: clamp(18px, 5vw, 30px) clamp(22px, 6vw, 40px) clamp(34px, 9vw, 54px);
    }

    /* the cover sits above the tracks rather than beside them */
    .albumViewInner {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .albumSide {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 14px;
        padding: clamp(22px, 6vw, 34px);
        border-right: none;
        border-bottom: 1px solid var(--line);
    }

    .albumSide__art {
        width: clamp(84px, 26vw, 130px);
        margin-bottom: 0;
    }

    .albumSide__title { font-size: clamp(22px, 7vw, 32px); }
    .albumSide__note { display: none; }
    .albumSide {
        position: relative;
        padding-right: clamp(88px, 26vw, 120px);
    }

    .albumSide__close {
        position: absolute;
        top: clamp(18px, 5vw, 28px);
        right: clamp(18px, 5vw, 28px);
        margin: 0;
        padding: 9px 16px;
    }

    .trackList { padding: clamp(14px, 4vw, 24px) clamp(18px, 5vw, 30px) clamp(34px, 9vw, 54px); }

    .track { gap: 12px; }
    .track__title { font-size: 14px; }

    /* ---------- 3d gallery ---------- */

    /* one under the other on a phone, whatever the row was meant to be */
    .galleryRow { grid-template-columns: 1fr; }

    .shot--hero { aspect-ratio: 16 / 10; max-height: none; }

    /* there is no hover on a phone, so the labels just stay on */
    .shot__label { opacity: 1; transform: none; }

    .folderRow { grid-template-columns: 1fr 1fr; }

    .folderViewTop {
        align-items: flex-start;
        padding: clamp(28px, 8vw, 44px) clamp(22px, 6vw, 40px) clamp(16px, 4vw, 24px);
    }

    .folderViewTitle { font-size: clamp(24px, 9vw, 40px); }

    .folderViewGrid {
        grid-template-columns: 1fr;
        padding: 0 0 clamp(30px, 8vw, 50px);
    }

    .folderViewGrid .shot,
    .folderViewGrid--single .shot { aspect-ratio: 2 / 1; }

    .folderViewGrid--single { align-content: start; }

    #shotViewer { padding: clamp(56px, 15vw, 80px) 0; }

    /* the whole width of the screen goes to the picture */
    #shotViewerImage { width: 100%; height: auto; }

    /* ---------- all games ---------- */

    .gamesListTop {
        align-items: flex-start;
        padding: clamp(28px, 8vw, 44px) clamp(22px, 6vw, 40px) clamp(16px, 4vw, 24px);
    }

    .gamesListTitle { font-size: clamp(28px, 10vw, 46px); }

    /* on a phone the same strip runs down the page instead of across */
    .gamesListStrip {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0;
        overflow-x: hidden;
        overflow-y: auto;
        scroll-snap-type: y proximity;
        overscroll-behavior-y: contain;
    }

    /* full width, stacked flush against each other */
    .gamesListStrip .gameCard {
        width: 100%;
        height: auto;
        min-height: 0;
        aspect-ratio: 16 / 9;
        border: none;
        border-bottom: 1px solid rgba(255, 255, 255, .1);
        border-radius: 0;
        scroll-snap-align: start;
    }

    /* the fade belongs at the bottom when it runs downwards */
    .gamesListInner::after {
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        height: clamp(40px, 12vw, 80px);
        background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, .85));
    }

    /* ---------- return popup ---------- */

    #returnPopup {
        width: calc(100vw - 2.5em);
        border-radius: 0;
    }
    .returnButtons { width: 100%; }
    .returnBtn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    .tile__inner, .chrome, .reveal { opacity: 1; transform: none; }
    .core { opacity: 1; transform: translate(-50%, -50%); }
}
