:root {
    color-scheme: dark;
    --background: #0b0b0d;
    --surface: #151519;
    --surface-raised: #1e1e24;
    --text: #f6f4ef;
    --muted: #aaa6a0;
    --accent: #e8b348;
    --border: #303038;
    --max-width: 1180px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

body.has-room-background {
    background-color: var(--background);
    background-image: linear-gradient(rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.42)), var(--room-background-image);
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body.has-fixed-header {
    padding-top: 64px;
}

button,
a {
    font: inherit;
}

a {
    color: inherit;
}

.page-width {
    width: min(calc(100% - 40px), var(--max-width));
    margin-inline: auto;
}

.site-header {
    border-bottom: 1px solid var(--border);
    background: rgba(11, 11, 13, 0.96);
}

.site-header.is-light {
    background: #fff;
    border-bottom-color: #ddd;
}

.site-header.is-fixed {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 100;
}

.header-inner,
.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
}

.header-inner {
    justify-content: center;
    min-height: 64px;
}

.footer-inner {
    justify-content: center;
}

.brand {
    color: var(--text);
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    text-decoration: none;
}

.room-logo {
    display: block;
    width: auto;
    max-width: min(320px, 75vw);
    max-height: 46px;
}

.brand-accent,
.eyebrow {
    color: var(--accent);
}

.eyebrow {
    margin: 0 0 8px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

h1,
h2 {
    margin: 0;
    line-height: 1.1;
}

h1 {
    font-size: clamp(2rem, 5vw, 4rem);
}

h2 {
    font-size: clamp(1.6rem, 4vw, 2.6rem);
}

.catalog-section {
    padding: clamp(40px, 7vw, 88px) 0;
}

.welcome-copy {
    max-width: 820px;
    margin: 0 auto 36px;
    padding: 24px 28px;
    color: #fff;
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.65;
    text-align: center;
    background: rgba(0, 0, 0, 0.74);
    border-left: 4px solid var(--accent);
}

.welcome-copy p {
    margin: 0;
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 32px;
}

.category-tab {
    min-height: 44px;
    padding: 11px 22px;
    color: #fff;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.72);
    border: 2px solid rgba(255, 255, 255, 0.7);
    cursor: pointer;
}

.category-tab[aria-selected="true"] {
    color: #111;
    background: var(--accent);
    border-color: var(--accent);
}

.category-tab:not([aria-selected="true"]):hover,
.category-tab:not([aria-selected="true"]):focus-visible {
    color: #111;
    background: #fff;
    border-color: #fff;
}

.category-tab:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.video-card {
    padding: 0;
    overflow: hidden;
    color: var(--text);
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease;
}

.video-card:hover,
.video-card:focus-visible {
    transform: translateY(-3px);
    border-color: var(--accent);
}

.video-card:disabled {
    cursor: default;
    opacity: 1;
}

.video-card:disabled:hover {
    transform: none;
    border-color: var(--border);
}

.video-card.is-playing {
    border-color: var(--accent);
}

.video-thumbnail {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: var(--surface-raised);
}

.video-media {
    position: relative;
    display: block;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #ff1827;
    transform: translate(-50%, -50%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.play-icon::after {
    position: absolute;
    top: 50%;
    left: 53%;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 16px solid #fff;
    content: '';
    transform: translate(-50%, -50%);
}

.availability-bar {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1;
    padding: 8px 10px;
    color: #ddd;
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
    background: rgba(0, 0, 0, 0.82);
}

.video-copy {
    display: block;
    padding: 18px;
}

.video-title {
    display: block;
    font-weight: 700;
}

.video-description {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: 0.9rem;
}

.empty-category,
.catalog-error {
    padding: 24px;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
}

.video-modal {
    width: min(960px, calc(100% - 32px));
    max-width: none;
    padding: 0;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65);
}

.video-modal::backdrop {
    background: rgba(0, 0, 0, 0.82);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
}

.modal-close {
    display: grid;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    place-items: center;
    color: var(--text);
    font-size: 2rem;
    line-height: 1;
    background: transparent;
    border: 1px solid var(--border);
    cursor: pointer;
}

.modal-close:hover,
.modal-close:focus-visible {
    border-color: var(--accent);
}

.modal-player-frame {
    aspect-ratio: 16 / 9;
    background: #000;
}

.modal-player-frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.modal-description {
    margin: 0;
    padding: 16px 18px 20px;
    color: var(--muted);
}

.catalog-error {
    color: #ffd3d3;
    border-color: #6f3434;
}

.site-footer {
    color: var(--muted);
    border-top: 1px solid var(--border);
}

@media (max-width: 800px) {
    .video-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 540px) {
    .page-width {
        width: min(calc(100% - 28px), var(--max-width));
    }

    .section-heading,
    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .footer-inner {
        justify-content: center;
        gap: 8px;
        padding: 20px 0;
    }

    .video-grid {
        grid-template-columns: 1fr;
    }

    .welcome-copy {
        padding: 20px;
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    .video-card {
        transition: none;
    }
}
