/* ── GLOBAL / SHARED STYLES ─────────────────────────────────────────────────── */
/* Scope: layout shell, header, nav, background, wash overlay, page transitions  */
/* Page-specific styles live in pages/<name>/<name>.css                          */

@font-face {
    font-family: 'Determination';
    src: url('assets/fonts/determination.ttf') format('truetype');
    font-display: swap;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; background: #000; }
body { overflow: hidden; }

/* ── Site header ── */
#site-header {
    position: relative;
    width: 100%;
    height: 140px;
    z-index: 20;
    pointer-events: auto;
    overflow: hidden;
}

#nav {
    position: absolute;
    top: 100px; left: 0;
    width: 100%;
    display: flex;
    pointer-events: auto;
    z-index: 1; /* iOS Safari ignores pointer-events:none on iframes; z-index routes touches here instead */
}

#nav a {
    flex: 1;
    padding: 10px 0;
    text-align: center;
    font-family: 'Determination', monospace;
    color: #fff;
    text-decoration: none;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: transparent;
    transition: background 0.15s, color 240ms ease;
}

#nav a:last-child { border-right: none; }
#nav a:hover, #nav a:active { background: rgba(255,255,255,0.12); }
#nav a.is-active { background: rgba(255,255,255,0.22); }

/* ── Background iframe ── */
#bg {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
    pointer-events: none;
    z-index: 0;
}

/* ── White wash overlay ── */
#bg-white-wash {
    position: fixed;
    inset: 0;
    background: #fff;
    opacity: 0;
    pointer-events: none;
    z-index: 5;
    transition: opacity 240ms ease;
}
body.is-bg-wash-on #bg-white-wash {
    opacity: 1;
}

/* ── Roulette header iframe ── */
#header-roulette {
    position: absolute;
    top: -25px; left: 0;
    width: 100%;
    height: 160px;
    border: none;
    pointer-events: none;
    background: transparent;
    transition: filter 240ms ease;
}

/* ── Clickable overlay: roulette acts as home button ── */
#header-home-link {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100px; /* covers roulette area above the nav */
    z-index: 1;
    cursor: pointer;
    display: block;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

/* ── Content scroll container ── */
#content {
    position: relative;
    width: calc(100% - 40px);
    margin: 0 auto;
    z-index: 10;
    padding: 0px 0 0 0;
    color: #fff;
    transition: color 240ms ease;
    border: #ff0000 0px solid;
    font-family: 'Determination', monospace;
    display: block;
    height: calc(100vh - 140px);
    overflow-y: auto;
    overflow-x: hidden;
    overflow-anchor: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
#content.is-home {
    /* visibility:hidden keeps iframe GPU contexts alive (unlike display:none) */
    visibility: hidden;
    pointer-events: none;
}
#content::-webkit-scrollbar {
    display: none;
}

/* ── Page view transitions ── */
.page-view {
    /* position:absolute keeps sections out of flow so they don't stack */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 220ms ease, transform 220ms ease;
}
.page-view.is-active {
    /* position:relative re-enters flow so #content can scroll to fit content */
    position: relative;
    opacity: 1;
    transform: translateY(0px);
    pointer-events: auto;
}

/* ── Shared content box ── */
.content-box {
    display: inline-block;
    width: 100%;
    height: fit-content;
    text-align: center;
    border: 0px dashed rgba(255, 255, 255, 0.7);
    padding: 0px;
    background: rgba(0, 0, 0, 0);
}
h1, h2 {
    font-family: 'Determination', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Audio debug console (hidden by default) ── */
#sc-debug-console {
    position: fixed;
    right: 8px;
    top: 8px;
    width: min(96vw, 560px);
    max-height: 44vh;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.92);
    border: 1px solid #ff7a00;
    color: #ffd9b3;
    font-family: "Courier New", monospace;
    font-size: 11px;
    line-height: 1.35;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
}
#sc-debug-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px;
    border-bottom: 1px solid rgba(255, 122, 0, 0.45);
    color: #fff;
}
#sc-debug-controls {
    display: flex;
    gap: 6px;
}
#sc-debug-controls button {
    appearance: none;
    border: 1px solid #ff7a00;
    background: #1a1a1a;
    color: #ffd9b3;
    font-family: inherit;
    font-size: 11px;
    padding: 2px 6px;
    cursor: pointer;
}
#sc-debug-lines {
    margin: 0;
    padding: 8px;
    white-space: pre-wrap;
    overflow-y: auto;
    max-height: calc(44vh - 34px);
    word-break: break-word;
}
/* Always hidden — enable by removing this rule when debugging */
#sc-debug-console { display: none !important; }

/* ── White wash: global text darkening ── */
body.is-bg-wash-on #nav a      { color: #000; }
body.is-bg-wash-on #content    { color: #000; }
body.is-bg-wash-on #header-roulette { filter: invert(1); }
