* {
    box-sizing: border-box;
}

:root {
    --bg: #020617;
    --panel: rgba(15, 23, 42, 0.82);
    --panel-solid: #0f172a;
    --panel-soft: rgba(30, 41, 59, 0.72);
    --line: rgba(148, 163, 184, 0.16);
    --text: #f8fafc;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --cyan: #06b6d4;
    --cyan-bright: #22d3ee;
    --emerald: #10b981;
    --purple: #a855f7;
    --shadow: 0 24px 80px rgba(8, 145, 178, 0.18);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 15% -10%, rgba(34, 211, 238, 0.22), transparent 32rem),
        radial-gradient(circle at 85% 10%, rgba(168, 85, 247, 0.18), transparent 34rem),
        linear-gradient(180deg, #020617 0%, #0f172a 46%, #020617 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(255, 255, 255, 0.024) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.024) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), transparent 70%);
}

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

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

button,
input {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--line);
    background: rgba(2, 6, 23, 0.86);
    backdrop-filter: blur(18px);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    min-height: 76px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 26px;
}

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    color: #ffffff;
    font-weight: 900;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    box-shadow: 0 0 34px rgba(34, 211, 238, 0.35);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.12;
}

.brand-text strong {
    font-size: 21px;
    letter-spacing: -0.04em;
}

.brand-text em {
    margin-top: 4px;
    font-size: 12px;
    font-style: normal;
    color: var(--cyan-bright);
}

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

.nav-link,
.mobile-link {
    color: var(--soft);
    font-weight: 650;
    transition: color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active,
.mobile-link:hover,
.mobile-link.is-active {
    color: var(--cyan-bright);
}

.top-search,
.mobile-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-search input,
.mobile-search input,
.grid-search input {
    color: var(--text);
    border: 1px solid rgba(148, 163, 184, 0.22);
    outline: none;
    background: rgba(15, 23, 42, 0.74);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.top-search input {
    width: 260px;
    border-radius: 999px;
    padding: 11px 16px;
}

.top-search button,
.mobile-search button {
    border: 0;
    border-radius: 999px;
    padding: 10px 15px;
    color: #ffffff;
    background: rgba(6, 182, 212, 0.92);
    cursor: pointer;
}

.top-search input:focus,
.mobile-search input:focus,
.grid-search input:focus {
    border-color: var(--cyan-bright);
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.13);
}

.search-results {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: min(420px, calc(100vw - 32px));
    max-height: 470px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(2, 6, 23, 0.98);
    box-shadow: var(--shadow);
    padding: 10px;
}

.search-results.is-visible {
    display: grid;
    gap: 8px;
}

.search-result-item {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 12px;
    padding: 10px;
    border-radius: 16px;
    color: var(--soft);
    transition: background 0.2s ease, color 0.2s ease;
}

.search-result-item:hover {
    color: var(--text);
    background: rgba(14, 116, 144, 0.2);
}

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

.search-result-item strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text);
}

.search-result-item span {
    font-size: 12px;
    color: var(--muted);
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.72);
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    border-radius: 999px;
    background: var(--text);
}

.mobile-panel {
    display: none;
    padding: 14px 24px 22px;
    border-top: 1px solid var(--line);
    background: rgba(2, 6, 23, 0.96);
}

.mobile-panel.is-open {
    display: block;
}

.mobile-panel nav {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.mobile-search input {
    width: 100%;
    border-radius: 16px;
    padding: 12px 14px;
}

main {
    position: relative;
    z-index: 1;
}

.hero-slider {
    position: relative;
    min-height: 72vh;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding: 140px max(24px, calc((100vw - 1280px) / 2 + 24px)) 96px;
    opacity: 0;
    transform: scale(1.02);
    background-position: center;
    background-size: cover;
    transition: opacity 0.7s ease, transform 1.2s ease;
}

.hero-slide.is-active {
    position: relative;
    opacity: 1;
    transform: scale(1);
}

.hero-content {
    max-width: 760px;
}

.eyebrow,
.section-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: 14px;
    border-radius: 999px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
}

.eyebrow {
    padding: 8px 14px;
}

.section-kicker {
    padding: 6px 12px;
}

.hero-content h1,
.page-hero h1,
.detail-info h1 {
    margin: 0;
    font-size: clamp(38px, 7vw, 78px);
    line-height: 0.98;
    letter-spacing: -0.07em;
}

.hero-content p,
.page-hero p,
.detail-one-line {
    max-width: 780px;
    margin: 22px 0 0;
    color: #dbeafe;
    font-size: clamp(17px, 2vw, 22px);
    line-height: 1.75;
}

.hero-tags,
.tag-row,
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-tags {
    margin-top: 24px;
}

.hero-tags span,
.tag-row span,
.detail-meta span {
    border: 1px solid rgba(103, 232, 249, 0.22);
    border-radius: 999px;
    color: #cffafe;
    background: rgba(8, 47, 73, 0.42);
}

