/* basic reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    font-family: system-ui, sans-serif;
    background: #05050f;
    color: #e8e8f0;
}

/* star field canvas sits behind everything */
#starfield {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* header/nav */
header {
    position: sticky;
    top: 0;
    background: rgba(5, 5, 20, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 10;
}

nav {
    display: flex;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
}

nav a+a {
    margin-left: 2rem;
}

/* home link sits on the left; other links stay grouped on the right */
nav .brand {
    margin-right: auto;
}

nav a {
    color: rgba(220, 230, 255, 0.85);
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: color 0.2s;
}

nav a:hover {
    color: #fff;
}

/* main sits above the canvas */
main {
    position: relative;
    z-index: 1;
}

/* hero tile — logo tiled with parallax, no overlay */
.tile {
    background-image: url("./assets/logo1.png");
    background-repeat: repeat-y;
    background-position: center;
    background-size: auto;

    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;

    background-attachment: fixed;
}

/* content tiles — dark glass panel, stars visible in gaps */
.tile.grey {
    background-color: rgba(8, 8, 24, 0.65);
    background-blend-mode: multiply;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin: 1rem;
}

/* content spacing */
.pad {
    padding: 8rem 2rem;
    width: 100%;
    max-width: 1000px;
}

/* keep other colour variants in case they're used later */
.tile.black {
    background-color: black;
    color: #fff;
    background-blend-mode: multiply;
}

.tile.blue {
    background-color: #060a2e;
    background-blend-mode: multiply;
}

/* mobile fallback: background-attachment: fixed is unreliable on many mobile browsers */
@media (max-width: 900px) {
    main {
        background-image: url("./assets/logo1.png");
        background-attachment: fixed;
        background-repeat: no-repeat;
        background-size: contain;
        background-position: center center;
    }

    .tile {
        background-image: none;
        background-attachment: scroll;
    }
}

/* prose content width + typography */
.prose {
    max-width: 700px;
}

.prose h2 {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-bottom: 1.5rem;
    color: #fff;
}

.prose h3 {
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(180, 200, 255, 0.9);
    margin-bottom: 1rem;
}

.prose p {
    line-height: 1.75;
    color: rgba(220, 225, 240, 0.8);
    margin-bottom: 1.25rem;
}

.btn {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.6rem 1.6rem;
    border: 1px solid rgba(180, 200, 255, 0.45);
    border-radius: 4px;
    color: rgba(200, 220, 255, 0.9);
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.btn + .btn {
    margin-left: 0.75rem;
}

.btn:hover {
    background: rgba(180, 200, 255, 0.12);
    border-color: rgba(180, 200, 255, 0.8);
    color: #fff;
}

/* demo page: sticky role sub-nav */
.role-nav {
    position: sticky;
    top: 0;
    /* top is set precisely by demo.js to sit beneath the main header */
    z-index: 9;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(5, 5, 20, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.role-nav a {
    color: rgba(220, 230, 255, 0.7);
    text-decoration: none;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.role-nav a:hover {
    color: #fff;
}

.role-nav a.active {
    color: #fff;
    border-bottom-color: rgba(180, 200, 255, 0.8);
}

/* demo page: single shared player + role-grouped lists */
.demo-pad {
    padding: 4rem 2rem;
    max-width: 1280px;
}

.demo-group {
    scroll-margin-top: 7.5rem;
}

.demo-heading {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-bottom: 1rem;
    color: #fff;
}

/* layout: role-grouped lists (left) + one sticky shared player (right) */
.demo-layout {
    display: grid;
    grid-template-columns: minmax(300px, 1fr) 1.5fr;
    gap: 2.5rem;
    align-items: start;
}

.demo-lists {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.demo-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.demo-item {
    padding: 0.85rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-left: 3px solid transparent;
    border-radius: 6px;
    background: rgba(8, 8, 24, 0.4);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.demo-item:hover {
    background: rgba(20, 24, 48, 0.6);
}

.demo-item:focus-visible {
    outline: 2px solid rgba(180, 200, 255, 0.7);
    outline-offset: 2px;
}

.demo-item.active {
    background: rgba(20, 24, 48, 0.75);
    border-left-color: rgba(180, 200, 255, 0.9);
}

.demo-item-title {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #fff;
}

.demo-item-desc {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.82rem;
    line-height: 1.45;
    color: rgba(200, 210, 235, 0.65);
}

.demo-player {
    position: sticky;
    top: var(--player-top, 7.5rem);
}

.demo-player video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
}

.demo-player-meta {
    padding: 1rem 0.25rem 0;
}

.demo-player-title {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #fff;
    text-transform: none;
    margin-bottom: 0.4rem;
}

.demo-player-desc {
    font-size: 0.9rem;
    line-height: 1.6;
    color: rgba(210, 218, 240, 0.8);
}

/* stack on narrow screens: player on top, lists below */
@media (max-width: 860px) {
    .demo-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .demo-player {
        position: static;
        order: -1;
    }
}

footer {
    position: relative;
    z-index: 1;
    height: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* back-to-top button */
#back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 11;
    padding: 0.6rem 1rem;
    border: 1px solid rgba(180, 200, 255, 0.45);
    border-radius: 4px;
    background: rgba(5, 5, 20, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: rgba(200, 220, 255, 0.9);
    font-size: 1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, background 0.2s, border-color 0.2s, color 0.2s;
}

#back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

#back-to-top:hover {
    background: rgba(180, 200, 255, 0.12);
    border-color: rgba(180, 200, 255, 0.8);
    color: #fff;
}