/* ==========================================================================
   Game Hermits - front page
   1. Tokens       2. Base           3. Layout       4. Components
   5. Header       6. Hero           7. Sections     8. Footer
   9. Motion
   Mobile first. Breakpoints: 600px (tablet), 900px (laptop), 1000px (work grid)
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
    /* Surfaces */
    --canvas: #121212;
    --surface: #1c1c1c;
    --surface-2: #272727;
    --paper: #fff;
    --text: #fff;
    --muted: rgb(255 255 255 / 0.66);
    --line: rgb(255 255 255 / 0.13);

    /* Brand */
    --red: #ae0808;          /* actions only: buttons and links */
    --red-hover: #d10b0b;
    --amber: #f4ac45;        /* small details: focus, progress, number suffix */
    --navy: #000e4d;         /* Metro Surge glow */

    /* Colour laid over the hero video. For a see-through red use: 174 8 8 */
    --hero-tint: 10 10 10;

    /* Type */
    --font: "Google Sans Code", ui-monospace, "Cascadia Code", Consolas, monospace;
    --font-display: var(--font);
    --tracking: -0.045em;
    --leading: 1;
    --clip: -0.08em;         /* room below a word during the headline reveal */

    /* Space and shape */
    --container: 1360px;
    --gutter: clamp(20px, 4vw, 56px);
    --header: 64px;
    --space: clamp(5rem, 10vw, 9.5rem);
    --gap: 0.75rem;
    --radius: 8px;
    --radius-lg: 12px;

    /* Motion and direction */
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --start: left;
    --dir: 1;

    color-scheme: dark;
}

[lang="ar"] {
    --font: "Cairo", "Segoe UI", Tahoma, sans-serif;
    --tracking: 0;
    --leading: 1.3;
    --clip: -0.28em;
}

[dir="rtl"] {
    --start: right;
    --dir: -1;
}

@media (min-width: 900px) {
    :root { --header: 80px; --gap: 1rem; }
}

@media (min-width: 1800px) {
    :root { --container: 1560px; }
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
[hidden] { display: none !important; }
html:not(.js) :is(.hero__toggle, .lang-btn, .voices__tabs) { display: none; }

html {
    scroll-padding-top: var(--header);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html:has(dialog[open], .site-nav.is-open) { overflow: hidden; }

body {
    background: var(--canvas);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9375rem;
    line-height: 1.7;
    overflow-wrap: break-word;
}

img, video, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: var(--tracking); text-wrap: balance; }
p, blockquote, dd { text-wrap: pretty; }

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

/* 3. Layout ---------------------------------------------------------------- */
.container {
    width: min(var(--container), 100% - var(--gutter) * 2);
    margin-inline: auto;
}

.section { padding-block: var(--space); }
.section--raised { background: var(--surface); }

.section--paper {
    --muted: #596466;
    background: var(--paper);
    color: var(--surface-2);
}

.section__head {
    display: grid;
    gap: 1.5rem;
    margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.section__title {
    max-width: 22ch;
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 4.5rem);
    font-weight: 800;
    line-height: var(--leading);
    text-transform: uppercase;
}

.section__lead {
    max-width: 58ch;
    color: var(--muted);
    font-size: clamp(1rem, 1.25vw, 1.125rem);
}

/* 4. Components ------------------------------------------------------------ */

/* Buttons: a colour wipe on hover */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3.25rem;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius);
    background: linear-gradient(var(--wipe) 0 0) var(--start) / 0% 100% no-repeat var(--base);
    font-weight: 600;
    line-height: 1.35;
    text-align: center;
    transition: background-size 0.5s var(--ease);
}

.btn:hover { background-size: 100% 100%; }
.btn:disabled { cursor: progress; opacity: 0.7; }
.btn--red { --base: var(--red); --wipe: var(--red-hover); }
.btn--ghost { --base: transparent; --wipe: rgb(255 255 255 / 0.14); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.4); }
.btn--small { min-height: 2.75rem; padding: 0.4rem 1.1rem; font-size: 0.8125rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn-row--center { justify-content: center; margin-top: 3rem; }

.icon {
    width: 1.5rem;
    height: 1.5rem;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    flex: none;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.28);
    transition: background-color 0.25s, color 0.25s, opacity 0.25s;
}

