:root {
    --color-sand-50: #faf8f3;
    --color-sand-100: #f5f0e6;
    --color-sand-200: #ebe2cd;
    --color-sand-300: #ddc9a3;
    --color-sand-400: #d4b683;
    --color-sand-500: #c49a5c;
    --color-sand-600: #b07d44;
    --color-sand-700: #8f6235;
    --color-sand-800: #6d4a29;
    --color-sand-900: #4a3218;
    --color-dune-50: #fdf6ed;
    --color-dune-100: #fae9d1;
    --color-dune-200: #f5d4a3;
    --color-dune-300: #ebb76a;
    --color-dune-400: #e19838;
    --color-dune-500: #d97c1e;
    --color-dune-600: #c05f14;
    --color-dune-700: #9c4613;
    --color-dune-900: #642d13;
    --shadow-soft: 0 10px 30px rgba(74, 50, 24, 0.10);
    --shadow-lift: 0 18px 42px rgba(74, 50, 24, 0.16);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--color-sand-50);
    color: var(--color-sand-900);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

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

button,
input,
select {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(221, 201, 163, 0.65);
    backdrop-filter: blur(18px);
}

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

.logo,
.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 800;
    color: var(--color-sand-900);
}

.logo-mark {
    width: 36px;
    height: 36px;
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--color-dune-500), var(--color-dune-700));
    box-shadow: 0 8px 18px rgba(192, 95, 20, 0.24);
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-link {
    color: var(--color-sand-700);
    font-weight: 650;
    transition: color 0.25s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-dune-600);
}

.mobile-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: var(--color-sand-100);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
}

.mobile-toggle span {
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: var(--color-sand-800);
}

.mobile-nav {
    display: none;
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto 16px;
    padding: 14px;
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.mobile-nav a {
    display: block;
    padding: 12px 8px;
    color: var(--color-sand-700);
    font-weight: 650;
}

.mobile-nav.open {
    display: block;
}

.hero-slider {
    position: relative;
    height: clamp(520px, 72vh, 720px);
    overflow: hidden;
    background: var(--color-sand-900);
}

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

.hero-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
}

.hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.84), rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.10));
}

.hero-content {
    position: absolute;
    left: 50%;
    bottom: 72px;
    width: min(1280px, calc(100% - 32px));
    transform: translateX(-50%);
    color: #fff;
}

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

.hero-tags span,
.tag {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 12px;
    border-radius: 999px;
    color: #fff;
    background: rgba(255, 255, 255, 0.20);
    backdrop-filter: blur(12px);
    font-size: 13px;
    font-weight: 650;
}

.hero-content h1 {
    max-width: 780px;
    margin: 18px 0 14px;
    font-size: clamp(36px, 6vw, 66px);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.hero-content p {
    max-width: 720px;
    margin: 0 0 28px;
    color: rgba(255, 255, 255, 0.92);
    font-size: clamp(16px, 2vw, 20px);
}

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

.btn-primary,
.btn-ghost,
.quick-search button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 22px;
    border: 0;
    border-radius: 12px;
    font-weight: 750;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.btn-primary,
.quick-search button {
    color: #fff;
    background: var(--color-dune-500);
    box-shadow: 0 10px 22px rgba(192, 95, 20, 0.24);
}

.btn-primary:hover,
.quick-search button:hover {
    background: var(--color-dune-600);
    transform: translateY(-2px);
    box-shadow: 0 16px 28px rgba(192, 95, 20, 0.30);
}

.btn-ghost {
    color: #fff;
    background: rgba(255, 255, 255, 0.17);
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(14px);
}

.btn-ghost:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.25);
}

.hero-control {
    position: absolute;
    top: 50%;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(12px);
    font-size: 32px;
    line-height: 1;
    transform: translateY(-50%);
}

.hero-prev {
    left: 24px;
}

.hero-next {
    right: 24px;
}

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

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

.hero-dot.active {
    width: 30px;
    background: #fff;
}

.search-band {
    width: min(1280px, calc(100% - 32px));
    margin: -42px auto 0;
    position: relative;
    z-index: 4;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 460px);
    gap: 24px;
    align-items: center;
    padding: 26px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-lift);
    backdrop-filter: blur(18px);
}

.search-band h2 {
    margin: 0 0 4px;
    font-size: clamp(22px, 3vw, 34px);
}

.search-band p {
    margin: 0;
    color: var(--color-sand-600);
}

.quick-search {
    display: flex;
    gap: 10px;
}

