/* ==========================================================================
   layout.css — sidebar, hero, shelves, catalog, search, pages, settings
   Stage coordinates: sidebar 72px (240px open) · content starts at x=72
   ========================================================================== */

/* ==========================================================================
   Sidebar
   ========================================================================== */
#sidebar {
    position: absolute;
    left: 0;
    top: 0;
    width: 72px;
    height: 720px;
    display: none;
    -webkit-transition: width 0.2s ease;
    transition: width 0.2s ease;
}
#stage.is-ready #sidebar { display: block; }
#stage.is-side-open #sidebar { width: 240px; }

.side-bg {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.7) 60%, rgba(0, 0, 0, 0) 100%);
    background: linear-gradient(to right, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.7) 60%, rgba(0, 0, 0, 0) 100%);
}
#stage.is-side-open .side-bg {
    width: 320px;
    background: -webkit-linear-gradient(left, #0d0d0d 70%, rgba(13, 13, 13, 0) 100%);
    background: linear-gradient(to right, #0d0d0d 70%, rgba(13, 13, 13, 0) 100%);
}

#scrim {
    position: absolute;
    left: 0;
    top: 0;
    width: 1280px;
    height: 720px;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    pointer-events: none;
    -webkit-transition: opacity 0.2s ease;
    transition: opacity 0.2s ease;
}
#stage.is-side-open #scrim { opacity: 1; }

