/* ============================================
   EBRET — DESIGN SYSTEM v2
   Dark Entertainment Theme — Netflix-inspired
   Mobile-First
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Outfit:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,700;1,800;1,900&display=swap');

:root {
    /* === DARK PALETTE === */
    --bg-primary: #0A0A0F;
    --bg-secondary: #12121A;
    --bg-card: #1A1A26;
    --bg-card-hover: #22222F;
    --bg-elevated: #252535;
    --bg-surface: rgba(255, 255, 255, 0.04);
    --bg-glass: rgba(18, 18, 26, 0.85);

    /* Red Accent (CGIL) */
    --accent: #E8364B;
    --accent-hover: #FF4158;
    --accent-dark: #C8102E;
    --accent-glow: rgba(232, 54, 75, 0.3);
    --accent-subtle: rgba(232, 54, 75, 0.1);

    /* Text */
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    --text-on-accent: #FFFFFF;

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);
    --border-focus: var(--accent);

    /* Gradients */
    --gradient-hero: linear-gradient(180deg, transparent 0%, var(--bg-primary) 100%);
    --gradient-card: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.95) 100%);
    --gradient-left: linear-gradient(90deg, var(--bg-primary) 0%, transparent 100%);
    --gradient-right: linear-gradient(270deg, var(--bg-primary) 0%, transparent 100%);
    --gradient-accent: linear-gradient(135deg, var(--accent) 0%, #FF6B6B 100%);

    /* === TYPOGRAPHY === */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    --fw-extrabold: 800;
    --fw-black: 900;

    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-md: 1.125rem;
    --text-lg: 1.25rem;
    --text-xl: clamp(1.25rem, 1rem + 1vw, 1.5rem);
    --text-2xl: clamp(1.5rem, 1.2rem + 1.5vw, 2rem);
    --text-3xl: clamp(1.75rem, 1.3rem + 2vw, 2.5rem);
    --text-4xl: clamp(2rem, 1.5rem + 2.5vw, 3rem);
    --text-5xl: clamp(2.5rem, 1.5rem + 4vw, 4.5rem);
    --text-6xl: clamp(3rem, 1.5rem + 6vw, 6rem);

    --leading-tight: 1.1;
    --leading-snug: 1.25;
    --leading-normal: 1.6;
    --leading-relaxed: 1.75;

    /* === SPACING === */
    --space-2xs: 0.25rem;
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
    --space-3xl: 6rem;
    --space-4xl: 8rem;

    --section-py: var(--space-xl);
    --section-px: var(--space-sm);

    /* === LAYOUT === */
    --container-max: 1400px;
    --content-max: 780px;

    /* === BORDERS & RADIUS === */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius-full: 9999px;

    /* === SHADOWS === */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px var(--accent-glow);

    /* === TRANSITIONS === */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
    --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (min-width: 768px) {
    :root {
        --section-py: var(--space-2xl);
        --section-px: var(--space-lg);
    }
}

@media (min-width: 1024px) {
    :root {
        --section-py: var(--space-3xl);
        --section-px: var(--space-xl);
    }
}


/* ============================================
   RESET & BASE
   ============================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-elevated) var(--bg-primary);
    overflow-x: hidden;
}

html,
body {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--fw-regular);
    line-height: var(--leading-normal);
    color: var(--text-secondary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--text-primary);
}

ul,
ol {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

::selection {
    background: var(--accent);
    color: white;
}


/* ============================================
   TYPOGRAPHY
   ============================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: var(--fw-bold);
    line-height: var(--leading-tight);
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

h1 {
    font-size: var(--text-5xl);
    font-weight: var(--fw-black);
}

h2 {
    font-size: var(--text-3xl);
    font-weight: var(--fw-extrabold);
}

h3 {
    font-size: var(--text-2xl);
}

h4 {
    font-size: var(--text-xl);
}

h5 {
    font-size: var(--text-lg);
}

h6 {
    font-size: var(--text-md);
    font-weight: var(--fw-semibold);
}

p {
    margin-bottom: var(--space-sm);
}

p:last-child {
    margin-bottom: 0;
}

.text-accent {
    color: var(--accent);
}

.text-muted {
    color: var(--text-muted);
}

.text-small {
    font-size: var(--text-sm);
}

.overline {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent);
}


/* ============================================
   LAYOUT
   ============================================ */

.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--section-px);
}

.container--narrow {
    max-width: var(--content-max);
}

.section {
    padding-block: var(--section-py);
}

.section--alt {
    background-color: var(--bg-secondary);
}

.section-header {
    margin-bottom: var(--space-lg);
}

.section-header h2 {
    margin-bottom: var(--space-2xs);
}

.section-header p {
    font-size: var(--text-md);
    color: var(--text-muted);
    max-width: 600px;
}

.section-header--row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

/* Grid */
.grid {
    display: grid;
    gap: var(--space-md);
}

.grid--2 {
    grid-template-columns: 1fr;
}

.grid--3 {
    grid-template-columns: 1fr;
}

.grid--4 {
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 640px) {
    .grid--2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid--3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .grid--3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid--4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid--4 {
        grid-template-columns: repeat(4, 1fr);
    }

    .grid {
        gap: var(--space-md);
    }
}


/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    font-family: var(--font-heading);
    font-size: var(--text-sm);
    font-weight: var(--fw-bold);
    line-height: 1;
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
    white-space: nowrap;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn--primary {
    background: var(--accent);
    color: white;
}

.btn--primary:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
    color: white;
}

.btn--secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    backdrop-filter: blur(10px);
}

