/* ==========================================================================
   astral-sea.css — the Astral Sea page
   Load AFTER /css/site.css (uses its fonts). The background is drawn by
   /js/astral-sea.js on #sea-canvas; the page reads like a voyage from the
   Portal of Portals (top) to the edge of reality (bottom).
   ========================================================================== */

.astral-page {
    --sea-deep: #040a17;
    --sea-blue: #7cc8ff;
    --mist: #d6e9ff;
    --ink: #dbe6f5;
    --ink-soft: #9fb4cf;

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

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

/* --- Top links --- */
.astral-page {
    /* shared scroll-page structure (scroll-page.css) */
    --sp-links-z: 5;
    --sp-links-bg: rgba(4, 10, 23, 0.92);
    --sp-links-bg0: rgba(4, 10, 23, 0);
    --sp-end: var(--sea-blue);
    --sp-end-opacity: 0.8;
    --sp-end-last: #b9a6ff;
    --sp-line: rgba(124, 200, 255, 0.25);
    --sp-here: var(--mist);
}

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

/* --- Depth gauge: how far from the Portal of Portals you have travelled --- */
.gauge-stops a::before {
    content: '';
    position: absolute; left: -10px; top: 50%;
    width: 7px; height: 7px;
    border-radius: 50%;
    transform: translateY(-50%);
    background: #10203a;
    border: 1px solid rgba(124, 200, 255, 0.5);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}
.gauge-stops a.here::before {
    background: var(--sea-blue);
    box-shadow: 0 0 10px var(--sea-blue);
}

/* --- Page body --- */
main,
.page-foot {
    position: relative;
    z-index: 2;
    width: min(680px, calc(100% - 48px));
    margin-left: max(24px, 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.25em;
    font-family: var(--font-fantasy);
    font-weight: 700;
    font-size: clamp(3.2rem, 11vw, 7.5rem);
    line-height: 0.95;
    letter-spacing: 0.02em;
    color: transparent;
    background: linear-gradient(100deg, #eaf5ff 0%, #7cc8ff 35%, #c7b8ff 60%, #eaf5ff 85%) 0 0 / 250% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: tide 12s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 18px rgba(124, 200, 255, 0.35));
}
@keyframes tide { to { background-position: 100% 0; } }
.hero-line {
    max-width: 30ch;
    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(--mist);
    text-decoration: none;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(124, 200, 255, 0.5);
}
.set-out:hover { border-bottom-color: var(--sea-blue); }

section {
    padding: 14vh 0 4vh;
}
section h2 {
    margin: 0 0 1rem;
    font-family: var(--font-fantasy);
    font-weight: 400;
    font-size: clamp(1.8rem, 4.5vw, 2.6rem);
    color: var(--mist);
    text-shadow: 0 0 18px rgba(124, 200, 255, 0.3);
}
section p {
    font-size: 1.12rem;
    line-height: 1.75;
    margin: 0 0 1.1em;
    max-width: 62ch;
    text-shadow: 0 0 6px var(--sea-deep), 0 0 2px var(--sea-deep);
}
h3.sub {
    margin: 2.2rem 0 0.6rem;
    font-family: var(--font-fantasy);
    font-weight: 400;
    font-size: 1.25rem;
    color: var(--sea-blue);
}

/* A short line telling you what the sea behind the text is showing */
.on-screen {
    font-style: italic;
    font-size: 0.98rem !important;
    color: var(--ink-soft);
}

/* The opening vignette of the wild */
.scene {
    font-style: italic;
    font-size: 1.2rem !important;
    color: var(--mist);
    padding-left: 1.2rem;
    border-left: 1px solid rgba(214, 233, 255, 0.3);
}

/* --- Lists of who lives here and where the portals lead --- */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 28px;
    margin-top: 2rem;
}
.ledger h3 {
    margin: 0 0 0.6rem;
    font-family: var(--font-fantasy);
    font-weight: 400;
    font-size: 1.1rem;
    color: var(--sea-blue);
}
.plain-list,
.portal-list {
    list-style: none;
    margin: 0; padding: 0;
    line-height: 1.9;
}
.portal-list {
    columns: 2;
    column-gap: 18px;
}
.portal-list li {
    break-inside: avoid;
    display: flex; align-items: center; gap: 8px;
}
.portal-list li::before {
    content: '';
    width: 7px; height: 7px;
    flex: none;
    border-radius: 50%;
    background: var(--c);
    box-shadow: 0 0 8px var(--c);
}

/* --- Observations: the sea's phenomena; --c is each one's colour --- */
.observation {
    margin: 2.2rem 0;
    padding: 1.2rem 1.4rem 0.4rem;
    border-left: 2px solid var(--c);
    background: linear-gradient(90deg, rgba(6, 13, 30, 0.82), rgba(6, 13, 30, 0.45));
    backdrop-filter: blur(5px);
    border-radius: 0 6px 6px 0;
}
.observation h3 {
    margin: 0 0 0.6rem;
    font-family: var(--font-fantasy);
    font-weight: 400;
    font-size: 1.3rem;
    color: var(--c);
    text-shadow: 0 0 14px color-mix(in srgb, var(--c) 45%, transparent);
}
.observation p { font-size: 1.06rem; }

blockquote {
    margin: 1.2rem 0 1rem;
    padding: 0;
}
blockquote p {
    font-size: 1.35rem !important;
    line-height: 1.5 !important;
    color: var(--mist);
    font-style: italic;
    margin-bottom: 0.4rem !important;
}
blockquote cite {
    font-size: 0.92rem;
    color: var(--ink-soft);
}

/* --- Engines --- */
.engines {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 1rem 0 0.5rem;
}
.engine {
    padding: 1rem 1rem 0.2rem;
    border-top: 1px solid rgba(124, 200, 255, 0.4);
    background: rgba(6, 13, 30, 0.6);
}
.engine h4 {
    margin: 0 0 0.5rem;
    font-family: var(--font-fantasy);
    font-weight: 400;
    font-size: 1rem;
    color: var(--mist);
}
.engine p { font-size: 0.98rem; line-height: 1.6; }

/* --- The edge and the way back --- */
#edge { padding-bottom: 8vh; }
.page-foot {
    padding: 4vh 0 28vh;
    color: var(--ink-soft);
    font-size: 0.95rem;
}
.page-foot p { margin: 0 0 0.5rem; }

/* Leave room for the depth gauge on wide screens; hide it on smaller ones */
@media (min-width: 1101px) {
    main, .page-foot { margin-left: max(210px, calc(50% - 470px)); }
}
@media (max-width: 1100px) {
    .depth-gauge { display: none; }
}
@media (max-width: 700px) {
    .two-col, .engines { grid-template-columns: 1fr; }
    .portal-list { columns: 2; }
    section { padding-top: 10vh; }
}

@media (prefers-reduced-motion: reduce) {
    .hero h1 { animation: none; }
}

/* ==========================================================================
   Visual quality tiers (html[data-quality], fx-quality.js)
   Light: the observations don't blur the moving sea behind them (a little more
   opaque instead). Still: the same as the reduced-motion rules.
   ========================================================================== */
html[data-quality="light"] .observation {
    backdrop-filter: none; -webkit-backdrop-filter: none;
    background: linear-gradient(90deg, rgba(6, 13, 30, 0.9), rgba(6, 13, 30, 0.6));
}
html[data-quality="still"] .hero h1 { animation: none; }