.icon-btn:enabled:hover { background: var(--paper); color: var(--canvas); }
.icon-btn:disabled { opacity: 0.3; cursor: default; }

.item-title { margin-bottom: 0.75rem; font-size: 1.1875rem; font-weight: 700; }
.item-text { color: var(--muted); }

/* Horizontal scroller used by achievements and blog posts */
.rail__track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 84%;
    gap: var(--gap);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    padding-block: 3px;
}

.rail__track > li { scroll-snap-align: start; }
.js .rail__track { scrollbar-width: none; }

.rail__nav {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 2rem;
}

[dir="rtl"] .rail__nav .icon { transform: scaleX(-1); }

@media (min-width: 600px) {
    .rail__track { grid-auto-columns: calc((100% - var(--gap)) / 2); }
}

@media (min-width: 900px) {
    .rail__track { grid-auto-columns: calc((100% - var(--gap) * 2) / 3); }
}

.card { position: relative; display: flex; flex-direction: column; }

.card__media {
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--surface-2);
}

.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { display: flex; flex: 1; flex-direction: column; padding-top: 1.5rem; }
.card__date { margin-bottom: 0.5rem; color: var(--muted); font-size: 0.8125rem; }
.card__link { align-self: start; margin-top: 1.25rem; border-bottom: 2px solid var(--red); font-weight: 600; }
.card__link::after { content: ""; position: absolute; inset: 0; }

/* 5. Header ---------------------------------------------------------------- */
.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 20;
}

/* The bar's background lives on a pseudo element so the mobile menu can cover the screen */
.site-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(rgb(0 0 0 / 0.65), transparent);
}

.site-header.is-solid::before {
    border-bottom: 1px solid var(--line);
    background: rgb(18 18 18 / 0.8);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

.site-header__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    column-gap: 1rem;
    min-height: var(--header);
}

.brand img { width: auto; height: 40px; }
.site-header__actions { display: flex; align-items: center; gap: 0.5rem; }

.lang-btn {
    min-height: 2.75rem;
    padding: 0 0.75rem;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 500;
    transition: background-color 0.25s;
}

.lang-btn:hover { background: rgb(255 255 255 / 0.12); }

.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 1.25rem;
}

.site-nav__link { padding-block: 0.6rem; font-size: 0.8125rem; font-weight: 500; }

@media (max-width: 899.98px) {
    html:not(.js) .site-header { position: absolute; }
    html:not(.js) .site-nav { order: 3; width: 100%; }
    html:not(.js) .site-nav__cta { display: none; }

    .js .site-nav {
        position: fixed;
        inset: 0;
        z-index: -1;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        height: 100dvh;
        overflow-y: auto;
        padding: calc(var(--header) + 1.5rem) var(--gutter) 2rem;
        background: var(--canvas);
        visibility: hidden;
        opacity: 0;
        transition: opacity 0.3s, visibility 0.3s;
    }

    .js .site-nav.is-open { visibility: visible; opacity: 1; }

    .js .site-nav__link {
        padding-block: 1rem;
        border-bottom: 1px solid var(--line);
        font-size: clamp(1.5rem, 6vw, 2.5rem);
        font-weight: 800;
        letter-spacing: var(--tracking);
        text-transform: uppercase;
    }

    .js .site-nav__cta { margin-top: 2rem; }
}

@media (max-width: 599.98px) {
    .site-header__cta { display: none; }
}

@media (min-width: 900px) {
    .site-header__bar { flex-wrap: nowrap; }
    .brand img { height: 48px; }
    .site-nav { flex-wrap: nowrap; gap: clamp(1.25rem, 2.6vw, 2.75rem); margin-inline-start: auto; }
    .site-nav__link { background: linear-gradient(currentColor 0 0) var(--start) bottom / 0% 2px no-repeat; transition: background-size 0.4s var(--ease); }
    .site-nav__link:hover { background-size: 100% 2px; }
    .site-nav__cta, .menu-toggle { display: none; }
}

