/* Movie Hopper — design tokens and components.
   Night navy + hopper blue are the original wordmark's colours; silver-screen grey is the page.
   Oswald = poster billing-block display face; Libre Franklin = Franklin Gothic-style body. */

:root {
    --night: #0F2536;
    --night-2: #16324A;
    --hopper: #57B8E9;
    --gold: #F2C14E;
    --paper: #E8EEF2;

    --bg: #EEF2F5;
    --surface: #FFFFFF;
    --ink: #142230;
    --muted: #536576;
    --line: #D3DCE4;
    --link: #1C6FA3;
    --placeholder: #D8E0E7;
    --pressed-bg: var(--night);
    --pressed-ink: #FFFFFF;

    --display: "Oswald", "Arial Narrow", sans-serif;
    --body: "Libre Franklin", "Franklin Gothic Book", system-ui, sans-serif;
    --radius: 4px;

    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --night: #081521;
        --night-2: #0F2536;
        --bg: #0B1A27;
        --surface: #10273A;
        --ink: #E3ECF2;
        --muted: #94A7B7;
        --line: #20394E;
        --link: #7CC9F0;
        --placeholder: #17324A;
        --pressed-bg: var(--hopper);
        --pressed-ink: #081521;
        color-scheme: dark;
    }
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--body);
    font-size: 1rem;
    line-height: 1.55;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    outline: none;
}

main>.view {
    flex: 1 0 auto;
}

a {
    color: var(--link);
    text-underline-offset: .18em;
}

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

.skip-link {
    position: absolute;
    left: 1rem;
    top: .5rem;
    z-index: 100;
    background: var(--hopper);
    color: var(--night);
    padding: .4rem .8rem;
    border-radius: var(--radius);
}

.container-xl {
    padding-inline: 16px;
}

@media (min-width: 768px) {
    .container-xl {
        padding-inline: 24px;
    }
}

/* ------------------------------------------------------------ masthead */

.masthead {
    background: var(--night);
    color: #fff;
    z-index: 20;
}

@media (min-width: 768px) {
    .masthead {
        position: sticky;
        top: 0;
    }
}

.masthead-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem 2rem;
    padding-block: .8rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    color: #fff;
    text-decoration: none;
}

.brand img {
    height: 34px;
    width: auto;
    filter: invert(1);
}

.wordmark {
    font-family: var(--display);
    font-weight: 500;
    font-size: 1.95rem;
    line-height: 1;
    letter-spacing: -.005em;
}

.wordmark span {
    color: var(--hopper);
}

.search {
    display: flex;
    flex: 1 1 340px;
    max-width: 560px;
    margin-left: auto;
}

.search input {
    flex: 1;
    min-width: 0;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .24);
    border-right: 0;
    border-radius: var(--radius) 0 0 var(--radius);
    color: #fff;
    padding: .55rem .85rem;
    font-size: 1rem;
}

.search input::placeholder {
    color: rgba(255, 255, 255, .6);
}

.search input:focus {
    outline: none;
    border-color: var(--hopper);
    background: rgba(255, 255, 255, .12);
}

