:root {
    --bg: #141414;
    --surface: #1c1c1c;
    --reel-bg: #404040; /* background colour of media/reel.mp4, so the video blends into the hero */
    --text: #f3f1ed;
    --text-soft: #d6d2cb;
    --muted: #aaa69f;
    --line: rgba(255, 255, 255, 0.12);
    --accent: #ff9a3c;
    --gutter: clamp(1.25rem, 5vw, 4rem);
    --max: 80rem;
    --header-h: 4rem;
    --font: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
}

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

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img,
video {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
}

h1,
h2,
h3,
p {
    margin: 0;
}

h1,
h2,
h3 {
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
}

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

.skip-link {
    position: absolute;
    left: var(--gutter);
    top: -4rem;
    z-index: 30;
    padding: 0.5rem 0.875rem;
    background: var(--text);
    color: var(--bg);
    border-radius: 4px;
    text-decoration: none;
}

.skip-link:focus {
    top: 0.75rem;
}

.eyebrow {
    margin-bottom: 1rem;
    color: var(--accent);
    font-family: var(--mono);
    font-size: 0.8125rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.wrap {
    max-width: var(--max);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

/* Header */

.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: var(--header-h);
    padding-inline: var(--gutter);
    border-bottom: 1px solid transparent;
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.site-header.is-scrolled {
    background: rgba(20, 20, 20, 0.82);
    border-bottom-color: var(--line);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.site-header__name {
    font-weight: 600;
    letter-spacing: -0.01em;
    text-decoration: none;
    white-space: nowrap;
}

.site-nav {
    display: flex;
    gap: clamp(1rem, 3vw, 2rem);
}

.site-nav a {
    padding-block: 0.5rem;
    color: var(--text-soft);
    font-size: 0.9375rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-nav a:hover {
    color: var(--text);
}

/* Buttons */

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 3rem;
    padding: 0 1.375rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.button:hover {
    border-color: var(--text);
    background: rgba(255, 255, 255, 0.08);
}

.button--primary {
    border-color: var(--text);
    background: var(--text);
    color: var(--bg);
}

.button--primary:hover {
    border-color: #fff;
    background: #fff;
}

.button[hidden] {
    display: none;
}

/* A second primary button only appears when the reel button is switched on; demote the one after it. */
.button--primary:not([hidden]) ~ .button--primary {
    border-color: rgba(255, 255, 255, 0.35);
    background: transparent;
    color: var(--text);
}

/* Hero */

.hero {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: clamp(1rem, 4vh, 2.5rem);
    min-height: 100vh;
    min-height: 100svh;
    padding: calc(var(--header-h) + 1rem) var(--gutter) clamp(4rem, 10vh, 6rem);
    background: var(--reel-bg);
    overflow: hidden;
}

/* Fades the hero into the page below. */
.hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    z-index: -1;
    height: 16%;
    background: linear-gradient(to bottom, rgba(20, 20, 20, 0), var(--bg));
    pointer-events: none;
}

.reel {
    flex: none;
    align-self: center;
    width: min(80vw, 44vh);
    width: min(80vw, 44svh);
    height: min(80vw, 44vh);
    height: min(80vw, 44svh);
    object-fit: contain;
    /* Feathers the frame edge in case a browser renders the video's background a shade off --reel-bg. */
    -webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent), linear-gradient(to bottom, transparent, #000 5%, #000 95%, transparent);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent), linear-gradient(to bottom, transparent, #000 5%, #000 95%, transparent);
    mask-composite: intersect;
}

.hero__content {
    width: 100%;
    max-width: 34rem;
    transition: opacity 0.3s ease;
}

.hero h1 {
    font-size: clamp(3rem, 8vw, 6rem);
    line-height: 0.95;
    letter-spacing: -0.035em;
}

.hero h1 span {
    display: block;
}

.hero__lead {
    margin-block: 1.5rem 2rem;
    color: var(--text-soft);
    font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
}

.hero__close {
    position: absolute;
    top: 1rem;
    right: var(--gutter);
    z-index: 3;
    display: none;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    background: rgba(20, 20, 20, 0.6);
    color: var(--text);
    cursor: pointer;
}

.hero__close:hover {
    border-color: var(--text);
}

@media (min-width: 56rem) {
    .hero {
        padding-inline: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
    }

    .hero__content {
        max-width: min(30rem, 40vw);
    }

    .reel {
        position: absolute;
        top: 50%;
        right: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
        z-index: -2;
        width: min(44vw, 78vh, 40rem);
        height: min(44vw, 78vh, 40rem);
        transform: translateY(-50%);
    }
}

/* Full-bleed footage: the video fills the hero and the text sits over it, bottom left. */

.hero[data-reel-fit="cover"] {
    justify-content: flex-end;
    background: #000;
}

.hero[data-reel-fit="cover"] .reel {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: none;
    -webkit-mask-image: none;
    mask-image: none;
}

.hero[data-reel-fit="cover"]::after {
    height: 100%;
    background:
        linear-gradient(to top, var(--bg) 0%, rgba(20, 20, 20, 0.7) 28%, rgba(20, 20, 20, 0) 65%),
        linear-gradient(to right, rgba(20, 20, 20, 0.55), rgba(20, 20, 20, 0) 60%);
}

/* Watching the reel: the video takes over the hero with sound and controls. */

.is-watching .site-header {
    transform: translateY(-100%);
}

.hero.is-watching {
    background: #000;
}

.hero.is-watching .reel {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: none;
    -webkit-mask-image: none;
    mask-image: none;
}

.hero.is-watching .hero__content {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}

.hero.is-watching::after {
    display: none;
}

.hero.is-watching .hero__close {
    display: grid;
}

/* Sections */

.section {
    padding-block: clamp(4rem, 10vw, 8rem);
}

.section--alt {
    background: var(--surface);
    border-block: 1px solid var(--line);
}

.section__head {
    margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

/* Work */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
    gap: 1.5rem;
}

.card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

a.card:hover {
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-3px);
}

.card__media {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #000;
}

.card__media img,
.card__media video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.card__media--cover img {
    object-fit: cover;
}

.card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.25rem 1.25rem 1.375rem;
}

.card__tag {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.card h3 {
    font-size: 1.1875rem;
    letter-spacing: -0.01em;
}

.card__body p:not(.card__tag) {
    color: var(--muted);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.card__link {
    margin-top: auto;
    padding-top: 0.5rem;
    color: var(--text-soft);
    font-size: 0.875rem;
    font-weight: 600;
}

.card__link::after {
    content: " \2197";
}

a.card:hover .card__link {
    color: var(--accent);
}

/* About */

.about {
    display: grid;
    gap: clamp(2.5rem, 6vw, 5rem);
}

.about__text h2 {
    margin-bottom: 1.5rem;
    max-width: 18ch;
}

.about__text p:not(.eyebrow) {
    max-width: 36rem;
    color: var(--text-soft);
}

.about__text p + p {
    margin-top: 1rem;
}

.facets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: 2rem 1.5rem;
    align-content: start;
    margin: 0;
}

.facets dt {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--line);
    color: var(--accent);
    font-family: var(--mono);
    font-size: 0.8125rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.facets dd {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.9375rem;
    line-height: 1.9;
}

@media (min-width: 56rem) {
    .about {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
        align-items: end;
    }
}

/* Contact and footer */

.contact h2 {
    font-size: clamp(2.25rem, 6vw, 4rem);
    letter-spacing: -0.03em;
}

.contact__lead {
    margin-block: 1rem 2rem;
    color: var(--text-soft);
}

.site-footer {
    padding: 1.5rem var(--gutter);
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.875rem;
    text-align: center;
}

/* Scroll reveal (only when scripting is available and motion is welcome) */

@media (prefers-reduced-motion: no-preference) {
    .js .reveal {
        opacity: 0;
        transform: translateY(1.25rem);
        transition: opacity 0.6s ease, transform 0.6s ease, border-color 0.2s ease;
    }

    .js .reveal.is-visible {
        opacity: 1;
        transform: none;
    }

    .js a.card.reveal.is-visible:hover {
        transform: translateY(-3px);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    * {
        transition-duration: 0.01ms !important;
    }
}
