/* ==========================================================================
   non-existence.css — the Non-existence page (a draft)
   Load AFTER /css/site.css. The void behind the page is drawn by
   /js/non-existence.js; the page reads like a fall from the barrier of
   reality down to Ophis himself.
   ========================================================================== */

.void-page {
    --void: #020205;
    --rune: #6f9cff;
    --pale: #c9d3ea;
    --ink: #d6dae6;
    --ink-soft: #7f879c;

    /* site.css locks the gateway to one screen; this page scrolls */
    height: auto;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--void);
    color: var(--ink);
}
html:has(.void-page) { height: auto; overflow-y: auto; }

#void-canvas {
    position: fixed; inset: 0;
    width: 100vw; height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* The void on PixiJS (non-existence.js); #void-canvas sits on top of it, transparent */
.void-pixi {
    position: fixed; inset: 0;
    width: 100vw; height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* Arriving from the planes' dive: black until Ophis' eyes have closed (non-existence.js) */
html.arriving body::after,
.arrival-veil {
    content: '';
    position: fixed; inset: 0;
    z-index: 30;
    background: var(--void, #020205);
}
.arrival-veil {
    pointer-events: none;
    transition: opacity 1.4s ease;
}
.arrival-veil canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.arrival-veil.lifting { opacity: 0; }

/* --- Top links --- */
.void-page {
    /* shared scroll-page structure (scroll-page.css) */
    --sp-links-z: 6;
    --sp-links-bg: rgba(2, 2, 5, 0.95);
    --sp-links-bg0: rgba(2, 2, 5, 0);
    --sp-end: #a9b8ff;
    --sp-end-opacity: 0.8;
    --sp-end-last: var(--rune);
    --sp-line: rgba(111, 156, 255, 0.2);
    --sp-here: var(--pale);
}

/* the links out are travel plaques (site.css), in the runes' colours */
.void-page { --travel-accent: var(--rune); --travel-ink: var(--ink); --travel-bg: var(--void); --travel-bg2: #0e0e1f; }
.page-links a,
.page-foot a {
    color: var(--rune);
    text-decoration: none;
}
.page-links a:hover,
.page-foot a:hover { text-decoration: underline; }
a:focus-visible {
    outline: 2px solid var(--rune);
    outline-offset: 3px;
    border-radius: 2px;
}

/* --- Depth gauge --- */
.gauge-stops a::before {
    /* a tiny obelisk */
    content: '';
    position: absolute; left: -9px; top: 50%;
    width: 5px; height: 10px;
    transform: translateY(-50%);
    background: #0a0a12;
    border: 1px solid rgba(111, 156, 255, 0.45);
    clip-path: polygon(50% 0, 100% 22%, 100% 100%, 0 100%, 0 22%);
    transition: background 0.3s ease;
}
.gauge-stops a.here::before { background: var(--rune); }

/* --- Page body --- */
main,
.page-foot {
    position: relative;
    z-index: 2;
    width: min(640px, calc(100% - 48px));
    margin-left: max(24px, calc(50% - 470px));
}
@media (min-width: 1101px) {
    main, .page-foot { margin-left: max(210px, calc(50% - 470px)); }
}

.hero {
    min-height: 100vh;
    display: flex; flex-direction: column; justify-content: center;
}
.plane-kind {
    margin: 0;
    font-style: italic;
    color: var(--ink-soft);
    font-size: 1.05rem;
}
.hero h1 {
    margin: 0.1em 0 0.3em;
    font-family: var(--font-fantasy);
    font-weight: 400;
    font-size: clamp(2.2rem, 7vw, 5rem);
    line-height: 1;
    white-space: nowrap; /* the letters are separate spans; keep the word whole */
    letter-spacing: 0.04em;
    color: var(--pale);
    text-shadow: 0 0 24px rgba(111, 156, 255, 0.25);
}
/* Each letter flickers out of existence and back (spans added by non-existence.js) */
.vanishing span {
    display: inline-block;
    animation: unexist var(--dur, 7s) ease-in-out var(--delay, 0s) infinite;
}
@keyframes unexist {
    0%, 70%, 100% { opacity: 1; filter: none; transform: none; }
    80% { opacity: 0.08; filter: blur(6px); transform: scale(0.9) translateY(4px); }
    88% { opacity: 0; filter: blur(10px); }
}
.hero-line {
    max-width: 32ch;
    margin: 0 0 2.2rem;
    font-size: clamp(1.15rem, 2.4vw, 1.45rem);
    line-height: 1.5;
}
.set-out {
    align-self: flex-start;
    font-family: var(--font-fantasy);
    font-size: 0.95rem;
    color: var(--pale);
    text-decoration: none;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(111, 156, 255, 0.5);
}
.set-out:hover { border-bottom-color: var(--rune); }

section {
    padding: 16vh 0 6vh;
}
section h2 {
    margin: 0 0 1rem;
    font-family: var(--font-fantasy);
    font-weight: 400;
    font-size: clamp(1.8rem, 4.5vw, 2.5rem);
    color: var(--pale);
}
section p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin: 0 0 1.1em;
    max-width: 60ch;
    text-shadow: 0 0 8px var(--void), 0 0 2px var(--void);
}
.epithet {
    font-style: italic;
    font-size: 1.3rem !important;
    color: var(--rune);
}
.on-screen {
    font-style: italic;
    font-size: 0.98rem !important;
    color: var(--ink-soft);
}

/* Paragraphs surface out of the dark as you reach them (class added by non-existence.js) */
.emerge {
    opacity: 0;
    filter: blur(4px);
    transform: translateY(10px);
    transition: opacity 1.2s ease, filter 1.2s ease, transform 1.2s ease;
}
.emerge.shown { opacity: 1; filter: none; transform: none; }

.observation {
    margin: 2rem 0;
    padding: 1rem 1.2rem 0.3rem;
    border-left: 2px solid #ffae4a;
    background: rgba(10, 8, 6, 0.7);
    border-radius: 0 6px 6px 0;
}
.observation h3 {
    margin: 0 0 0.5rem;
    font-family: var(--font-fantasy);
    font-weight: 400;
    font-size: 1.25rem;
    color: #ffae4a;
}

.ledger {
    display: flex; flex-wrap: wrap; gap: 12px 30px;
    margin: 1.6rem 0 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(111, 156, 255, 0.25);
}
.ledger dt { font-size: 0.85rem; font-style: italic; color: var(--ink-soft); }
.ledger dd { margin: 2px 0 0; }

.page-foot {
    padding: 10vh 0 40vh;
    color: var(--ink-soft);
    font-size: 0.95rem;
}
.page-foot p { margin: 0 0 0.5rem; }

/* At the very bottom the dark closes in on everything (--dark, 0..1, set by
   non-existence.js); "Return to existence" is the last light left */
main,
.depth-gauge { opacity: calc(1 - var(--dark, 0) * 0.55); }
.page-foot p:not(:last-child) { opacity: calc(1 - var(--dark, 0) * 0.55); }
.page-foot .last-light {
    color: var(--rune);
    color: color-mix(in srgb, var(--pale) calc(var(--dark, 0) * 100%), var(--rune));
    text-shadow: 0 0 calc(4px + var(--dark, 0) * 16px) rgba(140, 180, 255, calc(var(--dark, 0) * 0.85));
}

@media (max-width: 1100px) {
    .depth-gauge { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .vanishing span { animation: none; }
    .emerge { transition: none; }
}

/* Visual quality: Still is the same as the reduced-motion rules (fx-quality.js) */
html[data-quality="still"] .vanishing span { animation: none; }
html[data-quality="still"] .emerge { transition: none; }