.btn--secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.btn--ghost {
    background: none;
    color: var(--text-secondary);
    padding: 0;
    text-transform: none;
    letter-spacing: 0;
    font-weight: var(--fw-semibold);
}

.btn--ghost:hover {
    color: var(--accent);
}

.btn--ghost::after {
    content: '→';
    transition: transform var(--transition-fast);
}

.btn--ghost:hover::after {
    transform: translateX(4px);
}

.btn--sm {
    font-size: var(--text-xs);
    padding: 0.625rem 1.25rem;
}

.btn--lg {
    font-size: var(--text-base);
    padding: 1rem 2.25rem;
}

.btn--icon {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
}

.btn--block-mobile {
    width: 100%;
}

@media (min-width: 640px) {
    .btn--block-mobile {
        width: auto;
    }
}

.btn-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

@media (min-width: 640px) {
    .btn-group {
        flex-direction: row;
    }
}


/* ============================================
   EPISODE CARDS — Netflix style
   ============================================ */

.ep-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-card);
    transition: all var(--transition-base);
    cursor: pointer;
}

.ep-card:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-lg);
    z-index: 2;
}

.ep-card__image {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--bg-elevated);
}

.ep-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.ep-card:hover .ep-card__image img {
    transform: scale(1.08);
}

.ep-card__image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-card);
    pointer-events: none;
}

/* Play button overlay */
.ep-card__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all var(--transition-base);
    z-index: 3;
    box-shadow: var(--shadow-glow);
}

.ep-card:hover .ep-card__play {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.ep-card__play svg {
    width: 22px;
    height: 22px;
    fill: white;
    margin-left: 3px;
}

/* Card info overlay */
.ep-card__info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-md);
    z-index: 2;
}

.ep-card__number {
    font-family: var(--font-heading);
    font-size: var(--text-xs);
    font-weight: var(--fw-bold);
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-2xs);
}

.ep-card__title {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: var(--fw-bold);
    color: white;
    line-height: var(--leading-snug);
    margin-bottom: var(--space-2xs);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ep-card__meta {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.ep-card__meta .dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-muted);
}

/* Card badge (NEW, Season, etc.) */
.ep-card__badge {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
    background: var(--accent);
    color: white;
    font-size: 10px;
    font-weight: var(--fw-bold);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    z-index: 3;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Body section (below image) */
.ep-card__body {
    padding: var(--space-sm) var(--space-md) var(--space-md);
}

.ep-card__excerpt {
    font-size: var(--text-sm);
    color: var(--text-muted);
    line-height: var(--leading-normal);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ep-card__tags {
    display: flex;
    gap: var(--space-2xs);
    margin-top: var(--space-xs);
}


/* ============================================
   HORIZONTAL SCROLL ROW (Netflix-style)
   ============================================ */

.scroll-row {
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: var(--space-xs);
    padding-left: var(--section-px);
    padding-right: var(--section-px);
}

@media (min-width: 1024px) {
    .scroll-row {
        padding-left: calc((100vw - var(--container-max)) / 2 + var(--section-px));
        padding-right: calc((100vw - var(--container-max)) / 2 + var(--section-px));
    }
}

.scroll-row::-webkit-scrollbar {
    display: none;
}

.scroll-row>* {
    flex: 0 0 75vw;
    max-width: 400px;
    scroll-snap-align: start;
}

@media (min-width: 640px) {
    .scroll-row>* {
        flex: 0 0 45vw;
    }
}

@media (min-width: 768px) {
    .scroll-row>* {
        flex: 0 0 32vw;
        max-width: 420px;
    }
}

@media (min-width: 1200px) {
    .scroll-row>* {
        flex: 0 0 24vw;
        max-width: 400px;
    }
}


/* ============================================
   TAGS / PILLS
   ============================================ */

.tag {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: var(--fw-bold);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
}

.tag:hover {
    background: var(--accent);
    color: white;
}

.tag--active {
    background: var(--accent);
    color: white;
}

.tag--outline {
    background: transparent;
    border: 1px solid var(--border-light);
}


/* ============================================
   PLATFORM LINKS
   ============================================ */

.platform-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.platform-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-sm);
    font-weight: var(--fw-semibold);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-fast);
}

.platform-link:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--border-light);
    color: white;
}

.platform-link svg,
.platform-link img {
    width: 18px;
    height: 18px;
}


/* ============================================
   UTILITIES
   ============================================ */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.hide-mobile {
    display: none;
}

@media (min-width: 768px) {
    .hide-mobile {
        display: initial;
    }

    .hide-desktop {
        display: none;
    }
}

.separator {
    width: 60px;
    height: 3px;
    background: var(--accent);
    border-radius: var(--radius-full);
    border: none;
}

/* Glow effect */
.glow {
    position: relative;
}

.glow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}


/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.animate-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.animate-in.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.animate-stagger>* {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.animate-stagger.is-visible>*:nth-child(1) {
    transition-delay: 0ms;
    opacity: 1;
    transform: translateY(0);
}

.animate-stagger.is-visible>*:nth-child(2) {
    transition-delay: 80ms;
    opacity: 1;
    transform: translateY(0);
}

.animate-stagger.is-visible>*:nth-child(3) {
    transition-delay: 160ms;
    opacity: 1;
    transform: translateY(0);
}

.animate-stagger.is-visible>*:nth-child(4) {
    transition-delay: 240ms;
    opacity: 1;
    transform: translateY(0);
}

.animate-stagger.is-visible>*:nth-child(5) {
    transition-delay: 320ms;
    opacity: 1;
    transform: translateY(0);
}

.animate-stagger.is-visible>*:nth-child(6) {
    transition-delay: 400ms;
    opacity: 1;
    transform: translateY(0);
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}