.side-brand {
    position: relative;
    height: 96px;
    padding: 30px 0 0 0;
    white-space: nowrap;
    overflow: hidden;
}
.side-mono {
    display: inline-block;
    width: 72px;
    text-align: center;
    font-size: 30px;
    font-weight: 700;
    color: #e50914;
    vertical-align: middle;
}
.side-name {
    display: inline-block;
    vertical-align: middle;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 2px;
    opacity: 0;
    -webkit-transition: opacity 0.2s ease;
    transition: opacity 0.2s ease;
}
.side-name b { color: #e50914; }
.side-logo { max-width: 52px; max-height: 40px; margin-left: 10px; }
#stage.is-side-open .side-name { opacity: 1; }
#stage.is-side-open .side-logo { max-width: 180px; margin-left: 24px; }

.side-nav { position: relative; }

.side-item {
    position: relative;
    height: 48px;
    margin: 0 8px 4px 8px;
    padding-left: 16px;
    -webkit-border-radius: 6px;
    border-radius: 6px;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
    overflow: hidden;
    -webkit-transition: background-color 0.15s ease, color 0.15s ease;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.side-item:before {                 /* active marker: 3px bar on the left edge */
    content: '';
    position: absolute;
    left: -8px;
    top: 12px;
    bottom: 12px;
    width: 3px;
    -webkit-border-radius: 0 2px 2px 0;
    border-radius: 0 2px 2px 0;
    background: #e50914;
    opacity: 0;
}
.side-item.is-active { color: #fff; }
.side-item.is-active:before { opacity: 1; }
.side-item.is-focused {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}
.side-label {
    margin-left: 22px;
    font-size: 17px;
    font-weight: 600;
    opacity: 0;
    -webkit-transition: opacity 0.2s ease;
    transition: opacity 0.2s ease;
}
#stage.is-side-open .side-label { opacity: 1; }
#stage.is-side-open .side-item.is-focused .side-label { color: #fff; }

.side-sep {
    height: 1px;
    margin: 12px 22px 16px 22px;
    background: rgba(255, 255, 255, 0.12);
}

.side-foot {
    position: absolute;
    left: 0;
    bottom: 26px;
    width: 72px;
    text-align: center;
    white-space: nowrap;
    -webkit-transition: width 0.2s ease;
    transition: width 0.2s ease;
}
#stage.is-side-open .side-foot { width: 240px; text-align: left; padding-left: 26px; }
.side-time { font-size: 16px; font-weight: 600; color: rgba(255, 255, 255, 0.8); }
.side-date {
    margin-top: 2px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.45);
    opacity: 0;
    -webkit-transition: opacity 0.2s ease;
    transition: opacity 0.2s ease;
}
#stage.is-side-open .side-time { font-size: 26px; font-weight: 700; color: #fff; }
#stage.is-side-open .side-date { opacity: 1; }

/* ==========================================================================
   Home — hero + shelves
   ========================================================================== */
.home { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; }

.hero {
    position: absolute;
    left: 72px;
    top: 0;
    width: 1208px;
    height: 374px;              /* 52vh of 720, inside the 300–440 band */
    overflow: hidden;
}
.hero.is-hidden { display: none; }

.hero-bd {
    position: absolute;
    right: 0;
    top: 0;
    width: 65%;
    height: 100%;
    -webkit-background-size: cover;
    background-size: cover;
    background-position: center 20%;
    background-repeat: no-repeat;
    opacity: 0;
    -webkit-transition: opacity 0.6s ease;
    transition: opacity 0.6s ease;
}
.hero-bd.is-on { opacity: 1; }

.hero-shade {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background:
        -webkit-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 32%),
        -webkit-linear-gradient(-15deg, #000 0%, #000 28%, rgba(0, 0, 0, 0.85) 42%, rgba(0, 0, 0, 0.3) 62%, rgba(0, 0, 0, 0) 80%);
    background:
        linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0) 32%),
        linear-gradient(105deg, #000 0%, #000 28%, rgba(0, 0, 0, 0.85) 42%, rgba(0, 0, 0, 0.3) 62%, rgba(0, 0, 0, 0) 80%);
}

.hero-content {
    position: absolute;
    left: 0;
    top: 0;
    width: 680px;
    padding: 28px 0 28px 40px;
    -webkit-transition: opacity 0.14s ease;
    transition: opacity 0.14s ease;
}
.hero-content.is-changing { opacity: 0; }
.hero.is-empty .hero-content { opacity: 0; }

.hero-top {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: end;
    -webkit-align-items: flex-end;
    align-items: flex-end;
}
.hero-poster {
    width: 110px;
    height: 165px;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
    -webkit-border-radius: 4px;
    border-radius: 4px;
    background-color: #161616;
    -webkit-background-size: cover;
    background-size: cover;
    background-position: center;
    -webkit-box-shadow: 0 10px 28px rgba(0, 0, 0, 0.7);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.7);
}
.hero-head {
    margin-left: 24px;
    min-width: 0;
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    padding-bottom: 2px;
}
.hero-kicker {
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hero-kicker b, .d-kicker b { color: #e50914; font-weight: 700; }
.hero-kicker span:before, .d-kicker span:before { content: '\00B7'; margin: 0 8px; color: rgba(255, 255, 255, 0.35); }
.hero-title {
    margin-top: 8px;
    font-size: 38px;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.3px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}
.hero-meta { margin-top: 12px; }
.hero-plot {
    margin-top: 18px;
    max-width: 600px;
    font-size: 16px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.78);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

/* meta row — shared by hero and details */
.hero-meta, .d-meta {
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    white-space: nowrap;
}
.hero-meta > *, .d-meta > * { margin-right: 12px; float: left; } /* float: wrap fallback for old -webkit-box browsers (ignored on flex items) */
.meta-rating {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    font-size: 20px;
    font-weight: 700;
    color: #46d369;
}
.meta-rating .ic { margin-right: 5px; }
.meta-year { font-size: 20px; font-weight: 500; color: #fff; }
.meta-badge {
    padding: 1px 8px 2px 8px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    -webkit-border-radius: 3px;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}
.meta-dim { font-size: 16px; color: rgba(255, 255, 255, 0.55); }

/* shelves */
.home-rows {
    position: absolute;
    left: 72px;
    top: 348px;
    width: 1208px;
    height: 372px;
    overflow: hidden;
}
.rows {
    position: relative;
    padding-left: 40px;
    -webkit-transition: -webkit-transform 0.32s cubic-bezier(0.2, 0.7, 0.2, 1);
    transition: transform 0.32s cubic-bezier(0.2, 0.7, 0.2, 1);
    will-change: transform;
}
.row { padding-bottom: 16px; }
.row-title {
    margin: 22px 0 10px 0;
    padding-left: 0;
    height: 18px;
    font-size: 15px;
    font-weight: 700;
    line-height: 18px;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
}
.row.is-active .row-title { color: #fff; }
.row-tag {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    margin-right: 10px;
}
.row-vp {
    overflow: hidden;
    margin: -8px 0 -8px -10px;
    padding: 8px 0 8px 10px;     /* room for the focus ring + scale */
}
.row-track {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    padding-bottom: 8px;
    -webkit-transition: -webkit-transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
    transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
    will-change: transform;
}
.sk-line {
    position: relative;
    display: inline-block;
    width: 180px;
    height: 14px;
    -webkit-border-radius: 3px;
    border-radius: 3px;
    background: #1a1a1a;
    overflow: hidden;
    vertical-align: middle;
}

/* ==========================================================================
   Pages (My List, Settings)
   ========================================================================== */
.page { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; }
.page-head { position: absolute; left: 112px; top: 40px; right: 40px; }
.page-title { font-size: 32px; font-weight: 700; letter-spacing: -0.3px; }
.page-sub { margin-top: 6px; font-size: 15px; color: rgba(255, 255, 255, 0.5); }
.page-sub b { color: rgba(255, 255, 255, 0.85); }

.mylist-rows {
    position: absolute;
    left: 72px;
    top: 104px;
    width: 1208px;
    height: 616px;
    overflow: hidden;
}

/* ==========================================================================
   Catalog — category rail + grid
   ========================================================================== */
.catalog { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; }

.cat-rail {
    position: absolute;
    left: 72px;
    top: 0;
    width: 260px;
    height: 720px;
    background: -webkit-linear-gradient(left, #060606, #0b0b0b);
    background: linear-gradient(to right, #060606, #0b0b0b);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}
.cat-head {
    padding: 38px 28px 0 28px;
    height: 96px;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.3px;
}
.cat-vp {
    position: absolute;
    left: 0;
    top: 96px;
    width: 260px;
    bottom: 24px;
    overflow: hidden;
}
.cat-list {
    -webkit-transition: -webkit-transform 0.22s ease;
    transition: transform 0.22s ease;
}
.cat-list .spinner { margin: 30px auto; }
.cat-item {                         /* 42px + 4px = 46px step (CAT_STEP in catalog.js) */
    position: relative;
    height: 42px;
    margin: 0 14px 4px 14px;
    padding: 0 14px;
    -webkit-border-radius: 4px;
    border-radius: 4px;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    font-size: 16px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.55);
    -webkit-transition: background-color 0.12s ease, color 0.12s ease;
    transition: background-color 0.12s ease, color 0.12s ease;
}
.cat-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-item:before {
    content: '';
    position: absolute;
    left: -14px;
    top: 10px;
    bottom: 10px;
    width: 3px;
    -webkit-border-radius: 0 2px 2px 0;
    border-radius: 0 2px 2px 0;
    background: #e50914;
    opacity: 0;
}
.cat-item.is-selected { color: #fff; font-weight: 600; }
.cat-item.is-selected:before { opacity: 1; }
.cat-item.is-focused { background: #fff; color: #000; }

.cat-main {
    position: absolute;
    left: 332px;
    top: 0;
    width: 948px;
    height: 720px;
}
.cat-main-head {
    height: 96px;
    padding: 38px 40px 0 40px;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: baseline;
    -webkit-align-items: baseline;
    align-items: baseline;
}
.cat-main-title {
    font-size: 26px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 640px;
}
.cat-main-count {
    margin-left: 14px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
}

.grid-vp {
    position: absolute;
    left: 30px;
    top: 92px;
    right: 0;
    bottom: 0;
    padding: 8px 0 0 10px;
    overflow: hidden;
}
.grid {
    width: 876px;               /* 6 × (138 + 8) */
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-align-content: flex-start;
    align-content: flex-start;
    -webkit-transition: -webkit-transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
    transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
    will-change: transform;
}
.grid .card { margin-bottom: 16px; }
.grid > * { float: left; }      /* wrap fallback for Maple / old -webkit-box (ignored on flex items) */
.grid--live { width: 864px; }   /* 4 × (204 + 12) */
.grid--live .card { margin-bottom: 12px; }

.grid-overlay {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    padding-bottom: 120px;
    text-align: center;
}
.grid-state { color: rgba(255, 255, 255, 0.5); max-width: 460px; }
.grid-state .ic { margin: 0 auto 16px auto; color: rgba(255, 255, 255, 0.3); }
.grid-state-title { font-size: 22px; font-weight: 700; color: #fff; }
.grid-state-text { margin-top: 8px; font-size: 15px; line-height: 1.5; }
.grid-state-text b { color: #fff; }
.grid-unlock { margin-top: 26px; }

/* ==========================================================================
   Search
   ========================================================================== */
.search { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; }
.search-left {
    position: absolute;
    left: 72px;
    top: 0;
    width: 576px;
    height: 720px;
    padding: 40px 40px 0 40px;
}
.search-field {
    height: 60px;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.5);
}
.search-q {
    margin-left: 14px;
    font-size: 26px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    max-width: 430px;
}
.search-field.is-empty .search-q:before {
    content: attr(data-ph);
    color: rgba(255, 255, 255, 0.3);
    font-weight: 500;
}
.search-field .caret {
    width: 2px;
    height: 28px;
    margin-left: 3px;
    background: #e50914;
    -webkit-animation: blink 1s step-end infinite;
    animation: blink 1s step-end infinite;
}
.search-field.is-empty .caret { margin-left: -2px; }
.search-kb { margin-top: 28px; }
.search-hint {
    margin-top: 22px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.4);
}
.search-hint b .ic { display: inline-block; vertical-align: -2px; }
.search-right {
    position: absolute;
    left: 648px;
    top: 0;
    width: 632px;
    height: 720px;
}
.search-right .grid { width: 584px; }   /* 4 × 146 */

/* ==========================================================================
   Settings
   ========================================================================== */
.settings-body {
    position: absolute;
    left: 112px;
    top: 108px;
    right: 40px;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: start;
    -webkit-align-items: flex-start;
    align-items: flex-start;
}
.set-list { width: 660px; }
.set-section {
    margin: 14px 0 10px 4px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
}
.set-section:first-child { margin-top: 0; }

.account {
    margin-left: 48px;
    width: 420px;
    padding: 34px 34px 28px 34px;
    -webkit-border-radius: 12px;
    border-radius: 12px;
    background: -webkit-linear-gradient(-30deg, #1b1b1b 0%, #0c0c0c 100%);
    background: linear-gradient(120deg, #1b1b1b 0%, #0c0c0c 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   Login
   ========================================================================== */
.login { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; background: #000; }
.login-bg {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: url(background.jpg) center / cover no-repeat;
    opacity: 0.4;
}
.login-shade {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background:
        -webkit-linear-gradient(left, #000 0%, rgba(0, 0, 0, 0.92) 38%, rgba(0, 0, 0, 0.55) 70%, rgba(0, 0, 0, 0.35) 100%),
        -webkit-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 40%);
    background:
        linear-gradient(to right, #000 0%, rgba(0, 0, 0, 0.92) 38%, rgba(0, 0, 0, 0.55) 70%, rgba(0, 0, 0, 0.35) 100%),
        linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0) 40%);
}
.login-panel {
    position: absolute;
    left: 120px;
    top: 84px;
    width: 420px;
}
.login-brand { font-size: 24px; font-weight: 700; letter-spacing: 4px; }
.login-brand b { color: #e50914; }
.login-brand img { max-height: 54px; max-width: 260px; }
.login-title { margin-top: 70px; font-size: 44px; font-weight: 700; letter-spacing: -0.5px; }
.login-sub { margin: 8px 0 26px 0; font-size: 16px; color: rgba(255, 255, 255, 0.55); }

.login-side {
    position: absolute;
    left: 620px;
    top: 0;
    width: 660px;
    height: 720px;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
}
.login-pitch {
    position: absolute;
    left: 60px;
    bottom: 90px;
    -webkit-transition: opacity 0.25s ease;
    transition: opacity 0.25s ease;
}
.login-pitch-title { font-size: 34px; font-weight: 700; line-height: 1.15; max-width: 480px; }
.login-pitch-title b { color: #e50914; }
.login-pitch-text { margin-top: 10px; font-size: 17px; color: rgba(255, 255, 255, 0.6); }
.login.is-typing .login-pitch { opacity: 0; }
.login-kb {
    padding: 28px;
    -webkit-border-radius: 14px;
    border-radius: 14px;
    background: rgba(18, 18, 18, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.08);
    -webkit-box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
    opacity: 0;
    -webkit-transform: translate3d(30px, 0, 0);
    transform: translate3d(30px, 0, 0);
    -webkit-transition: opacity 0.22s ease, -webkit-transform 0.22s ease;
    transition: opacity 0.22s ease, transform 0.22s ease;
}
.login.is-typing .login-kb {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}
.login-kb-title { margin-bottom: 18px; font-size: 16px; font-weight: 600; color: rgba(255, 255, 255, 0.7); }
.login-error {
    min-height: 22px;
    margin: 14px 0 10px 2px;
    font-size: 15px;
    font-weight: 500;
    color: #ff6b6b;
    opacity: 0;
}
.login-error.is-visible { opacity: 1; }