/* 6. Hero ------------------------------------------------------------------ */
.hero {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 100vh;
    min-height: 100svh;
    padding-block: calc(var(--header) + 4rem) clamp(1.5rem, 5vh, 3.5rem);
    overflow: hidden;
}

.hero__media {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.hero__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
        var(--canvas) 2%,
        rgb(var(--hero-tint) / 0.78) 34%,
        rgb(var(--hero-tint) / 0.3) 68%,
        rgb(var(--hero-tint) / 0.45));
}

.hero__video { width: 100%; height: 100%; object-fit: cover; }

.hero__toggle {
    position: absolute;
    top: calc(var(--header) + 0.75rem);
    inset-inline-end: var(--gutter);
    background: rgb(0 0 0 / 0.4);
}

.hero__toggle .icon:last-child,
.hero__toggle[aria-pressed="true"] .icon:first-child { display: none; }
.hero__toggle[aria-pressed="true"] .icon:last-child { display: block; }

.hero__badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.hero__badge::before { content: ""; width: 2rem; height: 2px; flex: none; background: var(--amber); }

.hero__title {
    font-family: var(--font-display);
    font-size: clamp(2.375rem, min(6.4vw, 11svh), 7rem);
    font-weight: 800;
    line-height: var(--leading);
    text-transform: uppercase;
}

.hero__row {
    display: grid;
    gap: 1.75rem;
    margin-top: clamp(1.5rem, 3.5vh, 2.5rem);
    padding-top: clamp(1.5rem, 3.5vh, 2.5rem);
    border-top: 1px solid rgb(255 255 255 / 0.24);
}

.hero__lead { max-width: 62ch; color: rgb(255 255 255 / 0.84); }

/* Upright screens: the video fills the top and fades into the text */
@media (max-aspect-ratio: 1 / 1) {
    .hero__media { bottom: 34%; }
}

@media (min-width: 900px) {
    .hero__row { grid-template-columns: 1fr auto; align-items: center; column-gap: 3rem; }
}

/* 7. Sections -------------------------------------------------------------- */

/* Track record */
.record__grid { display: grid; column-gap: clamp(1.5rem, 4vw, 4rem); }

.metric { position: relative; padding-block: 2rem 3rem; }

.metric::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 1px;
    background: rgb(255 255 255 / 0.28);
    transform-origin: var(--start);
}

.metric__number {
    display: flex;
    justify-content: var(--start);
    direction: ltr;
    margin-bottom: 1rem;
    font-family: var(--font-display);
    font-size: clamp(5rem, 9vw, 8.5rem);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    letter-spacing: -0.07em;
}

.metric__number b { color: var(--amber); font-weight: 300; }
.metric__title { margin-bottom: 0.5rem; font-size: 1.0625rem; }
.metric__text { max-width: 40ch; color: var(--muted); font-size: 0.875rem; }

@media (min-width: 600px) {
    .record__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
    .record__grid { grid-template-columns: repeat(3, 1fr); }
}

/* Market opportunity */
.market { display: grid; gap: 2.5rem; }
.market__item { padding-block: 2.5rem; border-top: 1px solid var(--line); }
.market__item .item-title { font-size: clamp(1.5rem, 2.6vw, 2.375rem); }
.market__item .item-text { max-width: 54ch; font-size: clamp(1rem, 1.25vw, 1.125rem); }

@media (min-width: 900px) {
    .market { grid-template-columns: 5fr 7fr; gap: 5rem; align-items: start; }
    .market__head { position: sticky; top: calc(var(--header) + 3rem); }
    .market__item { display: flex; flex-direction: column; justify-content: center; min-height: 40svh; }
}

/* Metro Surge */
.metro { background: radial-gradient(130% 60% at 50% 0%, var(--navy), var(--canvas) 75%); }
.metro .section__title { font-size: clamp(2.75rem, 9vw, 8.5rem); }
.metro__art { display: block; overflow: hidden; }
.metro__art img { width: 100%; height: auto; max-height: 92svh; object-fit: cover; }

