/*
 * Pages: indexes, artists, projects, the pager, credits, the 404 and the
 * sign-in cards.
 */
main {
    padding-bottom: 0;
}

/* The moodboard's cropped gradient shapes, behind a page's title and a
   project's head: cut by the page's edge, never by a line. */
.page-freeform:has(> h1)::before,
.project-page::before {
    content: "";
    position: absolute;
    top: clamp(-16rem, -14vw, -6rem);
    right: clamp(-14rem, -10vw, -5rem);
    z-index: -1;
    width: clamp(18rem, 38vw, 38rem);
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--brand-gradient-sunrise);
}

.project-page::before {
    background: var(--brand-gradient-ultraviolet);
    width: clamp(14rem, 28vw, 28rem);
}

.page-freeform > h1 {
    font-size: var(--text-monster);
    letter-spacing: var(--tracking-monster);
    line-height: var(--leading-tight);
    margin: 0;
}

.page-freeform {
    padding-top: var(--space-6);
}

.page-freeform:has(> h1) {
    position: relative;
    isolation: isolate;
    overflow-x: clip;
}

.opens-with-media .page-freeform,
.opens-with-poster .page-freeform {
    padding-top: 0;
}

/* Filter chips: ink pills, the chosen one filled with the gradient. */
.filter {
    margin-bottom: var(--space-6);
}

.chip {
    border: 1.5px solid var(--ink);
    color: var(--ink);
    font-size: var(--text-xs);
    font-weight: var(--weight-strong);
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
}

.chip:hover {
    background: var(--ink);
    color: var(--on-night);
}

.chip[aria-current="true"],
.chip[aria-pressed="true"] {
    border-color: transparent;
    /* Drawn from the border's edge, so it does not repeat under it. */
    background: var(--brand-gradient-under-ink) border-box;
    color: var(--ink);
}

/* Artist -------------------------------------------------------------- */
.artist-page {
    padding-top: var(--space-6);
    row-gap: var(--space-8);
}

.artist-head {
    position: relative;
    padding-right: clamp(0rem, 6vw, 6rem);
    display: grid;
    /* The name leads; the portrait stays modest, so the work is close. */
    grid-template-columns: minmax(0, 1fr) minmax(0, 18rem);
    align-items: end;
    gap: var(--space-6);
}

.artist-name {
    margin: 0;
    /* Sized to its column: a name never breaks inside a word or takes a
       hyphen, so a long one ("LINDQVIST") must fit at this size. */
    font-size: clamp(2.8rem, 8.6vw, 10rem);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-monster);
    overflow-wrap: normal;
    hyphens: manual;
}

.artist-portrait {
    aspect-ratio: 4 / 5;
}

.artist-portrait :is(.media, .media-frame, picture, img) {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: cover;
}

.artist-about .bio {
    font-size: var(--text-lg);
    line-height: 1.4;
}

.artist-head-text .artist-links {
    margin-top: var(--space-5);
}

.artist-links a {
    font-size: var(--text-sm);
    font-weight: var(--weight-bold);
    text-transform: uppercase;
    color: var(--ink);
    text-decoration: none;
    background: var(--brand-gradient) left bottom / 100% 2px no-repeat;
}

/* Project -------------------------------------------------------------- */
.project-page {
    position: relative;
    isolation: isolate;
    overflow-x: clip;
    padding-top: var(--space-6);
    row-gap: var(--space-8);
}

.project-head {
    display: grid;
    gap: var(--space-6);
}

.project-title {
    margin: 0;
    font-size: var(--text-monster);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-monster);
    overflow-wrap: anywhere;
}

.project-intro {
    display: grid;
    grid-template-columns: minmax(0, 38rem) minmax(0, 20rem);
    justify-content: space-between;
    gap: var(--space-6);
}

.project-tagline {
    margin: 0;
    color: var(--ink);
    font-size: var(--text-xl);
    font-weight: var(--weight-bold);
    line-height: 1.05;
    text-transform: uppercase;
}

/* Who did what, as the brand's stacked list. */
.byline-stack {
    display: grid;
    gap: var(--space-4);
    align-content: start;
    margin: 0;
}

.byline-stack dt {
    font-size: var(--text-xs);
    font-weight: var(--weight-strong);
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
}

.byline-stack dd {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: var(--weight-black);
    line-height: 1;
    text-transform: uppercase;
}

.byline-stack a,
.credits-name a {
    color: var(--ink);
    text-decoration: none;
    background: var(--brand-gradient) left bottom / 100% 2px no-repeat;
}

