:root {
    color-scheme: dark;
    --bg: #07080d;
    --surface: #11131b;
    --text: #f7f7fb;
    --muted: #a4a7b5;
    --accent: #8b5cf6;
    --accent-2: #c4b5fd;
    --line: rgba(255,255,255,.1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-width: 320px;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 20;
    height: 76px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 clamp(1.2rem, 4vw, 4.5rem);
    background: linear-gradient(180deg, rgba(7,8,13,.94), rgba(7,8,13,.35), transparent);
    transition: background .25s, backdrop-filter .25s;
}
.site-header.scrolled { background: rgba(7,8,13,.88); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: .65rem; width: max-content; font-size: 1.18rem; font-weight: 800; letter-spacing: -.03em; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--accent); box-shadow: 0 0 24px rgba(139,92,246,.45); }
nav { display: flex; align-items: center; gap: 2rem; color: #c7c8d0; font-size: .92rem; }
nav a { position: relative; padding: .6rem 0; }
nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; transform: scaleX(0); background: var(--accent-2); transition: transform .2s; }
nav a:hover::after, nav a.active::after { transform: scaleX(1); }
nav a.active { color: white; }
.header-actions { justify-self: end; display:flex;align-items:center;gap:1rem;color:#d9d9e2;font-size:.9rem }
.search-link { display: flex; align-items: center; gap: .45rem; padding:0;border:0;background:none;color:inherit;cursor:pointer;font-size: .9rem; }
.search-link span:first-child { font-size: 1.45rem; }

.hero {
    position: relative;
    min-height: min(760px, 88vh);
    display: flex;
    align-items: flex-end;
    padding: 9rem clamp(1.2rem, 6vw, 6.5rem) 7rem;
    background-image: var(--hero-image);
    background-size: cover;
    background-position: center 24%;
    overflow: hidden;
}
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(7,8,13,.97) 0%, rgba(7,8,13,.66) 46%, rgba(7,8,13,.08) 76%), linear-gradient(0deg, var(--bg), transparent 38%); }
.hero-shade { position: absolute; inset: 0; background: radial-gradient(circle at 78% 35%, transparent 0 18%, rgba(7,8,13,.18) 48%, transparent 70%); }
.hero-content { position: relative; z-index: 2; max-width: 680px; }
.eyebrow, .kicker { color: var(--accent-2); text-transform: uppercase; letter-spacing: .18em; font-size: .75rem; font-weight: 800; }
.eyebrow { display: flex; align-items: center; gap: .55rem; }
.eyebrow i { width: 22px; height: 2px; background: var(--accent); }
.hero h1 { margin: .8rem 0 .75rem; max-width: 660px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(3.25rem, 7.5vw, 7rem); font-weight: 500; line-height: .92; letter-spacing: -.055em; text-wrap: balance; }
.hero-meta { display: flex; flex-wrap: wrap; gap: .55rem 1rem; margin: 1.3rem 0; color: #d1d2da; font-size: .88rem; }
.hero-meta span + span::before { content: "•"; color: var(--accent); margin-right: 1rem; }
.hero-content > p { max-width: 600px; margin: 0; color: #c7c8d2; font-size: 1rem; line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.primary-action, .secondary-action {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .7rem;
    padding: 0 1.4rem;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 750;
}
.primary-action { background: var(--text); color: #080910; }
.primary-action:hover { background: var(--accent-2); }
.secondary-action { border-color: rgba(255,255,255,.25); background: rgba(17,19,27,.35); backdrop-filter: blur(8px); }
.secondary-action:hover { border-color: rgba(255,255,255,.65); }
.hero-index { position: absolute; z-index: 2; right: clamp(1.2rem, 5vw, 5rem); bottom: 5.8rem; font: 2rem Georgia, serif; }
.hero-index span { color: var(--muted); font-size: .95rem; }

.catalog-shell { position: relative; z-index: 4; margin-top: -2rem; padding: 0 clamp(1.2rem, 6vw, 6.5rem) 5rem; }
.catalog-section { padding: 2.6rem 0 1.6rem; scroll-margin-top: 80px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.section-heading h2 { margin: .3rem 0 0; font: 500 clamp(2rem, 4vw, 3.5rem)/1 Georgia, serif; letter-spacing: -.04em; }
.count { color: var(--muted); font-size: .85rem; }
.media-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: clamp(.8rem, 1.8vw, 1.4rem); }
.media-card { min-width: 0; outline: none; cursor: pointer; }
.poster-wrap { position: relative; aspect-ratio: 2 / 3; overflow: hidden; border-radius: 6px; background: var(--surface); box-shadow: 0 14px 40px rgba(0,0,0,.25); }
.poster-wrap::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(7,8,13,.75), transparent 40%); opacity: 0; transition: opacity .3s; }
.poster-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .45s ease, filter .45s; }
.media-card:hover img, .media-card:focus img { transform: scale(1.045); filter: brightness(.72); }
.media-card:hover .poster-wrap::after, .media-card:focus .poster-wrap::after { opacity: 1; }
.card-play { position: absolute; z-index: 2; inset: 50% auto auto 50%; display: grid; place-items: center; width: 50px; height: 50px; padding-left: 3px; border-radius: 50%; background: white; color: #090a10; opacity: 0; transform: translate(-50%, -35%); transition: opacity .25s, transform .25s; }
.favorite-button{position:absolute;z-index:3;top:.65rem;right:.65rem;width:36px;height:36px;border:1px solid rgba(255,255,255,.3);border-radius:50%;background:rgba(7,8,13,.65);color:white;font-size:1.35rem;cursor:pointer;backdrop-filter:blur(8px)}
.favorite-button.active{background:var(--accent);border-color:var(--accent)}
.media-card:hover .card-play, .media-card:focus .card-play { opacity: 1; transform: translate(-50%, -50%); }
.card-copy { padding: .8rem .15rem 0; }
.card-copy h3 { margin: 0; font-size: 1rem; line-height: 1.3; letter-spacing: -.01em; }
.card-copy p { margin: .35rem 0 0; color: var(--muted); font-size: .8rem; }
.catalog-search{display:none;margin:1rem 0 0;padding:1rem;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
.catalog-search.open{display:flex;align-items:end;gap:1rem}.catalog-search label{display:grid;gap:.4rem;flex:1;color:var(--muted);font-size:.8rem}.catalog-search input{width:100%;padding:.75rem;border:1px solid var(--line);border-radius:8px;background:#090a0f;color:white}.catalog-search>span{color:var(--muted);font-size:.8rem;white-space:nowrap}

footer { display: flex; align-items: center; gap: 1.4rem; padding: 2rem clamp(1.2rem, 6vw, 6.5rem); border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
footer > span { margin-left: auto; }
.footer-brand { color: var(--text); }
.footer-brand .brand-mark { width: 28px; height: 28px; border-radius: 8px; }

.details-dialog { width: min(720px, calc(100% - 2rem)); padding: 0; border: 1px solid var(--line); border-radius: 14px; background: #0e1017; color: var(--text); overflow: hidden; box-shadow: 0 28px 100px rgba(0,0,0,.7); }
.details-dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(10px); }
.dialog-image { min-height: 270px; background-size: cover; background-position: center; position: relative; }
.dialog-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, #0e1017, transparent 70%); }
.dialog-content { padding: 1.25rem 2rem 2rem; }
.dialog-content h2 { margin: .45rem 0; font: 500 2.5rem Georgia, serif; }
.dialog-meta { color: var(--accent-2); font-size: .88rem; }
.dialog-description { color: #c6c8d0; line-height: 1.65; }
.dialog-close { position: absolute; z-index: 3; top: .8rem; right: .8rem; width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(7,8,13,.72); color: white; font-size: 1.5rem; cursor: pointer; }

@media (max-width: 700px) {
    .site-header { height: 66px; grid-template-columns: 1fr auto; }
    nav { display: none; }
    .search-link span:last-child { display: none; }
    .header-actions>a{font-size:.8rem}
    .hero { min-height: 710px; padding-bottom: 6rem; background-position: 63% center; }
    .hero::before { background: linear-gradient(90deg, rgba(7,8,13,.92), rgba(7,8,13,.35)), linear-gradient(0deg, var(--bg) 2%, transparent 58%); }
    .hero h1 { font-size: clamp(3.2rem, 16vw, 5rem); }
    .hero-index { display: none; }
    .catalog-shell { margin-top: -1rem; }
    .media-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .section-heading { align-items: center; }
    footer { align-items: flex-start; flex-direction: column; }
    footer > span { margin-left: 0; }
    .dialog-content { padding: 1rem 1.25rem 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .01ms !important; }
}
