@font-face { font-family: "Creato Display"; src: url("fonts/creato-display/CreatoDisplay-Thin.woff2") format("woff2"); font-weight: 100; font-style: normal; font-display: swap; }
@font-face { font-family: "Creato Display"; src: url("fonts/creato-display/CreatoDisplay-ThinItalic.woff2") format("woff2"); font-weight: 100; font-style: italic; font-display: swap; }
@font-face { font-family: "Creato Display"; src: url("fonts/creato-display/CreatoDisplay-Light.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Creato Display"; src: url("fonts/creato-display/CreatoDisplay-LightItalic.woff2") format("woff2"); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: "Creato Display"; src: url("fonts/creato-display/CreatoDisplay-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Creato Display"; src: url("fonts/creato-display/CreatoDisplay-RegularItalic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Creato Display"; src: url("fonts/creato-display/CreatoDisplay-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Creato Display"; src: url("fonts/creato-display/CreatoDisplay-MediumItalic.woff2") format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Creato Display"; src: url("fonts/creato-display/CreatoDisplay-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Creato Display"; src: url("fonts/creato-display/CreatoDisplay-BoldItalic.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Creato Display"; src: url("fonts/creato-display/CreatoDisplay-ExtraBold.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Creato Display"; src: url("fonts/creato-display/CreatoDisplay-ExtraBoldItalic.woff2") format("woff2"); font-weight: 800; font-style: italic; font-display: swap; }
@font-face { font-family: "Creato Display"; src: url("fonts/creato-display/CreatoDisplay-Black.woff2") format("woff2"); font-weight: 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Creato Display"; src: url("fonts/creato-display/CreatoDisplay-BlackItalic.woff2") format("woff2"); font-weight: 900; font-style: italic; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
    --c-bg: #1E202C;
    --c-accent: #60519b;
    --c-text: #bfc0d1;

    /* Same side margin on every page. Full-bleed elements break out of it with a negative margin. */
    --page-margin: 3rem;

    /* Fixed navbar height (desktop), so pinned layouts can sit right under it. */
    --header-h: 2rem;

    /* What the navbar is actually built from: its padding above and below the
       row of pills, and the pills' height. Anything that must start exactly
       where the navbar ends (the Photo page's frame) adds these up. */
    --header-pad: 1rem;
    --pill-h: 2.75rem;

    /* Brighter tint of the text colour, for type over footage and the pills. */
    --c-ink: color-mix(in srgb, var(--c-text) 45%, white);
    /* Buttons: accent at rest, --c-accent-hi on hover, --c-text while pressed. */
    --c-accent-hi: color-mix(in srgb, var(--c-accent) 80%, white);
    --line: color-mix(in srgb, var(--c-ink) 55%, transparent);
    /* Creato Display is the only font on the site. `sans-serif` is not a font name,
       just the browser's last resort if the font files ever fail to load. */
    /* Body copy, labels, UI and forms. */
    --f-sans: "Creato Display", sans-serif;
    /* Big uppercase titles. Same family, kept separate so titles can change on their own. */
    --f-display: "Creato Display", sans-serif;

    color-scheme: dark;
}

@media (max-width: 47.99em) {
    :root {
        --page-margin: 1.5rem;
    }
}

/* Keep Sanity images and trailers inside their container. */
img,
video {
    display: block;
    max-width: 100%;
    height: auto;
}

body {
    margin-inline: var(--page-margin);
    margin-block: 0;
    background: var(--c-bg);
    color: var(--c-text);
    font-family: var(--f-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

/* Read by screen readers, never shown. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Links: never underlined, the text takes the accent on hover.
   Round buttons (.to-top) set their own hover. */
a {
    color: inherit;
    text-decoration-line: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--c-accent-hi);
}

/* ---------- Navbar ---------- */
/* Always visible: it sticks to the top and takes the page background (also while it animates). */
.site-header {
    position: fixed;
    width: 100%;
    z-index: 10;
    top: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem 2rem;
    box-sizing: border-box;
    min-height: var(--header-h);
    /* Background runs edge to edge; content stays on the page margin. */
    margin-inline: calc(-1 * var(--page-margin));
    padding: var(--header-pad) var(--page-margin);
    background-color: inherit;
}

/* Pills, with the logo in the middle. */
.site-header nav {
    flex: 1;
}

.site-header__logo {
    position: absolute;
    top: 50%;
    left: 50%;
    translate: -50% -50%;
}

.site-header__logo img {
    width: auto;
    height: 5.25rem;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* About and Contact sit on the right of the logo. */
.site-nav__split {
    margin-inline-start: auto;
}

/* Plain text links. The row keeps --pill-h as its height: photo.css measures the navbar with it. */
.site-nav a {
    display: inline-flex;
    align-items: center;
    min-height: var(--pill-h);
    font-family: var(--f-sans);
    font-size: 0.875rem;
    letter-spacing: 0;
    text-transform: none;
}

/* "page" for the page itself, "true" for a page inside that section (a video project). */
/* A lighter accent than --c-accent-hi, which reads at only 3.9:1 on the page background as small text. */
.site-nav a[aria-current] {
    color: color-mix(in srgb, var(--c-accent) 60%, white);
}

/* Hover comes from the global a:hover (accent). */

/* Tighter row so Photo never reaches the logo on tablets. */
@media (max-width: 69.99em) {
    .site-nav {
        gap: 0.5rem 1rem;
    }
}

/* Phones: logo on top, links on their own row. */
@media (max-width: 47.99em) {
    :root {
        --pill-h: 2.25rem;
    }

    .site-header {
        flex-direction: column;
        justify-content: center;
        gap: 0.5rem;
    }

    .site-header__logo {
        position: static;
        translate: none;
    }

    .site-header__logo img {
        height: 3.75rem;
        margin-block: -0.5rem;
    }

    .site-header nav {
        flex: none;
        width: 100%;
    }

    .site-nav {
        justify-content: space-between;
        gap: 0.375rem;
    }

    /* The current page is already marked by where you are: the logo right above is the way home. */
    .site-nav li:has([aria-current="page"]) {
        display: none;
    }

    .site-nav__split {
        margin-inline-start: 0;
    }

    .site-nav a {
        font-size: 0.75rem;
    }
}

/* ---------- Footer ---------- */
.hero-footer {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding-block: 1.25rem 1.75rem;
    font: 400 0.75rem/1.2 var(--f-sans);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.hero-footer p {
    margin: 0;
}

/* Contacts on the right. */
.hero-footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    margin: 0 0 0 auto;
    padding: 0;
    list-style: none;
}

/* Phones: contacts on their own row, under the copyright. */
@media (max-width: 47.99em) {
    .hero-footer {
        flex-wrap: wrap;
    }

    .hero-footer__links {
        flex-basis: 100%;
        margin-inline-start: 0;
    }

    /* The address takes a row; LinkedIn and Instagram share the next. */
    .hero-footer__links li:has(.hero-footer__mail) {
        flex-basis: 100%;
    }
}

/* A film reel; home.css spins it while a trailer plays. */
.hero-footer__mark {
    display: flex;
}

.hero-footer__mark::before {
    content: "";
    width: 1.625rem;
    height: 1.625rem;
    border-radius: 50%;
    background:
        radial-gradient(circle 0.1rem at 50% 50%, var(--c-bg) 95%, transparent),
        radial-gradient(circle 0.27rem at 50% 25%, var(--c-bg) 95%, transparent),
        radial-gradient(circle 0.27rem at 71.7% 62.5%, var(--c-bg) 95%, transparent),
        radial-gradient(circle 0.27rem at 28.3% 62.5%, var(--c-bg) 95%, transparent),
        var(--c-ink);
    animation: reel-spin 3s linear infinite paused;
}

@keyframes reel-spin {
    to { rotate: 1turn; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-footer__mark::before {
        animation: none;
    }
}

/* ---------- Contact ----------
   Title and intro across the top; contacts on the left, the form on the right.
   Both columns are ruled like the project facts on the video pages, and their
   top rules line up. */
.page-contact {
    /* Free space under the fixed navbar. */
    --contact-top: var(--header-h);
    /* Only for a field the visitor got wrong: the palette has no red of its own. */
    --c-error: color-mix(in srgb, #ff6b6b 70%, var(--c-text));

    display: flex;
    flex-direction: column;
    min-height: 100svh;
}

.page-contact :focus-visible {
    outline-color: var(--c-accent-hi);
}

.contact {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    grid-template-areas:
        "head head"
        "info write";
    align-items: start;
    column-gap: clamp(2.5rem, 7vw, 8rem);
    padding-block: calc(var(--contact-top) + clamp(2rem, 5vw, 4.5rem)) clamp(4rem, 9vw, 8rem);
}

.contact__head {
    grid-area: head;
    margin-bottom: clamp(3rem, 7vw, 6rem);
}

.contact__title,
.about__title,
.clients__title,
.videos__title {
    margin: 0;
    color: var(--c-ink);
    font-family: var(--f-display);
    font-weight: 900;
    font-synthesis: none;
    font-size: clamp(3.5rem, 8vw, 10rem);
    line-height: 0.86;
    text-transform: uppercase;
    text-wrap: balance;
}

/* Same voice as the bio on the home page. */
.contact__intro {
    max-width: 50rem;
    margin: 1.75rem 0 0;
    font: 400 1.4rem/1.45 var(--f-sans);
    text-transform: uppercase;
    text-wrap: pretty;
}

.contact__info {
    grid-area: info;
}

.contact__write {
    grid-area: write;
}

.contact__label {
    margin: 0 0 1rem;
    color: var(--c-text);
    font: 800 0.9rem/1.2 var(--f-sans);
    text-transform: uppercase;
}

/* ---------- Rows: label left, value right, a rule under each ---------- */
.contact__rows {
    margin: 0;
    border-top: 1px solid var(--line);
}

.contact__rows > div {
    /* The rule's colour: the form fields change it on focus and on errors. */
    --rule: var(--line);

    display: grid;
    grid-template-columns: 8.5rem minmax(0, 1fr);
    align-items: start;
    gap: 1rem;
    padding-block: 0.875rem;
    border-bottom: 1px solid var(--rule);
}

/* Labels and values share a 1.5rem line, so their first lines sit level. */
.contact__rows dt,
.contact-form__field label {
    font: 400 0.75rem/1.5rem var(--f-sans);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.contact__rows dd {
    margin: 0;
    color: var(--c-ink);
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.5rem;
    overflow-wrap: anywhere;
}

/* ---------- Form ---------- */
.contact-form__field {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-form__field label {
    transition: color 0.2s ease;
}

.contact-form__field :is(input, textarea) {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    color: var(--c-ink);
    font: 400 1rem/1.5rem var(--f-sans);
    caret-color: var(--c-accent-hi);
}

/* Grows with the message (where supported) up to 12 lines, then scrolls.
   Dragging it taller stops at the same height. */
.contact-form__field textarea {
    min-height: 5rem;
    max-height: 12rem;
    overflow-y: auto;
    resize: vertical;
    field-sizing: content;
}

/* The row is the focus ring: its rule doubles and takes the accent. */
.contact-form__field :is(input, textarea):focus-visible {
    outline: none;
}

.contact-form__field:focus-within {
    --rule: var(--c-accent-hi);
    box-shadow: 0 1px 0 var(--rule);
}

.contact-form__field:focus-within label {
    color: var(--c-ink);
}

/* Only once the visitor has been through the field, never on a fresh page. */
.contact-form__field:has(:user-invalid) {
    --rule: var(--c-error);
}

.contact-form__field:has(:user-invalid) label {
    color: var(--c-error);
}

/* Browser autofill: keep the page colour instead of the browser's tint. */
.contact-form__field input:autofill {
    -webkit-text-fill-color: var(--c-ink);
    box-shadow: inset 0 0 0 100vmax var(--c-bg);
}

.contact-form__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 2rem;
    margin-top: 2rem;
}

/* Filled by contact.js after a send; it sits right of the button, or under it on narrow screens. */
.contact-form__status {
    flex: 1 1 16rem;
    margin: 0;
    font: 400 0.75rem/1.5 var(--f-sans);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-wrap: pretty;
}

.contact-form__status[data-state="sent"] {
    color: var(--c-ink);
}

.contact-form__status[data-state="error"] {
    color: var(--c-error);
}

/* Same pill as the rest of the site: accent at rest, lighter on hover, text colour while pressed. */
.contact-form__send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 10.5rem;
    min-height: 2.75rem;
    padding: 0 1.75rem;
    border: 0;
    border-radius: 999px;
    background-color: var(--c-accent);
    color: var(--c-ink);
    font: 400 0.75rem/1 var(--f-sans);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, scale 0.15s ease;
}

.contact-form__send:hover {
    background-color: var(--c-accent-hi);
}

.contact-form__send:active {
    background-color: var(--c-text);
    color: var(--c-bg);
    scale: 0.95;
}

/* While sending. aria-disabled, not disabled: the button keeps keyboard focus. */
.contact-form__send[aria-disabled="true"] {
    background-color: var(--c-accent);
    color: var(--c-ink);
    opacity: 0.65;
    scale: 1;
    cursor: progress;
}

/* ---------- Entrance ---------- */
@media (prefers-reduced-motion: no-preference) {
    .contact > *,
    .about > * {
        animation: contact-rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    }

    .contact__info,
    .about__photo {
        animation-delay: 0.08s;
    }

    .contact__write,
    .about__text {
        animation-delay: 0.16s;
    }
}

@keyframes contact-rise {
    from {
        opacity: 0;
        translate: 0 1.5rem;
    }
}

/* ---------- Medium screens: one column ---------- */
@media (max-width: 69.99em) {
    .contact {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "head"
            "info"
            "write";
        row-gap: 3.5rem;
    }

    .contact__head {
        margin-bottom: 0;
    }

    .contact__info,
    .contact__write {
        max-width: 44rem;
    }
}

/* ---------- Small screens: labels above their values ---------- */
@media (max-width: 47.99em) {
    .page-contact {
        /* The navbar stacks the logo over the links here. */
        --contact-top: 7rem;
    }

    .contact__rows > div {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.25rem;
    }
}

/* ---------- About ----------
   Title across the top; the photo on the left, the bio and the ruled contacts
   on the right, then the client logos running full width.
   Labels and rows are the contact page's own. */

/* Registered so it computes to pixels: about.js reads it to fill the rows. */
@property --cell-min {
    syntax: "<length>";
    inherits: true;
    initial-value: 0px;
}

.page-about {
    /* Free space under the fixed navbar. */
    --about-top: var(--header-h);
}

.about {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    grid-template-areas:
        "title   title"
        "photo   text"
        "clients clients";
    align-items: start;
    column-gap: clamp(2.5rem, 7vw, 8rem);
    padding-block: calc(var(--about-top) + clamp(2rem, 5vw, 4.5rem)) clamp(4rem, 9vw, 8rem);
}

.about__title {
    grid-area: title;
    margin-bottom: clamp(3rem, 5vw, 6rem);
    line-height: 1;
}

#about__title {
    letter-spacing: -0.2rem;
}

.about__photo {
    grid-area: photo;
    margin: 0;
}

/* Portrait crop beside the text; the subject and the camera stay in frame.
   Its height follows the column's width, so on large screens it is capped: it
   fits the screen under the navbar and never goes past 45rem. The crop just
   gets wider, never stretched. */
.about__photo img {
    width: 100%;
    max-height: clamp(24rem, 100svh - var(--header-h) - 4rem, 45rem);
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: 29% 50%;
}

/* As tall as the photo: the bio at its top edge, the contacts at its bottom edge. */
.about__text {
    grid-area: text;
    align-self: stretch;
    display: grid;
    align-content: space-between;
    gap: clamp(2.5rem, 5vw, 3.5rem);
}

/* Full column width: its right edge lines up with the contacts below. */
.about__bio {
    margin: 0;
    font-size: clamp(1rem, 1.3vw, 1.375rem);
    line-height: 1.45;
    text-wrap: pretty;
    font-weight: 400;
}

/* ---------- Clients: a wall of logos, every other row running the other way ---------- */
.clients {
    grid-area: clients;
    min-width: 0;
    margin-top: clamp(5rem, 11vw, 10rem);
}

/* The page title's voice, one step down. */
.clients__title {
    margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
    font-size: clamp(1.75rem, 3.2vw, 3.5rem);
    line-height: 1;
}

/* Full width: the rows break out of the page margin. */
.clients__rows {
    --cell-min: 9.5rem;
    --cell: clamp(var(--cell-min), 16vw, 19rem);
    --row-h: clamp(5.5rem, 8vw, 8rem);
    /* Every logo gets about this area, whatever its shape: wide ones lie lower, square ones stand taller. */
    --logo-size: clamp(2.75rem, 4vw, 4.25rem);

    margin-inline: calc(-1 * var(--page-margin));
    border-top: 1px solid var(--line);
}

.clients__row {
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

/* Two identical laps side by side: sliding by one lap loops without a seam.
   --n (cells in a lap) keeps the same pace on every row. */
.clients__track {
    display: flex;
    width: max-content;
    animation: clients-scroll calc(var(--n, 8) * 4s) linear infinite;
}

.clients__row:nth-child(even) .clients__track {
    animation-direction: reverse;
}
.clients__cell {
    display: grid;
    flex: none;
    place-items: center;
    width: var(--cell);
    height: var(--row-h);
}

/* The files come ready from Sanity: one colour on transparency, trimmed to the logo. */
.clients__logo {
    width: min(var(--logo-size) * var(--sqrt-ratio, 1), var(--cell) - 2.5rem);
    height: min(var(--logo-size) / var(--sqrt-ratio, 1), var(--row-h) - 2rem);
    object-fit: contain;
}

@keyframes clients-scroll {
    to { translate: -50% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .clients__track {
        animation: none;
    }
}

/* ---------- Medium screens: the photo across the page, bio and contacts side by side under it ---------- */
@media (max-width: 69.99em) {
    .about {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "title"
            "photo"
            "text"
            "clients";
        row-gap: 3.5rem;
    }

    .about__title {
        margin-bottom: 0;
    }

    .about__photo img {
        aspect-ratio: 4 / 3;
    }

    .about__text {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: clamp(2.5rem, 7vw, 8rem);
    }

    .clients {
        margin-top: 2rem;
    }
}

/* Too narrow for two columns: the email would break. Contacts go under the bio. */
@media (max-width: 55.99em) {
    .about__text {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ---------- Small screens ---------- */
@media (max-width: 47.99em) {
    .page-about {
        /* The navbar stacks the logo over the links here. */
        --about-top: 7rem;
    }
}