/* Back to an artist's other projects, where the label was. */
.project-back {
    --cluster-gap: var(--space-2) var(--space-6);
}

.project-back a {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: var(--tap);
    color: var(--ink);
    font-size: var(--text-xs);
    font-weight: var(--weight-strong);
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
    text-decoration: none;
}

.project-back a span {
    background: var(--brand-gradient) left bottom / 0 2px no-repeat;
    transition: background-size var(--duration) var(--ease);
}

.project-back a:hover span {
    background-size: 100% 2px;
}

/* Closed to begin with (_credits): the title is the line that opens it,
   lit with the gradient under the pointer like every disclosure. */
.project-credits > .disclosure-body {
    display: grid;
    gap: var(--space-5);
}

.project-credits-title {
    margin: 0;
    font-size: var(--text-xl);
    font-weight: var(--weight-black);
    letter-spacing: var(--tracking-display);
    color: inherit;
}

.credits-row {
    border-bottom: 1px solid var(--ink);
}

.credits-role {
    font-size: var(--text-xs);
    font-weight: var(--weight-strong);
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
}

.credits-name {
    font-weight: var(--weight-bold);
}

/* Pager: the previous and the next as two giant halves. Under the pointer
   a half floods with the gradient from its outer edge, the arrow runs ahead,
   the title leans towards the pointer (js/pager.js) and the page it leads
   to shows its picture beside the cursor. ------------------------------- */
.flow > .pager {
    grid-column: full;
}

.pager {
    gap: 0;
    padding: 0;
    border-top: 2px solid var(--ink);
}

/* The footer's own rule closes it. */
.flow > .pager:last-child {
    margin-bottom: calc(-1 * clamp(4rem, 8vw, 7rem));
}

.pager-link {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    align-content: center;
    gap: var(--space-3);
    min-height: clamp(12rem, 22vw, 20rem);
    padding: var(--space-6) var(--gutter);
    color: var(--ink);
}

.pager-link.is-next {
    border-left: 2px solid var(--ink);
}

.pager-link:only-child.is-next {
    border-left: 0;
}

.pager-link::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--brand-gradient-under-ink);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--duration-slow) var(--ease);
}

/* The next half the other way round, from its own edge. Both stay on the
   warm end: the label is ink, too faint on violet or blue. */
.pager-link.is-next::before {
    background: linear-gradient(240deg, var(--brand-magenta), var(--brand-orange) 50%, var(--brand-yellow));
    transform-origin: right;
}

.pager-link:hover::before,
.pager-link:focus-visible::before {
    transform: scaleX(1);
}

.pager-label {
    color: var(--ink);
    font-size: var(--text-xs);
    font-weight: var(--weight-strong);
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
}

.pager-label .icon {
    transition: translate var(--duration) var(--ease-spring);
}

.pager-link.is-prev:hover .pager-label .icon {
    translate: -.5rem 0;
}

.pager-link.is-next:hover .pager-label .icon {
    translate: .5rem 0;
}

.pager-title {
    display: inline-block;
    font-size: var(--text-2xl);
    font-weight: var(--weight-black);
    letter-spacing: var(--tracking-display);
    line-height: .95;
    text-transform: uppercase;
    text-wrap: balance;
}

.pager-link:hover .pager-title {
    text-decoration: none;
}

@media (max-width: 760px) {
    .pager {
        grid-template-columns: 1fr;
    }

    .pager-link.is-next {
        grid-column: 1;
        border-left: 0;
        border-top: 2px solid var(--ink);
    }
}

/* 404: the slinky. --------------------------------------------------------- */
.lost {
    position: relative;
    min-height: 80svh;
    padding-top: var(--space-7);
}

.lost-text {
    position: relative;
    z-index: 1;
    max-width: 44rem;
}

.lost-title {
    font-size: clamp(2.4rem, 6.5vw, 6rem);
    margin: 0 0 var(--space-5);
}

.lost-hint {
    font-weight: var(--weight-strong);
    text-transform: uppercase;
}

.slinky {
    position: absolute;
    top: 0;
    right: clamp(1rem, 12vw, 12rem);
    width: clamp(9rem, 18vw, 15rem);
    height: 100%;
    pointer-events: none;
}

.slinky svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.slinky-handle {
    pointer-events: auto;
    cursor: grab;
    touch-action: none;
}

.slinky-handle:active {
    cursor: grabbing;
}

@media (max-width: 760px) {
    .artist-head,
    .project-intro {
        grid-template-columns: 1fr;
    }

    .artist-portrait {
        width: min(45%, 10rem);
    }

    /* No room beside the words on a phone: the slinky hangs under them
       instead of over them. */
    .slinky {
        position: relative;
        right: auto;
        width: clamp(8rem, 40vw, 11rem);
        height: 20rem;
        margin: var(--space-5) auto 0;
    }
}

