/* 1. Design tokens */
:root {
    color-scheme: dark;
    --bg-primary: #070a12;
    --bg-secondary: #0b1020;
    --surface: #111827;
    --surface-elevated: #151c2e;
    --surface-soft: rgba(255, 255, 255, 0.045);
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.18);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --brand: #d03232;
    --brand-hover: #e13d3d;
    --brand-deep: #7f1d1d;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-pill: 999px;
    --shadow-card: 0 22px 70px rgba(0, 0, 0, 0.42);
    --shadow-red: 0 16px 46px rgba(208, 50, 50, 0.28);
    --container: 1120px;
}

/* 2. Base */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    background: var(--bg-primary);
    scroll-behavior: smooth;
    text-size-adjust: 100%;
}

body {
    min-width: 320px;
    margin: 0;
    overflow-x: hidden;
    background:
        radial-gradient(circle at top left, rgba(208, 50, 50, 0.18), transparent 34rem),
        radial-gradient(circle at 85% 12%, rgba(127, 29, 29, 0.18), transparent 30rem),
        linear-gradient(180deg, var(--bg-primary) 0%, #080b14 42%, #05070d 100%);
    color: var(--text-primary);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.7;
}

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

h1,
h2,
h3 {
    margin: 0 0 18px;
    color: var(--text-primary);
    line-height: 1.08;
    letter-spacing: 0;
}

h1 {
    max-width: 920px;
    font-size: clamp(2.25rem, 6vw, 4rem);
}

h2 {
    font-size: clamp(1.75rem, 3.5vw, 2.25rem);
}

h3 {
    font-size: clamp(1.25rem, 2.4vw, 1.5rem);
}

p,
ul,
ol {
    margin: 0 0 18px;
}

p {
    max-width: 76ch;
    color: var(--text-secondary);
}

ul,
ol {
    padding-left: 1.25rem;
    color: var(--text-secondary);
}

li + li {
    margin-top: 8px;
}

strong {
    color: var(--text-primary);
    font-weight: 800;
}

::selection {
    background: rgba(208, 50, 50, 0.45);
    color: #ffffff;
}

/* 3. Layout */
body > header,
main,
body > footer {
    width: min(100% - 32px, var(--container));
    margin-inline: auto;
}

main {
    padding: 42px 0 80px;
}

main > nav[aria-label*="Ariane"] {
    margin: 0 0 26px;
    color: var(--text-muted);
    font-size: 0.92rem;
}

main > nav[aria-label*="Ariane"] ol {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

main > nav[aria-label*="Ariane"] li {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

main > nav[aria-label*="Ariane"] li + li::before {
    content: "/";
    margin-right: 8px;
    color: rgba(255, 255, 255, 0.32);
}

article,
main > section {
    display: grid;
    gap: 28px;
}

article > section,
main > section {
    margin-top: 48px;
}

article > section:first-of-type {
    margin-top: 0;
}

/* 4. Header/nav */
body > header {
    position: sticky;
    top: 12px;
    z-index: 10;
    display: flex;
    gap: 18px;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(7, 10, 18, 0.82);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(18px);
}

body > header div[itemtype*="Organization"] a {
    display: inline-flex;
    align-items: center;
    padding: 8px 10px;
    color: var(--text-primary);
    line-height: 1;
    text-decoration: none;
}

body > header div[itemtype*="Organization"] img {
    display: block;
    width: 113px;
    height: 22px;
    object-fit: contain;
}

body > header > input[type="checkbox"],
body > header > label[for="site-menu-toggle"] {
    display: none;
}

body > header nav ul,
footer nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

body > header nav li,
footer nav li {
    margin: 0;
}

body > header nav a {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-size: 0.94rem;
    font-weight: 700;
    line-height: 1.15;
    text-decoration: none;
}

body > header nav a:hover {
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

body > header nav a[aria-current="page"] {
    border-color: rgba(208, 50, 50, 0.42);
    background: rgba(208, 50, 50, 0.16);
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

body > header nav a[href="/cinepulse-live/"] {
    border-color: rgba(208, 50, 50, 0.34);
    color: #ffffff;
}

/* 5. Hero */
main > section:first-child,
article > header {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: clamp(32px, 6vw, 64px);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 30px;
    background:
        radial-gradient(circle at 22% 18%, rgba(208, 50, 50, 0.32), transparent 30rem),
        radial-gradient(circle at 92% 20%, rgba(251, 191, 36, 0.09), transparent 24rem),
        linear-gradient(145deg, rgba(21, 28, 46, 0.96), rgba(7, 10, 18, 0.92) 58%, rgba(48, 16, 21, 0.92));
    box-shadow: var(--shadow-card), var(--shadow-red);
}

main > section:first-child::before,
article > header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(110deg, black, transparent 72%);
}

main > section:first-child > p:first-child,
article > header > p:first-child {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 6px 11px;
    border: 1px solid rgba(52, 211, 153, 0.28);
    border-radius: var(--radius-pill);
    background: rgba(52, 211, 153, 0.09);
    color: var(--success);
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0;
}

main > section:first-child > p:first-child::before,
article > header > p:first-child::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 16px currentColor;
}

main > section:first-child p,
article > header p {
    font-size: clamp(1rem, 1.5vw, 1.12rem);
}

main > section:first-child p[itemprop="description"],
article > header p[itemprop="description"] {
    max-width: 820px;
    color: #e2e8f0;
    font-size: clamp(1.06rem, 1.8vw, 1.22rem);
}

/* 6. Sections/cards */
article > section,
main > section:not(:first-child) {
    position: relative;
    overflow: hidden;
    padding: clamp(24px, 4vw, 36px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025)),
        rgba(17, 24, 39, 0.82);
    box-shadow: var(--shadow-card);
}

article > section::before,
main > section:not(:first-child)::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(208, 50, 50, 0.65), transparent);
}