.metro__body { display: grid; gap: 3rem; padding-top: clamp(2.5rem, 5vw, 4.5rem); }
.metro__label { margin-bottom: 1rem; color: var(--amber); font-size: 0.9375rem; }
.metro__pitch { max-width: 44ch; margin-bottom: 2rem; font-size: clamp(1.1875rem, 2vw, 1.75rem); line-height: 1.6; }

.spec__row {
    display: grid;
    gap: 0.25rem 1.5rem;
    padding-block: 1.25rem;
    border-top: 1px solid var(--line);
}

.spec__row:last-child { border-bottom: 1px solid var(--line); }
.spec dt { color: var(--muted); font-size: 0.8125rem; }
.spec dd { font-weight: 500; }

@media (min-width: 600px) {
    .spec__row { grid-template-columns: 9rem 1fr; align-items: baseline; }
}

@media (min-width: 900px) {
    .metro__body { grid-template-columns: 7fr 5fr; gap: 5rem; align-items: start; }
}

/* Portfolio */
.filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding-block: 3px;
    overflow-x: auto;
    scrollbar-width: none;
}

.filter {
    flex: none;
    min-height: 2.75rem;
    padding: 0 1.25rem;
    border-radius: 2rem;
    box-shadow: inset 0 0 0 1px var(--line);
    font-size: 0.8125rem;
    transition: background-color 0.25s, color 0.25s;
}

.filter:hover { background: var(--surface-2); }
.filter[aria-pressed="true"] { background: var(--paper); color: var(--canvas); }

.works { display: grid; gap: var(--gap); }

.work__stage {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--surface-2);
}

.work__stage .work__media { position: absolute; inset: 0; z-index: -1; }
.work__stage img { width: 100%; height: 100%; object-fit: cover; }

.work__stage .work__body {
    padding: 5rem clamp(1.125rem, 2vw, 1.75rem) clamp(1.125rem, 2vw, 1.75rem);
    background: linear-gradient(to top, rgb(0 0 0 / 0.94), rgb(0 0 0 / 0.7) 50%, transparent);
}

.work__type { color: rgb(255 255 255 / 0.72); font-size: 0.75rem; }
.work__title { margin-top: 0.35rem; font-size: clamp(1.0625rem, 1.6vw, 1.375rem); }

.work__open {
    margin-top: 0.75rem;
    border-bottom: 2px solid var(--red);
    font-size: 0.8125rem;
    font-weight: 600;
}

/* The whole tile opens the details */
.work__open::after { content: ""; position: absolute; inset: 0; }
.work__open:focus-visible { outline: 0; }
.work__stage:focus-within { outline: 2px solid var(--amber); outline-offset: 2px; }

.work__details { padding-top: 1rem; }
.js .works .work__details { display: none; }
.work__details h4 { margin: 2rem 0 0.5rem; font-size: 0.9375rem; color: var(--amber); }
.work__details p { color: var(--muted); white-space: pre-line; }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tags li { padding: 0.15rem 0.65rem; border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); font-size: 0.75rem; }

@media (min-width: 600px) {
    .filters { flex-wrap: wrap; }
    .works { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 600px) and (max-width: 999.98px) {
    .work--lead { grid-column: 1 / -1; }
    .work--lead .work__stage { aspect-ratio: 16 / 9; }
}

@media (min-width: 1000px) {
    .works { grid-template-columns: repeat(6, 1fr); }
    .work { grid-column: span 2; }
    .work--wide { grid-column: span 3; }
    .work--wide .work__stage { aspect-ratio: 16 / 10; }
    .work--wide .work__title { font-size: clamp(1.375rem, 2.2vw, 2rem); }
    .work--full { grid-column: 1 / -1; }
    .work--full .work__stage { aspect-ratio: 21 / 9; }
}

@media (hover: hover) {
    .work__stage .work__open { opacity: 0; transition: opacity 0.35s; }
    .work__stage:is(:hover, :focus-within) .work__open { opacity: 1; }
}

/* Recognition */
.honor {
    display: grid;
    gap: 1.5rem 4rem;
    padding-block: clamp(2rem, 5vw, 3.5rem);
    border-top: 1px solid var(--line);
}

.honor:last-child { border-bottom: 1px solid var(--line); }

.honor__media {
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--surface-2);
}

