* {
    box-sizing: border-box;
}

:root {
    --bg: #020617;
    --panel: #0f172a;
    --panel-soft: #1e293b;
    --card: #1e293b;
    --card-hover: #334155;
    --line: #334155;
    --text: #cbd5e1;
    --muted: #94a3b8;
    --dim: #64748b;
    --white: #ffffff;
    --accent: #2563eb;
    --accent-soft: rgba(37, 99, 235, .18);
    --radius: 18px;
    --shadow: 0 22px 60px rgba(0, 0, 0, .35);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

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

button,
input {
    font: inherit;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(15, 23, 42, .95);
    border-bottom: 1px solid #1e293b;
    backdrop-filter: blur(10px);
}

.nav-wrap {
    width: min(1180px, calc(100% - 32px));
    height: 64px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.site-logo {
    font-size: 24px;
    line-height: 1;
    font-weight: 800;
    color: var(--white);
    letter-spacing: -.04em;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 32px;
    margin-left: auto;
}

.desktop-nav a,
.mobile-nav a {
    color: var(--text);
    transition: color .2s ease;
}

.desktop-nav a:hover,
.desktop-nav a.active,
.mobile-nav a:hover,
.mobile-nav a.active {
    color: var(--white);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-button {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    color: var(--text);
    background: transparent;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}

.icon-button:hover {
    color: var(--white);
    background: rgba(255, 255, 255, .08);
}

.mobile-menu-button {
    display: none;
}

.mobile-nav {
    border-top: 1px solid var(--line);
    background: #1e293b;
    padding: 12px 16px 16px;
}

.mobile-nav a {
    display: block;
    padding: 10px 0;
}

.hero {
    position: relative;
    min-height: 70vh;
    overflow: hidden;
    background: #020617;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1s ease;
}

.hero-slide.is-active {
    opacity: 1;
    z-index: 1;
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, #020617 0%, rgba(2, 6, 23, .62) 42%, rgba(2, 6, 23, .16) 100%);
}

.hero-content {
    position: absolute;
    left: max(32px, calc((100vw - 1180px) / 2));
    right: max(32px, calc((100vw - 1180px) / 2));
    bottom: 56px;
    z-index: 2;
    max-width: 740px;
}

.hero-kicker,
.breadcrumb {
    color: var(--muted);
    font-size: 14px;
    margin: 0 0 12px;
}

.breadcrumb a {
    color: var(--text);
}

.breadcrumb a:hover {
    color: var(--white);
}

.hero h1,
.page-hero h1,
.detail-copy h1 {
    margin: 0;
    color: var(--white);
    font-size: clamp(34px, 6vw, 72px);
    line-height: .98;
    letter-spacing: -.06em;
}

.hero p,
.page-hero p,
.detail-line {
    max-width: 720px;
    margin: 20px 0 0;
    color: var(--text);
    font-size: 18px;
}

.hero-tags,
.movie-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.hero-tags span,
.movie-tags span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(51, 65, 85, .72);
    color: var(--text);
    font-size: 12px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.primary-button,
.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border-radius: 999px;
    font-weight: 700;
    transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}

.primary-button {
    color: #0f172a;
    background: rgba(255, 255, 255, .92);
}

.primary-button:hover,
.ghost-button:hover {
    transform: translateY(-2px);
}

.ghost-button {
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(15, 23, 42, .58);
}

.ghost-button:hover {
    border-color: rgba(255, 255, 255, .42);
    background: rgba(30, 41, 59, .9);
}

.hero-nav {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 48px;
    height: 64px;
    border: 0;
    border-radius: 16px;
    color: var(--white);
    background: rgba(0, 0, 0, .36);
    font-size: 44px;
    cursor: pointer;
    transform: translateY(-50%);
    transition: background .2s ease;
}

.hero-nav:hover {
    background: rgba(0, 0, 0, .7);
}

.hero-prev {
    left: 18px;
}

.hero-next {
    right: 18px;
}

.hero-dots {
    position: absolute;
    left: 50%;
    bottom: 24px;
    z-index: 3;
    display: flex;
    gap: 8px;
    transform: translateX(-50%);
}

.hero-dot {
    width: 10px;
    height: 10px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .38);
    cursor: pointer;
}

.hero-dot.is-active {
    width: 28px;
    background: var(--white);
}

.home-intro {
    padding: 48px 0 12px;
}

.home-intro h2,
.section-title h2,
.story-card h2 {
    margin: 0;
    color: var(--white);
    font-size: clamp(24px, 3vw, 36px);
    letter-spacing: -.04em;
}

.home-intro p {
    max-width: 880px;
    color: var(--muted);
    font-size: 17px;
}

.content-section {
    padding: 36px 0;
}

.section-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.section-title p {
    margin: 8px 0 0;
    color: var(--muted);
}

.text-link {
    color: var(--text);
    font-weight: 700;
}

.text-link:hover {
    color: var(--white);
}

.movie-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

.category-movie-grid {
    padding-bottom: 64px;
}

.scroll-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(230px, 280px);
    gap: 18px;
    overflow-x: auto;
    padding: 2px 2px 16px;
    scrollbar-width: none;
}