.quick-search input,
.filter-input,
.filter-select {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--color-sand-200);
    border-radius: 12px;
    padding: 0 14px;
    color: var(--color-sand-900);
    background: #fff;
    outline: none;
}

.quick-search input:focus,
.filter-input:focus,
.filter-select:focus {
    border-color: var(--color-dune-400);
    box-shadow: 0 0 0 4px rgba(217, 124, 30, 0.12);
}

.section,
.filter-panel,
.page-main,
.detail-main {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
}

.section {
    padding: 64px 0 0;
}

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

.section-head h2 {
    margin: 0;
    font-size: clamp(26px, 3vw, 38px);
    letter-spacing: -0.03em;
}

.section-head p {
    margin: 6px 0 0;
    color: var(--color-sand-600);
}

.section-more {
    color: var(--color-dune-600);
    font-weight: 800;
}

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

.movie-card,
.category-card,
.detail-card,
.aside-card,
.rank-row {
    overflow: hidden;
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow-soft);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover,
.category-card:hover,
.compact-card:hover,
.rank-row:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lift);
}

.poster-frame {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: var(--color-sand-200);
}

.poster-frame img,
.category-card img,
.compact-poster img,
.rank-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.movie-card:hover .poster-frame img,
.category-card:hover img,
.compact-card:hover img,
.rank-row:hover img {
    transform: scale(1.08);
}

.view-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 8px;
    color: #fff;
    background: rgba(0, 0, 0, 0.66);
    font-size: 12px;
    font-weight: 750;
    backdrop-filter: blur(10px);
}

.movie-info {
    padding: 14px;
}

.movie-info h3 {
    min-height: 52px;
    margin: 0 0 8px;
    font-size: 17px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.movie-meta {
    display: flex;
    gap: 10px;
    color: var(--color-sand-500);
    font-size: 12px;
    font-weight: 650;
}

.tag-row {
    margin-top: 12px;
}

.mini-tag {
    padding: 4px 8px;
    border-radius: 8px;
    color: var(--color-sand-700);
    background: var(--color-sand-100);
    font-size: 12px;
    font-weight: 650;
}

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

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

.category-card {
    position: relative;
    min-height: 210px;
    color: #fff;
}

.category-card img {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.category-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.20));
}

.category-card div {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 20px;
    z-index: 1;
}

.category-card h3 {
    margin: 0 0 6px;
    font-size: 22px;
}

.category-card p {
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: 14px;
}

.rank-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

.compact-card {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 112px;
    padding: 10px;
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow-soft);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.compact-poster {
    position: relative;
    width: 84px;
    height: 92px;
    overflow: hidden;
    border-radius: 12px;
    background: var(--color-sand-200);
}

.rank-no,
.rank-index {
    position: absolute;
    top: 6px;
    left: 6px;
    display: inline-grid;
    place-items: center;
    min-width: 26px;
    height: 26px;
    border-radius: 8px;
    color: #fff;
    background: var(--color-dune-600);
    font-size: 12px;
    font-weight: 800;
}

.compact-card h3 {
    margin: 0 0 6px;
    font-size: 15px;
    line-height: 1.4;
}

.compact-card p {
    margin: 0;
    color: var(--color-sand-600);
    font-size: 12px;
}

.page-main {
    padding: 42px 0 72px;
}

.page-hero {
    position: relative;
    overflow: hidden;
    min-height: 260px;
    display: flex;
    align-items: end;
    padding: 38px;
    border-radius: 28px;
    color: #fff;
    background: radial-gradient(circle at 20% 20%, rgba(217, 124, 30, 0.82), transparent 34%), linear-gradient(135deg, var(--color-sand-900), var(--color-dune-900));
    box-shadow: var(--shadow-lift);
}

.page-hero p {
    margin: 0 0 8px;
    color: var(--color-dune-100);
    font-weight: 750;
}

.page-hero h1 {
    margin: 0 0 8px;
    font-size: clamp(34px, 5vw, 56px);
    letter-spacing: -0.04em;
}

.page-hero span {
    display: block;
    max-width: 700px;
    color: rgba(255, 255, 255, 0.84);
}

.filter-panel {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) repeat(3, minmax(160px, 220px));
    gap: 14px;
    margin-top: 28px;
    padding: 18px;
    border-radius: 20px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.empty-state {
    padding: 36px;
    border-radius: 18px;
    color: var(--color-sand-600);
    background: #fff;
    text-align: center;
}

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

.rank-link {
    display: grid;
    grid-template-columns: 54px 96px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    padding: 12px 18px;
}

.rank-link .rank-index {
    position: static;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 16px;
}