.search button {
    border: 0;
    background: var(--hopper);
    color: var(--night);
    font-family: var(--display);
    font-weight: 500;
    font-size: 1.05rem;
    letter-spacing: .02em;
    padding: 0 1.15rem;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.search button:hover {
    background: #7CC9F0;
}

/* ------------------------------------------------------------ hop trail: ticket stubs */

.trail {
    background: var(--night-2);
    border-top: 1px solid rgba(255, 255, 255, .06);
}

.trail-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.trail ol {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: .55rem 0;
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1;
    min-width: 0;
}

.trail ol::-webkit-scrollbar {
    display: none;
}

.trail li {
    display: flex;
    align-items: center;
    flex: none;
}

.hop {
    width: 22px;
    height: 9px;
    margin: 0 3px;
    border: 1.5px dashed rgba(255, 255, 255, .45);
    border-bottom: 0;
    border-radius: 12px 12px 0 0;
    transform: translateY(-4px);
}

.stub {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    max-width: 15rem;
    padding: .28rem .9rem .28rem .8rem;
    background: var(--paper);
    color: var(--night);
    border-radius: 3px;
    font-size: .85rem;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    -webkit-mask: radial-gradient(circle 5px at 0 50%, #0000 96%, #000) left / 51% 100% no-repeat,
        radial-gradient(circle 5px at 100% 50%, #0000 96%, #000) right / 51% 100% no-repeat;
    mask: radial-gradient(circle 5px at 0 50%, #0000 96%, #000) left / 51% 100% no-repeat,
        radial-gradient(circle 5px at 100% 50%, #0000 96%, #000) right / 51% 100% no-repeat;
}

.stub span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.stub:hover {
    background: #fff;
    color: var(--night);
}

.stub[aria-current="page"] {
    background: var(--hopper);
    color: var(--night);
}

.stub img,
.stub .thumb {
    flex: none;
    object-fit: cover;
    background: rgba(15, 37, 54, .15);
}

.stub--person img,
.stub--person .thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.stub--movie img,
.stub--movie .thumb {
    width: 14px;
    height: 21px;
    border-radius: 2px;
}

.trail li.is-new .stub {
    animation: stub-in .35s cubic-bezier(.2, .8, .2, 1);
}

@keyframes stub-in {
    from {
        transform: translateY(-6px) rotate(-3deg);
        opacity: 0;
    }
}

.trail-clear {
    flex: none;
    background: none;
    border: 0;
    color: rgba(255, 255, 255, .7);
    font-size: .85rem;
    padding: .25rem .25rem;
    text-decoration: underline;
    text-underline-offset: .2em;
}

.trail-clear:hover {
    color: #fff;
}

/* ------------------------------------------------------------ home */

.home {
    background: var(--night);
    color: #fff;
    padding: 3rem 0 4rem;
    flex: 1 0 auto;
    min-height: min(78vh, 760px);
    display: flex;
    align-items: center;
}

.home>.container-xl {
    width: 100%;
}

.home-title {
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(2.6rem, 7.4vw, 6.4rem);
    line-height: 1.02;
    letter-spacing: -.012em;
    max-width: 16ch;
    margin: 0 0 1.25rem;
}

.home-lede {
    max-width: 54ch;
    font-size: 1.125rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, .8);
    margin: 0;
}

/* The suggestions are set like a poster's billing block. */
.billing {
    margin-top: 2.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, .16);
    max-width: 62rem;
}

.billing-lead {
    font-size: .95rem;
    color: rgba(255, 255, 255, .65);
    margin: 0 0 .5rem;
}

.billing-names {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .15rem 1.4rem;
    font-family: var(--display);
    font-weight: 500;
    font-size: clamp(1.25rem, 2.7vw, 1.9rem);
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: .015em;
}

.billing-names a {
    color: #fff;
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

.billing-names a:hover,
.billing-names a:focus-visible {
    color: var(--hopper);
    border-bottom-color: var(--hopper);
}

/* ------------------------------------------------------------ status */

.status {
    margin: 2.5rem 0;
    color: var(--muted);
    font-size: 1.05rem;
    max-width: 60ch;
}

.status strong {
    color: var(--ink);
}

.status.is-error {
    color: var(--ink);
    border-left: 3px solid #D9534F;
    padding-left: 1rem;
}

/* ------------------------------------------------------------ person */

.person-head {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem 1.5rem;
    align-items: end;
    padding: 2rem 0 1.5rem;
    border-bottom: 1px solid var(--line);
}

.headshot {
    display: block;
    width: 104px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: var(--radius);
    background: var(--placeholder);
}

@media (min-width: 992px) {
    .headshot {
        width: 148px;
    }

    .person-head {
        gap: 1rem 2rem;
    }
}

.initials {
    display: grid;
    place-items: center;
    font-family: var(--display);
    font-size: 2.2rem;
    color: var(--muted);
}

.person-name {
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(2.1rem, 5.4vw, 3.9rem);
    line-height: 1;
    letter-spacing: -.01em;
    margin: 0 0 .6rem;
    overflow-wrap: anywhere;
}

.person-meta {
    color: var(--muted);
    margin: 0;
    max-width: 62ch;
}

.others {
    margin: .5rem 0 0;
    font-size: .925rem;
    color: var(--muted);
}

.others a {
    margin-right: .75rem;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem 1rem;
    padding: 1.1rem 0 1.4rem;
}

.seg {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
}

.seg button {
    border: 0;
    background: transparent;
    color: var(--ink);
    padding: .42rem .85rem;
    font-size: .925rem;
    font-weight: 500;
}

.seg button+button {
    border-left: 1px solid var(--line);
}

.seg button[aria-pressed="true"] {
    background: var(--pressed-bg);
    color: var(--pressed-ink);
}

.seg .count {
    font-variant-numeric: tabular-nums;
    opacity: .7;
    margin-left: .3rem;
}

.toolbar .filter {
    flex: 1 1 180px;
    max-width: 300px;
}

.toolbar .form-control,
.toolbar .form-select {
    background-color: var(--surface);
    border-color: var(--line);
    color: var(--ink);
    font-size: .925rem;
}

.toolbar .sort {
    flex: 0 1 auto;
    width: auto;
}

.toolbar .layout {
    margin-left: auto;
}

@media (max-width: 575px) {
    .toolbar .filter {
        max-width: none;
        flex-basis: 100%;
        order: 3;
    }

    .toolbar .layout {
        margin-left: 0;
    }
}

/* ------------------------------------------------------------ poster grid */

.poster-grid {
    list-style: none;
    margin: 0 0 3.5rem;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
    gap: 1.9rem 1.25rem;
}

@media (max-width: 575px) {
    .poster-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.4rem .9rem;
    }
}

.film {
    display: block;
    color: inherit;
    text-decoration: none;
}

.film:focus-visible {
    outline: none;
}

.poster-frame {
    position: relative;
    display: block;
}

.poster {
    display: block;
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: var(--radius);
    background: var(--placeholder);
    box-shadow: inset 0 0 0 1px rgba(20, 34, 48, .08);
}

.poster--empty {
    display: grid;
    place-items: center;
    padding: .9rem;
    text-align: center;
    font-family: var(--display);
    font-size: 1.15rem;
    line-height: 1.15;
    color: var(--muted);
}

.film:hover .poster,
.film:focus-visible .poster {
    outline: 3px solid var(--hopper);
    outline-offset: 2px;
}

.score {
    position: absolute;
    left: 6px;
    bottom: 6px;
    background: rgba(15, 37, 54, .88);
    color: var(--gold);
    font-size: .78rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    padding: .1rem .4rem;
    border-radius: 3px;
}

.film-title {
    display: block;
    margin-top: .6rem;
    font-weight: 600;
    line-height: 1.25;
}

.film-year {
    font-weight: 500;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    margin-left: .25rem;
}

.film-role {
    display: block;
    margin-top: .15rem;
    color: var(--muted);
    font-size: .875rem;
    line-height: 1.35;
}

/* ------------------------------------------------------------ list layout */

.film-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 3.5rem;
}

.film-table th {
    text-align: left;
    font-weight: 500;
    font-size: .85rem;
    color: var(--muted);
    padding: .5rem .6rem;
    border-bottom: 1px solid var(--line);
}

.film-table td {
    padding: .55rem .6rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.film-table td.num {
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    white-space: nowrap;
}

.film-table a {
    font-weight: 600;
    text-decoration: none;
}

.film-table a:hover {
    text-decoration: underline;
}

.film-table .role-inline {
    display: none;
    color: var(--muted);
    font-size: .875rem;
}

@media (max-width: 575px) {
    .film-table .col-role {
        display: none;
    }

    .film-table .role-inline {
        display: block;
    }
}

/* ------------------------------------------------------------ movie */

.movie-hero {
    position: relative;
    background: var(--night);
    color: #fff;
    overflow: hidden;
}

.movie-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--backdrop, none);
    background-size: cover;
    background-position: center 25%;
    opacity: .4;
}

/* Legibility scrim over the backdrop. */
.movie-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 37, 54, .25) 0%, var(--night) 88%);
}