.hero-tags span,
.detail-meta span {
    padding: 8px 12px;
}

.tag-row span {
    padding: 5px 9px;
    font-size: 12px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 30px;
}

.primary-btn,
.ghost-btn,
.outline-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border-radius: 16px;
    padding: 0 22px;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.primary-btn {
    color: #ffffff;
    background: linear-gradient(135deg, var(--cyan), var(--emerald));
    box-shadow: 0 18px 40px rgba(6, 182, 212, 0.24);
}

.ghost-btn,
.outline-btn {
    color: var(--text);
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.68);
}

.primary-btn:hover,
.ghost-btn:hover,
.outline-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: rgba(34, 211, 238, 0.42);
}

.hero-dots {
    position: absolute;
    right: max(24px, calc((100vw - 1280px) / 2 + 24px));
    bottom: 34px;
    display: flex;
    gap: 10px;
}

.hero-dot {
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.32);
    cursor: pointer;
    transition: width 0.25s ease, background 0.25s ease;
}

.hero-dot.is-active {
    width: 38px;
    background: var(--cyan-bright);
}

.intro-strip,
.section-block,
.category-preview,
.detail-main {
    max-width: 1280px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}

.intro-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 34px;
    padding-top: 28px;
    padding-bottom: 28px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.88), rgba(8, 47, 73, 0.38));
}

.intro-strip h2,
.section-head h2,
.text-card h2,
.side-panel h2,
.player-block h2 {
    margin: 0;
    font-size: clamp(26px, 4vw, 42px);
    line-height: 1.08;
    letter-spacing: -0.05em;
}

.intro-strip p,
.category-preview p {
    max-width: 780px;
    color: var(--soft);
    line-height: 1.8;
}

.section-block,
.category-preview {
    padding-top: 72px;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 28px;
}

.section-head a {
    color: var(--cyan-bright);
    font-weight: 800;
}

.compact-head h2 {
    font-size: 30px;
}

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

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

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

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

.movie-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.82);
    box-shadow: 0 18px 60px rgba(2, 6, 23, 0.25);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-7px);
    border-color: rgba(34, 211, 238, 0.42);
    box-shadow: var(--shadow);
}

.poster-link {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.96);
}

.poster-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease, filter 0.45s ease;
}

.movie-card:hover .poster-link img {
    transform: scale(1.06);
    filter: saturate(1.12) contrast(1.06);
}

.poster-shade {
    position: absolute;
    inset: auto 0 0;
    height: 45%;
    background: linear-gradient(to top, rgba(2, 6, 23, 0.92), transparent);
}

.card-score {
    position: absolute;
    right: 12px;
    bottom: 12px;
    min-width: 42px;
    border-radius: 999px;
    padding: 6px 10px;
    color: #031d22;
    font-weight: 900;
    text-align: center;
    background: var(--cyan-bright);
}

.card-body {
    padding: 16px;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 12px;
}

.card-body h3 {
    margin: 0;
    font-size: 18px;
    line-height: 1.32;
}

.card-body h3 a:hover {
    color: var(--cyan-bright);
}