.rank-link img {
    width: 96px;
    height: 120px;
    border-radius: 14px;
    background: var(--color-sand-200);
}

.rank-link h2 {
    margin: 0 0 8px;
    font-size: 21px;
}

.rank-link p {
    margin: 0 0 8px;
    color: var(--color-sand-600);
}

.rank-link span {
    color: var(--color-sand-500);
    font-size: 13px;
    font-weight: 650;
}

.detail-main {
    padding: 32px 0 72px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
    color: var(--color-sand-600);
    font-size: 14px;
}

.breadcrumb a {
    color: var(--color-dune-600);
    font-weight: 750;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) 360px;
    gap: 28px;
    align-items: start;
}

.detail-primary {
    display: grid;
    gap: 22px;
}

.player-card {
    border-radius: 22px;
    overflow: hidden;
    background: #000;
    box-shadow: var(--shadow-lift);
}

.video-wrap {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
}

.player-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.play-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 14px;
    border: 0;
    color: #fff;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.18));
    cursor: pointer;
}

.play-overlay.hidden {
    display: none;
}

.play-icon {
    display: grid;
    place-items: center;
    width: 82px;
    height: 82px;
    border-radius: 50%;
    background: var(--color-dune-500);
    box-shadow: 0 20px 45px rgba(192, 95, 20, 0.36);
    font-size: 34px;
}

.player-error {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 24px;
    z-index: 3;
    padding: 14px 18px;
    border-radius: 14px;
    color: #fff;
    background: rgba(156, 70, 19, 0.90);
    text-align: center;
}

.detail-card,
.aside-card {
    padding: 26px;
}

.detail-card h1 {
    margin: 14px 0 14px;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.15;
}

.detail-card h2,
.aside-card h2 {
    margin: 22px 0 10px;
    font-size: 22px;
}

.detail-card p {
    margin: 0 0 14px;
    color: var(--color-sand-700);
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--color-sand-200);
}

.detail-meta span {
    padding: 6px 10px;
    border-radius: 10px;
    color: var(--color-sand-700);
    background: var(--color-sand-100);
    font-size: 13px;
    font-weight: 700;
}

.detail-tags .tag {
    color: var(--color-sand-700);
    background: var(--color-sand-100);
}

.review-card {
    background: linear-gradient(135deg, #fff, var(--color-dune-50));
}

.detail-aside {
    position: sticky;
    top: 96px;
}

.compact-list {
    display: grid;
    gap: 14px;
}

.site-footer {
    margin-top: 72px;
    padding: 48px 0 24px;
    color: var(--color-dune-100);
    background: var(--color-sand-900);
}

.footer-grid {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 36px;
}

.footer-logo {
    color: #fff;
}

.site-footer p {
    max-width: 460px;
    color: rgba(250, 233, 209, 0.80);
}

.site-footer h2 {
    margin: 0 0 14px;
    color: #fff;
    font-size: 18px;
}

.footer-links {
    display: grid;
    gap: 8px;
}

.footer-links a {
    color: rgba(250, 233, 209, 0.84);
}

.footer-links a:hover {
    color: #fff;
}

.copyright {
    width: min(1280px, calc(100% - 32px));
    margin: 32px auto 0;
    padding-top: 18px;
    border-top: 1px solid rgba(250, 233, 209, 0.16);
    color: rgba(250, 233, 209, 0.68);
    font-size: 14px;
}

@media (max-width: 1180px) {
    .movie-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

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

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

    .detail-aside {
        position: static;
    }
}

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

    .mobile-toggle {
        display: flex;
    }

    .hero-control {
        display: none;
    }

    .hero-content {
        bottom: 58px;
    }

    .search-band,
    .filter-panel,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .quick-search {
        flex-direction: column;
    }

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

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

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

    .rank-link {
        grid-template-columns: 42px 76px minmax(0, 1fr);
        padding: 10px;
    }

    .rank-link img {
        width: 76px;
        height: 96px;
    }

    .detail-card,
    .aside-card {
        padding: 20px;
    }
}

@media (max-width: 520px) {
    .nav-wrap,
    .section,
    .filter-panel,
    .page-main,
    .detail-main,
    .search-band,
    .copyright,
    .footer-grid {
        width: min(100% - 22px, 1280px);
    }

    .hero-slider {
        height: 560px;
    }

    .hero-content h1 {
        font-size: 34px;
    }

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

    .movie-info {
        padding: 12px;
    }

    .movie-info h3 {
        font-size: 15px;
    }

    .compact-card {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .compact-poster {
        width: 72px;
        height: 86px;
    }
}