.honor__media img { width: 100%; height: 100%; object-fit: cover; }
.honor__fallback { padding: 1.5rem; font-size: clamp(1.25rem, 3vw, 2rem); font-weight: 800; text-align: center; text-transform: uppercase; letter-spacing: var(--tracking); }
.honor__year { color: var(--muted); font-size: clamp(2.5rem, 6vw, 5rem); font-weight: 800; line-height: 1; letter-spacing: -0.06em; }
.honor__title { margin-top: 1rem; font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2.5rem); font-weight: 800; line-height: var(--leading); text-transform: uppercase; }
.honor__org { margin: 0.5rem 0 1.25rem; font-weight: 600; }
.honor .item-text { max-width: 50ch; }
.honor__link { display: inline-block; margin-top: 1.5rem; padding-block: 0.4rem; border-bottom: 2px solid var(--red); font-weight: 600; }

@media (min-width: 900px) {
    .honor { grid-template-columns: 5fr 6fr; align-items: center; }
}

/* Community and press */
.reach { display: grid; column-gap: clamp(1.5rem, 4vw, 4rem); margin-bottom: clamp(2.5rem, 5vw, 4rem); }

@media (min-width: 600px) {
    .reach { grid-template-columns: repeat(3, 1fr); }
}

.moment__place { color: var(--muted); white-space: nowrap; }
.moment--lead .card__media { aspect-ratio: 16 / 10; }
.moment--lead figcaption { margin-top: 1rem; font-weight: 600; }
.moment__caption { margin-top: 1rem; font-size: 0.875rem; font-weight: 600; }
.rail--photos { margin-top: var(--gap); }
.rail--photos .rail__track { grid-auto-columns: 78%; }

@media (min-width: 600px) {
    .rail--photos .rail__track { grid-auto-columns: calc((100% - var(--gap)) / 2); }
}

@media (min-width: 900px) {
    .rail--photos .rail__track { grid-auto-columns: calc((100% - var(--gap) * 3) / 4); }
}

/* Project details panel, slides in from the side */
.drawer {
    width: min(44rem, 100%);
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    margin-inline-start: auto;
    border: 0;
    background: var(--surface);
    color: var(--text);
    overscroll-behavior: contain;
}

.drawer::backdrop { background: rgb(0 0 0 / 0.75); }

.drawer__close {
    position: sticky;
    top: 1rem;
    z-index: 1;
    display: grid;
    margin-block: 1rem -3.75rem;
    margin-inline: auto 1rem;
    background: var(--canvas);
}

.drawer__content img { width: 100%; max-height: 46svh; aspect-ratio: 16 / 10; object-fit: contain; background: var(--canvas); }
.drawer__content :is(.work__body, .work__details) { padding-inline: clamp(1.25rem, 5vw, 3rem); }
.drawer__content .work__body { padding-top: 2rem; }
.drawer__content .work__title { font-size: clamp(1.5rem, 3.4vw, 2.25rem); line-height: var(--leading); }
.drawer__content .work__details { padding-bottom: 3rem; }

/* Why we're positioned to win: cards stack as you scroll, team photo stays beside them */
.team { display: grid; gap: 1.5rem var(--gap); }
.team__photo img { width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: var(--radius-lg); object-fit: cover; background: var(--surface-2); }

.edges { display: grid; gap: clamp(1rem, 5vh, 3rem); }

.edge {
    position: sticky;
    top: calc(var(--header) + 0.75rem + var(--n) * 0.875rem);
    display: grid;
    align-content: center;
    min-height: min(15rem, 44svh);
    padding: clamp(1.5rem, 4vw, 3rem);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface-2);
    box-shadow: 0 -16px 40px rgb(0 0 0 / 0.4);
    transform-origin: top;
}

