/* ==========================================================================
   gods.css — the Pantheon page
   Load AFTER /css/site.css. gods.js sets the --g-* colours, the title font
   and data-frame on <body> for whichever god is chosen; the colours glide
   from one god to the next thanks to the @property declarations below.
   ========================================================================== */

@property --g-bg     { syntax: '<color>'; inherits: true; initial-value: #05050a; }
@property --g-bg2    { syntax: '<color>'; inherits: true; initial-value: #14142a; }
@property --g-accent { syntax: '<color>'; inherits: true; initial-value: #ffd700; }
@property --g-ink    { syntax: '<color>'; inherits: true; initial-value: #e0e0e0; }

.gods-page {
    --g-title-font: var(--font-fantasy);
    --g-radius: 4px;
    height: 100vh;
    overflow: hidden;
    color: var(--g-ink);
    background: radial-gradient(ellipse at 70% 30%, var(--g-bg2), var(--g-bg) 70%);
    transition: --g-bg 1.2s ease, --g-bg2 1.2s ease, --g-accent 1.2s ease, --g-ink 1.2s ease;
}

#god-canvas,
.gods-pixi {
    position: fixed; inset: 0;
    width: 100vw; height: 100vh;
    z-index: 0;
    pointer-events: none;
}
/* With PixiJS the 2D scenes keep drawing here, hidden, and are shown through PixiJS */
.pixi-on #god-canvas { visibility: hidden; }
/* On the Pantheon, over a god's star */
.star-hover, .star-hover .god-view { cursor: pointer; }

.page-links {
    position: fixed; top: 12px; left: 16px;
    z-index: 5;
    display: flex; gap: 18px;
    font-size: 0.8rem;
}
/* The way back out: two small plaques */
.page-links { gap: 10px; }
.page-links a { color: var(--g-accent); text-decoration: none; }
/* The way back out: plaques in the god's own colours (.travel-link, shared in site.css) */
.gods-page {
    --travel-accent: var(--g-accent);
    --travel-ink: var(--g-ink);
    --travel-bg: var(--g-bg);
    --travel-bg2: var(--g-bg2);
}
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--g-accent);
    outline-offset: 3px;
}

/* --- Layout: the pantheon on the left, the chosen god on the right --- */
.gods-layout {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 260px 1fr;
    height: 100vh;
}

.pantheon {
    padding: 56px 20px 24px 22px;
    overflow-y: auto;
    border-right: 1px solid color-mix(in srgb, var(--g-accent) 25%, transparent);
    background: linear-gradient(90deg, color-mix(in srgb, var(--g-bg) 88%, transparent), color-mix(in srgb, var(--g-bg) 40%, transparent));
    backdrop-filter: blur(6px);
}
.pantheon-title {
    all: unset;
    cursor: pointer;
    display: block;
    width: max-content;
    margin-bottom: 1.4rem;
    font-family: var(--font-fantasy);
    font-size: 1.35rem;
    color: var(--g-accent);
    /* A golden glint slides over the letters now and then; underneath, the text keeps the god's own accent */
    background: linear-gradient(105deg, transparent 43%, rgba(255, 226, 130, 0.9) 48%, #fff7d2 50%, rgba(255, 208, 80, 0.9) 52%, transparent 57%) no-repeat,
                linear-gradient(var(--g-accent), var(--g-accent));
    background-size: 300% 100%, 100% 100%;
    background-position: 110% 0, 0 0;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: title-glint 5.5s ease-in-out infinite;
}
.pantheon-title:hover { animation-duration: 1.8s; }
@keyframes title-glint {
    0%, 52% { background-position: 110% 0, 0 0; }
    100% { background-position: -10% 0, 0 0; }
}
.pantheon-group h2 {
    margin: 1.2rem 0 0.5rem;
    font-family: var(--font-body);
    font-style: italic;
    font-weight: 400;
    font-size: 0.95rem;
    color: color-mix(in srgb, var(--g-ink) 60%, transparent);
}
.pantheon ul { list-style: none; margin: 0; padding: 0; }
.pantheon li button {
    all: unset;
    cursor: pointer;
    box-sizing: border-box;
    width: 100%;
    display: flex; align-items: center; gap: 10px;
    padding: 5px 6px;
    border: 2px solid transparent;
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 1rem;
    color: color-mix(in srgb, var(--g-ink) 78%, transparent);
    transition: background 0.3s ease, color 0.3s ease, padding-left 0.3s ease;
}
.pantheon li button::before {
    content: '';
    width: 8px; height: 8px;
    flex: none;
    border-radius: 50%;
    background: var(--dot);
    box-shadow: 0 0 8px var(--dot);
}
.pantheon li button:hover { color: var(--g-ink); background: color-mix(in srgb, var(--dot) 12%, transparent); }
/* The god whose page is open wears that god's own style: font, colours, frame */
.pantheon li button[aria-current="true"] {
    color: var(--dot);
    font-family: var(--b-font, var(--font-body));
    padding-left: 12px;
    border-color: color-mix(in srgb, var(--dot) 35%, transparent);
    background: linear-gradient(90deg, color-mix(in srgb, var(--b-bg2) 90%, transparent), color-mix(in srgb, var(--dot) 8%, transparent));
    box-shadow: 0 0 18px color-mix(in srgb, var(--dot) 22%, transparent), inset 0 0 12px color-mix(in srgb, var(--dot) 12%, transparent);
    text-shadow: 0 0 10px color-mix(in srgb, var(--dot) 55%, transparent);
}
.pantheon li button[aria-current="true"]::before { width: 9px; height: 9px; box-shadow: 0 0 10px var(--dot), 0 0 3px #fff; }
.pantheon li button[aria-current="true"][data-frame="none"] { border-color: transparent; border-bottom-color: color-mix(in srgb, var(--dot) 55%, transparent); border-radius: 2px; }
.pantheon li button[aria-current="true"][data-frame="sharp"] { border-radius: 0; border-left-color: var(--dot); }
.pantheon li button[aria-current="true"][data-frame="soft"] { border-radius: 16px; }
.pantheon li button[aria-current="true"][data-frame="double"] { border: 3px double color-mix(in srgb, var(--dot) 75%, transparent); padding: 4px 5px 4px 11px; }
.pantheon li button[aria-current="true"][data-frame="torn"] { border-style: dashed; border-color: color-mix(in srgb, var(--dot) 60%, transparent); border-radius: 2px; }
/* (a text-shadow would show through the clipped text, so the glow is a drop-shadow) */
.pantheon-title[aria-current="true"] { filter: drop-shadow(0 0 7px color-mix(in srgb, var(--g-accent) 60%, transparent)); }

/* ...and a little of the god's behaviour */
.pantheon button[data-god="red"][aria-current="true"] { animation: list-chaos 2.6s steps(1) infinite; }
.pantheon button[data-god="rhaius"][aria-current="true"] { animation: list-sway 5s ease-in-out infinite alternate; }
.pantheon button[data-god="oldking"][aria-current="true"] { animation: list-smoulder 1.8s ease-in-out infinite alternate; }
.pantheon button[data-god="thousand"][aria-current="true"] { animation: list-faces 7s steps(1) infinite; white-space: nowrap; overflow: hidden; font-size: 0.86rem; }
.pantheon button[data-god="green"][aria-current="true"],
.pantheon button[data-god="aelith"][aria-current="true"] { animation: list-breathe 3.2s ease-in-out infinite; }
.pantheon button[data-god="phyrae"][aria-current="true"] { animation: list-heart 1.1s ease-in-out infinite; }
.pantheon button[data-god="osius"][aria-current="true"] {
    background-image: linear-gradient(100deg, transparent 40%, color-mix(in srgb, var(--dot) 30%, transparent) 50%, transparent 60%),
                      linear-gradient(90deg, color-mix(in srgb, var(--b-bg2) 90%, transparent), color-mix(in srgb, var(--dot) 8%, transparent));
    background-size: 250% 100%, 100% 100%;
    animation: list-shine 3.5s ease-in-out infinite;
}
.pantheon button[data-god="ralios"][aria-current="true"] { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.9rem; }
.pantheon button[data-god="primus"][aria-current="true"] { letter-spacing: 0.05em; font-size: 0.82rem; }
.pantheon button[data-god="zaenta"][aria-current="true"] { color: color-mix(in srgb, var(--dot) 82%, transparent); }
.pantheon button[data-god="aletha"][aria-current="true"] { font-weight: 300; }
.pantheon button[data-god="oldking"][aria-current="true"] { font-size: 1.1rem; }
@keyframes list-chaos {
    0%, 100% { transform: none; }
    12% { transform: translate(2px, -1px) skewX(-6deg); }
    14% { transform: none; }
    51% { transform: translate(-2px, 1px); }
    53% { transform: none; }
}
@keyframes list-sway { from { transform: rotate(-1deg); } to { transform: rotate(1deg) translateY(-1px); } }
@keyframes list-smoulder {
    from { text-shadow: 0 0 8px #ff2a00, 0 0 18px #7a0000; }
    to { text-shadow: 0 0 14px #ff5a00, 0 0 28px #a00000; }
}
@keyframes list-faces {
    0%, 100% { font-family: 'Cinzel', serif; color: #c07be0; }
    20% { font-family: 'UnifrakturMaguntia', serif; color: #4dd6a0; }
    40% { font-family: 'Orbitron', sans-serif; color: #ff5a6e; }
    60% { font-family: 'Cormorant Garamond', serif; color: #7cc8ff; }
    80% { font-family: 'Almendra', serif; color: #ffd24a; }
}
@keyframes list-breathe { 50% { box-shadow: 0 0 26px color-mix(in srgb, var(--dot) 40%, transparent), inset 0 0 16px color-mix(in srgb, var(--dot) 20%, transparent); } }
@keyframes list-heart {
    0%, 40%, 100% { box-shadow: 0 0 16px color-mix(in srgb, var(--dot) 20%, transparent); }
    10% { box-shadow: 0 0 26px color-mix(in srgb, var(--dot) 55%, transparent); }
    25% { box-shadow: 0 0 22px color-mix(in srgb, var(--dot) 40%, transparent); }
}
@keyframes list-shine { from { background-position: 120% 0, 0 0; } to { background-position: -20% 0, 0 0; } }

/* --- The chosen god --- */
.god-view {
    overflow-y: auto;
    padding: 9vh 6vw 10vh;
}
.god-card {
    max-width: 720px;
    transition: opacity 0.45s ease, transform 0.45s ease, filter 0.45s ease;
}
/* The card leaves the way the shift runs (--shift-x/y, set by gods.js) and the new one
   comes in from the other side; the name arrives last */
.god-card.leaving {
    opacity: 0;
    transform: translate(var(--shift-x, 0px), var(--shift-y, 14px)) scale(0.985);
    filter: blur(6px);
}
.god-card.entering {
    transition: none;
    opacity: 0;
    transform: translate(calc(var(--shift-x, 0px) * -0.8), calc(var(--shift-y, 14px) * -0.8));
    filter: blur(6px);
}
.god-card.arrive { transition: opacity 0.6s ease, transform 0.7s cubic-bezier(0.2, 0.75, 0.25, 1), filter 0.6s ease; }
.god-card.arrive.leaving { transition: opacity 0.42s ease, transform 0.42s ease-in, filter 0.42s ease; }
.god-card.arrive .god-name-wrap { animation: name-arrive 0.9s cubic-bezier(0.2, 0.75, 0.25, 1) 0.2s both; }
@keyframes name-arrive {
    from { opacity: 0; filter: blur(10px); transform: translate(calc(var(--shift-x, 0px) * -0.6), calc(var(--shift-y, 0px) * -0.6)); }
    to { opacity: 1; filter: none; transform: none; }
}

.god-tier {
    margin: 0;
    font-style: italic;
    font-size: 1.05rem;
    color: color-mix(in srgb, var(--g-ink) 65%, transparent);
}
.god-name {
    margin: 0.05em 0 0.15em;
    font-family: var(--g-title-font);
    font-weight: 700;
    font-size: clamp(2.8rem, 7vw, 5.6rem);
    line-height: 1;
    color: var(--g-accent);
    text-shadow: 0 0 28px color-mix(in srgb, var(--g-accent) 45%, transparent);
}
.god-epithet {
    margin: 0 0 1.6rem;
    font-size: 1.35rem;
    color: var(--g-ink);
}

.god-facts {
    display: flex; flex-wrap: wrap; gap: 10px 26px;
    margin: 0 0 2rem;
    padding: 14px 18px;
    border: 1px solid color-mix(in srgb, var(--g-accent) 35%, transparent);
    border-radius: var(--g-radius);
    background: color-mix(in srgb, var(--g-bg) 60%, transparent);
}
.god-facts div { min-width: 120px; }
/* The labels (Classification, Domains, Resides on) stand out: small capitals in Cinzel, in the god's accent;
   the values are set in the god's own title font */
.god-facts dt {
    font-family: var(--font-fantasy);
    font-size: 0.72rem;
    font-weight: 700;
    font-style: normal;
    letter-spacing: 0.17em;
    text-transform: uppercase;
    color: var(--g-accent);
    text-shadow: 0 0 10px color-mix(in srgb, var(--g-accent) 55%, transparent);
}
.god-facts dt::before { content: '\2726\00a0'; font-size: 0.85em; opacity: 0.85; }
.god-facts dd { margin: 5px 0 0; font-family: var(--g-title-font); font-size: 1.25rem; line-height: 1.25; color: var(--g-ink); }
.god-facts a { color: var(--g-accent); text-decoration-thickness: 1px; text-underline-offset: 4px; }

.god-section h3 {
    margin: 2rem 0 0.6rem;
    font-family: var(--g-title-font);
    font-weight: 400;
    font-size: 1.45rem;
    color: var(--g-accent);
}
.god-section p {
    margin: 0 0 1em;
    max-width: 62ch;
    font-size: 1.12rem;
    line-height: 1.75;
    text-shadow: 0 0 8px var(--g-bg);
}
.god-quote {
    margin: 2rem 0;
    padding: 0.4rem 0 0.4rem 1.3rem;
    border-left: 2px solid var(--g-accent);
}
.god-quote p {
    margin: 0;
    font-family: 'Cormorant Garamond', var(--font-body);
    font-style: italic;
    font-size: 1.55rem;
    line-height: 1.45;
}
.god-note {
    font-style: italic;
    color: color-mix(in srgb, var(--g-ink) 60%, transparent);
}

/* --- Each god's own frame (data-frame on <body>) --- */
[data-frame="sharp"] { --g-radius: 0; }
[data-frame="sharp"] .god-facts { border-width: 2px; }
[data-frame="soft"] { --g-radius: 22px; }
[data-frame="double"] .god-facts { border-style: double; border-width: 4px; }
[data-frame="none"] .god-facts { border-color: transparent; background: transparent; padding-left: 0; }
[data-frame="torn"] .god-facts { border-style: dashed; }

/* --- A few gods also change how the page behaves --- */
/* The Red Creator: the title cannot keep still */
[data-god="red"] .god-name { animation: chaos 2.6s steps(1) infinite; }
@keyframes chaos {
    0%, 100% { transform: none; }
    12% { transform: translate(3px, -2px) skewX(-6deg); }
    14% { transform: none; }
    51% { transform: translate(-4px, 1px) rotate(-1.5deg); }
    53% { transform: none; }
    77% { transform: scale(1.04) skewX(5deg); }
    79% { transform: none; }
}
/* Ralios: everything squared and set in order */
[data-god="ralios"] .god-name { letter-spacing: 0.08em; text-transform: uppercase; }
/* Rhaius: free to drift */
[data-god="rhaius"] .god-name { animation: sway 6s ease-in-out infinite alternate; display: inline-block; }
@keyframes sway { from { transform: rotate(-2deg); } to { transform: rotate(2deg) translateY(-4px); } }
/* The Old King: smouldering */
[data-god="oldking"] .god-name { text-shadow: 0 0 18px #ff2a00, 0 0 40px #7a0000; }
/* The Thousand Faces: always one line (gods.js sizes it so the widest face fits) */
[data-god="thousand"] .god-name { white-space: nowrap; }
/* Zaenta: her face is faintly transparent */
[data-god="zaenta"] .god-name { opacity: 0.82; }
/* Aletha: still and soft */
[data-god="aletha"] .god-name { font-weight: 300; }
/* Primus: mechanical */
[data-god="primus"] .god-name { letter-spacing: 0.06em; }

/* --- Smaller screens: the pantheon becomes a strip across the top --- */
@media (max-width: 800px) {
    .gods-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .travel-link { padding: 4px 11px 4px 8px; font-size: 0.66rem; }
    .pantheon {
        padding: 50px 12px 10px;
        border-right: none;
        border-bottom: 1px solid color-mix(in srgb, var(--g-accent) 25%, transparent);
        display: flex; gap: 14px; overflow-x: auto; align-items: flex-start;
    }
    .pantheon-title { margin: 6px 0 0; white-space: nowrap; font-size: 1rem; }
    .pantheon-group h2 { display: none; }
    .pantheon ul { display: flex; gap: 4px; }
    .pantheon li button { white-space: nowrap; }
    .god-view { padding: 5vh 6vw 8vh; }
}

@media (prefers-reduced-motion: reduce) {
    .god-name,
    .god-name-wrap,
    .pantheon-title,
    .pantheon li button { animation: none !important; }
    .god-card, .god-card.arrive { transition: opacity 0.2s ease; }
    .god-card.leaving { transform: none; filter: none; }
}

/* ==========================================================================
   Visual quality tiers (html[data-quality], fx-quality.js)
   Light: no backdrop blur over the moving worlds (it is redone every frame);
   the panels keep their gradients, a little more opaque.
   Still: the same as the reduced-motion rules above.
   ========================================================================== */
html[data-quality="light"] .pantheon { backdrop-filter: none; -webkit-backdrop-filter: none; }
html[data-quality="light"] .pantheon {
    background: linear-gradient(90deg, color-mix(in srgb, var(--g-bg) 94%, transparent), color-mix(in srgb, var(--g-bg) 62%, transparent));
}
html[data-quality="light"] .pantheon-title[aria-current="true"] { filter: none; }
html[data-quality="still"] .god-name,
html[data-quality="still"] .god-name-wrap,
html[data-quality="still"] .pantheon-title,
html[data-quality="still"] .pantheon li button { animation: none !important; }
html[data-quality="still"] .god-card,
html[data-quality="still"] .god-card.arrive { transition: opacity 0.2s ease; }
html[data-quality="still"] .god-card.leaving { transform: none; filter: none; }