.scroll-row::-webkit-scrollbar {
    display: none;
}

.movie-card {
    display: block;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: 0 0 0 1px rgba(51, 65, 85, .4);
    transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}

.movie-card:hover {
    transform: translateY(-4px);
    background: var(--card-hover);
    box-shadow: 0 0 0 2px #475569, var(--shadow);
}

.movie-cover {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #334155;
}

.movie-card-small .movie-cover {
    aspect-ratio: 16 / 9;
}

.movie-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

.movie-card:hover .movie-cover img {
    transform: scale(1.055);
}

.movie-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, .78), rgba(0, 0, 0, .18), transparent);
    transition: opacity .25s ease;
}

.movie-card:hover .movie-cover::after {
    opacity: 1;
}

.movie-meta,
.rank-badge {
    position: absolute;
    z-index: 2;
    top: 10px;
    left: 10px;
    padding: 4px 9px;
    border-radius: 999px;
    color: var(--white);
    background: rgba(0, 0, 0, .7);
    font-size: 12px;
}

.rank-badge {
    left: auto;
    right: 10px;
    background: rgba(37, 99, 235, .9);
}

.movie-play {
    position: absolute;
    z-index: 3;
    left: 50%;
    top: 50%;
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #0f172a;
    background: rgba(255, 255, 255, .9);
    opacity: 0;
    transform: translate(-50%, -50%) scale(.72);
    transition: opacity .25s ease, transform .25s ease;
}

.movie-card:hover .movie-play {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.movie-info {
    padding: 16px;
}

.movie-info h3 {
    min-height: 50px;
    margin: 0 0 8px;
    color: var(--white);
    font-size: 16px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.movie-info p {
    min-height: 46px;
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.movie-tags {
    margin-top: 0;
}

.category-grid,
.category-overview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.category-tile,
.category-overview-card {
    position: relative;
    min-height: 220px;
    overflow: hidden;
    border-radius: 22px;
    background: var(--panel-soft);
    box-shadow: 0 0 0 1px rgba(51, 65, 85, .45);
}

.category-tile img,
.category-overview-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .44;
    transition: transform .5s ease, opacity .3s ease;
}

.category-tile:hover img,
.category-overview-card:hover img {
    transform: scale(1.06);
    opacity: .58;
}

.category-tile::after,
.category-overview-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(2, 6, 23, .96), rgba(2, 6, 23, .26));
}

.category-tile div,
.category-overview-card div {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: end;
    padding: 24px;
}

.category-tile h3,
.category-overview-card h2 {
    margin: 0;
    color: var(--white);
    font-size: 26px;
    letter-spacing: -.04em;
}

.category-tile p,
.category-overview-card p,
.category-overview-card span {
    margin: 8px 0 0;
    color: var(--text);
}

.category-tile span,
.category-overview-card strong {
    margin-top: 14px;
    color: var(--white);
}

.page-main {
    padding-top: 64px;
}

.page-hero {
    min-height: 360px;
    display: flex;
    align-items: end;
    padding: 72px 0 48px;
    background: radial-gradient(circle at top right, rgba(37, 99, 235, .22), transparent 38%), #020617;
    border-bottom: 1px solid rgba(51, 65, 85, .58);
}

.page-hero.small-hero {
    min-height: 300px;
}

.ranking-hero {
    background-position: center;
    background-size: cover;
}

.category-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.category-stats span {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(30, 41, 59, .82);
    color: var(--text);
}

.filter-panel {
    margin: 32px 0;
    padding: 20px;
    border: 1px solid rgba(51, 65, 85, .74);
    border-radius: 22px;
    background: rgba(15, 23, 42, .86);
}

.filter-panel label {
    display: block;
    margin-bottom: 10px;
    color: var(--white);
    font-weight: 700;
}

.filter-panel input,
.search-input {
    width: 100%;
    height: 48px;
    border: 1px solid #334155;
    border-radius: 14px;
    color: var(--white);
    background: #0f172a;
    padding: 0 16px;
    outline: none;
}

.filter-panel input:focus,
.search-input:focus {
    border-color: #64748b;
    box-shadow: 0 0 0 4px rgba(100, 116, 139, .16);
}