/* Sign-in cards: viewer login, a locked page, a share's password. ------- */
.auth-card {
    border: 0;
    border-radius: 0;
    background: var(--paper);
    box-shadow: 0 0 0 2px var(--ink), 12px 12px 0 0 var(--ink);
}

.auth-card h1 {
    font-size: var(--text-xl);
    font-weight: var(--weight-black);
    text-transform: uppercase;
}

.auth-card input {
    border: 2px solid var(--ink);
    border-radius: 0;
    background: var(--bg);
}

.auth-card button,
.auth-card [type="submit"] {
    border-radius: 0;
    background: var(--ink);
    color: var(--on-night);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
}

.auth-card button:hover,
.auth-card [type="submit"]:hover {
    background: var(--brand-gradient-under-ink);
    color: var(--ink);
}

/* The player and the viewer: the kit's, re-pitched. ------------------------ */
.video {
    --video-bar-bg: rgb(13 12 11 / .78);
    --video-accent: var(--brand-orange);
    --video-track: rgb(244 238 228 / .3);
}

/* No big play button: a film opens on its cover (parts/media), and once
   playing, a pause leaves the bar to start it again and the star cursor to
   say Play over it; at the end the cover comes back (js/covers.js). */
.video-bigplay {
    display: none;
}

.video input[type="range"]::-webkit-slider-thumb {
    background: var(--brand-magenta);
}

.video input[type="range"]::-moz-range-thumb {
    background: var(--brand-magenta);
}

/* Buffering: the star, spinning. */
.video[data-buffering]::after {
    width: 2.6rem;
    height: 2.6rem;
    border: 0;
    border-radius: 0;
    background: var(--brand-gradient);
    mask: url("logo-star.svg") center / contain no-repeat;
}

/* The viewer: on the paper, the counter big, a gradient line for how far
   through the set you are (js/lightbox.js sets --lightbox-progress), an ink
   close button that turns, gradient discs for the arrows. */
.lightbox {
    background: var(--bg);
    color: var(--ink);
}

.lightbox[open] {
    animation: mdpt-lightbox-in .45s var(--ease) both;
}

.lightbox::after {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    height: 4px;
    width: var(--lightbox-progress, 100%);
    background: var(--brand-gradient);
    transition: width var(--duration) var(--ease);
}

.lightbox-bar {
    padding: var(--space-4) var(--gutter);
}

.lightbox-count {
    padding: 0;
    font-size: var(--text-lg);
    font-weight: var(--weight-black);
    letter-spacing: var(--tracking-display);
    text-transform: uppercase;
    opacity: 1;
}

.lightbox-close {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: var(--ink);
    color: var(--bg);
    transition: rotate var(--duration) var(--ease-spring), background var(--duration-fast);
}

.lightbox-close:hover {
    rotate: 90deg;
    background: var(--brand-magenta);
    color: var(--ink);
}

.lightbox-prev,
.lightbox-next {
    width: clamp(3.25rem, 5vw, 4.5rem);
    height: clamp(3.25rem, 5vw, 4.5rem);
    border-radius: 50%;
    background: var(--brand-gradient);
    color: var(--ink);
    box-shadow: 0 14px 30px -12px rgb(17 17 17 / .45);
    transition: scale var(--duration) var(--ease-spring), translate var(--duration) var(--ease-spring);
}

.lightbox-prev:hover {
    scale: 1.1;
    translate: -.3rem -50%;
}

.lightbox-next:hover {
    scale: 1.1;
    translate: .3rem -50%;
}

.lightbox-prev {
    left: var(--gutter);
}

.lightbox-next {
    right: var(--gutter);
}

.lightbox-caption {
    font-size: var(--text-sm);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
    opacity: 1;
}

/* A film played from its card: the title as a card's, and the way to the
   project with the brand's underline. */
.card-watch-title {
    font-weight: var(--weight-black);
    text-transform: uppercase;
}

.card-watch-link {
    text-decoration: none;
    font-size: var(--text-sm);
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
    background: var(--brand-gradient) left bottom / 100% 2px no-repeat;
}

.lightbox-stage img {
    box-shadow: 0 30px 60px -30px rgb(17 17 17 / .45);
}

/* Room beside the picture for the arrows, so they never sit on the work. */
@media (min-width: 761px) {
    .lightbox-stage {
        padding-inline: calc(var(--gutter) + clamp(3.25rem, 5vw, 4.5rem) + var(--space-4));
    }
}

