/* hatkid.xyz — warm dark theme, cream accent (#f7e2ad) */

:root {
    --bg:        #120f0a;   /* warm near-black */
    --bg-2:      #1a160f;
    --surface:   #221d14;
    --surface-2: #2e2718;
    --text:      #f6f1e6;   /* warm off-white */
    --text-dim:  #bcb29b;
    --text-mute: #857b64;
    --accent:    #f7e2ad;   /* the cream */
    --on-accent: #1c1710;   /* ink for text sitting on the cream */
    --gold:      #f2cf83;   /* rating amber, tuned toward the cream family */
    --radius:    8px;
    --maxw:      1500px;
    --ease:      cubic-bezier(.2,.7,.2,1);
    font-synthesis: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ---------- Top bar ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(180deg, rgba(10,8,4,.96), rgba(10,8,4,.55) 70%, transparent);
    backdrop-filter: blur(6px);
    transition: background .3s var(--ease);
}
.topbar.is-scrolled { background: rgba(14,11,6,.97); box-shadow: 0 1px 0 rgba(247,226,173,.08); }
.topbar__inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: .7rem 1.4rem;
    display: flex;
    align-items: center;
    gap: 1.6rem;
}
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; letter-spacing: -.02em; }
.brand__mark {
    display: grid; place-items: center;
    width: 34px; height: 34px;
    background: var(--accent);
    color: var(--on-accent); border-radius: 7px;
    font-size: 1.15rem; font-weight: 900;
    box-shadow: 0 4px 16px rgba(247,226,173,.28);
}
.brand__name { font-size: 1.3rem; }
.nav { display: flex; gap: 1.15rem; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--text-dim); font-size: .92rem; white-space: nowrap; transition: color .15s; }
.nav a:hover { color: var(--text); }
.search input {
    background: rgba(20,20,26,.85);
    border: 1px solid rgba(255,255,255,.14);
    color: var(--text);
    padding: .45rem .8rem;
    border-radius: 20px;
    width: 150px;
    font-size: .9rem;
    transition: width .25s var(--ease), border-color .2s;
}
.search input:focus { outline: none; border-color: var(--accent); width: 210px; }

.page { min-height: 60vh; }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    min-height: min(82vh, 780px);
    margin-top: -64px;   /* slide under the transparent topbar */
    overflow: hidden;
}
.hero--empty {
    display: flex; align-items: center; text-align: center; min-height: 60vh;
    background: radial-gradient(120% 120% at 50% 0%, #24242e, var(--bg));
}
.hero__slides { position: absolute; inset: 0; }

/* Each billboard slide, stacked and crossfaded */
.hero__slide {
    position: absolute; inset: 0;
    display: flex; align-items: flex-end;
    padding: 0 0 5.5rem;
    opacity: 0;
    transition: opacity 1.2s var(--ease);
    pointer-events: none;
}
.hero__slide.is-active { opacity: 1; pointer-events: auto; z-index: 1; }
/* The outgoing slide fades out ON TOP, so you watch it dissolve into the next. */
.hero__slide.is-leaving { opacity: 0; z-index: 2; pointer-events: none; }

.hero__slide::before {          /* the artwork — scaled separately for Ken Burns */
    content: ""; position: absolute; inset: 0; z-index: 0;
    background-image: var(--hero-img);
    background-size: cover; background-position: center 20%;
    animation: heroKen 16s ease-out both;
    animation-play-state: paused;   /* frozen until active; freezes again (no snap-back) on leave */
}
.hero__slide.is-active::before { animation-play-state: running; }
@keyframes heroKen { from { transform: scale(1.03); } to { transform: scale(1.12); } }

.hero__scrim {
    position: absolute; inset: 0; z-index: 1;
    background:
        linear-gradient(90deg, rgba(8,8,12,.92) 0%, rgba(8,8,12,.6) 42%, transparent 75%),
        linear-gradient(0deg, var(--bg) 2%, transparent 40%);
}
.hero__content { position: relative; z-index: 2; max-width: var(--maxw); width: 100%; margin: 0 auto; padding: 0 1.4rem; }
.hero--empty .hero__content { max-width: 640px; }

/* Text rises in as a slide becomes active (staggered) */
.hero__slide .hero__content > * { opacity: 0; transform: translateY(22px); }
.hero__slide.is-active .hero__content > * { animation: heroRise .7s var(--ease) both; }
.hero__slide.is-active .hero__content > *:nth-child(1) { animation-delay: .12s; }
.hero__slide.is-active .hero__content > *:nth-child(2) { animation-delay: .22s; }
.hero__slide.is-active .hero__content > *:nth-child(3) { animation-delay: .32s; }
.hero__slide.is-active .hero__content > *:nth-child(4) { animation-delay: .42s; }
.hero__slide.is-active .hero__content > *:nth-child(5) { animation-delay: .52s; }
/* While leaving, hold the text in place so it fades out with the slide (no snap). */
.hero__slide.is-leaving .hero__content > * { opacity: 1; transform: none; animation: none; }
@keyframes heroRise { to { opacity: 1; transform: none; } }

/* Bar indicators */
.hero__dots { position: absolute; z-index: 3; bottom: 2rem; right: 1.6rem; display: flex; gap: .5rem; }
.hero__dot {
    position: relative; overflow: hidden;
    width: 34px; height: 4px; border: 0; padding: 0; border-radius: 3px;
    background: rgba(255,255,255,.28); cursor: pointer;
    transition: background .3s, transform .3s;
}
.hero__dot:hover { background: rgba(255,255,255,.5); }
.hero__dot.is-active { transform: scaleY(1.5); }
.hero__dot-fill {           /* auto-scroll progress, width driven by JS (scaleX 0→1) */
    position: absolute; inset: 0;
    background: var(--accent);
    transform: scaleX(0); transform-origin: left;
}

@media (prefers-reduced-motion: reduce) {
    .hero__slide, .hero__slide::before,
    .hero__slide .hero__content > * { transition: none; animation: none; }
    .hero__slide .hero__content > * { opacity: 1; transform: none; }
    .hero__slide::before { transform: none; }
}
.hero__eyebrow { color: var(--accent); font-weight: 700; font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; }
.hero__title {
    font-size: clamp(2.4rem, 6vw, 4.6rem);
    line-height: 1.02;
    margin: .4rem 0 .7rem;
    font-weight: 900;
    letter-spacing: -.03em;
    max-width: 16ch;
    text-shadow: 0 4px 30px rgba(0,0,0,.6);
}
.hero__blurb { max-width: 46ch; color: var(--text); font-size: 1.08rem; text-shadow: 0 2px 12px rgba(0,0,0,.7); }
.hero__meta { display: flex; gap: .5rem; margin: 1rem 0; }
.hero__actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.4rem; }

