/* ============================================
   GLOBAL STYLESHEET - Shared across all pages
   ============================================ */

:root {
    --bg-color: #050505;
    --grid-line: rgba(255, 255, 255, 0.04);
    --accent-color: #ffffff;
    --text-main: #e0e0e0;
    --scanline-color: rgba(255, 255, 255, 0.02);
    --grid-size: 1.85vw;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Manrope', sans-serif;
    overflow-x: hidden;
    width: 100vw;
    overflow-y: auto;
    -webkit-font-smoothing: antialiased;
}

/* VISUAL EFFECTS - Consistent across all pages */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9000;
    background: linear-gradient(to bottom, var(--scanline-color) 50%, transparent 50%);
    background-size: 100% 4px;
}

.grid-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -10;
    background-image: linear-gradient(var(--grid-line) 1px, transparent 1px),
                      linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: var(--grid-size) var(--grid-size);
    pointer-events: none;
}

#active-cell {
    position: fixed;
    width: var(--grid-size);
    height: var(--grid-size);
    z-index: -9;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 0, 150, 0.5), rgba(0, 204, 255, 0.5));
    filter: blur(4px);
    opacity: 0;
    transition: opacity 0.1s ease;
}

/* CUSTOM CURSOR */
#cursor-crosshair {
    position: fixed;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
}

#cursor-crosshair::before {
    content: '';
    position: absolute;
    background: white;
    width: 30px;
    height: 1px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: 0.3s;
}

#cursor-crosshair::after {
    content: '';
    position: absolute;
    background: white;
    width: 1px;
    height: 30px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: 0.3s;
}

body.hovering #cursor-crosshair::before {
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--accent-color);
    border-radius: 50%;
}

body.hovering #cursor-crosshair::after {
    width: 0;
    height: 0;
    opacity: 0;
}

body.hovering-footer #cursor-crosshair::before {
    width: 28px !important;
    height: 28px !important;
    background: transparent;
    border: 1px solid var(--accent-color);
    border-radius: 50%;
}

body.hovering-footer #cursor-crosshair::after {
    width: 0;
    height: 0;
    opacity: 0;
}

/* TOP CONTROLS - Navigation & Sound Toggle */
.top-controls {
    position: fixed;
    top: 40px;
    left: 40px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    width: auto;
}

.sound-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.8);
}

.equalizer-bar {
    width: 2px;
    background: #fff;
    animation: equalize 3s infinite ease-in-out;
}

.sound-on .equalizer-bar {
    animation: equalize 0.5s infinite linear;
    background: var(--accent-color);
}

@keyframes equalize {
    0% { height: 5px; }
    50% { height: 20px; }
    100% { height: 5px; }
}

.lang-switch {
    display: flex;
    gap: 10px;
    font-family: 'Space Mono';
    font-size: 0.7rem;
}

.lang-opt {
    color: #aaa;
    text-decoration: none;
    transition: 0.3s;
}

.lang-opt.active {
    color: #fff;
    border-bottom: 1px solid var(--accent-color);
}

.lang-opt:hover {
    color: #ccc;
}

/* BACK NAVIGATION */
.back-nav {
    position: fixed;
    top: 40px;
    right: 40px;
    z-index: 10000;
}

.back-btn {
    text-decoration: none;
    color: #fff;
    font-family: 'Syncopate', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    transition: 0.3s;
    background: rgba(0, 0, 0, 0.5);
}

.back-btn:hover {
    border-color: var(--accent-color);
    background: var(--accent-color);
    color: #000;
}

/* Links stay light on the black background. iPhone otherwise paints them blue. */
a:any-link {
    color: #fff;
    -webkit-text-fill-color: currentColor;
    text-decoration-color: rgba(255, 255, 255, 0.55);
}
a.lang-opt:any-link {
    color: #aaa;
}
a.lang-opt.active:any-link,
a.lang-opt:hover:any-link {
    color: #fff;
}
.before-book-note a:any-link,
.terms-accept a:any-link {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

/* RESPONSIVE - Hide cursor on mobile */
@media (max-width: 768px) {
    body {
        cursor: auto;
    }

    #cursor-crosshair,
    #active-cell {
        display: none;
    }
}

/*
  Narrow chrome flows with the bar width, the same idea as timefind:
  clamp() for size, safe-area insets, and a container query so the
  section numbers drop to their own row when they no longer fit.
  !important is required because each page repeats these positions
  in a style block that loads after this file.
*/
.top-controls {
    container-type: inline-size;
    container-name: site-chrome;
}