.detail-head {
    position: relative;
    min-height: 620px;
    padding: 110px 0 70px;
    overflow: hidden;
}

.detail-bg {
    position: absolute;
    inset: 0;
    background-position: center;
    background-size: cover;
    filter: saturate(1.05);
}

.detail-layout {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 310px 1fr;
    gap: 42px;
    align-items: end;
}

.detail-poster {
    overflow: hidden;
    border-radius: 24px;
    background: #1e293b;
    box-shadow: var(--shadow);
}

.detail-poster img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.detail-meta span {
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .44);
    color: var(--text);
}

.player-block {
    margin-top: -32px;
    position: relative;
    z-index: 4;
}

.player-shell {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    background: #000000;
    box-shadow: var(--shadow);
}

.player-shell video {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000000;
}

.player-start {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    border: 0;
    color: var(--white);
    background: linear-gradient(to top, rgba(0, 0, 0, .82), rgba(0, 0, 0, .28));
    cursor: pointer;
    transition: opacity .25s ease, visibility .25s ease;
}

.player-start span {
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #0f172a;
    background: rgba(255, 255, 255, .92);
    font-size: 30px;
}

.player-start strong {
    font-size: 24px;
}

.player-start small {
    color: var(--text);
}

.player-start.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.detail-content {
    padding: 36px 0 70px;
}

.story-card {
    margin-bottom: 22px;
    padding: 26px;
    border: 1px solid rgba(51, 65, 85, .72);
    border-radius: 22px;
    background: rgba(15, 23, 42, .82);
}

.story-card p {
    margin: 14px 0 0;
    color: var(--text);
    font-size: 16px;
}

.meta-card dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0 0;
}

.meta-card dl div {
    padding: 14px;
    border-radius: 16px;
    background: rgba(30, 41, 59, .72);
}

.meta-card dt {
    color: var(--dim);
    font-size: 13px;
}

.meta-card dd {
    margin: 6px 0 0;
    color: var(--white);
}

.related-section {
    padding-bottom: 0;
}

.search-layer {
    position: fixed;
    inset: 0;
    z-index: 80;
}

.search-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .68);
}

.search-box {
    position: relative;
    width: min(720px, calc(100% - 28px));
    margin: 88px auto 0;
    padding: 22px;
    border: 1px solid rgba(51, 65, 85, .8);
    border-radius: 24px;
    background: rgba(15, 23, 42, .98);
    box-shadow: var(--shadow);
}

.search-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.search-head h2 {
    margin: 0;
    color: var(--white);
}

.search-results {
    display: grid;
    gap: 10px;
    margin-top: 16px;
    max-height: min(58vh, 520px);
    overflow: auto;
}

.search-result-item {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 12px;
    padding: 10px;
    border-radius: 16px;
    background: rgba(30, 41, 59, .78);
}

.search-result-item img {
    width: 64px;
    height: 46px;
    border-radius: 10px;
    object-fit: cover;
}

.search-result-item h3 {
    margin: 0;
    color: var(--white);
    font-size: 15px;
}

.search-result-item p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.site-footer {
    border-top: 1px solid #1e293b;
    background: #0f172a;
}

.footer-inner {
    padding: 30px 0;
    text-align: center;
}

.footer-inner p {
    margin: 4px 0;
    color: var(--dim);
    font-size: 14px;
}

[hidden] {
    display: none !important;
}

@media (max-width: 980px) {
    .desktop-nav {
        display: none;
    }

    .mobile-menu-button {
        display: inline-grid;
        place-items: center;
    }

    .movie-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .detail-layout {
        grid-template-columns: 240px 1fr;
    }
}

@media (max-width: 760px) {
    .hero {
        min-height: 76vh;
    }

    .hero-content {
        left: 18px;
        right: 18px;
        bottom: 60px;
    }

    .hero p,
    .page-hero p,
    .detail-line {
        font-size: 16px;
    }

    .hero-nav {
        display: none;
    }

    .section-title {
        align-items: start;
        flex-direction: column;
    }

    .movie-grid,
    .category-grid,
    .category-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .detail-head {
        padding: 96px 0 48px;
    }

    .detail-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .detail-poster {
        width: min(250px, 72vw);
    }

    .meta-card dl {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .container,
    .nav-wrap {
        width: min(100% - 24px, 1180px);
    }

    .site-logo {
        font-size: 20px;
    }

    .movie-grid {
        grid-template-columns: 1fr;
    }

    .movie-cover {
        aspect-ratio: 16 / 10;
    }

    .category-grid,
    .category-overview-grid {
        grid-template-columns: 1fr;
    }

    .scroll-row {
        grid-auto-columns: minmax(220px, 82vw);
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .primary-button,
    .ghost-button {
        width: 100%;
    }
}
