/* ===================================================================
   REELIST — design tokens
   Palette: near-black marquee background, warm gold accent (ticket/
   marquee lamp), muted red for "hot" signals, one signature motif —
   a perforated film-strip rule used as a section divider.
   =================================================================== */

:root {
    --bg:        #0B0E14;
    --surface:   #141826;
    --surface-2: #1B2133;
    --border:    #262E42;
    --text:      #EDEFF4;
    --text-muted:#8B93A7;
    --gold:      #E8B84B;
    --gold-dim:  #6E5A2C;
    --red:       #C1443C;
    --teal:      #4FA9A0;

    --font-display: 'Oswald', sans-serif;
    --font-body:    'Inter', sans-serif;
    --font-mono:    'JetBrains Mono', monospace;

    --radius: 10px;
    --wrap: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select { font-family: inherit; }

.wrap {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 24px;
}

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

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ===================================================================
   Signature motif — perforated film-strip divider
   =================================================================== */

.film-strip {
    height: 14px;
    background:
        repeating-linear-gradient(90deg, var(--surface-2) 0 10px, transparent 10px 20px) top / 100% 6px no-repeat,
        repeating-linear-gradient(90deg, var(--surface-2) 0 10px, transparent 10px 20px) bottom / 100% 6px no-repeat;
    opacity: .8;
}
.film-strip--hero { margin-top: 36px; }

/* ===================================================================
   Header
   =================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(11, 14, 20, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 28px;
    height: 68px;
}

.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand__mark {
    display: grid; place-items: center;
    width: 34px; height: 34px;
    background: var(--gold);
    color: #1a1206;
    font-family: var(--font-display);
    font-weight: 700;
    border-radius: 6px;
    font-size: 18px;
}
.brand__name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 21px;
    letter-spacing: 0.02em;
}

.main-nav { display: flex; gap: 22px; flex-shrink: 0; }
.main-nav a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    padding: 8px 2px;
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
}
.main-nav a:hover, .main-nav a.is-active { color: var(--text); border-color: var(--gold); }

.header-search { position: relative; flex: 1; max-width: 380px; margin-left: auto; }
.header-search form {
    display: flex; align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 8px 6px 16px;
}
.header-search input {
    flex: 1;
    background: none; border: none; color: var(--text);
    font-size: 14px; outline: none;
}
.header-search input::placeholder { color: var(--text-muted); }
.header-search button {
    display: grid; place-items: center;
    width: 32px; height: 32px;
    background: var(--gold-dim);
    color: var(--gold);
    border: none; border-radius: 999px;
    cursor: pointer;
}
.header-search button:hover { background: var(--gold); color: #1a1206; }

.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0; right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 30px rgba(0,0,0,.4);
    max-height: 420px;
    overflow-y: auto;
    display: none;
    z-index: 60;
}
.search-dropdown.is-open { display: block; }
.search-dropdown__item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}
.search-dropdown__item:last-child { border-bottom: none; }
.search-dropdown__item:hover { background: var(--surface-2); }
.search-dropdown__item img { width: 36px; height: 54px; object-fit: cover; border-radius: 4px; flex-shrink: 0; background: var(--surface-2); }
.search-dropdown__meta { display: flex; flex-direction: column; min-width: 0; }
.search-dropdown__meta strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-dropdown__meta span { font-size: 12px; color: var(--text-muted); }
.search-dropdown__empty, .search-dropdown__loading { padding: 16px; font-size: 13px; color: var(--text-muted); text-align: center; }

.nav-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text); }

/* ===================================================================
   Hero
   =================================================================== */

/* Homepage: centered search block */
.home-search { padding: 72px 0 40px; }
.home-search__inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.home-search__title {
    font-family: var(--font-display);
    font-size: clamp(32px, 5vw, 46px);
    font-weight: 600;
    letter-spacing: 0.01em;
    margin: 0 0 26px;
}

.hero-search { position: relative; display: flex; width: 100%; max-width: 620px; gap: 10px; }
.hero-search input {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 16px 20px;
    border-radius: 999px;
    font-size: 15px;
    outline: none;
}
.hero-search input:focus { border-color: var(--gold); }
.hero-search button {
    background: var(--gold);
    color: #1a1206;
    border: none;
    padding: 0 30px;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .1s;
    flex-shrink: 0;
}
.hero-search button:hover { transform: translateY(-1px); }

.search-dropdown--hero { left: 0; right: 0; top: calc(100% + 10px); text-align: left; }

.home-search__links { margin-top: 18px; }
.home-search__links a { font-size: 13.5px; color: var(--gold); font-weight: 500; }

/* Categories page */
.cat-head { padding: 44px 0 24px; }
.cat-head h1 {
    font-family: var(--font-display);
    font-size: clamp(28px, 4vw, 38px);
    font-weight: 600;
    margin: 0 0 8px;
}

.cat-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 48px; }
.cat-tile {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 28px 24px;
    min-height: 140px;
    border-radius: 14px;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: transform .15s ease;
}
.cat-tile:hover { transform: translateY(-3px); }
.cat-tile__label { font-family: var(--font-display); font-size: 22px; font-weight: 600; position: relative; z-index: 1; }
.cat-tile__arrow { font-size: 20px; position: relative; z-index: 1; opacity: .8; }
.cat-tile--movie { background: linear-gradient(135deg, #2a2210, var(--surface)); }
.cat-tile--movie .cat-tile__label, .cat-tile--movie .cat-tile__arrow { color: var(--gold); }
.cat-tile--tv { background: linear-gradient(135deg, #12302c, var(--surface)); }
.cat-tile--tv .cat-tile__label, .cat-tile--tv .cat-tile__arrow { color: var(--teal); }
.cat-tile--anime { background: linear-gradient(135deg, #331a17, var(--surface)); }
.cat-tile--anime .cat-tile__label, .cat-tile--anime .cat-tile__arrow { color: var(--red); }

.genre-block { padding-bottom: 40px; }
.genre-block h2 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 14px;
    color: var(--text-muted);
}
.genre-chip-list { display: flex; flex-wrap: wrap; gap: 10px; }
.genre-chip-list a {
    font-size: 13px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 999px;
    color: var(--text);
    transition: border-color .15s, color .15s;
}
.genre-chip-list a:hover { border-color: var(--gold); color: var(--gold); }

/* ===================================================================
   Row sections / grids
   =================================================================== */

.row-section { padding: 44px 0 8px; }
.row-section__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.row-section h2, .browse-head h1, .search-head h1 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 24px;
    margin: 0 0 18px;
    letter-spacing: 0.01em;
}
.row-section__head h2 { margin: 0; }
.see-all { font-size: 13px; color: var(--gold); font-weight: 500; }

.card-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 168px;
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 12px;
    scrollbar-width: thin;
}
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 18px;
    padding: 8px 0 40px;
}

.card { display: block; }
.card__poster {
    position: relative;
    aspect-ratio: 2 / 3;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.card__poster img { width: 100%; height: 100%; object-fit: cover; }
.card:hover .card__poster {
    transform: translateY(-4px);
    border-color: var(--gold-dim);
    box-shadow: 0 14px 28px rgba(0,0,0,.45);
}

.card__rating {
    position: absolute;
    top: 8px; right: 8px;
    background: rgba(11,14,20,.85);
    color: var(--gold);
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 3px 7px;
    border-radius: 6px;
    border: 1px solid rgba(232,184,75,.35);
}
.card__type {
    position: absolute;
    bottom: 8px; left: 8px;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(11,14,20,.85);
    color: var(--text-muted);
}
.card__type--movie { color: var(--gold); }
.card__type--tv { color: var(--teal); }
.card__type--anime { color: var(--red); }

.card__meta { padding-top: 9px; }
.card__title {
    margin: 0;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card__year { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted); }

.empty-state { color: var(--text-muted); padding: 40px 0; font-size: 15px; }

/* ===================================================================
   Browse / filter bar
   =================================================================== */

.browse-head { padding: 44px 0 20px; }
.filter-bar { display: flex; gap: 12px; }
.filter-bar select {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13.5px;
}

.sentinel { height: 1px; }
.browse-status { text-align: center; color: var(--text-muted); font-size: 13px; padding-bottom: 40px; }

/* ===================================================================
   Search page
   =================================================================== */

.search-head { padding: 44px 0 8px; }
.muted { color: var(--text-muted); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-top: 18px; }
.tabs a {
    padding: 10px 18px;
    font-size: 14px;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.tabs a.is-active, .tabs a:hover { color: var(--text); border-color: var(--gold); }

/* ===================================================================
   Detail page
   =================================================================== */

.detail-hero {
    position: relative;
    background-image: var(--backdrop);
    background-size: cover;
    background-position: center 20%;
    padding-top: 64px;
}
.detail-hero__scrim {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(11,14,20,.55) 0%, rgba(11,14,20,.88) 60%, var(--bg) 100%);
}
.detail-hero__inner {
    position: relative;
    display: flex;
    gap: 36px;
    padding: 40px 24px 48px;
    align-items: flex-start;
}
.detail-hero__poster {
    width: 240px;
    flex-shrink: 0;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 24px 48px rgba(0,0,0,.5);
}
.detail-hero__info { min-width: 0; padding-top: 8px; }
.detail-hero__info h1 {
    font-family: var(--font-display);
    font-size: clamp(28px, 4vw, 44px);
    margin: 10px 0 14px;
    line-height: 1.05;
}

.pill {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
}
.pill--movie { color: var(--gold); border-color: var(--gold-dim); }
.pill--tv { color: var(--teal); border-color: #24504c; }
.pill--anime { color: var(--red); border-color: #5c2c28; }

.detail-facts { display: flex; flex-wrap: wrap; gap: 16px; font-family: var(--font-mono); font-size: 13.5px; color: var(--text-muted); margin-bottom: 14px; }
.fact-rating { color: var(--gold); }

.genre-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.genre-tags span { font-size: 12.5px; background: var(--surface); border: 1px solid var(--border); padding: 5px 12px; border-radius: 999px; color: var(--text-muted); }

.detail-overview { max-width: 680px; color: var(--text); font-size: 15px; line-height: 1.6; margin-bottom: 26px; }

.watch-providers h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin: 0 0 12px; }
.watch-providers__logos { display: flex; gap: 10px; flex-wrap: wrap; }
.provider img { width: 46px; height: 46px; border-radius: 10px; border: 1px solid var(--border); }
.watch-providers__note { font-size: 12px; color: var(--text-muted); margin-top: 10px; }

.video-embed { position: relative; padding-top: 56.25%; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }

.cast-row { display: grid; grid-auto-flow: column; grid-auto-columns: 120px; gap: 16px; overflow-x: auto; padding-bottom: 12px; }
.cast-card img { width: 100%; aspect-ratio: 2/3; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); margin-bottom: 8px; }
.cast-card strong { display: block; font-size: 13px; }
.cast-card span { display: block; font-size: 11.5px; color: var(--text-muted); }

/* ===================================================================
   Footer
   =================================================================== */

.site-footer { margin-top: 60px; }
.site-footer__inner { padding: 26px 24px 40px; text-align: center; }
.site-footer__note { font-size: 13px; color: var(--text-muted); max-width: 560px; margin: 20px auto 8px; }
.site-footer__credit { font-size: 12px; color: var(--text-muted); }
.site-footer__credit a { color: var(--gold); }

/* ===================================================================
   Responsive
   =================================================================== */

@media (max-width: 860px) {
    .main-nav { display: none; }
    .nav-toggle { display: flex; }
    .header-search { max-width: none; }
    .detail-hero__inner { flex-direction: column; }
    .detail-hero__poster { width: 160px; }
    .cat-tiles { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .card-grid, .card-row { grid-auto-columns: 130px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
    .hero { padding-top: 40px; }
    .hero-search { flex-direction: column; }
    .hero-search button { padding: 14px; }
}
