/* ═══════════════════════════════════════════════════════════════
   NOVA — Sky and Ground
   One night world, two altitudes. The sky is indigo, radial, alive.
   The ground is loam, paper, lamplight. Fraunces speaks; Karla works.
   ═══════════════════════════════════════════════════════════════ */

:root {
    /* sky */
    --night: #0a0d20;
    --night-deep: #060714;
    --nebula: #241b45;
    --starlight: #ffd27d;
    --starlight-hot: #fff3d6;
    --skyblue: #9cc8e8;
    --skytext: #e8ecf9;
    --skymute: #939cc0;
    --glass: rgba(24, 30, 62, 0.55);
    --glass-line: rgba(156, 200, 232, 0.16);

    /* ground */
    --loam: #201612;
    --loam-deep: #150e0a;
    --ember: #e2a35c;
    --ember-hot: #f6c98a;
    --moss: #97a878;
    --parchment: #f3ead6;
    --parchment-shade: #e5d8bc;
    --ink: #372c1f;
    --ink-soft: #6b5c46;

    --serif: 'Fraunces', Georgia, serif;
    --sans: 'Karla', -apple-system, 'Segoe UI', sans-serif;

    --ease-drift: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--skytext);
    background: radial-gradient(ellipse 120% 90% at 50% -10%, var(--nebula) 0%, var(--night) 46%, var(--night-deep) 100%);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 1.2s var(--ease-drift);
}
body.realm-ground {
    background: radial-gradient(ellipse 130% 100% at 20% 0%, #2a3820 0%, #1b2415 40%, #10160c 100%);
    color: var(--parchment);
}

::selection { background: rgba(255, 210, 125, 0.35); }

:focus-visible {
    outline: 2px solid var(--starlight);
    outline-offset: 3px;
    border-radius: 2px;
}
.realm-ground :focus-visible { outline-color: var(--ember); }

/* ───────── the living sky ───────── */
#cosmos {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* ───────── the horizon veil (realm transition) ───────── */
#horizonVeil {
    position: fixed;
    left: 0;
    width: 100vw;
    height: 220vh;
    top: 0;
    z-index: 90;
    pointer-events: none;
    transform: translateY(110vh);
    opacity: 0;
    background: linear-gradient(to top,
        transparent 0%,
        rgba(21, 14, 10, 0.97) 18%,
        #2a1c13 34%,
        #6b4226 46%,
        #b07940 50%,       /* the horizon itself — a stripe of dusk */
        #3a3260 56%,
        rgba(13, 15, 38, 0.97) 70%,
        transparent 100%);
}
#horizonVeil.descend { animation: veil-up 1.35s var(--ease-drift) forwards; }
#horizonVeil.ascend  { animation: veil-down 1.35s var(--ease-drift) forwards; }
@keyframes veil-up   { 0% { transform: translateY(110vh); opacity: 1; } 100% { transform: translateY(-225vh); opacity: 1; } }
@keyframes veil-down { 0% { transform: translateY(-225vh); opacity: 1; } 100% { transform: translateY(110vh); opacity: 1; } }
body.crossing { overflow: hidden; }

/* ───────── scenes ───────── */
#app { position: relative; z-index: 1; }

