/* ────────────────────────────────────────────────────────────────
   Photic Field — light entrainment overlay for Sonic Journeys.
   A full-viewport wash whose brightness is modulated as a smooth
   sine at a target brainwave frequency (alpha/theta/etc.), ramped
   across the journey's phases. Light drives the visual cortex more
   reliably than binaural audio drives the auditory cortex — this is
   the "look" layer under the "listen" layer.
   Sine, never strobe. Pointer-events pass through. Opt-in only.
   ──────────────────────────────────────────────────────────────── */

#photic-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;              /* ABOVE the fullscreen player (#journey-playback z:10000)
                                    — at z:40 the wash rendered UNDER the player and was
                                    invisible, so the Light button appeared to do nothing */
    pointer-events: none;        /* never eats clicks */
    opacity: 0;                  /* driven every frame by JS */
    mix-blend-mode: screen;      /* adds light, never darkens the field */
    background: radial-gradient(circle at 50% 46%,
        rgba(150,175,205,0.95) 0%,
        rgba(150,175,205,0.55) 42%,
        rgba(150,175,205,0.12) 74%,
        rgba(150,175,205,0) 100%);
    will-change: opacity;
    transition: none;
    display: none;
}
#photic-overlay.armed { display: block; }

/* Toggle button — mounts into .transport-controls next to the field control */
.photic-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    font: 500 12px/1 var(--font-body, system-ui, sans-serif);
    letter-spacing: 0.04em;
    color: rgba(230,235,245,0.72);
    padding: 6px 10px;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 999px;
    background: rgba(255,255,255,0.04);
    transition: color .2s ease, border-color .2s ease, background .2s ease;
    white-space: nowrap;
}
.photic-toggle:hover { color: #fff; border-color: rgba(255,255,255,0.28); }
.photic-toggle .photic-glyph { font-size: 14px; line-height: 1; }
.photic-toggle.on {
    color: #fff;
    border-color: rgba(160,190,230,0.6);
    background: rgba(120,160,220,0.18);
    box-shadow: 0 0 14px rgba(120,160,220,0.35);
}

/* "Close your eyes" hint — fades in then out when the field arms */
#photic-hint {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 10060;              /* above the player + the wash */
    pointer-events: none;
    font: 300 clamp(15px, 2.4vw, 22px)/1.5 var(--font-display, Cormorant Garamond, serif);
    letter-spacing: 0.06em;
    color: rgba(240,244,252,0.92);
    text-align: center;
    text-shadow: 0 2px 24px rgba(0,0,0,0.6);
    opacity: 0;
    transition: opacity 1.1s ease;
}
#photic-hint.show { opacity: 1; }

/* Consent / safety gate */
#photic-consent {
    position: fixed;
    inset: 0;
    z-index: 2147483000;         /* safety modal — above everything incl. the player */
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(6,8,14,0.86);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 24px;
}
#photic-consent.show { display: flex; }
#photic-consent .pc-card {
    max-width: 460px;
    width: 100%;
    background: linear-gradient(180deg, rgba(22,26,38,0.98), rgba(14,17,26,0.98));
    border: 1px solid rgba(160,190,230,0.24);
    border-radius: 16px;
    padding: 26px 26px 22px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.6);
    color: #e7ecf5;
    font: 400 14.5px/1.6 var(--font-body, system-ui, sans-serif);
}
#photic-consent h3 {
    margin: 0 0 12px;
    font: 500 18px/1.3 var(--font-display, Cormorant Garamond, serif);
    letter-spacing: 0.04em;
    color: #fff;
}
#photic-consent p { margin: 0 0 12px; color: rgba(226,232,244,0.82); }
#photic-consent .pc-warn {
    color: #ffd7a6;
    border-left: 2px solid rgba(255,180,90,0.7);
    padding-left: 12px;
}
#photic-consent .pc-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    justify-content: flex-end;
}
#photic-consent button {
    font: 500 13px/1 var(--font-body, system-ui, sans-serif);
    letter-spacing: 0.04em;
    padding: 11px 16px;
    border-radius: 999px;
    cursor: pointer;
    border: 1px solid transparent;
}
#photic-consent .pc-cancel {
    background: transparent;
    border-color: rgba(255,255,255,0.18);
    color: rgba(230,235,245,0.8);
}
#photic-consent .pc-begin {
    background: linear-gradient(180deg, #7fa8e6, #5f7fd0);
    color: #0a0e18;
    font-weight: 600;
}
#photic-consent .pc-cancel:hover { border-color: rgba(255,255,255,0.4); color: #fff; }
#photic-consent .pc-begin:hover { filter: brightness(1.08); }