.movie-hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 210px 1fr;
    grid-template-areas: "poster head" "poster body";
    gap: .5rem 2.5rem;
    padding: 3rem 16px 2.75rem;
    align-items: end;
}

@media (min-width: 768px) {
    .movie-hero-inner {
        padding-inline: 24px;
    }
}

.movie-hero .poster {
    grid-area: poster;
    align-self: start;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .12);
}

.movie-head {
    grid-area: head;
}

.movie-body {
    grid-area: body;
    align-self: start;
}

.movie-title {
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(2.1rem, 5.6vw, 4.4rem);
    line-height: 1;
    letter-spacing: -.01em;
    margin: 0;
    overflow-wrap: anywhere;
}

.tagline {
    font-style: italic;
    color: rgba(255, 255, 255, .78);
    margin: .6rem 0 0;
}

.facts {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem 2.25rem;
    margin: 1.1rem 0 1rem;
}

.facts dt {
    font-size: .8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, .62);
}

.facts dd {
    margin: 0;
    font-family: var(--display);
    font-weight: 500;
    font-size: 1.3rem;
    line-height: 1.2;
}

.facts .is-score {
    color: var(--gold);
}

.overview {
    max-width: 66ch;
    color: rgba(255, 255, 255, .9);
    margin: 0 0 .9rem;
}

.credits-line {
    margin: 0;
    color: rgba(255, 255, 255, .75);
}

.movie-hero a {
    color: var(--hopper);
}

.ext-link {
    display: inline-block;
    margin-top: .6rem;
    font-size: .9rem;
}

@media (max-width: 575px) {
    .movie-hero-inner {
        grid-template-columns: 104px 1fr;
        grid-template-areas: "poster head" "body body";
        gap: 1.1rem 1.1rem;
        padding-top: 1.75rem;
        align-items: end;
    }
}

.section-title {
    font-family: var(--display);
    font-weight: 500;
    font-size: 1.75rem;
    margin: 2.25rem 0 .25rem;
}

.section-note {
    color: var(--muted);
    margin: 0 0 1.25rem;
    font-size: .925rem;
}

.cast-grid {
    list-style: none;
    margin: 0 0 3.5rem;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
    gap: 1.6rem 1rem;
}

@media (max-width: 575px) {
    .cast-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem .75rem;
    }
}

.cast-grid .poster {
    aspect-ratio: 2 / 3;
}

.cast-name {
    display: block;
    margin-top: .5rem;
    font-weight: 600;
    line-height: 1.25;
}

/* ------------------------------------------------------------ footer */

.site-footer {
    flex: none;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .85rem;
    padding: 1.25rem 0 1.5rem;
}

.site-footer p {
    margin: 0;
    max-width: 70ch;
}

.site-footer a {
    color: inherit;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