@keyframes mdpt-lightbox-in {
    from { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .lightbox[open] {
        animation: none;
    }
}

/* A project's credits on the line of its head and its files' names (the
   wide column), not a step in from them. */
.project-page > .project-credits { grid-column: wide; }

/* Coming soon (page/coming_soon) ------------------------------------------ */
/* The studio's launch page: one screen, its bar at the top, its foot at the
   bottom, the logo and the lines in the middle; a light grain over the
   paper; a gradient sun rising from the foot; three ink stars. */
.is-landing {
    --landing-pad: clamp(18px, 4vw, 56px);
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

.is-landing > main {
    flex: 1;
    display: grid;
    padding: 0;
}

.is-landing::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    opacity: .07;
    mix-blend-mode: multiply;
    background-image: url("grain.svg");
}

.landing-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: clamp(18px, 3.5vh, 36px) var(--landing-pad) 0;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.landing-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.landing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand-magenta);
}

/* The sun: two discs, far wider than the screen, their tops showing. */
.landing-sun {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.landing-sun-ring,
.landing-sun-core {
    position: absolute;
    left: 50%;
    border-radius: 50%;
    translate: -50% 0;
}

.landing-sun-ring {
    top: calc(100% - 15vh);
    width: max(150vw, 1100px);
    aspect-ratio: 1;
    background: linear-gradient(90deg, var(--brand-yellow), var(--brand-orange) 30%, var(--brand-magenta) 62%, var(--brand-violet) 82%, var(--brand-blue));
}

.landing-sun-core {
    top: calc(100% - 6vh);
    width: max(110vw, 800px);
    aspect-ratio: 1;
    background: linear-gradient(270deg, var(--brand-red), var(--brand-magenta) 35%, var(--brand-violet) 65%, var(--brand-blue));
}

/* The logo's star, in ink. */
.landing-star {
    position: absolute;
    aspect-ratio: 1;
    background: var(--ink);
    mask: url("logo-star.svg") center / contain no-repeat;
    pointer-events: none;
}

.landing-star-a { top: 12vh; left: 8vw; width: clamp(70px, 9vw, 140px); }
.landing-star-b { top: 20vh; right: 9vw; width: clamp(48px, 5.5vw, 90px); }
.landing-star-c { top: 62vh; right: 5vw; width: clamp(34px, 3.6vw, 60px); }

.landing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 3vh, 40px) var(--landing-pad) clamp(110px, 20vh, 200px);
    text-align: center;
}

.landing-logo {
    width: min(500px, 82vw);
    margin: 0;
}

.landing-lines {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: start;
    gap: clamp(18px, 3vw, 48px);
    max-width: 980px;
    margin-top: clamp(28px, 5vh, 56px);
}

/* One language: its column alone, in the middle. */
.landing-lines:not(:has(.landing-divider)) {
    grid-template-columns: minmax(0, 32rem);
}

.landing-line {
    text-align: left;
}

.landing-lang {
    display: block;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .16em;
}

.landing-line p {
    margin: 0;
    text-wrap: wrap;
    font-size: clamp(1.15rem, 2vw, 1.6rem);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -.01em;
}

.landing-line p + p {
    margin-top: 10px;
    color: var(--muted);
    font-weight: 400;
}

.landing-line em {
    font-style: normal;
    font-weight: 700;
    color: transparent;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
}

.landing-divider {
    align-self: stretch;
    width: 1.5px;
    background: var(--ink);
    opacity: .15;
}

.landing-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: clamp(28px, 5vh, 48px);
    padding: 15px 26px;
    border-radius: 999px;
    background: var(--ink);
    color: var(--paper);
    font-size: 1.05rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease;
}

.landing-cta:hover {
    color: var(--paper);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgb(236 79 154 / .35);
}

.landing-cta svg {
    flex: none;
    width: 17px;
    height: 17px;
}

@media (max-width: 760px) {
    .landing-lines {
        grid-template-columns: 1fr;
        gap: 26px;
    }

    .landing-divider {
        justify-self: center;
        align-self: auto;
        width: 48px;
        height: 1.5px;
    }

    .landing-line {
        text-align: center;
    }

    .landing-star-a { top: 9vh; left: auto; right: 6vw; width: 64px; }
    .landing-star-b { top: 12vh; right: auto; left: 5vw; width: 34px; }
    .landing-star-c { top: auto; bottom: 5vh; right: 10vw; width: 36px; }

    .landing-sun-ring { top: calc(100% - 17vh); }
    .landing-sun-core { top: calc(100% - 9vh); }
}