.scene {
    display: none;
    min-height: 100vh;
    padding: 48px clamp(20px, 6vw, 80px) 120px;
    animation: scene-in 0.9s var(--ease-drift);
}
.scene.on { display: block; }
@keyframes scene-in {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── crystalline titles: cut-gem type, lit from within ──
   the face is a faceted gradient — abrupt light-bands like planes of cut
   crystal — and the air around each glyph glows in the realm's own light.
   drop-shadow (not text-shadow) so glow follows the gradient-clipped glyphs. */
.scene-title {
    font-family: var(--serif);
    font-weight: 520;
    font-size: clamp(30px, 4.4vw, 44px);
    letter-spacing: 0.01em;
    background: linear-gradient(108deg,
        #dceefc 0%, #ffffff 14%, #ffffff 15%, #f6e7c4 26%,
        var(--starlight) 38%, #fffdf2 47%, #fffdf2 48.5%, #ffd98f 60%,
        #cfe4f6 72%, #fff3d6 84%, #f0d69e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 1px 0 rgba(74, 62, 34, 0.65))
            drop-shadow(0 0 10px rgba(220, 238, 255, 0.55))
            drop-shadow(0 0 26px rgba(255, 214, 140, 0.5))
            drop-shadow(0 8px 22px rgba(0, 0, 0, 0.42));
}
/* on earth the crystal is citrine — amber facets, lamp-lit from within */
.ground-title {
    background: linear-gradient(108deg,
        #fff6e4 0%, #ffffff 13%, #ffffff 14.5%, #ffe3b0 26%,
        var(--ember) 40%, #fff2d8 49%, #fff2d8 50.5%, #f2b96a 63%,
        #d99a4a 76%, #ffe9c4 88%, #cf9346 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 1px 0 rgba(66, 42, 18, 0.7))
            drop-shadow(0 0 10px rgba(255, 232, 190, 0.5))
            drop-shadow(0 0 26px rgba(255, 190, 110, 0.45))
            drop-shadow(0 8px 20px rgba(0, 0, 0, 0.45));
}

.whisper {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 350;
    font-size: 15.5px;
    color: var(--skymute);
}
.whisper.center { text-align: center; }
.realm-ground .whisper { color: #b9a486; }

h3 {
    font-family: var(--serif);
    font-weight: 480;
    font-size: 21px;
    color: var(--skyblue);
    margin-bottom: 6px;
    /* every heading carries a little of its realm's light */
    text-shadow: 0 0 14px rgba(156, 200, 232, 0.4), 0 0 30px rgba(156, 200, 232, 0.18);
}
.realm-ground h3 {
    color: var(--ember);
    text-shadow: 0 0 14px rgba(226, 163, 92, 0.35), 0 0 30px rgba(226, 163, 92, 0.15);
}
body.in-journal h3 {
    text-shadow: 0 0 14px rgba(140, 205, 218, 0.35), 0 0 30px rgba(140, 205, 218, 0.15);
}

/* ───────── buttons ───────── */
.btn {
    font-family: var(--sans);
    font-weight: 600;
    font-size: 14.5px;
    letter-spacing: 0.01em;
    border: none;
    border-radius: 999px;
    padding: 13px 30px;
    cursor: pointer;
    transition: transform 0.25s var(--ease-drift), box-shadow 0.25s, background 0.25s;
}
.btn.primary {
    background: linear-gradient(135deg, var(--starlight-hot), var(--starlight) 55%, #e8a84c);
    color: #3a2c10;
    box-shadow: 0 4px 26px rgba(255, 210, 125, 0.28);
}
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 8px 34px rgba(255, 210, 125, 0.42); }
.btn.quiet {
    background: transparent;
    color: var(--skymute);
    border: 1px solid var(--glass-line);
}
.btn.quiet:hover { color: var(--skytext); border-color: rgba(156, 200, 232, 0.4); }
.btn.small { padding: 9px 20px; font-size: 13px; }
.btn.wide { width: 100%; }

.realm-ground .btn.primary {
    background: linear-gradient(135deg, var(--ember-hot), var(--ember) 60%, #c07f3c);
    color: #2b1c0c;
    box-shadow: 0 4px 22px rgba(226, 163, 92, 0.3);
}
.realm-ground .btn.quiet { color: #b9a486; border-color: rgba(226, 163, 92, 0.28); }
.realm-ground .btn.quiet:hover { color: var(--parchment); }

.linklike {
    background: none;
    border: none;
    font: inherit;
    color: var(--ember);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.need-now {
    position: fixed;
    top: 18px;
    right: 20px;
    z-index: 60;
    font-family: var(--serif);
    font-style: italic;
    font-size: 14px;
    color: var(--night-deep);
    background: var(--starlight);
    border: none;
    border-radius: 999px;
    padding: 8px 18px;
    cursor: pointer;
    box-shadow: 0 2px 18px rgba(255, 210, 125, 0.35);
    transition: transform 0.25s, box-shadow 0.25s;
}
.need-now:hover { transform: scale(1.05); box-shadow: 0 4px 26px rgba(255, 210, 125, 0.55); }

/* ───────── arrival ───────── */
.arrival-center {
    max-width: 480px;
    margin: 0 auto;
    text-align: center;
    padding-top: 4vh;
}
/* the halo and spikes are painted into the star itself — no CSS glow needed */
.nova-star { width: 170px; height: 170px; }
.nova-star.small { width: 96px; height: 96px; }
@keyframes star-breathe {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.07); }
}
#arrivalStar {
    margin-bottom: -26px; /* the halo is wide; let the wordmark sit close to the core */
    animation: arrive 1.8s var(--ease-drift), star-breathe 6s ease-in-out 1.8s infinite;
    transform-origin: center;
}
@keyframes arrive {
    from { opacity: 0; transform: scale(0.25); }
    to   { opacity: 1; transform: scale(1); }
}

.wordmark {
    font-family: var(--serif);
    font-weight: 600;
    font-size: clamp(52px, 9vw, 76px);
    letter-spacing: 0.34em;
    margin: 10px 0 2px 0.34em; /* offset the tracking so it sits centred */
    /* the name is crystal now: prismatic facets, starlight refracting through,
       a shimmer crossing it slowly the way light travels a cut gem */
    background: linear-gradient(112deg,
        #c9a75e 0%, #fff8e6 10%, #ffffff 16%, #ffffff 17.5%, #cfe4f6 24%,
        var(--starlight) 34%, #fffdf2 42%, #fffdf2 43.5%, #ffd98f 52%,
        #bcd8f0 62%, #fff3d6 72%, var(--skyblue) 86%, #eaf4ff 100%);
    background-size: 240% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 1px 0 rgba(74, 62, 34, 0.6))
            drop-shadow(0 0 12px rgba(220, 238, 255, 0.6))
            drop-shadow(0 0 34px rgba(255, 214, 140, 0.55))
            drop-shadow(0 12px 30px rgba(0, 0, 0, 0.5));
    animation: wordmark-shimmer 14s ease-in-out infinite;
}
@keyframes wordmark-shimmer {
    0%, 12%  { background-position: 100% 0; }
    50%      { background-position: 0% 0; }
    88%, 100%{ background-position: 100% 0; }
}
@media (prefers-reduced-motion: reduce) {
    .wordmark { animation: none; background-position: 55% 0; }
}
.tagline {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 340;
    font-size: 17px;
    color: var(--skymute);
    margin-bottom: 22px;
}

/* the promises, quiet as engravings under the name */
.arrival-vows {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 34px;
}
.arrival-vows span {
    font-family: var(--serif);
    font-style: italic;
    font-size: 13.5px;
    color: rgba(220, 232, 248, 0.75);
    padding: 5px 14px;
    border: 1px solid rgba(156, 200, 232, 0.22);
    border-radius: 999px;
    text-shadow: 0 0 12px rgba(156, 200, 232, 0.3);
}
.arrival-notes {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
    color: var(--skymute);
}
.arrival-notes .linklike { font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--skyblue); }
.arrival-notes .an-crisis { color: #f0a8a0; }
.arrival-honest { margin-top: 10px; text-align: center; font-size: 13px; opacity: 0.8; }

.keeper-letter p { font-family: var(--serif); font-size: 16px; line-height: 1.75; margin-bottom: 14px; }
.keeper-letter .keeper-sign { font-style: italic; color: var(--skymute); margin-top: 20px; }
.vows-list { padding-left: 20px; display: grid; gap: 14px; }
.vows-list li { font-size: 15px; line-height: 1.65; }
.vows-list li strong { display: block; font-family: var(--serif); font-size: 16.5px; }
.crisis-sheet-lines { display: grid; gap: 10px; justify-items: start; margin: 14px 0; }
.vows-link { font-size: 12.5px; color: var(--skymute); font-style: italic; margin-left: 6px; }
.vows-link:hover { color: var(--skytext); }

.auth-card {
    background: var(--glass);
    border: 1px solid var(--glass-line);
    border-radius: 18px;
    padding: 30px 30px 34px;
    text-align: left;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 18px 60px rgba(4, 5, 16, 0.6), inset 0 1px 0 rgba(232, 236, 249, 0.07);
}
.auth-tabs {
    display: flex;
    gap: 24px;
    margin-bottom: 26px;
    border-bottom: 1px solid var(--glass-line);
}
.auth-tab {
    font-family: var(--serif);
    font-size: 17px;
    font-weight: 460;
    background: none;
    border: none;
    color: var(--skymute);
    padding: 6px 2px 12px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.auth-tab.active { color: var(--starlight); border-bottom-color: var(--starlight); }

label {
    display: block;
    font-weight: 650;
    font-size: 13px;
    color: var(--skyblue);
    margin: 18px 0 7px;
}
input[type="text"], input[type="email"], input[type="password"],
input[type="date"], input[type="time"], textarea {
    width: 100%;
    padding: 12px 14px;
    font-family: var(--sans);
    font-size: 14px;
    color: var(--skytext);
    background: rgba(10, 13, 32, 0.55);
    border: 1px solid var(--glass-line);
    border-radius: 9px;
    transition: border-color 0.2s;
    color-scheme: dark;
}
input:focus, textarea:focus { border-color: rgba(255, 210, 125, 0.55); outline: none; }
input::placeholder, textarea::placeholder { color: rgba(147, 156, 192, 0.55); }
textarea { resize: vertical; line-height: 1.55; }
#signupForm input[type="text"] + input[type="text"] { margin-top: 8px; }

.field-pair { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; }
.field-note {
    font-size: 12.5px;
    color: var(--skymute);
    margin: 4px 0 8px;
}
.field-note.center { text-align: center; }
.field-note.spaced { margin-top: 26px; }
.form-error { color: #ff9d8a; font-size: 13px; min-height: 1.2em; margin-top: 14px; }
.signup-divider { border-top: 1px solid var(--glass-line); margin: 28px 0 4px; }

.guidelines {
    margin-top: 24px;
    padding: 14px 16px;
    border-left: 2px solid var(--starlight);
    background: rgba(255, 210, 125, 0.06);
    border-radius: 0 9px 9px 0;
    font-size: 13px;
    color: var(--skymute);
}
#loginForm .btn, #signupForm .btn { margin-top: 10px; }

/* ───────── chips ───────── */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-row.center { justify-content: center; }
.chip {
    font-family: var(--sans);
    font-size: 13px;
    color: var(--skymute);
    background: transparent;
    border: 1px solid var(--glass-line);
    border-radius: 999px;
    padding: 7px 15px;
    cursor: pointer;
    transition: all 0.2s;
}
.chip:hover { color: var(--skytext); border-color: rgba(156, 200, 232, 0.4); }
.chip.active {
    color: #3a2c10;
    background: var(--starlight);
    border-color: var(--starlight);
    box-shadow: 0 0 16px rgba(255, 210, 125, 0.3);
}

/* ───────── sliders ───────── */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 4px;
    background: linear-gradient(to right, #3a4470, #6f86b8 45%, var(--starlight));
    outline: none;
    margin: 18px 0 10px;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, var(--starlight-hot), var(--starlight) 60%, #d99a3e);
    border: none;
    cursor: pointer;
    box-shadow: 0 0 18px rgba(255, 210, 125, 0.7);
}
input[type="range"]::-moz-range-thumb {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, var(--starlight-hot), var(--starlight) 60%, #d99a3e);
    border: none;
    cursor: pointer;
    box-shadow: 0 0 18px rgba(255, 210, 125, 0.7);
}

.band-line { text-align: center; margin-top: 6px; }
.band-line.big { margin-top: 14px; }
.band-label {
    font-family: var(--serif);
    font-weight: 520;
    font-size: 20px;
    color: var(--starlight);
}
.band-line.big .band-label { font-size: 30px; }
.band-hint {
    font-family: var(--serif);
    font-style: italic;
    font-size: 14px;
    color: var(--skymute);
    margin-left: 10px;
}
.band-hint.center { display: block; text-align: center; margin: 2px 0 0; }

/* ───────── check-in ───────── */
.checkin-center {
    max-width: 560px;
    margin: 0 auto;
    text-align: center;
    padding-top: 3vh;
}
.checkin-center .scene-title { margin-bottom: 6px; }
.tuned-star-wrap { margin: 8px auto 0; width: min(300px, 70vw); }
#tunedStar { width: 100%; }
#tunedCore { transition: filter 0.3s, opacity 0.3s, transform 0.3s; transform-origin: center; transform-box: fill-box; }
#tunedCorona { stroke: var(--starlight); transition: all 0.4s; }
#tunedRays line { stroke: var(--starlight); stroke-linecap: round; transition: opacity 0.4s, stroke-width 0.4s; }
.checkin-center .btn.primary { margin: 30px 8px 0; }
.checkin-center .btn.quiet { margin-top: 14px; display: inline-block; }
.checkin-center input[type="range"] { max-width: 360px; }

/* ───────── the collective ───────── */
.collective-head { text-align: center; margin-bottom: 30px; }

.collective-grid {
    display: grid;
    grid-template-columns: 248px minmax(0, 560px) 248px; /* trail | orbit | music */
    gap: 28px;
    justify-content: center;
    align-items: center; /* the wings float beside the orbit's middle */
}

.orbit-wrap { text-align: center; }
.orbit {
    position: relative;
    width: 520px;
    height: 520px;
    margin: 0 auto;
}
#orbitLines { position: absolute; inset: 0; width: 100%; height: 100%; }
.orbit-centre {
    position: absolute;
    left: 50%; top: 50%;
    width: 122px; height: 122px;
    margin: -61px 0 0 -61px;
    animation: star-breathe 6s ease-in-out infinite;
}
/* the ring containers stack over each other and must not eat the cursor —
   only the stars themselves are touchable */
#soulRing, #hallRing { position: absolute; inset: 0; pointer-events: none; }
#soulRing .orbit-node, #hallRing .orbit-node { pointer-events: auto; }
#soulRing { animation: ring-turn 300s linear infinite; }
#soulRing .orbit-node { animation: node-counter 300s linear infinite; }
@keyframes ring-turn    { from { transform: rotate(0deg); }   to { transform: rotate(360deg); } }
/* counter-rotation keeps each soul's label upright; the translate must ride along */
@keyframes node-counter { from { transform: translate(-50%, -50%) rotate(360deg); } to { transform: translate(-50%, -50%) rotate(0deg); } }

.orbit-node {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--skytext);
    font-family: var(--sans);
}
.orbit-node .node-star {
    transition: transform 0.35s var(--ease-drift), opacity 0.35s;
}
.soul-node .node-star {
    display: block;
    width: 70px;
    height: 70px;
    margin: -10px;  /* the baked halo is generous; tighten the layout box */
}
/* a soul under the cursor blooms: the star swells and their name lights up */
.soul-node:hover, .soul-node.linked { z-index: 5; }
.soul-node:hover .node-star, .soul-node.linked .node-star {
    transform: scale(2);
    opacity: 1 !important; /* full brightness while met, whatever their frequency */
}
.hall-node .node-star {
    font-size: 24px;
    line-height: 1;
}
.orbit-node .node-label { white-space: nowrap; pointer-events: none; }
.soul-node .node-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.25s, transform 0.3s var(--ease-drift);
}
.soul-node:hover .node-label, .soul-node.linked .node-label {
    opacity: 1;
    transform: translateY(10px);
}
.node-name {
    font-family: var(--serif);
    font-weight: 560;
    font-size: 19px;
    color: var(--starlight-hot);
    text-shadow: 0 0 12px rgba(255, 210, 125, 0.7), 0 2px 10px rgba(4, 5, 16, 0.9);
}
.node-band {
    font-family: var(--serif);
    font-style: italic;
    font-size: 12px;
    color: var(--skyblue);
    text-shadow: 0 1px 8px rgba(4, 5, 16, 0.9);
}

/* real planets, each riding its own petal of the flower */
.planet-sphere {
    display: block;
    position: relative;
    width: var(--psize);
    height: var(--psize);
    border-radius: 50%;
    background:
        radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 30%),
        radial-gradient(circle at 34% 32%, var(--p-light), var(--p-base) 52%, var(--p-dark) 100%);
    box-shadow:
        inset calc(var(--psize) * -0.18) calc(var(--psize) * -0.16) calc(var(--psize) * 0.36) rgba(3, 4, 14, 0.5),
        0 0 calc(var(--psize) * 0.55) color-mix(in srgb, var(--p-glow) 40%, transparent),
        0 0 calc(var(--psize) * 1.1) color-mix(in srgb, var(--p-glow) 16%, transparent);
    filter: saturate(1.25) brightness(1.08);
    transition: transform 0.3s var(--ease-drift), box-shadow 0.3s;
}
/* the planet wears its astrological sign */
.planet-glyph {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: calc(var(--psize) * 0.52);
    line-height: 1;
    color: rgba(255, 253, 246, 0.92);
    text-shadow: 0 1px 4px rgba(10, 8, 20, 0.75), 0 0 10px rgba(10, 8, 20, 0.4);
}
.planet-sphere.banded::before {
    content: '';
    position: absolute; inset: 0;
    border-radius: 50%;
    background: repeating-linear-gradient(168deg,
        rgba(122, 74, 40, 0) 0 4px, rgba(122, 74, 40, 0.28) 4px 7px,
        rgba(255, 240, 210, 0.14) 7px 10px);
    mix-blend-mode: overlay;
}
.planet-sphere.ringed::after {
    content: '';
    position: absolute;
    left: 50%; top: 50%;
    width: 185%; height: 58%;
    transform: translate(-50%, -50%) rotate(-18deg);
    border-radius: 50%;
    border: 2px solid rgba(226, 205, 150, 0.55);
    border-top-color: rgba(226, 205, 150, 0.2); /* the far side passes behind */
    box-shadow: 0 0 8px rgba(226, 205, 150, 0.2);
}
.hall-node:hover .planet-sphere {
    transform: scale(1.22);
    box-shadow:
        inset calc(var(--psize) * -0.18) calc(var(--psize) * -0.16) calc(var(--psize) * 0.36) rgba(3, 4, 14, 0.6),
        0 0 calc(var(--psize) * 0.9) color-mix(in srgb, var(--p-glow) 45%, transparent);
}
.hall-node { z-index: 2; }
.hall-node:hover { z-index: 6; }
.hall-node .node-label { opacity: 0.85; font-size: 11.5px; margin-top: 4px; }
#soulRing { z-index: 3; }
.orbit-centre { z-index: 4; pointer-events: none; }
.hall-node .node-archetype {
    font-family: var(--serif);
    font-style: italic;
    font-size: 11px;
    color: var(--skymute);
    opacity: 0;
    transition: opacity 0.25s;
    white-space: nowrap;
}
.hall-node:hover .node-archetype { opacity: 1; }

.orbit-caption { margin-top: 14px; font-family: var(--serif); font-style: italic; font-size: 13.5px; color: var(--skymute); }

/* a quiet track-list rail — the orbit is the hero, this is its soundtrack */
.resonating {
    padding: 4px 0 4px 18px;
    border-left: 1px solid var(--glass-line);
}
.resonating h3 {
    font-size: 15px;
    margin-bottom: 0;
}
.resonating > .whisper { font-size: 12px; }
#orbitPlaylist { margin: 12px 0 10px; }
.resonance-row {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 8px;
    border-radius: 8px;
    cursor: default;
    transition: background 0.25s;
}
.resonance-row:hover, .resonance-row.linked { background: rgba(156, 200, 232, 0.09); }
.resonance-star { color: var(--starlight); font-size: 12px; }
.resonance-track { font-weight: 650; font-size: 12px; color: var(--skytext); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resonance-by { font-size: 10.5px; color: var(--skymute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resonating .btn.small { padding: 7px 14px; font-size: 11.5px; }

.panel-glass {
    background: var(--glass);
    border: 1px solid var(--glass-line);
    border-radius: 16px;
    padding: 24px 26px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.sky-journal { max-width: 900px; margin: 48px auto 0; }
.sky-journal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px;
    margin-top: 14px;
    align-items: end;
}
#journalTrend { width: 100%; height: auto; }
#journalEntries { margin-top: 18px; }
.journal-entry {
    padding: 10px 0;
    border-top: 1px solid var(--glass-line);
    font-size: 13.5px;
    color: var(--skymute);
}
.journal-entry strong { color: var(--skyblue); font-weight: 650; }
.sky-journal .btn { margin-top: 10px; }

/* ───────── the hearth (ground) ───────── */
#scene-hearth { padding-top: 0; }

.hearth-body {
    position: relative;
    max-width: 820px;
    margin: 44px auto 0;
    padding: 0 4px;
}
.lamp-glow {
    position: absolute;
    top: -80px; left: -140px;
    width: 480px; height: 480px;
    background: radial-gradient(circle, rgba(226, 163, 92, 0.16) 0%, transparent 65%);
    pointer-events: none;
}
#embers { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.ember-mote {
    position: absolute;
    width: 3px; height: 3px;
    border-radius: 50%;
    background: var(--ember);
    opacity: 0;
    animation: mote-rise linear infinite;
}
@keyframes mote-rise {
    0%   { transform: translateY(0) translateX(0); opacity: 0; }
    12%  { opacity: 0.55; }
    85%  { opacity: 0.25; }
    100% { transform: translateY(-46vh) translateX(3vw); opacity: 0; }
}

.hearth-lede {
    font-family: var(--serif);
    font-weight: 340;
    font-size: 18px;
    color: #cbb391;
    max-width: 52ch;
    margin: 10px 0 34px;
}

.contemplation {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 360;
    font-size: clamp(19px, 2.6vw, 24px);
    line-height: 1.5;
    color: var(--parchment);
    border-left: 3px solid var(--ember);
    padding: 6px 0 6px 24px;
    margin: 0 0 48px;
    max-width: 46ch;
}
.contemplation cite {
    display: block;
    font-style: normal;
    font-size: 13px;
    color: #b9a486;
    margin-top: 10px;
}

/* ── the crisis bar: small, pinned, always within reach ── */
.crisis-bar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 14px;
    margin: -48px -8px 34px;
    padding: 9px 14px;
    background: rgba(26, 15, 12, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(232, 140, 122, 0.32);
    border-top: none;
    border-left: 4px solid #e88c7a;
    border-radius: 0 0 12px 12px;
}
.cb-label {
    flex-shrink: 0;
    font-family: var(--serif);
    font-style: italic;
    font-size: 13px;
    color: #f3a894;
    white-space: nowrap;
}
.cb-scroll {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(232, 140, 122, 0.35) transparent;
    padding-bottom: 3px;
}
.cb-scroll::-webkit-scrollbar { height: 5px; }
.cb-scroll::-webkit-scrollbar-thumb { background: rgba(232, 140, 122, 0.3); border-radius: 6px; }
.cb-scroll::-webkit-scrollbar-track { background: transparent; }
.cb-pill {
    flex-shrink: 0;
    font-family: var(--sans);
    font-size: 12px;
    color: #dbc0ad;
    background: rgba(243, 234, 214, 0.05);
    border: 1px solid rgba(232, 140, 122, 0.3);
    border-radius: 999px;
    padding: 6px 13px;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.cb-pill:hover { border-color: rgba(232, 140, 122, 0.65); background: rgba(243, 234, 214, 0.1); }
.cb-pill strong { color: #f3a894; }
.cb-danger { flex-shrink: 0; font-size: 12px; color: #dbc0ad; padding: 0 6px; white-space: nowrap; }
.cb-danger strong { color: #f3a894; }

/* ── the crisis panel: visible from the doorway, warm not alarming ── */
.crisis-line .cl-name {
    display: block;
    font-weight: 700;
    font-size: 14px;
    color: var(--parchment);
}
.crisis-line .cl-name em { font-style: italic; font-weight: 400; font-size: 12px; color: #dbc0ad; }
.crisis-line .cl-how { display: block; font-size: 12.5px; color: #dbc0ad; margin-top: 3px; }
.crisis-line .cl-how strong { color: #f3a894; }
.crisis-line .cl-url { text-decoration: underline; text-underline-offset: 2px; }

.shelf { margin-bottom: 44px; }
.shelf-note { font-size: 13.5px; color: #b9a486; max-width: 56ch; margin-bottom: 16px; }

/* each shelf keeps its own colour — the room is warm, not monochrome */
.shelf h3 { display: inline-block; padding-bottom: 3px; border-bottom: 2px solid transparent; }
.shelf-body h3   { color: #a8c08a; border-bottom-color: rgba(151, 168, 120, 0.6); }
.shelf-mind h3   { color: #8fc3d9; border-bottom-color: rgba(122, 168, 190, 0.55); }
.shelf-inward h3 { color: #c3a8e0; border-bottom-color: rgba(168, 132, 200, 0.5); }

.shelf-body .tool-card {
    background: linear-gradient(160deg, #edecd6, #dde3c4);
    border-top: 3px solid #97a878;
}
.shelf-body .tool-card .tool-name { color: #46512f; }
.shelf-mind .tool-card {
    background: linear-gradient(160deg, #e7ecec, #d3e0e4);
    border-top: 3px solid #7aa8be;
}
.shelf-mind .tool-card .tool-name { color: #2f4a56; }
.shelf-inward .tool-card.inward {
    background: linear-gradient(160deg, #eae4ef, #dcd2e6);
    border-top: 3px solid #a884c8;
}
.shelf-inward .tool-card.inward .tool-name { color: #4a3560; }
.shelf-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}
.tool-card {
    font-family: var(--sans);
    text-align: left;
    background: var(--parchment);
    color: var(--ink);
    border: none;
    border-radius: 4px 10px 5px 9px; /* paper is never perfectly square */
    padding: 16px 16px 14px;
    cursor: pointer;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.35), 0 1px 0 rgba(255, 255, 255, 0.06) inset;
    transition: transform 0.25s var(--ease-drift), box-shadow 0.25s;
}
.shelf-row .tool-card:nth-child(odd)  { transform: rotate(-0.5deg); }
.shelf-row .tool-card:nth-child(even) { transform: rotate(0.4deg); }
.tool-card:hover {
    transform: rotate(0deg) translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}
.tool-card .tool-name {
    display: block;
    font-family: var(--serif);
    font-weight: 560;
    font-size: 16.5px;
    margin-bottom: 4px;
}
.tool-card .tool-helps {
    display: block;
    font-size: 12.5px;
    color: var(--ink-soft);
    line-height: 1.45;
}
.tool-card.inward { background: linear-gradient(160deg, #e9e4cf, #d9dcbd); }
.tool-card.inward .tool-name { color: #3c4426; }


/* ── Earth: two rooms side by side, a stream between them and the sky ── */
.earth-body { max-width: 1180px; }

.earth-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px;
    align-items: start;
    margin-bottom: 44px;
}
.earth-sections .earth-section { margin-bottom: 0; }
@media (max-width: 1120px) {
    .earth-sections { grid-template-columns: 1fr; }
}

/* the stream: water moving through the room */

/* plants: small ferns that sway */
.sprig {
    position: relative;
    width: 62px;
    height: 64px;
    transform-origin: bottom center;
    animation: sprig-sway 7s ease-in-out infinite alternate;
}
@keyframes sprig-sway {
    from { transform: rotate(-2deg); }
    to   { transform: rotate(2.6deg); }
}
.sprig-head {
    position: absolute;
    top: 6px; right: 16px;
    scale: 0.72;
    transform-origin: bottom center;
    opacity: 0.9;
    animation-delay: 0.8s;
}
.earth-section-head { position: relative; }

.earth-section {
    border: 1px solid rgba(226, 163, 92, 0.28);
    border-radius: 8px 16px 10px 14px;
    background: rgba(26, 18, 13, 0.55);
    margin-bottom: 44px;
    overflow: hidden;
}
.earth-section-head {
    padding: 20px 26px 16px;
    border-bottom: 1px solid rgba(226, 163, 92, 0.22);
    background: linear-gradient(150deg, rgba(51, 36, 27, 0.85), rgba(32, 22, 18, 0.9));
}
.es-title {
    font-size: 24px;
    margin-bottom: 0;
    border-bottom: none;
    background: linear-gradient(108deg,
        #fff6e4 0%, #ffffff 16%, #ffffff 18%, var(--ember-hot) 38%,
        #fff2d8 50%, var(--ember) 68%, #ffe9c4 86%, #d99a4a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 1px 0 rgba(52, 32, 13, 0.6))
            drop-shadow(0 0 9px rgba(255, 220, 160, 0.45))
            drop-shadow(0 3px 8px rgba(0, 0, 0, 0.4));
}
.es-sub {
    font-family: var(--serif);
    font-style: italic;
    font-size: 13.5px;
    color: #b9a486;
}
.earth-section-scroll {
    max-height: 74vh;
    overflow-y: auto;
    padding: 26px 26px 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(226, 163, 92, 0.35) transparent;
}
.earth-section-scroll::-webkit-scrollbar { width: 8px; }
.earth-section-scroll::-webkit-scrollbar-thumb {
    background: rgba(226, 163, 92, 0.3);
    border-radius: 8px;
}
.earth-section-scroll::-webkit-scrollbar-track { background: transparent; }
.apothecary { border-color: rgba(151, 168, 120, 0.35); }
.apothecary .earth-section-head { border-bottom-color: rgba(151, 168, 120, 0.28); }
.apothecary .es-title {
    background: linear-gradient(108deg,
        #f4fae8 0%, #ffffff 16%, #ffffff 18%, #cfe0ab 38%,
        #f0f7e0 50%, #b5c793 68%, #e4efcc 86%, #93a870 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 1px 0 rgba(38, 46, 24, 0.6))
            drop-shadow(0 0 9px rgba(210, 230, 170, 0.45))
            drop-shadow(0 3px 8px rgba(0, 0, 0, 0.4));
}

.wheel-crown { text-align: center; max-width: 520px; margin: 0 auto; }
.wheel-crown #crystalWheel {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 12px 40px rgba(0, 0, 0, 0.55));
}
#crystalCarrying { margin-top: 2px; font-size: 12.5px; }

/* the breath dock: a small circle that breathes beside you all the way down */
#breathDock {
    position: fixed;
    right: 26px;
    top: 46%;
    z-index: 45;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}
.bd-circle {
    display: block;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: radial-gradient(circle at 34% 30%, #f6c98a, #c07f3c 70%);
    box-shadow: 0 0 26px rgba(226, 163, 92, 0.4);
    animation: breath-cycle 14s ease-in-out infinite;
}
/* four in, four held, six out — the same rhythm as the full practice */
@keyframes breath-cycle {
    0%      { transform: scale(1); }
    28.5%   { transform: scale(1.55); }
    57%     { transform: scale(1.55); }
    100%    { transform: scale(1); }
}
.bd-label {
    font-family: var(--serif);
    font-style: italic;
    font-size: 11.5px;
    line-height: 1.3;
    color: #cbb391;
    text-align: center;
    opacity: 0.85;
}
#breathDock:hover .bd-label { color: var(--parchment); }
@media (max-width: 760px) { #breathDock { display: none; } }

/* mindfulness first, before everything */

/* the herb garden */
.shelf-garden h3 { color: #a8c08a; border-bottom-color: rgba(151, 168, 120, 0.6); }
.herb-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
.herb-card {
    background: linear-gradient(160deg, #e7ecd8, #d5e0c0);
    border-top: 3px solid #7d8b5e;
    border-radius: 4px 10px 5px 9px;
    padding: 14px 16px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.35);
}
.herb-leaf { color: #5c7040; font-size: 15px; }
.herb-name {
    display: block;
    font-family: var(--serif);
    font-weight: 580;
    font-size: 16px;
    color: #3c4a26;
    margin: 2px 0 4px;
}
.herb-use { display: block; font-size: 12.5px; color: #5a6244; line-height: 1.5; }
.herb-care { font-size: 12px; color: #b9a486; margin-top: 12px; max-width: 56ch; }

/* drawn portraits of stones and plants */
.portrait-canvas {
    display: block;
    margin: 14px auto 4px;
    width: min(300px, 100%);
    height: auto;
    background: linear-gradient(160deg, rgba(255, 253, 246, 0.65), rgba(240, 230, 208, 0.75));
    border-radius: 10px;
    box-shadow: inset 0 0 24px rgba(120, 95, 55, 0.18), 0 3px 12px rgba(0, 0, 0, 0.18);
}
.portrait-note {
    text-align: center;
    font-family: var(--serif);
    font-style: italic;
    font-size: 11.5px;
    color: var(--ink-soft);
    opacity: 0.8;
    margin-bottom: 14px;
}

/* the herb wheel */
.herb-wheel-wrap { max-width: 540px; margin: 20px auto 6px; text-align: center; }
#herbWheel {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.45));
}
.herb-seg { cursor: pointer; transition: filter 0.2s; }
.herb-seg:hover { filter: brightness(1.2); }
#herbCaption { margin-top: 12px; min-height: 1.4em; }

/* sound */
.shelf-sound h3 { color: #d9b98a; border-bottom-color: rgba(217, 185, 138, 0.5); }
.tone-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tone-btn {
    font-family: var(--sans);
    text-align: left;
    background: rgba(243, 234, 214, 0.06);
    border: 1px solid rgba(226, 163, 92, 0.3);
    border-radius: 10px;
    padding: 14px 16px;
    cursor: pointer;
    color: var(--parchment);
    transition: background 0.25s, border-color 0.25s;
}
.tone-btn:hover { border-color: rgba(226, 163, 92, 0.6); }
.tone-btn.playing {
    background: rgba(226, 163, 92, 0.18);
    border-color: var(--ember);
    animation: tone-pulse 3s ease-in-out infinite;
}
@keyframes tone-pulse { 50% { box-shadow: 0 0 24px rgba(226, 163, 92, 0.35); } }
.tone-name { font-family: var(--serif); font-weight: 560; font-size: 16px; display: inline-block; }
.tone-hz { font-size: 11px; color: #b9a486; margin-left: 8px; }
.tone-note { display: block; font-size: 12px; color: #b9a486; margin-top: 3px; }
.tone-btn.playing .tone-note::after { content: ' — playing, touch to stop'; color: var(--ember-hot); }

/* the oldest tools */
.basics-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.basic-card {
    border: 1px dashed rgba(226, 163, 92, 0.35);
    border-radius: 10px;
    padding: 14px 16px;
}
.basic-card strong { display: block; font-family: var(--serif); font-size: 15.5px; color: var(--ember-hot); margin-bottom: 3px; }
.basic-card span { font-size: 12.5px; color: #cbb391; line-height: 1.5; }

/* the three signs, resting under the wheel */
.natal-wrap .sign-cards { margin: 0 0 16px; }

/* the nightly horoscope, right under the wheel */
.horoscope-panel { margin-top: 26px; text-align: left; }
.horoscope-text {
    font-family: var(--serif);
    font-weight: 360;
    font-size: 16.5px;
    line-height: 1.6;
    color: var(--skytext);
    margin: 8px 0 10px;
}
.horoscope-ritual {
    font-size: 13.5px;
    color: var(--starlight);
    border-left: 2px solid rgba(255, 210, 125, 0.45);
    padding-left: 12px;
    margin-bottom: 10px;
}

/* the sky journal, tucked under the natal wheel on the chart page */
.natal-wrap .sky-journal { margin: 26px 0 0; max-width: none; text-align: left; }
.natal-wrap .sky-journal-grid { grid-template-columns: 1fr; gap: 14px; }

/* stones for your sign, on the chart page */
.stones-panel { margin-bottom: 18px; }
#signStones { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.stone-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(10, 13, 32, 0.45);
    border: 1px solid var(--glass-line);
    border-radius: 10px;
    padding: 9px 14px;
    cursor: pointer;
    font-family: var(--sans);
    color: var(--skytext);
    text-align: left;
    transition: border-color 0.2s, transform 0.2s;
}
.stone-chip:hover { border-color: rgba(255, 210, 125, 0.45); transform: translateX(3px); }
.stone-chip .crystal-gem { width: 22px; height: 22px; margin-bottom: 0; flex-shrink: 0; }
.stone-chip-name { font-weight: 700; font-size: 13.5px; }
.stone-chip-quality { font-family: var(--serif); font-style: italic; font-size: 12px; color: var(--skymute); margin-left: auto; }

#crystalWheel {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 34px rgba(0, 0, 0, 0.5));
}
.crystal-seg {
    cursor: pointer;
    transition: opacity 0.2s, filter 0.2s;
}
.crystal-seg:hover {
    filter: brightness(1.25) saturate(1.15);
}
#crystalCaption { margin-top: 14px; min-height: 1.4em; }
.crystal-gem {
    display: block;
    width: 34px; height: 34px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--gem) 55%, white), var(--gem) 55%, color-mix(in srgb, var(--gem) 60%, black));
    clip-path: polygon(50% 0, 92% 28%, 80% 90%, 20% 90%, 8% 28%);
    box-shadow: 0 4px 16px color-mix(in srgb, var(--gem) 50%, transparent);
}

.hearth-footnote {
    font-size: 13px;
    color: #b9a486;
    border-top: 1px solid rgba(226, 163, 92, 0.2);
    padding-top: 20px;
    max-width: 56ch;
}

/* ───────── profile ───────── */
/* who this sky belongs to — name, birth line, and the dressing controls,
   held above the wheel so choices are seen changing it live */
.profile-head {
    position: relative;
    max-width: 700px;
    margin: 0 auto 30px;
    text-align: center;
}
.profile-head .scene-title {
    font-size: clamp(26px, 3vw, 34px);
    /* the name wears the sign's accent — a crystal cut in their own colour */
    background: linear-gradient(108deg,
        #ffffff 0%, #ffffff 12%,
        color-mix(in srgb, var(--sign-accent, var(--starlight)) 35%, #ffffff) 24%,
        color-mix(in srgb, var(--sign-accent, var(--starlight)) 70%, var(--starlight)) 40%,
        #ffffff 49%, #ffffff 50.5%,
        color-mix(in srgb, var(--sign-accent, var(--starlight)) 55%, var(--starlight-hot)) 64%,
        color-mix(in srgb, var(--sign-accent, var(--starlight)) 80%, #ffffff) 82%,
        color-mix(in srgb, var(--sign-accent, var(--starlight)) 45%, #ffffff) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 1px 0 rgba(40, 40, 60, 0.6))
            drop-shadow(0 0 10px color-mix(in srgb, var(--sign-accent, var(--starlight)) 45%, transparent))
            drop-shadow(0 0 24px color-mix(in srgb, var(--sign-accent, var(--starlight)) 35%, transparent))
            drop-shadow(0 6px 16px rgba(0, 0, 0, 0.4));
}
.profile-head .sign-ornament { margin-left: auto; margin-right: auto; }
.profile-head .chart-prefs { justify-content: center; }
.profile-head .chart-epigraph { width: min(440px, 92%); margin-left: auto; margin-right: auto; text-align: center; }
.profile-head #signWatermark { top: -34px; right: 6px; }

.profile-grid {
    display: grid;
    grid-template-columns: minmax(300px, 460px) minmax(320px, 520px);
    gap: 50px;
    justify-content: center;
    align-items: start;
    padding-top: 2vh;
}
.natal-wrap { text-align: center; }
#natalWheel { width: 100%; max-width: 440px; }
#natalWheel .wheel-ring { fill: none; stroke: var(--glass-line); }
#natalWheel .wheel-spoke { stroke: rgba(156, 200, 232, 0.1); }
#natalWheel .wheel-glyph { fill: #c9d6ec; font-size: 21px; font-weight: 700; font-family: var(--sans); paint-order: stroke; stroke: rgba(10, 13, 32, 0.55); stroke-width: 2px; }
#natalWheel .wheel-glyph.lit { fill: var(--starlight); font-size: 26px; filter: drop-shadow(0 0 6px rgba(255, 210, 125, 0.6)); }
#natalWheel .wheel-planet { filter: drop-shadow(0 0 8px rgba(255, 210, 125, 0.8)); }
#natalWheel .wheel-line { stroke: rgba(255, 210, 125, 0.35); stroke-dasharray: 3 4; }
#natalWheel .wheel-soul { fill: var(--skyblue); font-size: 11px; filter: drop-shadow(0 0 5px rgba(156, 200, 232, 0.8)); }
#natalWheel .wheel-soul-name { fill: var(--skymute); font-size: 8px; font-family: var(--sans); }

/* the wheel is touchable: signs, friends, and the Earth itself */
#natalWheel .wheel-sign-hit { fill: transparent; cursor: pointer; transition: fill 0.2s; }
#natalWheel .wheel-sign-hit:hover { fill: rgba(255, 210, 125, 0.08); }
#natalWheel .wheel-soul-hit { cursor: pointer; }
#natalWheel .wheel-soul-hit:hover .wheel-soul { filter: drop-shadow(0 0 9px rgba(200, 226, 255, 1)); }
#natalWheel .wheel-soul-hit:hover .wheel-soul-name { fill: var(--skytext); }
#natalWheel #natalEarthBtn { cursor: pointer; }
#natalWheel #natalEarthBtn:hover { filter: brightness(1.2) drop-shadow(0 0 14px rgba(120, 180, 240, 0.6)); }

.profile-side { position: relative; }
/* the page dresses in the person's sign */
#signWatermark {
    position: absolute;
    top: -50px; right: -10px;
    font-size: 190px;
    line-height: 1;
    color: var(--sign-accent, var(--starlight));
    opacity: 0.07;
    pointer-events: none;
    user-select: none;
}
.sign-ornament {
    display: block;
    width: 210px;
    height: 26px;
    margin: 8px 0 2px;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    opacity: 0.85;
}
.natal-wrap .sign-ornament, .sheet-inner .sign-ornament { margin-left: auto; margin-right: auto; }
.sheet-inner .sign-ornament { margin-top: 4px; }
#scene-profile .panel-glass {
    border-color: color-mix(in srgb, var(--sign-accent, var(--starlight)) 22%, transparent);
}
#natalWheel .wheel-glyph.lit { fill: var(--sign-accent, var(--starlight)); }
#natalWheel .wheel-planet { filter: drop-shadow(0 0 8px color-mix(in srgb, var(--sign-accent, var(--starlight)) 80%, transparent)); }
#scene-profile .horoscope-ritual {
    color: var(--sign-accent, var(--starlight));
    border-left-color: color-mix(in srgb, var(--sign-accent, var(--starlight)) 45%, transparent);
}

.sign-cards { display: flex; gap: 12px; margin: 20px 0 26px; flex-wrap: wrap; }
.sign-card {
    flex: 1;
    min-width: 110px;
    text-align: center;
    background: var(--glass);
    border: 1px solid color-mix(in srgb, var(--sc, #9cc8e8) 35%, transparent);
    border-radius: 12px;
    padding: 14px 10px;
    box-shadow: 0 0 18px color-mix(in srgb, var(--sc, transparent) 12%, transparent);
}
.sign-card .sc-symbol { font-size: 24px; color: var(--sc, var(--starlight)); display: block; }

/* mini sign chips on a person's public profile */
.mini-signs { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 4px; }
.mini-sign {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    min-width: 86px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--sc) 45%, transparent);
    background: color-mix(in srgb, var(--sc) 8%, transparent);
}
.mini-sign .ms-glyph { font-size: 20px; color: var(--sc); }
.mini-sign .ms-role { font-family: var(--serif); font-style: italic; font-size: 11px; color: var(--skymute); }
.mini-sign .ms-name { font-weight: 700; font-size: 13px; color: var(--skytext); }
.sign-card .sc-role { font-family: var(--serif); font-style: italic; font-size: 12px; color: var(--skymute); display: block; margin: 3px 0 1px; }
.sign-card .sc-sign { font-weight: 650; font-size: 14px; }
.bio-panel { margin-bottom: 18px; }
.bio-panel textarea { margin: 8px 0 10px; }
#connectionList { margin-top: 14px; }

/* ───────── compass ───────── */
#compass {
    position: fixed;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    display: flex;
    gap: 4px;
    background: rgba(13, 16, 38, 0.75);
    border: 1px solid var(--glass-line);
    border-radius: 999px;
    padding: 6px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 10px 40px rgba(4, 5, 16, 0.6);
}
#compass button {
    font-family: var(--sans);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--skymute);
    background: none;
    border: none;
    border-radius: 999px;
    padding: 9px 18px;
    cursor: pointer;
    transition: all 0.25s;
}
#compass button:hover { color: var(--skytext); }
#compass button.here { background: rgba(255, 210, 125, 0.14); color: var(--starlight); }
#compass .compass-quiet { font-style: italic; font-family: var(--serif); font-weight: 400; }
body.realm-ground #compass {
    background: rgba(32, 22, 18, 0.85);
    border-color: rgba(226, 163, 92, 0.25);
}
body.realm-ground #compass button.here { background: rgba(226, 163, 92, 0.16); color: var(--ember-hot); }

/* ───────── sheet (paper & glass dialogs) ───────── */
.sheet { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; }
.sheet-backdrop {
    position: absolute; inset: 0;
    background: rgba(5, 6, 16, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.sheet-inner {
    position: relative;
    width: min(660px, 94vw);
    max-height: 88vh;
    overflow-y: auto;
    background: var(--parchment);
    color: var(--ink);
    border-radius: 6px 14px 7px 12px;
    padding: 40px 44px 36px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.75);
    animation: sheet-in 0.45s var(--ease-drift);
}
@keyframes sheet-in {
    from { opacity: 0; transform: translateY(26px) rotate(0.5deg); }
    to   { opacity: 1; transform: translateY(0) rotate(0); }
}
.sheet-inner h2 {
    font-family: var(--serif);
    font-weight: 520;
    font-size: 28px;
    color: #4a3517;
    margin-bottom: 4px;
}
.sheet-inner h3 { color: #6b4e22; font-size: 18px; margin: 22px 0 4px; }
.sheet-inner p { font-size: 14px; color: var(--ink-soft); }
.sheet-inner .sheet-intro { font-family: var(--serif); font-style: italic; font-size: 15px; margin-bottom: 22px; }
.sheet-inner .btn.primary {
    background: linear-gradient(135deg, #f0c98a, var(--ember) 60%, #c07f3c);
    color: #2b1c0c;
    box-shadow: 0 3px 14px rgba(192, 127, 60, 0.4);
}
.sheet-inner .btn.quiet { color: var(--ink-soft); border-color: rgba(107, 92, 70, 0.35); }
.sheet-inner .btn.quiet:hover { color: var(--ink); border-color: var(--ink-soft); }
.sheet-close {
    position: sticky;
    top: 0;
    float: right;
    margin: -22px -22px 0 0;
    width: 34px; height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(55, 44, 31, 0.08);
    color: var(--ink-soft);
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 2;
}
.sheet-close:hover { background: rgba(55, 44, 31, 0.18); }

/* glass variant — for halls and people, which live in the sky */
.sheet-inner.glass {
    background: linear-gradient(160deg, rgba(30, 36, 74, 0.96), rgba(13, 16, 38, 0.97));
    color: var(--skytext);
    border: 1px solid var(--glass-line);
    border-radius: 18px;
}
.sheet-inner.glass h2 { color: var(--starlight-hot); }
.sheet-inner.glass h3 { color: var(--skyblue); }
.sheet-inner.glass p { color: var(--skymute); }
.sheet-inner.glass .sheet-close { background: rgba(232, 236, 249, 0.08); color: var(--skymute); }
.sheet-inner.glass .btn.primary {
    background: linear-gradient(135deg, var(--starlight-hot), var(--starlight) 55%, #e8a84c);
    color: #3a2c10;
}
.sheet-inner.glass .btn.quiet { color: var(--skymute); border-color: var(--glass-line); }

/* worksheet fields on paper */
.ws-field { margin: 20px 0; }
.ws-label {
    display: block;
    font-weight: 650;
    font-size: 13.5px;
    color: #4a3517;
    margin-bottom: 7px;
}
.ws-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(107, 92, 70, 0.3);
    border-radius: 4px;
    color: var(--ink);
    font-size: 14px;
    padding: 10px 12px;
    color-scheme: light;
}
.ws-input:focus { border-color: var(--ember); }
.ws-input::placeholder { color: rgba(107, 92, 70, 0.5); }
.ws-ref {
    background: rgba(226, 163, 92, 0.12);
    border-left: 3px solid var(--ember);
    border-radius: 0 6px 6px 0;
    padding: 14px 16px 14px 32px;
    margin: 18px 0;
}
.ws-ref li { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 6px; }
.sheet-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid rgba(107, 92, 70, 0.25);
}
.sheet-saved-note { font-size: 12px; color: var(--ink-soft); opacity: 0.75; margin-top: 12px; }
.journal-note-intro {
    font-family: var(--serif);
    font-style: italic;
    background: rgba(151, 168, 120, 0.16);
    border-left: 3px solid var(--moss);
    border-radius: 0 6px 6px 0;
    padding: 12px 16px;
    margin-bottom: 20px;
}

/* mandala */
#mandalaCanvas {
    display: block;
    margin: 16px auto;
    border-radius: 50%;
    background: #fffdf6;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25), 0 0 0 6px rgba(226, 163, 92, 0.25);
    cursor: crosshair;
    touch-action: none;
    max-width: 100%;
}
.mandala-swatches { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 14px 0; }
.mandala-swatch {
    width: 30px; height: 30px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s;
}
.mandala-swatch:hover { transform: scale(1.15); }
.mandala-swatch.active { border-color: var(--ink); transform: scale(1.15); }

/* ───────── presence gate ───────── */
.gate {
    position: fixed; inset: 0; z-index: 100;
    display: grid; place-items: center;
    background: radial-gradient(ellipse at 50% 100%, #33241b 0%, var(--loam) 55%, var(--loam-deep) 100%);
    animation: scene-in 0.8s var(--ease-drift);
    padding: 24px;
    overflow-y: auto;
}
.gate-inner { max-width: 480px; text-align: center; color: var(--parchment); }
.gate-inner h2 {
    font-family: var(--serif);
    font-weight: 460;
    font-size: 32px;
    color: var(--ember-hot);
    margin: 18px 0 10px;
}
.gate-inner > div > p { color: #cbb391; font-size: 15px; }
#gateActivities { display: grid; gap: 10px; margin-top: 26px; }
.gate-activity {
    font-family: var(--sans);
    text-align: left;
    background: var(--parchment);
    color: var(--ink);
    border: none;
    border-radius: 4px 10px 5px 9px;
    padding: 14px 18px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 650;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s var(--ease-drift);
}
.gate-activity:hover { transform: translateY(-2px); }
.gate-activity small { display: block; font-weight: 400; font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.gate-activity-name { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--ember-hot); margin: 8px 0; }

/* ───────── the nightline (connect sequence) ───────── */
#connectOverlay {
    position: fixed; inset: 0; z-index: 120;
    background: #05040d;
    display: grid; place-items: center;
    cursor: pointer;
}
.crt {
    position: relative;
    width: min(640px, 92vw);
    padding: 40px 44px 56px;
    font-family: 'VT323', monospace;
    font-size: clamp(19px, 2.6vw, 25px);
    color: var(--starlight);
    text-shadow: 0 0 6px rgba(255, 210, 125, 0.55);
    border: 1px solid rgba(255, 210, 125, 0.22);
    border-radius: 8px;
    background: rgba(16, 12, 6, 0.5);
    overflow: hidden;
}
.crt::after {  /* scanlines — the glass of an old monitor */
    content: '';
    position: absolute; inset: 0;
    background: repeating-linear-gradient(to bottom,
        rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 2px, rgba(0, 0, 0, 0.16) 3px);
    pointer-events: none;
}
.crt-line {
    margin: 4px 0;
    white-space: pre-wrap;
    animation: crt-type 0.18s steps(2) both;
    overflow-wrap: anywhere;
}
.crt-line:last-child::after {
    content: '▌';
    animation: crt-blink 0.9s steps(1) infinite;
    margin-left: 4px;
}
@keyframes crt-type  { from { opacity: 0; } to { opacity: 1; } }
@keyframes crt-blink { 50% { opacity: 0; } }
.crt-skip {
    position: absolute;
    bottom: 14px; right: 20px;
    font-size: 15px;
    opacity: 0.45;
}

/* ───────── star flight ───────── */
#flightCanvas {
    position: fixed; inset: 0;
    width: 100vw; height: 100vh;
    z-index: 110;
    display: none;
    cursor: pointer;
    background: rgba(5, 4, 13, 0.28);
}
#flightCanvas.on { display: block; }

/* ───────── online line & guestbook ───────── */
.online-line {
    margin-top: 10px;
    font-size: 13px;
    color: var(--skymute);
}
.online-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #79d98c;
    box-shadow: 0 0 8px rgba(121, 217, 140, 0.9);
    margin-right: 7px;
    animation: online-pulse 2.6s ease-in-out infinite;
}
@keyframes online-pulse { 50% { opacity: 0.5; } }

/* ── the resonance circle: the doorway to your band's room ── */
/* the centre of the orbit is you, and it says so */
.orbit-centre { position: relative; }
.centre-label {
    position: absolute;
    top: 102%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-family: var(--serif);
    font-style: italic;
    font-size: 12.5px;
    color: var(--starlight);
    text-shadow: 0 0 12px rgba(255, 210, 125, 0.45);
    pointer-events: none;
}

.circle-btn {
    display: block;
    margin: 16px auto 0;
    padding: 9px 20px;
    font-family: var(--serif);
    font-size: 14.5px;
    color: var(--skytext);
    background: linear-gradient(120deg, rgba(255, 210, 125, 0.12), rgba(156, 200, 232, 0.1));
    border: 1px solid rgba(255, 210, 125, 0.35);
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.25s var(--ease-drift), border-color 0.25s, box-shadow 0.25s;
}
.circle-btn strong { color: var(--starlight-hot); font-weight: 560; }
.circle-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 210, 125, 0.65);
    box-shadow: 0 6px 22px rgba(255, 210, 125, 0.14);
}
.circle-members {
    font-family: var(--serif);
    font-style: italic;
    font-size: 14px;
    color: var(--skymute);
    margin: 4px 0 14px;
}
.circle-member {
    display: inline-block;
    margin: 0 10px 4px 0;
    color: var(--m-accent, var(--skyblue));
    font-style: normal;
    text-shadow: 0 0 10px color-mix(in srgb, var(--m-accent, var(--skyblue)) 60%, transparent);
}

/* ── the nebula: violet, where the sky journal is indigo ── */
.nebula {
    max-width: 720px;
    margin: 34px auto 0;
    padding: 22px 26px;
    border-radius: 16px;
    background: linear-gradient(155deg, rgba(88, 61, 158, 0.3), rgba(46, 28, 92, 0.34) 55%, rgba(30, 18, 64, 0.4));
    border: 1px solid rgba(195, 168, 224, 0.28);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.nebula > h3 { color: #cdb2ef; }
.nebula .whisper { color: #a793c9; }

.nebula-compose { margin: 18px 0 8px; }
.nebula-chip { border-color: rgba(195, 168, 224, 0.3); color: #b4a1d6; }
.nebula-chip:hover { color: #e8ddf7; border-color: rgba(195, 168, 224, 0.6); }
.nebula-chip.active {
    background: var(--kind-color);
    border-color: var(--kind-color);
    color: #241535;
    box-shadow: 0 0 16px color-mix(in srgb, var(--kind-color) 45%, transparent);
}
.nebula-compose input[type="text"], .nebula-compose textarea {
    margin-top: 10px;
    background: rgba(20, 12, 40, 0.55);
    border-color: rgba(195, 168, 224, 0.25);
}
.nebula-compose input:focus, .nebula-compose textarea:focus { border-color: rgba(205, 178, 239, 0.6); }
.nebula-photo-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.nebula-photo-btn { color: #b4a1d6; border-color: rgba(195, 168, 224, 0.35); cursor: pointer; }
.nebula-actions { margin-top: 12px; }
.nebula .btn.primary {
    background: linear-gradient(135deg, #e8ddf7, #c3a8e0 55%, #9a79c4);
    color: #2b1a42;
    box-shadow: 0 4px 22px rgba(195, 168, 224, 0.3);
}

/* browse tabs: one section per kind of gift */
.nebula-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 18px;
    margin-top: 22px;
    padding-top: 14px;
    border-top: 1px solid rgba(195, 168, 224, 0.18);
}
.nebula-filter-tab {
    --kind-color: #cdb2ef;
    font-family: var(--sans);
    font-size: 12.5px;
    font-weight: 650;
    color: #a793c9;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 6px 2px 8px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}
.nebula-filter-tab:hover { color: #e8ddf7; }
.nebula-filter-tab.active { color: var(--kind-color); border-bottom-color: var(--kind-color); }
.nf-count {
    font-weight: 400;
    font-size: 10.5px;
    margin-left: 5px;
    opacity: 0.75;
}
.nebula-empty {
    font-family: var(--serif);
    font-style: italic;
    font-size: 14.5px;
    color: #a793c9;
    padding: 26px 4px;
}

#nebulaFeed {
    column-count: 2;
    column-gap: 16px;
    margin-top: 18px;
}
.nebula-card {
    break-inside: avoid;
    margin-bottom: 16px;
    padding: 16px 18px;
    border-radius: 12px;
    background: rgba(24, 14, 48, 0.55);
    border: 1px solid rgba(195, 168, 224, 0.18);
}
.nebula-tag {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--kind-color);
    border: 1px solid color-mix(in srgb, var(--kind-color) 55%, transparent);
    border-radius: 999px;
    padding: 2px 10px;
    margin-bottom: 10px;
}
.nebula-img {
    display: block;
    width: 100%;
    border-radius: 8px;
    margin-bottom: 10px;
}
.nebula-title {
    font-family: var(--serif);
    font-weight: 560;
    font-size: 16.5px;
    color: #e8ddf7;
    margin-bottom: 6px;
}
.nebula-text {
    white-space: pre-wrap;
    font-size: 13.5px;
    color: #cfc2e6;
    line-height: 1.6;
}
.kind-poem .nebula-text {
    font-family: var(--serif);
    font-style: italic;
    font-size: 15px;
}
.nebula-quote {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 360;
    font-size: 17.5px;
    line-height: 1.5;
    color: #e8ddf7;
    white-space: pre-wrap;
}
.nebula-source { font-size: 12.5px; color: #a793c9; margin-top: 6px; }
.nebula-by {
    font-family: var(--serif);
    font-style: italic;
    font-size: 11.5px;
    color: #8d7ab0;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed rgba(195, 168, 224, 0.18);
}
.nebula-foot { margin-top: 6px; font-size: 12px; }
#nebulaBody[hidden] { display: none; }
.nebula-toggle {
    display: block;
    margin: 12px auto 2px;
    padding: 8px 20px;
    font-family: var(--serif);
    font-style: italic;
    font-size: 14px;
    color: #cdb2ef;
    background: transparent;
    border: 1px solid rgba(195, 168, 224, 0.35);
    border-radius: 999px;
    cursor: pointer;
    transition: border-color 0.25s, background 0.25s;
}
.nebula-toggle:hover { border-color: rgba(195, 168, 224, 0.65); background: rgba(195, 168, 224, 0.08); }

/* hearing what the orbit hears: preview + open-in-your-player */
.resonance-controls { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.resonance-play, .resonance-open {
    width: 28px; height: 28px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px;
    color: var(--skymute);
    background: transparent;
    border: 1px solid var(--glass-line);
    border-radius: 50%;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.resonance-play:hover, .resonance-open:hover { color: var(--skytext); border-color: rgba(156, 200, 232, 0.55); }
.resonance-play.playing {
    color: var(--starlight-hot);
    border-color: rgba(255, 210, 125, 0.65);
    box-shadow: 0 0 14px rgba(255, 210, 125, 0.3);
}

/* ── the frequency library: every Hz, twenty seconds at a touch ── */
.freq-library { margin-top: 22px; }
.freq-title {
    font-family: var(--serif);
    font-size: 18px;
    color: var(--ember-hot);
    margin-bottom: 4px;
}
.freq-group {
    font-family: var(--serif);
    font-variant-caps: small-caps;
    letter-spacing: 0.06em;
    font-size: 14.5px;
    color: var(--ember);
    margin: 16px 0 6px;
}
.freq-group-note { font-variant-caps: normal; font-style: italic; font-size: 12.5px; letter-spacing: 0; color: #b9a486; }
.freq-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 4px;
    border-bottom: 1px dashed rgba(226, 163, 92, 0.18);
}
.freq-row:last-child { border-bottom: none; }
.freq-play {
    width: 30px; height: 30px;
    flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px;
    color: #b9a486;
    background: transparent;
    border: 1px solid rgba(226, 163, 92, 0.35);
    border-radius: 50%;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.freq-play:hover { color: var(--ember-hot); border-color: rgba(226, 163, 92, 0.65); }
.freq-play.playing {
    color: var(--ember-hot);
    border-color: var(--ember-hot);
    box-shadow: 0 0 14px rgba(246, 201, 138, 0.35);
}
.freq-hz {
    font-family: var(--sans);
    font-variant-numeric: tabular-nums;
    font-size: 13px;
    font-weight: 600;
    color: var(--ember-hot);
    width: 64px;
    flex-shrink: 0;
}
.freq-name { font-family: var(--serif); font-size: 15px; color: #e8dcc8; flex-shrink: 0; }
.freq-about { font-size: 12.5px; color: #b9a486; min-width: 0; }
@media (max-width: 700px) { .freq-about { display: none; } }

/* on the chart, the same rows wear the sky's glass */
.tones-sign-panel { margin-top: 18px; }
.tones-sign-panel .freq-row { border-bottom-color: rgba(156, 200, 232, 0.14); }
.tones-sign-panel .freq-play { color: var(--skymute); border-color: var(--glass-line); }
.tones-sign-panel .freq-play:hover,
.tones-sign-panel .freq-play.playing { color: var(--starlight-hot); border-color: rgba(255, 210, 125, 0.65); }
.tones-sign-panel .freq-hz { color: var(--skyblue); }
.tones-sign-panel .freq-name { color: var(--skytext); }
.tones-sign-panel .freq-about { color: var(--skymute); }

/* the bridge: one of the keeper's prints drifting through, pointing to Earth */
.nebula-bridge {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 620px;
    margin: 26px auto 4px;
    padding: 12px 18px;
    text-align: left;
    background: linear-gradient(120deg, rgba(64, 46, 88, 0.4), rgba(38, 30, 62, 0.5));
    border: 1px solid rgba(190, 160, 230, 0.28);
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.25s var(--ease-drift), border-color 0.25s, box-shadow 0.25s;
}
.nebula-bridge:hover {
    transform: translateY(-2px);
    border-color: rgba(226, 163, 92, 0.5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.nebula-bridge img {
    width: 62px;
    height: 62px;
    object-fit: cover;
    border: 3px solid #f3ead6;
    border-radius: 3px;
    transform: rotate(-2.5deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
    flex-shrink: 0;
}
.nebula-bridge .nb-text {
    font-family: var(--serif);
    font-size: 14px;
    color: var(--skymute);
    flex: 1;
}
.nebula-bridge .nb-text em { color: #cdb4e8; font-style: italic; }
.nebula-bridge .nb-go {
    font-family: var(--serif);
    font-style: italic;
    font-size: 13.5px;
    color: var(--ember-hot);
    white-space: nowrap;
}
@media (max-width: 640px) { #nebulaFeed { column-count: 1; } }

/* ── the comet trail: the orbit's left wing, mirroring the music ── */
.orbit-rail .comet-strip {
    margin-top: 0;
    padding: 4px 18px 4px 0;
    border-right: 1px solid var(--glass-line);
    border-left: none;
    border-top: none;
    background: none;
    outline: none;
    border-radius: 0;
    border-bottom: none;
}
.orbit-rail .comet-strip h3 { font-size: 15px; margin-bottom: 0; }
.orbit-rail .guestbook-head { margin-bottom: 8px; }
.orbit-rail .guestbook-counter { font-size: 13px; }
.comet-sign { display: flex; gap: 8px; margin-bottom: 8px; }
.comet-sign input { flex: 1; padding: 8px 12px; font-size: 12.5px; }
.comet-sign .btn { flex-shrink: 0; padding: 7px 14px; font-size: 12px; }
.comet-scroll {
    display: flex;
    flex-direction: column;
}
.comet-entries {
    max-height: 240px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 210, 125, 0.3) transparent;
    padding-right: 6px;
}
.comet-entries::-webkit-scrollbar { width: 5px; }
.comet-entries::-webkit-scrollbar-thumb { background: rgba(255, 210, 125, 0.25); border-radius: 6px; }
.orbit-rail .guestbook-entry { padding: 8px 0 7px; font-size: 12.5px; }
.orbit-rail .ge-by { font-size: 11px; }
.orbit-rail .guard-note { font-size: 12px; }

.guestbook {
    max-width: 900px;
    margin: 34px auto 0;
    padding: 22px 26px;
    border: 1px solid var(--glass-line);
    outline: 1px solid rgba(156, 200, 232, 0.07);
    outline-offset: 4px;             /* the double-border of a 90s homepage */
    border-radius: 4px;
    background: rgba(13, 16, 38, 0.5);
}
.guestbook-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.guestbook-counter {
    font-family: 'VT323', monospace;
    font-size: 17px;
    color: var(--skymute);
}
.guestbook-counter span {
    color: var(--starlight);
    background: rgba(255, 210, 125, 0.08);
    border: 1px solid rgba(255, 210, 125, 0.25);
    padding: 1px 7px;
    letter-spacing: 2px;
}
.guestbook-entry {
    padding: 10px 0 9px;
    border-top: 1px dashed rgba(156, 200, 232, 0.18);
    font-size: 13.5px;
}
.guestbook-entry:first-of-type { margin-top: 14px; }
.ge-text { color: var(--skytext); }
.ge-by { display: block; margin-top: 2px; font-family: var(--serif); font-style: italic; font-size: 12px; color: var(--skymute); }

/* ───────── the gentle guard & hall chat ───────── */
.guard-note {
    font-family: var(--serif);
    font-style: italic;
    font-size: 13.5px;
    color: #ffc9a3;
    min-height: 1.2em;
    margin-top: 10px;
}
.guard-note.care {
    font-style: normal;
    font-family: var(--sans);
    color: var(--skytext);
    background: rgba(121, 217, 140, 0.1);
    border-left: 3px solid #79d98c;
    border-radius: 0 8px 8px 0;
    padding: 12px 14px;
    margin: 12px 0 0;
}

.hall-chat {
    max-height: 300px;
    overflow-y: auto;
    margin: 18px 0 4px;
    padding: 6px 2px;
    border-top: 1px solid var(--glass-line);
    border-bottom: 1px solid var(--glass-line);
}
.hall-msg { padding: 9px 4px; }
.hall-msg .hm-by {
    font-weight: 700;
    font-size: 13px;
    color: var(--starlight);
    margin-right: 8px;
}
.hall-msg.guide .hm-by { color: #79d98c; }
.hall-msg .hm-text { font-size: 14px; color: var(--skytext); overflow-wrap: anywhere; }
.hall-msg.guide .hm-text { font-family: var(--serif); font-style: italic; color: var(--skymute); }
.hall-msg .hm-at { display: block; font-size: 10.5px; color: var(--skymute); opacity: 0.6; margin-top: 2px; }
.hall-compose { display: flex; gap: 10px; align-items: flex-end; margin-top: 12px; }
.hall-compose textarea { flex: 1; }
.hall-compose .btn { flex-shrink: 0; }

/* ───────── the journal: a real book with tabs ───────── */
.journal-body { max-width: 1120px; }

.journal-book {
    display: grid;
    grid-template-columns: 258px 38px minmax(0, 1fr) 112px;
    gap: 0 0;
    margin-top: 28px;
    align-items: start;
}
/* every piece of the book knows its place, so the cover can lie beneath */
.journal-book > .journal-side  { grid-column: 1; grid-row: 1; }
.journal-book > .book-cover    { grid-column: 2 / 4; grid-row: 1; }
.journal-book > .journal-spine { grid-column: 2; grid-row: 1; }
.journal-book > .journal-paper { grid-column: 3; grid-row: 1; }
.journal-book > .journal-tabs  { grid-column: 4; grid-row: 1; }

/* hidden must win — these are grid/flex elements */
.journal-book[hidden], .journal-cover-wrap[hidden] { display: none; }

/* ── the front cover: your book, closed, dressed in your own sky ── */
.journal-cover-wrap {
    display: grid;
    justify-items: center;
    gap: 14px;
    margin-top: 30px;
    perspective: 1400px;
}
.journal-cover {
    position: relative;
    width: min(480px, 92vw);
    aspect-ratio: 5 / 6.4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 40px 34px;
    border: none;
    border-radius: 10px 20px 20px 10px;
    cursor: pointer;
    background:
        repeating-linear-gradient(112deg, rgba(0, 0, 0, 0.05) 0 2px, transparent 2px 5px),
        radial-gradient(ellipse at 30% 18%, rgba(255, 235, 200, 0.14), transparent 55%),
        linear-gradient(155deg, color-mix(in srgb, var(--cover-leather, #4a3522) 80%, #a88d5c) 0%, var(--cover-leather, #4a3522) 45%, color-mix(in srgb, var(--cover-leather, #4a3522) 70%, #0a0604) 100%);
    box-shadow:
        0 22px 54px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 226, 170, 0.16),
        inset 0 -3px 8px rgba(0, 0, 0, 0.45);
    transform-origin: left center;
    transition: transform 0.5s var(--ease-drift), box-shadow 0.5s;
}
/* the bound spine along the left edge */
.journal-cover::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 26px;
    border-radius: 10px 0 0 10px;
    background:
        repeating-linear-gradient(180deg, transparent 0 72px, rgba(20, 12, 6, 0.5) 72px 76px, rgba(255, 226, 170, 0.14) 76px 78px, transparent 78px 82px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.45), transparent 80%);
}
/* the page block peeking out at the fore-edge */
.journal-cover::after {
    content: '';
    position: absolute;
    right: -7px; top: 12px; bottom: 12px;
    width: 7px;
    border-radius: 0 3px 3px 0;
    background: repeating-linear-gradient(180deg, #efe6cf 0 3px, #d9cca9 3px 4px);
}
.journal-cover:hover {
    transform: rotateY(-7deg);
    box-shadow: 14px 24px 60px rgba(0, 0, 0, 0.65),
        inset 0 1px 0 rgba(255, 226, 170, 0.16);
}
.cover-frame {
    position: absolute;
    inset: 20px 22px 20px 40px;
    border: double 4px color-mix(in srgb, var(--cover-foil, #e9c87e) 65%, transparent);
    border-radius: 8px 14px 14px 8px;
    pointer-events: none;
}
.cover-emblem {
    font-size: 74px;
    line-height: 1;
    color: var(--cover-foil, #e9c87e);
    text-shadow:
        0 1px 1px rgba(0, 0, 0, 0.6),
        0 0 18px color-mix(in srgb, var(--cover-foil, #e9c87e) 55%, transparent),
        0 0 40px color-mix(in srgb, var(--cover-foil, #e9c87e) 30%, transparent);
}
.cover-title {
    font-family: var(--serif);
    font-weight: 560;
    font-size: clamp(24px, 3vw, 32px);
    text-align: center;
    max-width: 100%;
    overflow-wrap: break-word;
    color: var(--cover-foil, #e9c87e);
    text-shadow:
        0 1px 1px rgba(0, 0, 0, 0.65),
        0 0 16px color-mix(in srgb, var(--cover-foil, #e9c87e) 45%, transparent);
}
.cover-sub {
    font-family: var(--serif);
    font-style: italic;
    font-size: 14.5px;
    color: color-mix(in srgb, var(--cover-foil, #e9c87e) 75%, transparent);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
}
.cover-star {
    margin-top: 6px;
    font-size: 15px;
    color: color-mix(in srgb, var(--cover-foil, #e9c87e) 70%, transparent);
    text-shadow: 0 0 12px color-mix(in srgb, var(--cover-foil, #e9c87e) 50%, transparent);
}
.cover-hint { opacity: 0.75; }
/* opening: the cover swings back like a real board */
.journal-cover-wrap.opening .journal-cover {
    transform: rotateY(-86deg);
    transition: transform 0.5s ease-in;
}
.journal-cover-wrap.opening .cover-hint { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
    .journal-cover, .journal-cover:hover, .journal-cover-wrap.opening .journal-cover { transform: none; transition: opacity 0.3s; }
    .journal-cover-wrap.opening .journal-cover { opacity: 0; }
}
.js-close { color: #6b4e22; font-family: var(--serif); font-style: italic; }

/* the cover: worn leather wrapping the whole block, stitched at the edge */
.book-cover {
    position: relative;
    align-self: stretch;
    z-index: 0;
    margin: -13px -9px -15px -13px;
    border-radius: 18px 10px 10px 18px;
    background:
        repeating-linear-gradient(112deg, rgba(0, 0, 0, 0.05) 0 2px, transparent 2px 5px),
        radial-gradient(ellipse at 30% 20%, rgba(120, 88, 50, 0.35), transparent 60%),
        linear-gradient(155deg, #503a24, #33241572 40%, transparent),
        linear-gradient(155deg, #4c3722, #33241560, #241812);
    background-color: #33241a;
    box-shadow:
        0 18px 46px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 226, 170, 0.14),
        inset 0 -2px 6px rgba(0, 0, 0, 0.4);
}
.book-cover::after {
    content: '';
    position: absolute;
    inset: 7px;
    border: 1px dashed rgba(226, 190, 130, 0.28);
    border-radius: 13px 7px 7px 13px;
    pointer-events: none;
}

/* the side palette: a sheet clipped to the book — they move as one,
   tops flush (it used to be sticky, which let it drift out of line mid-scroll) */
.journal-side {
    margin-right: 18px;
    background: linear-gradient(165deg, #efe8d4, #e0d5b8);
    border-radius: 8px;
    padding: 16px 14px;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.4);
}
.js-title {
    font-variant-caps: small-caps;
    letter-spacing: 0.08em;
    font-family: var(--serif);
    font-size: 15px;
    color: #3c2d16;
    text-align: center;
    border-bottom: double 3px rgba(107, 92, 70, 0.5);
    padding-bottom: 6px;
    margin-bottom: 10px;
}
.js-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(107, 92, 70, 0.25);
}
.js-group:last-child { border-bottom: none; }
.js-group .jf-label { width: 100%; }
.js-group .style-chip { font-size: 10.5px; padding: 3px 9px; }
.journal-spine {
    align-self: stretch;
    z-index: 1;
    background:
        repeating-radial-gradient(circle at 50% 14px, rgba(220, 205, 175, 0.9) 0 4px, rgba(90, 70, 45, 0.9) 4px 6px, transparent 6px 7px),
        repeating-linear-gradient(180deg, transparent 0 74px, rgba(20, 12, 6, 0.35) 74px 78px, rgba(255, 226, 170, 0.12) 78px 80px, transparent 80px 84px),
        linear-gradient(90deg, #3c2d1c, #6b5638 55%, #3c2d1c);
    background-size: 100% 44px, 100% 100%, 100% 100%;
    border-radius: 12px 0 0 12px;
    box-shadow:
        inset -5px 0 10px rgba(0, 0, 0, 0.5),
        inset 3px 0 6px rgba(0, 0, 0, 0.35);
}
.journal-paper {
    position: relative;
    z-index: 2;
    background:
        linear-gradient(105deg, rgba(120, 95, 55, 0.08), transparent 12%),
        var(--parchment);
    color: var(--ink);
    min-height: 700px;
    padding: 34px 38px 34px 50px;
    border-radius: 0 4px 4px 0;
    /* pages sink toward the binding, curl up at the fore-edge */
    box-shadow:
        inset 26px 0 30px -20px rgba(60, 40, 15, 0.5),
        inset 0 -18px 24px -20px rgba(60, 40, 15, 0.3),
        6px 8px 30px rgba(0, 0, 0, 0.45);
    /* the classic notebook margin rule */
    background-image:
        linear-gradient(to right, transparent 34px, rgba(190, 100, 90, 0.35) 34px, rgba(190, 100, 90, 0.35) 35px, transparent 35px),
        linear-gradient(105deg, rgba(120, 95, 55, 0.08), transparent 12%);
    background-color: var(--parchment);
}
.jp-title {
    font-family: var(--serif);
    font-weight: 540;
    font-size: 26px;
    color: #4a3517;
    margin-bottom: 12px;
}
.jp-margin-title { font-family: var(--serif); font-size: 16px; color: #6b4e22; margin: 22px 0 8px; }
.jp-actions { display: flex; gap: 10px; margin-top: 14px; }
.journal-paper .ws-label { color: #4a3517; }
.journal-paper .ws-input {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(107, 92, 70, 0.35);
    border-radius: 0;
    padding: 6px 2px;
    background-image: repeating-linear-gradient(to bottom, transparent 0 26px, rgba(107, 92, 70, 0.16) 26px 27px);
    line-height: 27px;
}
.journal-paper .ws-input:focus { border-bottom-color: var(--ember); }

/* the tabs, sticking out of the book's right edge */
.journal-tabs {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding-top: 26px;
    z-index: 1;
}
.journal-tab {
    position: relative;
    left: -6px;
    font-family: var(--serif);
    font-weight: 560;
    font-size: 13.5px;
    text-align: left;
    color: #33281a;
    background: linear-gradient(100deg, color-mix(in srgb, var(--jc) 75%, #f3ead6), color-mix(in srgb, var(--jc) 55%, #d8cbae));
    border: none;
    border-radius: 0 9px 9px 0;
    padding: 9px 12px 9px 16px;
    cursor: pointer;
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.3);
    transition: left 0.2s var(--ease-drift), filter 0.2s;
}
.journal-tab:hover { left: 0; filter: brightness(1.06); }
.journal-tab.active {
    left: -10px;
    z-index: 3;
    background: var(--parchment);
    font-weight: 700;
    box-shadow: 4px 3px 12px rgba(0, 0, 0, 0.35);
    border-left: 4px solid var(--jc);
}
.jt-count {
    float: right;
    font-family: var(--sans);
    font-size: 10.5px;
    font-weight: 700;
    background: rgba(55, 44, 31, 0.16);
    border-radius: 999px;
    padding: 1px 7px;
    margin-left: 6px;
}

/* keep the palette clipped beside the book as long as the window allows;
   only fold it above on genuinely narrow screens */
@media (max-width: 1080px) {
    .journal-book { grid-template-columns: 232px 34px minmax(0, 1fr) 100px; }
    .journal-side { margin-right: 12px; }
}
@media (max-width: 900px) {
    .journal-book { grid-template-columns: 34px minmax(0, 1fr) 96px; }
    .journal-book > .journal-side {
        grid-column: 1 / -1;
        grid-row: 1;
        margin: 0 0 18px;
    }
    .journal-book > .book-cover    { grid-column: 1 / 3; grid-row: 2; }
    .journal-book > .journal-spine { grid-column: 1; grid-row: 2; }
    .journal-book > .journal-paper { grid-column: 2; grid-row: 2; }
    .journal-book > .journal-tabs  { grid-column: 3; grid-row: 2; }
}
@media (max-width: 820px) {
    .journal-book { grid-template-columns: 28px minmax(0, 1fr); }
    .journal-book > .journal-tabs {
        grid-column: 1 / -1;
        grid-row: 2;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
        padding: 0 0 10px;
    }
    .journal-book > .book-cover    { grid-column: 1 / 3; grid-row: 3; }
    .journal-book > .journal-spine { grid-column: 1; grid-row: 3; }
    .journal-book > .journal-paper { grid-column: 2; grid-row: 3; }
    .journal-tab, .journal-tab.active, .journal-tab:hover { left: 0; border-radius: 9px; }
}

.jf-label { font-family: var(--serif); font-style: italic; font-size: 12px; color: var(--ink-soft); }
.ink-row { display: flex; gap: 6px; margin-right: 8px; }
.ink-swatch {
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s;
}
.ink-swatch:hover { transform: scale(1.2); }
.ink-swatch.active { border-color: #fff; box-shadow: 0 0 0 1px var(--ink-soft); transform: scale(1.15); }
.sticker-tray { display: flex; gap: 2px; flex-wrap: wrap; }
.tray-sticker {
    font-size: 17px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    transition: transform 0.15s;
}
.tray-sticker:hover { transform: scale(1.35) rotate(8deg); }
.sticker-strip { min-height: 8px; display: flex; gap: 6px; flex-wrap: wrap; padding: 4px 2px 8px; }
.placed-sticker {
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
}
.placed-sticker:hover { filter: grayscale(0.4) drop-shadow(0 2px 3px rgba(0,0,0,0.25)); }
.doodle-canvas {
    display: block;
    width: 100%;
    background:
        repeating-linear-gradient(to bottom, transparent 0 27px, rgba(107, 92, 70, 0.18) 27px 28px),
        rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(107, 92, 70, 0.3);
    border-radius: 6px;
    cursor: crosshair;
    touch-action: none;
}

/* ───────── the dial: your tones, on every page ───────── */
#soundDock {
    position: fixed;
    right: 20px;
    bottom: 24px;
    z-index: 55;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}
.sd-label {
    font-family: var(--serif);
    font-style: italic;
    font-size: 11px;
    color: var(--skymute);
    opacity: 0.85;
}
body.realm-ground .sd-label { color: #b9a486; }
.sd-tone {
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 650;
    color: var(--skymute);
    background: rgba(13, 16, 38, 0.8);
    border: 1px solid var(--glass-line);
    border-radius: 999px;
    padding: 7px 14px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: color 0.2s, border-color 0.2s;
}
.sd-tone:hover { color: var(--skytext); }
.sd-tone.playing {
    color: var(--starlight);
    border-color: rgba(255, 210, 125, 0.6);
    animation: tone-pulse 3s ease-in-out infinite;
}
body.realm-ground .sd-tone { background: rgba(32, 22, 18, 0.85); border-color: rgba(226, 163, 92, 0.3); color: #b9a486; }
body.realm-ground .sd-tone.playing { color: var(--ember-hot); border-color: var(--ember); }

.tone-btn { position: relative; }
.tone-btn.binaural { border-style: dashed; }
.tone-save {
    position: absolute;
    top: 10px; right: 12px;
    background: none;
    border: none;
    font-size: 15px;
    color: rgba(226, 163, 92, 0.35);
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}
.tone-save:hover { transform: scale(1.3); }
.tone-save.on { color: var(--ember-hot); text-shadow: 0 0 8px rgba(226, 163, 92, 0.7); }

@media (max-width: 760px) { #soundDock { bottom: 78px; } }

/* ───────── misc ───────── */
.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
[hidden] { display: none !important; }

/* ───────── responsive ───────── */
@media (max-width: 1259px) {
    .collective-grid { grid-template-columns: minmax(0, 1fr); }
    .orbit-rail { max-width: 420px; margin: 0 auto; width: 100%; }
    .orbit-wrap { order: 1; }
    .rail-right { order: 2; }
    .rail-left { order: 3; }
    .resonating { border-left: none; border-top: 1px solid var(--glass-line); padding: 16px 0 0; }
    .orbit-rail .comet-strip { padding: 16px 0 0; border-right: none; border-top: 1px solid var(--glass-line); }
}
@media (max-width: 1020px) {
    .profile-grid { grid-template-columns: minmax(0, 1fr); }
    .orbit-rail { max-width: 420px; margin: 0 auto; width: 100%; }
    .orbit-wrap { order: 1; }
    .rail-right { order: 2; }
    .rail-left { order: 3; }
    .resonating {
        border-left: none;
        border-top: 1px solid var(--glass-line);
        padding: 16px 0 0;
    }
    .orbit-rail .comet-strip {
        padding: 16px 0 0;
        border-right: none;
        border-top: 1px solid var(--glass-line);
    }
}
@media (max-width: 600px) {
    .scene { padding: 32px 16px 130px; }
    .orbit { width: 340px; height: 340px; }
    .sky-journal-grid { grid-template-columns: 1fr; }
    .sheet-inner { padding: 30px 22px 28px; }
    .field-pair { grid-template-columns: 1fr; }
    #compass {
        max-width: 96vw;
        bottom: 12px;
        padding: 5px;
        gap: 0;
    }
    #compass button { font-size: 12px; padding: 8px 10px; white-space: nowrap; }
    .need-now { top: 12px; right: 12px; font-size: 12.5px; padding: 7px 14px; }
}

/* ───────── reduced motion ───────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001s !important;
    }
    #soulRing, #soulRing .orbit-node { animation: none; }
    .ember-mote { display: none; }
}

/* journal paper themes, line styles and pens */
.journal-paper.paper-moon { background-color: #e6ebf2; }
.journal-paper.paper-kraft { background-color: #d9c6a3; }
.journal-paper.paper-rose { background-color: #f2e0dc; }
.journal-paper.lines-dotted .ws-input {
    background-image: radial-gradient(rgba(107, 92, 70, 0.28) 1px, transparent 1.2px);
    background-size: 14px 27px;
}
.journal-paper.lines-plain .ws-input { background-image: none; }
.journal-paper.pen-hand .ws-input, .kp-body.pen-hand .kp-text {
    font-family: 'Caveat', var(--serif);
    font-size: 21px;
    line-height: 27px;
}
.kp-body.pen-neat .kp-text { font-family: var(--sans); font-size: 14px; }
.style-chip { font-size: 11.5px; padding: 4px 11px; color: var(--ink-soft); border-color: rgba(107, 92, 70, 0.35); }
.style-chip.active { background: var(--ink-soft); border-color: var(--ink-soft); color: #f6f0e2; box-shadow: none; }
.keep-note { font-family: var(--serif); font-style: italic; font-size: 12.5px; color: var(--ink-soft); }

/* kept pages: the journal's own past */
.kept-pages { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.kept-page {
    background: rgba(255, 255, 255, 0.32);
    border: 1px solid rgba(107, 92, 70, 0.28);
    border-radius: 6px;
    padding: 10px 14px;
}
.kept-page summary {
    cursor: pointer;
    display: flex;
    gap: 12px;
    align-items: baseline;
    list-style: none;
}
.kept-page summary::-webkit-details-marker { display: none; }
.kp-date { font-family: var(--serif); font-weight: 600; font-size: 13.5px; color: #4a3517; white-space: nowrap; }
.kp-peek { font-size: 12.5px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kp-body { margin-top: 10px; }
.kp-prompt { font-size: 11.5px; color: var(--ink-soft); margin-top: 10px; }
.kp-text { white-space: pre-wrap; }
.kp-release { font-size: 11.5px; color: #a04b3a; margin-top: 10px; }

/* the skills log picker */
.skill-chip-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 4px 0 14px; }
.skill-chip { font-size: 12px; color: #6b4e22; border-color: rgba(192, 138, 42, 0.45); }
.skill-chip:hover { background: rgba(232, 180, 90, 0.2); color: #4a3517; }

/* real photographs, framed like plates in a field guide */
.portrait-photo { margin: 14px auto 16px; text-align: center; }
.portrait-photo img {
    display: block;
    margin: 0 auto;
    width: min(340px, 100%);
    max-height: 260px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3), 0 0 0 6px rgba(255, 255, 255, 0.5);
}
.portrait-photo figcaption {
    margin-top: 10px;
    font-family: var(--serif);
    font-style: italic;
    font-size: 10.5px;
    color: var(--ink-soft);
    opacity: 0.8;
}

/* the skill's own card, open on the journal page */
.skill-guide {
    background: rgba(232, 180, 90, 0.14);
    border-left: 3px solid #c08a2a;
    border-radius: 0 8px 8px 0;
    padding: 12px 16px;
    margin: 2px 0 16px;
}
.sg-name { font-family: var(--serif); font-weight: 650; font-size: 16px; color: #6b4e22; }
.sg-when { font-family: var(--serif); font-style: italic; font-size: 13px; color: var(--ink-soft); margin: 2px 0 8px; }
.sg-steps { margin-left: 18px; }
.sg-steps li { font-size: 13px; color: var(--ink); margin-bottom: 4px; }
.skill-chip.active { background: #c08a2a; border-color: #c08a2a; color: #fff8ea; }

/* ───────── Lumen: the guide's lamp and window ───────── */
#lumenBtn {
    position: fixed;
    left: 20px;
    bottom: 22px;
    z-index: 56;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
#lumenBtn svg { width: 62px; height: 62px; animation: star-breathe 5s ease-in-out infinite; transform-origin: center; }
#lumenBtn span {
    font-family: var(--serif);
    font-style: italic;
    font-size: 12.5px;
    color: var(--skymute);
    margin-top: -10px;
}
body.realm-ground #lumenBtn span { color: #b9a486; }
#lumenBtn:hover span { color: var(--starlight); }

#lumenPanel {
    position: fixed;
    right: 16px;
    bottom: 16px;
    top: 70px;
    width: min(400px, calc(100vw - 32px));
    z-index: 85;
    display: flex;
    flex-direction: column;
    background: linear-gradient(165deg, rgba(26, 32, 66, 0.97), rgba(12, 15, 36, 0.98));
    border: 1px solid rgba(255, 210, 125, 0.25);
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(4, 5, 16, 0.8);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
body.realm-ground #lumenPanel {
    background: linear-gradient(165deg, rgba(46, 32, 24, 0.97), rgba(24, 16, 12, 0.98));
    border-color: rgba(226, 163, 92, 0.3);
}
.lumen-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 16px 20px 12px;
    border-bottom: 1px solid rgba(255, 210, 125, 0.16);
}
.lumen-title { font-family: var(--serif); font-weight: 560; font-size: 19px; color: var(--starlight-hot); }
.lumen-sub { font-family: var(--serif); font-style: italic; font-size: 12px; color: var(--skymute); flex: 1; }
body.realm-ground .lumen-sub { color: #b9a486; }
.lumen-close { position: static; float: none; margin: 0; background: rgba(232,236,249,0.08); color: var(--skymute); }
.lumen-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
}
.lumen-msg {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--skytext);
    white-space: pre-wrap;
}
body.realm-ground .lumen-msg { color: var(--parchment); }
.from-lumen {
    align-self: flex-start;
    background: rgba(255, 210, 125, 0.1);
    border: 1px solid rgba(255, 210, 125, 0.18);
    border-radius: 14px 14px 14px 4px;
}
.from-you {
    align-self: flex-end;
    background: rgba(156, 200, 232, 0.12);
    border: 1px solid rgba(156, 200, 232, 0.2);
    border-radius: 14px 14px 4px 14px;
}
.lumen-status {
    align-self: center;
    font-family: var(--serif);
    font-style: italic;
    font-size: 11.5px;
    color: var(--skymute);
}
.lumen-thinking { animation: online-pulse 1.6s ease-in-out infinite; }
.lumen-setup { display: flex; flex-direction: column; gap: 8px; }
.lumen-setup input { font-size: 12.5px; }
.lumen-compose {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    padding: 10px 14px;
    border-top: 1px solid rgba(255, 210, 125, 0.16);
}
.lumen-compose textarea { flex: 1; font-size: 13px; }
.lumen-note {
    font-family: var(--serif);
    font-style: italic;
    font-size: 10.5px;
    color: var(--skymute);
    text-align: center;
    padding: 0 14px 10px;
    opacity: 0.8;
}
body.realm-ground .lumen-note { color: #b9a486; }
@media (max-width: 760px) {
    #lumenBtn { bottom: 76px; left: 10px; }
    #lumenBtn svg { width: 50px; height: 50px; }
    #lumenPanel { top: 12px; }
}

/* ───────── the apothecary, dressed as one ───────── */
.apoth-banner {
    position: relative;
    margin-top: 14px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 0 40px rgba(20, 12, 6, 0.5), 0 4px 16px rgba(0, 0, 0, 0.4);
}
.apoth-banner img {
    display: block;
    width: 100%;
    height: 150px;
    object-fit: cover;
    object-position: 50% 78%; /* the drawers and jars, not the signage above */
    filter: sepia(0.2) saturate(0.95) brightness(0.85);
}
.apoth-banner::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(26, 18, 13, 0.55), transparent 55%);
}
.apoth-credit {
    position: absolute;
    right: 10px; bottom: 6px;
    z-index: 1;
    font-family: var(--serif);
    font-style: italic;
    font-size: 9.5px;
    color: rgba(240, 228, 205, 0.75);
}

/* wooden shelving behind the apothecary's goods */
.apothecary .earth-section-scroll {
    background:
        repeating-linear-gradient(to bottom,
            transparent 0 236px,
            rgba(66, 44, 24, 0.5) 236px 244px,
            rgba(30, 20, 10, 0.4) 244px 248px),
        linear-gradient(165deg, rgba(52, 36, 20, 0.35), rgba(34, 24, 13, 0.45));
}

/* herbs kept in labeled jars */
.herb-jar {
    padding: 0;
    overflow: hidden;
    border: none;
    border-radius: 10px 10px 6px 6px;
    cursor: pointer;
    text-align: left;
    font-family: var(--sans);
    background: linear-gradient(160deg, #efe9d8, #ddd2b8);
    transition: transform 0.25s var(--ease-drift), box-shadow 0.25s;
}
.herb-jar:hover { transform: translateY(-4px) rotate(0); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5); }
.jar-glass {
    display: block;
    height: 108px;
    position: relative;
    overflow: hidden;
    background: rgba(210, 220, 218, 0.4);
    border-bottom: 3px solid #8a6f4a; /* the jar's shoulder band */
}
.jar-glass img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.jar-glass::after {
    content: '';
    position: absolute;
    top: 0; left: 8%;
    width: 14%; height: 100%;
    background: linear-gradient(100deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0));
    pointer-events: none;
}
.jar-glass .herb-leaf { display: grid; place-items: center; height: 100%; font-size: 34px; }
.jar-label {
    display: block;
    padding: 10px 12px 12px;
    background:
        radial-gradient(ellipse at 50% -30%, rgba(120, 90, 50, 0.14), transparent 60%),
        #f3ecd8;
    border-top: 1px dashed rgba(107, 92, 70, 0.4);
}
.jar-label .herb-name { margin: 0 0 3px; }
.jar-label .herb-use { font-size: 11.5px; }

/* ───────── the ground realm's forest backdrop ───────── */
#groundBackdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: url('../img/earth-bg.jpg') center / cover no-repeat;
    filter: sepia(1) hue-rotate(55deg) saturate(1.9) brightness(0.44);
    opacity: 0;
    transition: opacity 1.2s var(--ease-drift);
}
body.realm-ground #groundBackdrop { opacity: 0.5; }

/* the vista is a photograph now, with a living canvas over it */

/* study tools carry their photographs */
.tool-photo-card { padding: 0; overflow: hidden; }
.tool-pic { display: block; height: 84px; overflow: hidden; }
.tool-pic img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.95); }
.tool-photo-card .tool-text { display: block; padding: 11px 14px 12px; }
.tool-photo-card:hover .tool-pic img { filter: saturate(1.1) brightness(1.05); }

/* ───────── the journal turns like a real book ───────── */
.journal-book { perspective: 1600px; }
.journal-paper {
    box-shadow:
        6px 8px 30px rgba(0, 0, 0, 0.45),
        10px 2px 0 -4px #e6dabd,
        15px 4px 0 -7px #d9cca9,
        20px 6px 0 -10px #ccbf97; /* the stack of pages behind this one */
}
.journal-paper.turning {
    animation: page-turn 0.55s var(--ease-drift);
    transform-origin: left center;
}
@keyframes page-turn {
    0%   { transform: rotateY(-68deg); opacity: 0.35; box-shadow: 40px 10px 60px rgba(0,0,0,0.5); }
    62%  { transform: rotateY(6deg); opacity: 1; }
    100% { transform: rotateY(0deg); }
}

/* professional plates: the journal's headings set like a printed book */
.jp-title {
    font-variant-caps: small-caps;
    letter-spacing: 0.09em;
    text-align: center;
    font-size: 23px;
    color: #3c2d16;
    border-bottom: double 4px rgba(107, 92, 70, 0.5);
    padding-bottom: 10px;
    margin-bottom: 16px;
}
.jp-margin-title {
    font-variant-caps: small-caps;
    letter-spacing: 0.08em;
    text-align: center;
    color: #5a4527;
}

/* more papers for the journal */
.journal-paper.paper-sage  { background-color: #e3e9d4; }
.journal-paper.paper-lilac { background-color: #e9e2f1; }
.journal-paper.paper-ocean { background-color: #d9e7e4; }
.journal-paper.paper-sand  { background-color: #efe3c6; }

/* more scripts for the hand that writes */
.journal-paper.pen-cursive .ws-input, .kp-body.pen-cursive .kp-text {
    font-family: 'Dancing Script', var(--serif);
    font-size: 21px;
    line-height: 27px;
}
.journal-paper.pen-type .ws-input, .kp-body.pen-type .kp-text {
    font-family: 'Special Elite', monospace;
    font-size: 14.5px;
    line-height: 27px;
}
.journal-paper.pen-print .ws-input, .kp-body.pen-print .kp-text {
    font-family: 'Shadows Into Light', var(--sans);
    font-size: 18px;
    line-height: 27px;
}

/* the nebula speaks from the centre */
.nebula > h3, .nebula > .whisper, .nebula-foot { text-align: center; }
.nebula > .whisper { max-width: 60ch; margin-left: auto; margin-right: auto; }

/* the dock: brighter, and it leans in when you reach for it */
#compass {
    background: linear-gradient(135deg, rgba(255, 214, 140, 0.28), rgba(156, 200, 232, 0.22));
    border-color: rgba(255, 210, 125, 0.55);
    box-shadow: 0 10px 40px rgba(255, 195, 110, 0.25), 0 4px 24px rgba(4, 5, 16, 0.5);
    transition: transform 0.28s var(--ease-drift), box-shadow 0.28s;
}
#compass:hover {
    transform: translateX(-50%) scale(1.09);
    box-shadow: 0 14px 52px rgba(255, 205, 120, 0.4), 0 6px 28px rgba(4, 5, 16, 0.5);
}
#compass button { color: #ffe9c0; }
#compass button:hover { color: #fff8e8; }
#compass button.here { background: rgba(255, 218, 140, 0.35); color: #fff3d6; text-shadow: 0 0 10px rgba(255, 220, 150, 0.8); }
#compass .compass-quiet { color: rgba(255, 233, 192, 0.75); }
body.realm-ground #compass {
    background: linear-gradient(135deg, rgba(246, 201, 138, 0.32), rgba(151, 168, 120, 0.28));
    border-color: rgba(246, 201, 138, 0.6);
    box-shadow: 0 10px 40px rgba(226, 163, 92, 0.3), 0 4px 24px rgba(10, 8, 4, 0.5);
}
body.realm-ground #compass button { color: #ffeccd; }
body.realm-ground #compass button.here { background: rgba(246, 201, 138, 0.4); color: #fff6e2; }

/* the book's own plate: its name and the line it opens with */
.journal-plate {
    max-width: 520px;
    margin: 18px 0 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.journal-plate input {
    background: rgba(24, 30, 16, 0.5);
    border: 1px solid rgba(226, 163, 92, 0.3);
    color: var(--ember-hot);
    font-family: var(--serif);
    text-align: center;
}
#journalTitleField { font-size: 19px; font-weight: 600; letter-spacing: 0.04em; }
#journalMottoField { font-style: italic; font-size: 13.5px; color: #d9c9a8; }
.jp-motto {
    text-align: center;
    font-family: var(--serif);
    font-style: italic;
    font-size: 13.5px;
    color: var(--ink-soft);
    margin: -2px 0 10px;
}

/* washi tape across the page's crown */
.journal-tape {
    position: absolute;
    top: -12px;
    left: 50%;
    width: 190px;
    height: 30px;
    transform: translateX(-50%) rotate(-1.6deg);
    opacity: 0.85;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.tape-stripes { background: repeating-linear-gradient(45deg, #d98a8a 0 10px, #f0dede 10px 20px); }
.tape-dots { background: #9ec3d8 radial-gradient(rgba(255,255,255,0.85) 3px, transparent 3.5px); background-size: 18px 18px; }
.tape-stars { background: #c8b0e0; }
.tape-stars::after { content: '✦ ✦ ✦ ✦ ✦ ✦'; display: block; text-align: center; line-height: 30px; color: rgba(255,255,255,0.8); font-size: 12px; letter-spacing: 6px; }
.tape-plaid { background: #a8c0a0 repeating-linear-gradient(0deg, transparent 0 8px, rgba(90,110,80,0.4) 8px 11px), repeating-linear-gradient(90deg, transparent 0 8px, rgba(90,110,80,0.4) 8px 11px); }

/* the bookmark ribbon hanging over the page's edge */
.journal-ribbon {
    position: absolute;
    top: -4px;
    right: 44px;
    width: 26px;
    height: 130px;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 86%, 0 100%);
    box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.3);
    opacity: 0.92;
    z-index: 2;
}
.journal-paper { position: relative; }
.ribbon-chip {
    width: 18px; height: 24px;
    border: 2px solid transparent;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%);
    cursor: pointer;
    background: rgba(107, 92, 70, 0.2);
    color: var(--ink-soft);
    font-size: 11px;
    line-height: 20px;
}
.ribbon-chip.active { outline: 2px solid var(--ink-soft); outline-offset: 1px; }

/* mood stamp on kept pages */
.kp-band {
    font-family: var(--serif);
    font-style: italic;
    font-size: 11px;
    color: #7a5c30;
    border: 1px solid rgba(122, 92, 48, 0.4);
    border-radius: 999px;
    padding: 1px 9px;
    white-space: nowrap;
}

/* the dock must read over pale paper too */
#compass {
    background:
        linear-gradient(135deg, rgba(255, 214, 140, 0.35), rgba(120, 150, 190, 0.3)),
        rgba(16, 13, 8, 0.82);
    border-color: rgba(255, 210, 125, 0.7);
}
body.realm-ground #compass {
    background:
        linear-gradient(135deg, rgba(246, 201, 138, 0.4), rgba(151, 168, 120, 0.34)),
        rgba(18, 14, 8, 0.85);
    border-color: rgba(246, 201, 138, 0.75);
}
#scene-journal { padding-bottom: 180px; }

/* dressing the chart */
.chart-prefs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 12px 0 8px;
}
.chart-prefs .jf-label { color: var(--skymute); }
.chart-chip, #chartLinesToggle {
    color: var(--skymute);
    border-color: var(--glass-line);
    background: transparent;
}
/* ── the threshold: a kind place to wait ── */
.threshold-center .tagline { max-width: 46ch; margin-left: auto; margin-right: auto; }
.threshold-actions { display: flex; gap: 12px; justify-content: center; margin: 26px 0 14px; flex-wrap: wrap; }

/* ── the keeper's room ── */
.keeper-room { max-width: 1000px; margin: 0 auto; padding-top: 2vh; }
.keeper-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 22px;
}
.keeper-wide { grid-column: 1 / -1; }
@media (max-width: 860px) { .keeper-grid { grid-template-columns: 1fr; } }
.keeper-panel h3 { margin-bottom: 2px; }
.keeper-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 2px;
    border-bottom: 1px solid var(--glass-line);
}
.keeper-row:last-child { border-bottom: none; }
.kr-who strong { font-family: var(--serif); font-size: 16px; }
.kr-meta { display: block; font-size: 12px; color: var(--skymute); margin-top: 2px; }
.kr-crown { font-size: 12px; color: var(--starlight); }
.kr-actions { display: flex; gap: 8px; flex-shrink: 0; }
.keeper-mint { display: flex; gap: 8px; margin: 8px 0 12px; }
.keeper-key {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 2px;
    border-bottom: 1px dashed var(--glass-line);
}
.keeper-key code {
    font-family: var(--mono, 'VT323', monospace);
    font-size: 16px;
    letter-spacing: 0.04em;
    color: var(--starlight-hot);
}

/* ── password strength: light gathering in a bar ── */
.strength-wrap { display: flex; align-items: center; gap: 10px; margin: 8px 0 4px; }
.strength-bar {
    flex: 1;
    height: 5px;
    border-radius: 999px;
    background: rgba(156, 200, 232, 0.12);
    overflow: hidden;
}
.strength-bar span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 999px;
    transition: width 0.35s var(--ease-drift), background 0.35s;
    box-shadow: 0 0 10px rgba(255, 210, 125, 0.35);
}
.strength-label {
    font-family: var(--serif);
    font-style: italic;
    font-size: 12.5px;
    color: var(--skymute);
    min-width: 70px;
}
.policy-checks { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 2px 0 10px; }
.policy-checks .pc { font-size: 12px; color: var(--skymute); }
.policy-checks .pc.ok { color: var(--starlight); }
.forgot-link {
    display: block;
    margin: 12px auto 0;
    font-family: var(--serif);
    font-style: italic;
    font-size: 13.5px;
    color: var(--skymute);
}
.forgot-link:hover { color: var(--skytext); }
.kr-code {
    font-family: 'VT323', monospace;
    font-size: 16px;
    color: var(--starlight-hot);
    letter-spacing: 0.04em;
}

.field-hint {
    font-family: var(--serif);
    font-style: italic;
    font-size: 12.5px;
    color: var(--skymute);
    margin: 4px 0 2px;
}
/* a tone chip glows while its sound is in the air */
.style-chip.playing, .tone-chip.playing {
    background: color-mix(in srgb, var(--ember) 35%, transparent);
    border-color: var(--ember-hot);
    color: #2e2015;
    box-shadow: 0 0 12px rgba(246, 201, 138, 0.35);
}
.chart-chip.active, #chartLinesToggle.active {
    background: color-mix(in srgb, var(--sign-accent, var(--starlight)) 30%, transparent);
    border-color: var(--sign-accent, var(--starlight));
    color: var(--skytext);
}
.chart-epigraph {
    max-width: 440px;
    font-family: var(--serif);
    font-style: italic;
    text-align: left;
    margin-bottom: 6px;
    display: block;
    padding: 8px 12px;
    color: var(--skytext);
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(156, 200, 232, 0.28);
    border-radius: 0;
    font-size: 16px;
}
.chart-epigraph::placeholder { color: rgba(147, 156, 192, 0.55); }
.chart-epigraph:focus { outline: none; border-bottom-color: rgba(255, 210, 125, 0.6); }

/* the palette's inks slide, the stickers scroll — nothing sprawls */
.js-group .ink-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 100%;
    padding: 2px 2px 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(107, 92, 70, 0.4) transparent;
}
.js-group .ink-row::-webkit-scrollbar { height: 5px; }
.js-group .ink-row::-webkit-scrollbar-thumb { background: rgba(107, 92, 70, 0.35); border-radius: 6px; }
.js-group .ink-row .ink-swatch { flex-shrink: 0; }
.js-group .sticker-tray {
    width: 100%;
    max-height: 64px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(107, 92, 70, 0.4) transparent;
}
.js-group .sticker-tray::-webkit-scrollbar { width: 5px; }
.js-group .sticker-tray::-webkit-scrollbar-thumb { background: rgba(107, 92, 70, 0.35); border-radius: 6px; }

/* ───────── the journal floats on water ───────── */
body.in-journal {
    background: radial-gradient(ellipse 130% 100% at 30% 0%, #17333a 0%, #0f2228 45%, #081418 100%);
}
#journalBackdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: url('../img/journal-water.jpg') center / cover no-repeat;
    filter: hue-rotate(160deg) saturate(0.7) brightness(0.4);
    opacity: 0;
    transition: opacity 1.2s var(--ease-drift);
}
body.in-journal #journalBackdrop { opacity: 0.45; }
body.in-journal #groundBackdrop { opacity: 0; }
#journalFlow {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.4s var(--ease-drift);
}
body.in-journal #journalFlow { opacity: 1; }
/* in the journal the crystal is aquamarine: light through cut water-glass */
body.in-journal .ground-title {
    background: linear-gradient(108deg,
        #eafcff 0%, #ffffff 13%, #ffffff 14.5%, #bfeef2 27%,
        #7cc4d4 40%, #f2feff 49%, #f2feff 50.5%, #a8dce4 63%,
        #5e9dab 77%, #d8f4f8 89%, #6fb2c0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 1px 0 rgba(20, 48, 56, 0.7))
            drop-shadow(0 0 10px rgba(190, 235, 242, 0.55))
            drop-shadow(0 0 26px rgba(120, 200, 214, 0.5))
            drop-shadow(0 8px 20px rgba(0, 10, 14, 0.45));
}
body.in-journal .hearth-lede { color: #9cc4c2; }
body.in-journal .journal-plate input {
    background: rgba(10, 30, 34, 0.55);
    border-color: rgba(140, 210, 220, 0.3);
    color: #bfe4e8;
}
body.in-journal .journal-tab { box-shadow: 3px 3px 12px rgba(0, 10, 14, 0.5); }
body.in-journal #compass {
    background:
        linear-gradient(135deg, rgba(150, 220, 230, 0.32), rgba(255, 214, 140, 0.24)),
        rgba(8, 18, 20, 0.85);
    border-color: rgba(150, 220, 230, 0.55);
}

/* real ferns growing out of the page's foot */
.grove-photo {
    margin: 10px auto 20px;
    max-width: 860px;
    height: 170px;
    overflow: hidden;
}
.grove-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 55%;
    filter: brightness(0.7) saturate(1.15);
    -webkit-mask-image: radial-gradient(ellipse 68% 95% at 50% 100%, rgba(0,0,0,0.95) 48%, transparent 92%);
    mask-image: radial-gradient(ellipse 68% 95% at 50% 100%, rgba(0,0,0,0.95) 48%, transparent 92%);
}

.water-whisper { max-width: 62ch; margin-top: 10px; color: #8fbcc2; }
body.in-journal #scene-journal { cursor: default; }

/* ───────── Deciduous: the poem that holds the room ───────── */
#earthLeaves {
    position: fixed;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1s var(--ease-drift);
}
body.realm-ground:not(.in-journal) #earthLeaves { opacity: 1; }

/* ───────── Healing Presence: the keeper's prints on the wall ───────── */

/* the wall in its sheet: two columns of prints behind the nebula bridge */
.sheet-wall {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-top: 16px;
}
@media (max-width: 560px) { .sheet-wall { flex-direction: column; } }
#presenceWall {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    max-width: 1100px;
}
.print-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 700px) { #presenceWall { flex-direction: column; } .print-col { width: 100%; } }
.print-card {
    display: block;
    width: 100%;
    padding: 10px 10px 12px;
    background: #f2ecdc;
    border: none;
    border-radius: 3px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
    cursor: pointer;
    text-align: left;
    transform: rotate(var(--tilt, 0deg));
    transition: transform 0.3s var(--ease-drift), box-shadow 0.3s;
}
.print-card:hover {
    transform: rotate(0deg) translateY(-5px) scale(1.02);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
    z-index: 2;
    position: relative;
}
.print-card img {
    display: block;
    width: 100%;
    border-radius: 2px;
}
.print-caption {
    display: block;
    font-family: 'Caveat', var(--serif);
    font-size: 17px;
    line-height: 1.35;
    color: #43331d;
    margin-top: 9px;
}
.print-place {
    display: block;
    font-family: var(--serif);
    font-style: italic;
    font-size: 11px;
    color: var(--ink-soft);
    margin-top: 2px;
}
.presence-large { display: block; width: 100%; border-radius: 8px; }
.presence-large-caption {
    font-family: 'Caveat', var(--serif);
    font-size: 21px;
    color: #43331d;
    margin-top: 14px;
    text-align: center;
}


/* ── whispers: soft star-notes in the corner ── */
#toastDock {
    position: fixed;
    right: 22px;
    bottom: 96px;
    z-index: 90;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}
.nova-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 340px;
    padding: 12px 18px;
    font-family: var(--serif);
    font-size: 14px;
    text-align: left;
    color: var(--skytext);
    background: linear-gradient(150deg, rgba(34, 40, 74, 0.92), rgba(18, 22, 46, 0.94));
    border: 1px solid rgba(255, 210, 125, 0.35);
    border-radius: 14px;
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.5), 0 0 22px rgba(255, 210, 125, 0.12);
    cursor: pointer;
    animation: toast-in 0.45s var(--ease-drift);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.nova-toast .toast-star { color: var(--starlight); text-shadow: 0 0 12px rgba(255, 210, 125, 0.6); }
.nova-toast:hover { border-color: rgba(255, 210, 125, 0.65); }
.nova-toast.leaving { opacity: 0; transform: translateY(8px); transition: opacity 0.6s, transform 0.6s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .nova-toast { animation: none; } }


/* ── the line between two souls ── */
.dm-thread { max-height: 260px; }
.hall-msg.mine { border-left: 2px solid rgba(255, 210, 125, 0.5); }
.hall-msg.mine .hm-by { color: var(--starlight); }


/* your star lands: a settling flare at the orbit's heart */
.orbit-centre.landed svg { animation: star-land 2.2s var(--ease-drift); }
.orbit-centre.landed .centre-label { animation: label-land 2.6s var(--ease-drift); }
@keyframes star-land {
    0%   { transform: scale(2.6); filter: brightness(2.2) drop-shadow(0 0 40px rgba(255, 220, 150, 0.9)); }
    55%  { transform: scale(0.92); filter: brightness(1.25) drop-shadow(0 0 22px rgba(255, 220, 150, 0.55)); }
    100% { transform: scale(1); filter: none; }
}
@keyframes label-land {
    0%, 30% { opacity: 0; transform: translateX(-50%) translateY(6px); }
    70%  { opacity: 1; }
    100% { opacity: 1; transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
    .orbit-centre.landed svg, .orbit-centre.landed .centre-label { animation: none; }
}