section h2 {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

section h3 {
    color: #ffffff;
}

section > *:last-child,
article > header > *:last-child,
main > section:first-child > *:last-child,
footer > *:last-child {
    margin-bottom: 0;
}

section ul,
section ol {
    display: grid;
    gap: 10px;
}

section li {
    margin-top: 0;
}

section li::marker {
    color: var(--brand-hover);
}

/* 7. Tables */
table {
    display: block;
    width: 100%;
    margin: 24px 0;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 18px;
    border-spacing: 0;
    background: rgba(7, 10, 18, 0.46);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

caption {
    padding: 14px 16px 0;
    color: var(--text-muted);
    font-size: 0.92rem;
    text-align: left;
}

thead,
tbody,
tr {
    width: 100%;
}

th,
td {
    min-width: 190px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

th {
    background: rgba(21, 28, 46, 0.96);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 800;
    text-transform: uppercase;
}

td {
    color: var(--text-secondary);
}

tbody tr:last-child td {
    border-bottom: 0;
}

td strong {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 4px 9px;
    border: 1px solid rgba(52, 211, 153, 0.28);
    border-radius: var(--radius-pill);
    background: rgba(52, 211, 153, 0.08);
    color: #b7f7db;
    font-size: 0.94rem;
    line-height: 1.3;
}

tbody tr:nth-child(3) td strong {
    border-color: rgba(251, 191, 36, 0.28);
    background: rgba(251, 191, 36, 0.08);
    color: #fde68a;
}

/* 8. FAQ */
div[itemtype*="Question"] {
    position: relative;
    margin-top: 16px;
    padding: 22px 22px 20px 52px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(7, 10, 18, 0.42);
}

div[itemtype*="Question"]::before {
    content: "?";
    position: absolute;
    top: 22px;
    left: 18px;
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 50%;
    background: rgba(208, 50, 50, 0.18);
    color: var(--brand-hover);
    font-size: 0.86rem;
    font-weight: 900;
}

div[itemtype*="Question"] h3 {
    margin-bottom: 10px;
    font-size: clamp(1.08rem, 2vw, 1.28rem);
}

div[itemtype*="Answer"] p {
    margin-bottom: 0;
    color: var(--text-secondary);
}

/* 9. Buttons/links */
a {
    color: #fca5a5;
    text-decoration-color: rgba(252, 165, 165, 0.5);
    text-underline-offset: 0.18em;
}

a:hover {
    color: #ffffff;
    text-decoration-color: var(--brand-hover);
}

main > section:first-child > p:has(> a),
article > header > p:has(> a),
article > section > p:last-child:has(> a),
main > section:not(:first-child) > p:last-child:has(> a) {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    max-width: none;
    margin-top: 24px;
}

main > section:first-child > p:has(> a) > a,
article > header > p:has(> a) > a,
article > section > p:last-child:has(> a) > a,
main > section:not(:first-child) > p:last-child:has(> a) > a {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    padding: 11px 18px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-primary);
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
}

main > section:first-child > p:has(> a) > a:first-child,
article > header > p:has(> a) > a:first-child,
article > section > p:last-child:has(> a) > a:first-child,
main > section:not(:first-child) > p:last-child:has(> a) > a:first-child,
main > section:first-child > p:has(> a) > a[href^="https://cinepulse.live"],
article > header > p:has(> a) > a[href^="https://cinepulse.live"],
article > section > p:last-child:has(> a) > a[href^="https://cinepulse.live"],
main > section:not(:first-child) > p:last-child:has(> a) > a[href^="https://cinepulse.live"] {
    border-color: rgba(208, 50, 50, 0.58);
    background: linear-gradient(135deg, var(--brand), var(--brand-hover) 55%, var(--brand-deep));
    color: #ffffff;
    box-shadow: var(--shadow-red);
}

main > section:first-child > p:has(> a) > a:hover,
article > header > p:has(> a) > a:hover,
article > section > p:last-child:has(> a) > a:hover,
main > section:not(:first-child) > p:last-child:has(> a) > a:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.26);
    background-color: rgba(255, 255, 255, 0.08);
}