/* ---------- Buttons & badges ---------- */
.btn {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .7rem 1.5rem;
    border-radius: 6px;
    font-weight: 700; font-size: .98rem;
    cursor: pointer; border: 0;
    transition: transform .12s var(--ease), background .2s, opacity .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: #fbeec6; }
.btn--ghost { background: rgba(247,226,173,.14); color: var(--text); border: 1px solid rgba(247,226,173,.28); backdrop-filter: blur(2px); }
.btn--ghost:hover { background: rgba(247,226,173,.24); }

.badge {
    display: inline-flex; align-items: center;
    padding: .28rem .6rem;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 5px;
    font-size: .8rem; font-weight: 600;
}
.badge--rating { background: rgba(242,207,131,.15); border-color: rgba(242,207,131,.4); color: var(--gold); }
.badge--cat { background: rgba(255,255,255,.06); }

/* ---------- Rows ---------- */
.rows { max-width: var(--maxw); margin: 0 auto; padding: 0 1.4rem 4rem; margin-top: -2.5rem; position: relative; z-index: 2; }
.row { margin: 2.4rem 0; }
.row--flat { margin-top: 3rem; }
.row__head { display: flex; align-items: baseline; gap: .8rem; margin: 0 0 .9rem; }
.row__title { font-size: 1.35rem; font-weight: 800; margin: 0; letter-spacing: -.02em; }
.row__title a { transition: color .15s; }
.row__title a:hover { color: var(--accent); }
.row__desc { color: var(--text-mute); font-size: .88rem; }

.row__scroller {
    display: flex;
    gap: .9rem;
    overflow-x: auto;
    padding: .4rem .2rem 1.2rem;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scrollbar-color: var(--surface-2) transparent;
}
.row__scroller::-webkit-scrollbar { height: 8px; }
.row__scroller::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 8px; }
.row__scroller::-webkit-scrollbar-track { background: transparent; }

/* ---------- Card ---------- */
.card {
    flex: 0 0 auto;
    width: 168px;
    scroll-snap-align: start;
    transition: transform .22s var(--ease);
}
.card:hover { transform: scale(1.06); z-index: 3; }
.card__art {
    position: relative;
    aspect-ratio: 2 / 3;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    box-shadow: 0 6px 20px rgba(0,0,0,.45);
}
.card__art img { width: 100%; height: 100%; object-fit: cover; }
.card__art--empty {
    display: grid; place-items: center; height: 100%; padding: 1rem; text-align: center;
    background: linear-gradient(160deg, var(--surface-2), var(--surface));
    color: var(--text-dim); font-weight: 700; font-size: .95rem;
}
.card__rating {
    position: absolute; top: .5rem; right: .5rem;
    background: rgba(0,0,0,.75); color: var(--gold);
    font-size: .78rem; font-weight: 800;
    padding: .12rem .42rem; border-radius: 5px;
    backdrop-filter: blur(2px);
}
.card__info { padding: .5rem .15rem 0; }
.card__title { display: block; font-size: .92rem; font-weight: 600; line-height: 1.25; }
.card__status { display: block; color: var(--text-mute); font-size: .78rem; margin-top: .1rem; }