.card-body p {
    display: -webkit-box;
    min-height: 48px;
    margin: 10px 0 14px;
    overflow: hidden;
    color: var(--soft);
    line-height: 1.6;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.compact-card .card-body p {
    min-height: auto;
}

.split-block {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 28px;
    align-items: start;
}

.rank-panel,
.text-card,
.side-panel,
.player-block {
    border: 1px solid var(--line);
    border-radius: 28px;
    background: rgba(15, 23, 42, 0.74);
    box-shadow: 0 18px 60px rgba(2, 6, 23, 0.2);
}

.rank-panel,
.player-block,
.side-panel {
    padding: 22px;
}

.rank-list {
    display: grid;
    gap: 10px;
}

.rank-row {
    display: grid;
    grid-template-columns: 42px 54px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.64);
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.rank-row:hover {
    transform: translateX(4px);
    border-color: rgba(34, 211, 238, 0.28);
    background: rgba(8, 47, 73, 0.38);
}

.rank-number {
    color: var(--cyan-bright);
    font-size: 20px;
    font-weight: 900;
    text-align: center;
}

.rank-row img {
    width: 54px;
    height: 72px;
    object-fit: cover;
    border-radius: 12px;
}

.rank-text {
    min-width: 0;
}

.rank-text strong,
.rank-text em {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.rank-text em {
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

.rank-score {
    color: var(--emerald);
    font-weight: 900;
}

.full-rank-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.category-tile {
    min-height: 210px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    border: 1px solid var(--line);
    border-radius: 26px;
    overflow: hidden;
    padding: 24px;
    background-position: center;
    background-size: cover;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.category-tile:hover {
    transform: translateY(-5px);
    border-color: rgba(34, 211, 238, 0.42);
    box-shadow: var(--shadow);
}

.category-tile span {
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.category-tile em {
    margin-top: 10px;
    color: var(--soft);
    font-style: normal;
    line-height: 1.65;
}

.page-main {
    padding-bottom: 80px;
}

.page-hero {
    max-width: 1280px;
    margin: 38px auto 0;
    border: 1px solid var(--line);
    border-radius: 34px;
    padding: 78px 44px;
    background-color: rgba(15, 23, 42, 0.8);
    background-position: center;
    background-size: cover;
    box-shadow: var(--shadow);
}

.compact-hero {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(8, 47, 73, 0.46));
}

.search-head {
    align-items: center;
}

.grid-search {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-weight: 700;
}

.grid-search input {
    width: min(340px, 50vw);
    border-radius: 999px;
    padding: 12px 16px;
}

.movie-card.is-hidden,
.rank-row.is-hidden {
    display: none;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
    color: var(--muted);
}

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

.detail-hero {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 34px;
    margin-top: 22px;
    border: 1px solid var(--line);
    border-radius: 34px;
    padding: 34px;
    background-position: center;
    background-size: cover;
    box-shadow: var(--shadow);
}

.detail-poster img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 24px;
    box-shadow: 0 22px 60px rgba(2, 6, 23, 0.48);
}

.detail-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.detail-meta {
    margin-top: 22px;
}

.detail-tags {
    margin-top: 18px;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
    margin-top: 32px;
}

.detail-content {
    display: grid;
    gap: 24px;
}

.video-player {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(34, 211, 238, 0.18);
    border-radius: 24px;
    background: #000000;
    aspect-ratio: 16 / 9;
}

.video-player video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #000000;
}

.play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    border: 0;
    color: #ffffff;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.28), rgba(2, 6, 23, 0.62));
    cursor: pointer;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.video-player.is-playing .play-overlay {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.play-icon {
    width: 78px;
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding-left: 4px;
    color: #04141a;
    font-size: 30px;
    background: var(--cyan-bright);
    box-shadow: 0 0 42px rgba(34, 211, 238, 0.42);
}

.text-card {
    padding: 28px;
}

.text-card p {
    margin: 18px 0 0;
    color: var(--soft);
    font-size: 17px;
    line-height: 1.9;
}

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

.side-panel h2 {
    margin-bottom: 18px;
    font-size: 28px;
}

.site-footer {
    position: relative;
    z-index: 1;
    margin-top: 82px;
    border-top: 1px solid var(--line);
    background: rgba(2, 6, 23, 0.82);
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 34px 24px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 34px;
}

.footer-brand {
    color: var(--text);
    font-size: 24px;
    font-weight: 900;
}

.footer-inner p {
    max-width: 560px;
    color: var(--muted);
    line-height: 1.8;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 14px 20px;
}

.footer-links a {
    color: var(--soft);
}

.footer-links a:hover {
    color: var(--cyan-bright);
}

.footer-bottom {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px 30px;
    color: var(--muted);
}

@media (max-width: 1180px) {
    .desktop-nav,
    .top-search {
        display: none;
    }

    .menu-toggle {
        display: block;
        margin-left: auto;
    }

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

    .split-block,
    .detail-layout {
        grid-template-columns: 1fr;
    }

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

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

@media (max-width: 820px) {
    .header-inner {
        padding: 0 16px;
    }

    .brand-text strong {
        font-size: 18px;
    }

    .brand-text em {
        display: none;
    }

    .hero-slide {
        min-height: 72vh;
        padding: 120px 18px 84px;
    }

    .hero-dots {
        left: 18px;
        right: auto;
    }

    .intro-strip,
    .section-head,
    .footer-inner {
        display: grid;
    }

    .section-block,
    .category-preview,
    .detail-main {
        padding-left: 16px;
        padding-right: 16px;
    }

    .movie-grid,
    .featured-grid,
    .small-grid,
    .catalog-grid,
    .side-grid,
    .full-rank-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .page-hero {
        margin: 24px 16px 0;
        padding: 46px 22px;
    }

    .detail-hero {
        grid-template-columns: 1fr;
        padding: 22px;
    }

    .detail-poster {
        max-width: 260px;
    }

    .grid-search {
        align-items: stretch;
        flex-direction: column;
    }

    .grid-search input {
        width: 100%;
    }

    .footer-links {
        justify-content: flex-start;
    }
}

@media (max-width: 560px) {
    .movie-grid,
    .featured-grid,
    .small-grid,
    .catalog-grid,
    .side-grid,
    .category-grid,
    .full-rank-list {
        grid-template-columns: 1fr;
    }

    .hero-actions {
        display: grid;
    }

    .rank-row {
        grid-template-columns: 36px 48px minmax(0, 1fr);
    }

    .rank-score {
        display: none;
    }
}