/* 10. Footer */
body > footer {
    margin-bottom: 24px;
    padding: 28px 0 34px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
}

footer nav {
    margin-bottom: 18px;
}

footer nav a {
    display: inline-flex;
    padding: 6px 0;
    color: var(--text-secondary);
    font-weight: 700;
    text-decoration: none;
}

footer p {
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

footer strong {
    color: #ffffff;
}

/* 11. Responsive */
@media (max-width: 820px) {
    body > header {
        position: static;
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        margin-top: 0;
        border-radius: 0 0 18px 18px;
    }

    body > header,
    main,
    body > footer {
        width: min(100% - 24px, var(--container));
    }

    body > header {
        width: 100%;
        padding-inline: 12px;
    }

    body > header > input[type="checkbox"] {
        position: absolute;
        display: block;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }

    body > header > label[for="site-menu-toggle"] {
        display: inline-flex;
        min-height: 38px;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 8px 12px;
        border: 1px solid var(--border);
        border-radius: var(--radius-pill);
        background: rgba(255, 255, 255, 0.06);
        color: var(--text-primary);
        font-size: 0.9rem;
        font-weight: 800;
        line-height: 1;
        cursor: pointer;
        user-select: none;
    }

    body > header > label[for="site-menu-toggle"]::before {
        content: "";
        width: 16px;
        height: 10px;
        border-block: 2px solid currentColor;
        box-shadow: inset 0 4px 0 -2px currentColor;
    }

    body > header > input[type="checkbox"]:checked + label[for="site-menu-toggle"] {
        border-color: rgba(208, 50, 50, 0.48);
        background: rgba(208, 50, 50, 0.18);
    }

    body > header > input[type="checkbox"]:focus-visible + label[for="site-menu-toggle"] {
        outline: 3px solid rgba(248, 113, 113, 0.9);
        outline-offset: 3px;
    }

    body > header nav {
        grid-column: 1 / -1;
        display: grid;
        grid-template-rows: 0fr;
        width: 100%;
        overflow: hidden;
        transition: grid-template-rows 180ms ease;
    }

    body > header > input[type="checkbox"]:checked ~ nav {
        grid-template-rows: 1fr;
    }

    body > header nav ul {
        min-height: 0;
        overflow: hidden;
        padding-top: 0;
        transition: padding-top 180ms ease;
    }

    body > header > input[type="checkbox"]:checked ~ nav ul {
        padding-top: 12px;
    }

    body > header nav ul {
        gap: 7px;
    }

    body > header nav a {
        min-height: 36px;
        padding: 7px 10px;
        font-size: 0.88rem;
    }

    main {
        padding-top: 28px;
        padding-bottom: 56px;
    }

    article,
    main > section {
        gap: 22px;
    }

    article > section,
    main > section:not(:first-child) {
        margin-top: 28px;
    }

    main > section:first-child,
    article > header {
        border-radius: 24px;
    }

    th,
    td {
        min-width: 170px;
        padding: 14px;
    }
}

@media (max-width: 560px) {
    body {
        font-size: 15.5px;
    }

    body > header nav ul,
    footer nav ul {
        width: 100%;
    }

    main > section:first-child,
    article > header,
    article > section,
    main > section:not(:first-child) {
        padding: 22px;
    }

    main > section:first-child > p:has(> a) > a,
    article > header > p:has(> a) > a,
    article > section > p:last-child:has(> a) > a,
    main > section:not(:first-child) > p:last-child:has(> a) > a {
        width: 100%;
    }

    div[itemtype*="Question"] {
        padding: 20px 18px 18px 46px;
    }

    footer {
        text-align: left;
    }
}

/* 12. Accessibility */
:focus-visible {
    outline: 3px solid rgba(248, 113, 113, 0.9);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

@media (hover: hover) {
    a,
    body > header nav a,
    main > section:first-child > p:has(> a) > a,
    article > header > p:has(> a) > a,
    article > section > p:last-child:has(> a) > a,
    main > section:not(:first-child) > p:last-child:has(> a) > a {
        transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
    }
}