/* ---------- Grid (category / search pages) ---------- */
.cat-page { max-width: var(--maxw); margin: 0 auto; padding: 6rem 1.4rem 4rem; }
.cat-page__head { border-left: 4px solid var(--accent); padding-left: 1rem; margin-bottom: 2rem; }
.cat-page__title { font-size: clamp(2rem, 5vw, 3.2rem); margin: 0; font-weight: 900; letter-spacing: -.03em; }
.cat-page__desc { color: var(--text-dim); font-size: 1.05rem; margin: .4rem 0 0; }
.cat-page__count { color: var(--text-mute); font-size: .85rem; margin: .3rem 0 0; text-transform: uppercase; letter-spacing: .1em; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.3rem 1rem;
}
.grid .card { width: auto; }
.empty-note { color: var(--text-mute); }

/* ---------- Detail page ---------- */
.detail { position: relative; }
.detail__backdrop {
    position: absolute; top: 0; left: 0; right: 0; height: 72vh; min-height: 420px;
    background-image: var(--backdrop);
    background-size: cover; background-position: center 18%;
    z-index: 0;
}
.detail__backdrop-scrim {
    position: absolute; inset: 0;
    background:
        linear-gradient(180deg, rgba(11,11,15,.4) 0%, rgba(11,11,15,.15) 30%, var(--bg) 92%),
        linear-gradient(90deg, rgba(11,11,15,.6), transparent 60%);
}
.detail__body { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 7rem 1.4rem 4rem; }
.detail__back { display: inline-block; color: var(--text-dim); margin-bottom: 1.4rem; font-weight: 600; }
.detail__back:hover { color: var(--text); }
.detail__head { display: flex; gap: 2rem; align-items: flex-end; flex-wrap: wrap; }
.detail__poster {
    flex: 0 0 220px; width: 220px; aspect-ratio: 2/3;
    border-radius: 10px; overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.08);
}
.detail__poster img { width: 100%; height: 100%; object-fit: cover; }
.detail__meta { flex: 1; min-width: 280px; }
.detail__title { font-size: clamp(2rem, 5vw, 3.4rem); margin: 0; font-weight: 900; letter-spacing: -.03em; line-height: 1.05; }
.detail__sub { color: var(--text-dim); font-size: 1.05rem; margin: .5rem 0 0; }
.detail__badges { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: 1rem 0; }
.stars { color: var(--gold); letter-spacing: 2px; font-size: 1.05rem; }
.detail__blurb { font-size: 1.15rem; color: var(--text); max-width: 60ch; margin: .6rem 0 1.2rem; }

/* Where to watch / play */
.watch { margin-top: 1.4rem; }
.watch__label { display: block; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-mute); margin-bottom: .6rem; }
.watch__services { display: flex; flex-wrap: wrap; gap: .6rem; }
.service {
    display: inline-flex; align-items: center; gap: .55rem;
    padding: .5rem .9rem .5rem .55rem;
    background: var(--surface); border: 1px solid rgba(247,226,173,.18);
    border-radius: 10px; font-weight: 600; font-size: .92rem; color: var(--text);
    transition: transform .12s var(--ease), border-color .2s, background .2s;
}
a.service:hover { transform: translateY(-2px); border-color: var(--accent); background: var(--surface-2); }
.service--nolink { opacity: .8; cursor: default; }
.service__icon { width: 26px; height: 26px; object-fit: contain; border-radius: 6px; background: #fff; padding: 2px; }
.service__name { line-height: 1; }

.detail__review { margin-top: 3rem; max-width: 72ch; }
.detail__review-head {
    font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em;
    border-left: 4px solid var(--accent); padding-left: .8rem; margin-bottom: 1rem;
}
.prose p { color: var(--text-dim); font-size: 1.08rem; line-height: 1.75; margin: 0 0 1.1rem; }
.prose p:first-child { color: var(--text); }

.tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 2.4rem; }
.tag {
    background: var(--surface); border: 1px solid rgba(255,255,255,.08);
    padding: .35rem .8rem; border-radius: 20px; font-size: .85rem; color: var(--text-dim);
    transition: border-color .15s, color .15s;
}
.tag:hover { border-color: var(--accent); color: var(--text); }

/* ---------- 404 ---------- */
.notfound { max-width: var(--maxw); margin: 0 auto; padding: 9rem 1.4rem; text-align: center; }
.notfound h1 { font-size: 5rem; margin: 0; color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid rgba(255,255,255,.06); margin-top: 3rem; }
.site-footer__inner { max-width: 820px; margin: 0 auto; padding: 3rem 1.4rem; text-align: center; }
.site-footer__bio { color: var(--text-dim); line-height: 1.7; }
.site-footer__meta { color: var(--text-mute); font-size: .85rem; margin-top: 1rem; }
.site-footer__meta a { color: var(--text-dim); font-weight: 700; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
    .nav { display: none; }
    .card { width: 138px; }
    .hero { margin-top: -64px; }
    .hero__slide { padding-bottom: 3.5rem; }
    .hero__dots { right: 50%; transform: translateX(50%); bottom: 1.2rem; }
    .detail__head { gap: 1.2rem; }
    .detail__poster { flex-basis: 140px; width: 140px; }
}