.edge .item-title { font-size: clamp(1.25rem, 2.4vw, 2rem); line-height: var(--leading); text-transform: uppercase; }
.edge .item-text { max-width: 52ch; }

@media (min-width: 900px) {
    .team--photo { grid-template-columns: 5fr 7fr; align-items: start; }
    .team__photo { position: sticky; top: calc(var(--header) + 0.75rem); }
    .team__photo img { aspect-ratio: 4 / 5; max-height: calc(100svh - var(--header) - 2rem); }
}

/* Testimonials */
.voices__stage { display: grid; gap: 3rem; }
.voice blockquote { max-width: 54ch; font-size: clamp(1.125rem, 2.2vw, 1.875rem); font-weight: 300; line-height: 1.65; }
.voice figcaption { margin-top: 1.5rem; }
.voice__author { display: block; font-weight: 700; }
.voice__company { display: block; color: var(--muted); font-size: 0.8125rem; }

.js .voice { grid-area: 1 / 1; visibility: hidden; opacity: 0; }
.js .voice.is-active { visibility: visible; opacity: 1; }
.js .voices--tabbed figcaption { display: none; }

.voices__tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem var(--gap);
    margin-top: 3rem;
}

.voice-tab {
    position: relative;
    align-content: start;
    padding-top: 1.25rem;
    border-top: 2px solid var(--line);
    text-align: start;
    opacity: 0.72;
    transition: opacity 0.3s;
}

.voice-tab:hover, .voice-tab[aria-pressed="true"] { opacity: 1; }

.voice-tab::before {
    content: "";
    position: absolute;
    inset: -2px 0 auto;
    height: 2px;
    background: var(--amber);
    transform: scaleX(0);
    transform-origin: var(--start);
}

.voice-tab[aria-pressed="true"]::before { transform: scaleX(1); }

@media (min-width: 900px) {
    .voices__tabs { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); margin-top: 4rem; }
}

/* Client logos */
.marquee { display: flex; direction: ltr; overflow: hidden; }

.logos {
    display: flex;
    align-items: center;
    gap: clamp(2.5rem, 6vw, 6rem);
    padding-inline-end: clamp(2.5rem, 6vw, 6rem);
}

.logos img { width: 150px; height: 72px; object-fit: contain; }

@media (hover: hover) {
    .logos img { filter: grayscale(1); opacity: 0.75; transition: filter 0.3s, opacity 0.3s; }
    .logos img:hover { filter: none; opacity: 1; }
}

/* Capabilities */
.capability {
    position: relative;
    isolation: isolate;
    display: grid;
    gap: 0.75rem 5rem;
    padding-block: clamp(1.75rem, 3.5vw, 3rem);
    border-top: 1px solid var(--line);
}

.capability:last-child { border-bottom: 1px solid var(--line); }

.capability::before {
    content: "";
    position: absolute;
    inset: 0 calc(var(--gutter) * -0.5);
    z-index: -1;
    background: var(--surface-2);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.45s var(--ease);
}

.capability:hover::before { transform: scaleY(1); }
.capability .item-title { margin: 0; font-size: clamp(1.375rem, 2.5vw, 2.25rem); line-height: var(--leading); transition: translate 0.45s var(--ease); }
.capability:hover .item-title { translate: calc(var(--dir) * 0.5rem); }
.capability .item-text { max-width: 56ch; }

@media (min-width: 900px) {
    .capability { grid-template-columns: 1fr 1fr; align-items: center; }
}

/* Tech stack */
.stack__row {
    display: grid;
    gap: 1.25rem;
    padding-block: 2rem;
    border-top: 1px solid var(--line);
}

.stack__row:last-child { border-bottom: 1px solid var(--line); }
.stack__title { font-size: 1.0625rem; }
.stack__tools { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; }
.tool { display: flex; align-items: center; gap: 0.7rem; font-size: 0.8125rem; }

/* Icons were drawn for light backgrounds, so each sits on a white tile */
.tool img { width: 44px; height: 44px; padding: 7px; border-radius: var(--radius); background: var(--paper); object-fit: contain; }