@media (max-width: 1100px) {
    .top-controls {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: auto !important;
        max-width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box;
        display: flex !important;
        flex-flow: row wrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 0.45rem 0.75rem !important;
        z-index: 100000 !important;
        background: rgba(5, 5, 5, 0.94) !important;
        -webkit-backdrop-filter: blur(16px);
        backdrop-filter: blur(16px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding:
            calc(env(safe-area-inset-top, 0px) + 0.55rem)
            max(0.85rem, env(safe-area-inset-right, 0px))
            0.55rem
            max(0.85rem, env(safe-area-inset-left, 0px)) !important;
    }

    .top-controls .sound-toggle,
    .top-controls .lang-switch {
        flex: 0 1 auto;
        min-width: 0;
        white-space: nowrap;
        font-size: clamp(0.62rem, 2.5vw, 0.75rem) !important;
    }

    .top-controls .side-nav {
        display: flex !important;
        position: static !important;
        top: auto !important;
        right: auto !important;
        transform: none !important;
        flex: 1 1 auto;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-end;
        gap: clamp(0.2rem, 1.6vw, 1rem) !important;
        margin: 0 0 0 auto !important;
        min-width: 0;
        padding: 0 !important;
        background: transparent !important;
        border: 0 !important;
    }

    .back-nav {
        position: fixed !important;
        top: calc(env(safe-area-inset-top, 0px) + 3.15rem) !important;
        right: 0 !important;
        left: 0 !important;
        width: 100% !important;
        max-width: none !important;
        z-index: 100000 !important;
        display: flex !important;
        justify-content: center;
        box-sizing: border-box;
        background: rgba(5, 5, 5, 0.94) !important;
        -webkit-backdrop-filter: blur(16px);
        backdrop-filter: blur(16px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding:
            0.3rem
            max(0.85rem, env(safe-area-inset-right, 0px))
            0.55rem
            max(0.85rem, env(safe-area-inset-left, 0px)) !important;
    }

    .back-nav .back-btn {
        width: min(100%, 36rem);
        max-width: 100%;
        justify-content: center;
        text-align: center;
        white-space: normal;
        line-height: 1.25;
        font-size: clamp(0.62rem, 2.5vw, 0.78rem) !important;
        letter-spacing: clamp(0.04em, 0.35vw, 0.12em) !important;
        padding: 0.5rem 0.7rem !important;
    }

    body:has(.back-nav) .page-content,
    body:has(.back-nav) .contact-container {
        padding-top: calc(env(safe-area-inset-top, 0px) + 8.75rem) !important;
    }

    #main-site {
        padding-top: calc(env(safe-area-inset-top, 0px) + 7.25rem) !important;
    }

    .page-content .card-img-wrapper {
        height: clamp(12rem, 42svh, 28rem) !important;
    }
}

@container site-chrome (max-width: 46rem) {
    .side-nav {
        flex: 1 0 100% !important;
        margin-left: 0 !important;
        justify-content: space-between !important;
        order: 2;
    }
}


/* ===== Accessibility & motion (shared) ===== */
body.custom-cursor-active,
body.custom-cursor-active * { cursor: none; }

#cursor-crosshair { display: none; }
body.custom-cursor-active #cursor-crosshair { display: block; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.lang-opt:focus-visible,
.ui-link:focus-visible,
.nav-dot:focus-visible,
.action-btn:focus-visible,
.enter-btn:focus-visible,
.back-btn:focus-visible,
.tab-btn:focus-visible,
.faq-question:focus-visible,
.sound-toggle:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 300000;
    background: #fff;
    color: #000;
    padding: 12px 18px;
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    text-decoration: none;
}
.skip-link:focus {
    left: 16px;
    top: 16px;
}

.nav-dot,
.ui-link,
.enter-btn,
.back-btn {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}
.sound-toggle,
.lang-opt {
    min-height: 0;
    min-width: 0;
    padding: 0;
    width: auto;
}
.sound-toggle {
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    text-transform: uppercase;
    gap: 12px;
    justify-content: flex-start;
}
.faq-question {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    font: inherit;
    color: inherit;
    padding: 12px 0;
    min-height: 44px;
}
.nav-dot {
    background: none;
    border: none;
    font: inherit;
    color: inherit;
}

@media (max-width: 1024px) {
    body { cursor: auto; }
    body.custom-cursor-active,
    body.custom-cursor-active * { cursor: auto; }
    #cursor-crosshair, #active-cell { display: none !important; }
}

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

.faq-answer[hidden] { display: none !important; }
.faq-item.active .faq-answer:not([hidden]) { display: block; }

.terms-accept {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin: 1.25rem 0;
    text-align: left;
}
.terms-accept input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin-top: 4px;
    flex: 0 0 22px;
    accent-color: #fff;
}
.terms-accept label {
    font-family: 'Manrope', sans-serif;
    font-size: 0.95rem;
    line-height: 1.55;
    color: #eee;
}
.terms-accept a { color: #fff; }