@media (min-width: 900px) {
    .stack__row { grid-template-columns: 20rem 1fr; gap: 3rem; align-items: center; }
}

@media (hover: hover) {
    .tool img { filter: grayscale(1); transition: filter 0.3s; }
    .stack__row:hover img { filter: none; }
}

/* 8. Footer ---------------------------------------------------------------- */
.site-footer { padding-top: var(--space); border-top: 1px solid var(--line); }
.contact__head .section__title { max-width: 16ch; font-size: clamp(2.5rem, 7.5vw, 7rem); }
.contact { display: grid; gap: 3.5rem; padding-bottom: var(--space); }
.contact__meet { align-self: start; }
.contact__logo { display: none; width: 100%; height: auto; margin-bottom: 2rem; mix-blend-mode: screen; }
.contact__subtitle { margin-bottom: 1.25rem; font-size: 1.25rem; }
.contact__note { margin-bottom: 1.5rem; }

.form { display: grid; align-content: start; gap: 1.5rem var(--gap); }
.form .contact__subtitle { margin: 0; }
.field { display: grid; gap: 0.25rem; color: var(--muted); font-size: 0.8125rem; }

.field input,
.field textarea {
    width: 100%;
    padding: 0.75rem 0;
    border: 0;
    border-bottom: 1px solid rgb(255 255 255 / 0.35);
    border-radius: 0;
    background: transparent;
    color: var(--text);
    font-size: 1rem;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus { outline: 0; border-color: var(--amber); box-shadow: 0 1px 0 var(--amber); }
.field [aria-invalid="true"] { border-color: #ff6b6b; }
.field textarea::placeholder { color: #8d8f92; }

.form__status { padding: 0.75rem 1rem; border-inline-start: 3px solid; background: var(--surface); }
.form__status--success { border-color: #4cc38a; }
.form__status--error { border-color: #ff6b6b; }

@media (min-width: 600px) {
    .form { grid-template-columns: repeat(2, 1fr); column-gap: 2rem; }
    .form .contact__subtitle, .field--wide { grid-column: 1 / -1; }
    .form [type="submit"] { justify-self: start; min-width: 14rem; }
}

@media (min-width: 900px) {
    .contact { grid-template-columns: 5fr 7fr; gap: 5rem; }
    .contact__logo { display: block; }
}

.footer-bottom {
    display: grid;
    justify-items: center;
    gap: 1.5rem;
    padding-block: 2.5rem;
    border-top: 1px solid var(--line);
    font-size: 0.8125rem;
    text-align: center;
}

.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem 1.5rem; }
.footer-links a { padding-block: 0.4rem; color: var(--muted); transition: color 0.25s; }
.footer-links a:hover { color: var(--text); }
.social { display: flex; gap: 0.5rem; }

.social a {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px var(--line);
    transition: background-color 0.25s, color 0.25s;
}

.social a:hover { background: var(--paper); color: var(--canvas); }
.social svg { width: 17px; height: 17px; fill: currentColor; }
.footer-copyright { color: var(--muted); }

@media (min-width: 900px) {
    .footer-bottom { grid-template-columns: 1fr auto; justify-items: start; text-align: start; }
    .footer-bottom > :nth-child(even) { justify-self: end; }
}

/* 9. Motion ---------------------------------------------------------------- */

/* Word wrappers created by home.js for the headline reveal */
.w { display: inline-block; vertical-align: top; }
.w > span { display: inline-block; }
.hero__title .w--alt { font-weight: 300; }

@media (prefers-reduced-motion: reduce) {
    .logos { flex: 1; flex-wrap: wrap; justify-content: center; padding-inline: var(--gutter); }
    .logos[aria-hidden] { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }

    .site-header { transition: translate 0.45s var(--ease); }
    .site-header.is-hidden { translate: 0 -100%; }

    .js .site-nav.is-open > * { animation: rise 0.6s var(--ease) both; }
    .site-nav > :nth-child(2) { animation-delay: 0.05s; }
    .site-nav > :nth-child(3) { animation-delay: 0.1s; }
    .site-nav > :nth-child(4) { animation-delay: 0.15s; }
    .site-nav > :nth-child(5) { animation-delay: 0.2s; }

    /* Headlines rise word by word */
    .js .w { clip-path: inset(-0.4em -0.3em var(--clip)); }
    .js .w > span { translate: 0 135%; transition: translate 1s var(--ease) calc(var(--i) * 60ms); }
    .js .is-in .w > span { translate: 0 0; }

    /* Page load: the video settles while the text arrives */
    .js .hero__media { animation: settle 2.4s var(--ease) both; }
    .js .hero__badge { animation: rise 1s var(--ease) 0.15s both; }
    .js .hero__row { animation: rise 1s var(--ease) 0.7s both; }

    /* Leaving the hero (--p goes 0 to 1) */
    .js .hero__video { transform: translateY(calc(var(--p, 0) * 14%)) scale(calc(1 + var(--p, 0) * 0.08)); opacity: calc(1 - var(--p, 0) * 0.65); }
    .js .hero__content { transform: translateY(calc(var(--p, 0) * -5rem)); opacity: calc(1 - var(--p, 0) * 1.15); }

    /* Blocks arrive when they scroll into view */
    .js [data-reveal] {
        opacity: 0;
        translate: 0 2.5rem;
        transition: opacity 0.9s var(--ease) var(--delay, 0s), translate 0.9s var(--ease) var(--delay, 0s);
    }

    .js [data-reveal].is-visible { opacity: 1; translate: 0 0; }

    .js .metric::before { transform: scaleX(0); transition: transform 1.2s var(--ease) var(--delay, 0s); }
    .js .metric.is-visible::before { transform: scaleX(1); }

    .js :is(.card, .honor, .moment) img { clip-path: inset(100% 0 0); scale: 1.25; transition: clip-path 1.1s var(--ease) var(--delay, 0s), scale 1.4s var(--ease) var(--delay, 0s); }
    .js :is(.card, .honor, .moment).is-visible img { clip-path: inset(0); scale: 1; }

    /* The market point in the middle of the screen is lit */
    .js .market__item { opacity: 0.35; transition: opacity 0.5s; }
    .js .market__item.is-current { opacity: 1; }

    /* Metro Surge art grows to full width without cropping the logo (--p goes 0 to 1) */
    .js .metro__art {
        border-radius: calc((1 - var(--p, 1)) * 36px);
        scale: calc(0.74 + var(--p, 1) * 0.26);
        transform-origin: top;
    }

    .work__stage img { transition: scale 1s var(--ease); }
    .work__stage:hover img { scale: 1.07; }

    .drawer[open] { animation: slide-in 0.55s var(--ease); }
    .drawer[open]::backdrop { animation: appear 0.4s; }

    /* A stacked card steps back as the next one covers it (--cover goes 0 to 1) */
    .js .edge { scale: calc(1 - var(--cover, 0) * 0.05); filter: brightness(calc(1 - var(--cover, 0) * 0.5)); }

    .js .voice { translate: 0 1.5rem; transition: opacity 0.6s, translate 0.8s var(--ease), visibility 0.6s; }
    .js .voice.is-active { translate: 0 0; }
    .voices.is-playing .voice-tab[aria-pressed="true"]::before { animation: progress 8s linear both; }
    .voices.is-paused .voice-tab::before { animation-play-state: paused; }

    .logos { flex: none; animation: marquee 45s linear infinite; }
    .marquee:is(:hover, :active) .logos { animation-play-state: paused; }

    /* Filtering the portfolio morphs the grid (View Transitions) */
    .is-filtering .work { view-transition-name: var(--vt); }
    .is-filtering .site-header { view-transition-name: site-header; }
}

@keyframes settle { from { scale: 1.16; } }
@keyframes rise { from { opacity: 0; translate: 0 2rem; } }
@keyframes appear { from { opacity: 0; } }
@keyframes slide-in { from { translate: calc(var(--dir, 1) * 100%) 0; } }
@keyframes progress { from { transform: scaleX(0); } }
@keyframes marquee { to { translate: -100% 0; } }
