@font-face {
    font-family: 'Galactico';
    src: url('./Galactico-Basic.otf') format('opentype');
    font-display: swap;
}

@font-face {
    font-family: 'TheCalling';
    src: url('./TheCalling.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'Alphacode Beyond';
    src: url('./AlphacodeBeyond-Regular.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'Waveform';
    src: url('./Waveform.otf') format('opentype');
    font-display: swap;
}

:root {
    --bg: #050505;
    --obsidian: #090807;
    --obsidian-soft: #13100d;
    --ink: #1f1912;
    --parchment: #d9c59c;
    --ivory: #f4ead4;
    --gold: #b69244;
    --gold-hot: #e2c27a;
    --copper: #8f5a2b;
    --lapis: #406280;
    --smoke: rgba(244, 234, 212, 0.08);
    --border: rgba(182, 146, 68, 0.28);
    --shadow: rgba(0, 0, 0, 0.55);
    --audio-low: 0;
    --audio-mid: 0;
    --audio-high: 0;
    --audio-energy: 0;
    --pointer-energy: 0;
    --logo-glow-a: rgba(255, 255, 255, 0.26);
    --logo-glow-b: rgba(255, 255, 255, 0.18);
    --logo-glow-c: rgba(255, 255, 255, 0.2);
    --logo-brightness: 1.04;
    --shell-padding: clamp(1rem, 2vw, 1.75rem);
    --panel-width: min(92vw, 430px);
}

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

html,
body {
    width: 100%;
    max-width: 100vw;
    min-height: 100%;
    min-height: 100dvh;
    min-height: calc(var(--vh, 1vh) * 100);
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background:
        radial-gradient(circle at 50% 50%, rgba(77, 53, 24, 0.18), transparent 28%),
        radial-gradient(circle at 12% 18%, rgba(64, 98, 128, 0.1), transparent 22%),
        radial-gradient(circle at 82% 24%, rgba(143, 90, 43, 0.12), transparent 20%),
        linear-gradient(180deg, #070605 0%, #0d0906 45%, #040404 100%);
    color: var(--ivory);
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    touch-action: manipulation;
    overscroll-behavior: none;
}

body::before,
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

body::before {
    background:
        radial-gradient(circle at center, rgba(226, 194, 122, 0.1), transparent 34%),
        repeating-radial-gradient(circle at center, rgba(182, 146, 68, 0.04) 0 1px, transparent 1px 78px);
    mix-blend-mode: screen;
    opacity: 0.42;
}

body::after {
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.28));
}

#shader-container,
#fallback-layer,
#glyph-canvas {
    position: fixed;
    inset: 0;
}

#shader-container {
    z-index: 1;
    contain: strict;
}

#shader-container canvas {
    width: 100%;
    height: 100%;
    display: block;
}

#fallback-layer {
    z-index: 2;
    display: grid;
    place-items: center;
    pointer-events: none;
    opacity: 0.18;
    transition: opacity 1s ease;
}

.fallback-sigil {
    width: min(76vmin, 860px);
    aspect-ratio: 1;
    fill: none;
    stroke: rgba(226, 194, 122, 0.24);
    stroke-width: 1.1;
    filter: drop-shadow(0 0 24px rgba(182, 146, 68, 0.12));
}

#glyph-canvas {
    z-index: 5;
    pointer-events: none;
    contain: strict;
}

.temple-shell {
    position: relative;
    min-height: 100dvh;
    min-height: calc(var(--vh, 1vh) * 100);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding:
        max(var(--shell-padding), env(safe-area-inset-top, 0px))
        max(var(--shell-padding), env(safe-area-inset-right, 0px))
        max(calc(var(--shell-padding) + 0.5rem), env(safe-area-inset-bottom, 0px))
        max(var(--shell-padding), env(safe-area-inset-left, 0px));
    pointer-events: none;
    /* Allow scrolling when content overflows on small screens */
    overflow-y: auto;
    overflow-x: hidden;
}

.orbital-card,
.noscript-panel {
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(20, 16, 12, 0.86), rgba(8, 7, 6, 0.78)),
        linear-gradient(180deg, rgba(244, 234, 212, 0.02), transparent);
    border: 1px solid rgba(182, 146, 68, 0.16);
    box-shadow:
        inset 0 1px 0 rgba(255, 244, 221, 0.05),
        0 16px 40px rgba(0, 0, 0, 0.36),
        0 0 28px rgba(182, 146, 68, 0.1);
}

.temple-core {
    pointer-events: auto;
    position: relative;
}

.orbital-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, transparent, rgba(226, 194, 122, 0.06), transparent),
        radial-gradient(circle at 50% 0%, rgba(226, 194, 122, 0.1), transparent 54%);
    pointer-events: none;
}

/* temple-core ::before removed — was causing visible square border */

.orbital-card {
    width: min(100%, 950px);
    justify-self: center;
    padding: 0.65rem 0.95rem;
    min-height: 0;
    background:
        linear-gradient(145deg, rgba(20, 16, 12, 0.72), rgba(8, 7, 6, 0.62)),
        linear-gradient(180deg, rgba(244, 234, 212, 0.015), transparent);
    box-shadow:
        inset 0 1px 0 rgba(255, 244, 221, 0.03),
        0 8px 24px rgba(0, 0, 0, 0.28);
}

.orbital-card--north { grid-area: north; }
.orbital-card--south { grid-area: south; }

.temple-banner-line {
    width: 52px;
    height: 1px;
    margin-bottom: 0.45rem;
    background: linear-gradient(90deg, transparent, rgba(226, 194, 122, 0.95), transparent);
    box-shadow: 0 0 18px rgba(226, 194, 122, 0.28);
}

.orbital-label {
    display: inline-block;
    font-family: 'Cinzel', serif;
    color: var(--gold-hot);
    font-size: 0.8rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 0.28rem;
}

.status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(226, 194, 122, 0.18);
    background: rgba(226, 194, 122, 0.07);
    color: var(--ivory);
    font-size: 0.64rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.status-pill--ghost {
    background: rgba(64, 98, 128, 0.08);
    border-color: rgba(64, 98, 128, 0.24);
    color: rgba(244, 234, 212, 0.82);
}

.track-name {
    font-family: 'Cinzel', serif;
    color: var(--ivory);
    letter-spacing: 0.18em;
}

.brand-logo-wrap {
    margin-bottom: clamp(0.15rem, 0.5vh, 0.35rem);
    position: relative;
    isolation: isolate;
    display: flex;
    justify-content: center;
}

.brand-logo-wrap::before {
    content: '';
    position: absolute;
    inset: 12% 12%;
    background: radial-gradient(circle, var(--logo-glow-a), transparent 70%);
    filter: blur(18px);
    opacity: 0.42;
    z-index: 0;
    pointer-events: none;
}

.brand-logo {
    display: block;
    width: min(100%, 260px);
    height: auto;
    position: relative;
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    transform: translateZ(0);
}

.logo-fluid {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(100%, 260px);
    height: auto;
    z-index: 2;
    pointer-events: none;
    filter:
        drop-shadow(0 0 6px rgba(255, 255, 255, 0.2))
        drop-shadow(0 0 14px var(--logo-glow-a))
        drop-shadow(0 0 24px var(--logo-glow-b))
        drop-shadow(0 0 38px var(--logo-glow-c));
    transition: filter 0.3s ease;
}

.orbital-copy {
    color: rgba(244, 234, 212, 0.78);
    line-height: 1.6;
    font-size: 0.83rem;
}

.orbital-copy--muted {
    margin-top: 0.75rem;
    color: rgba(244, 234, 212, 0.55);
}

.micro-grid,
.temple-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 0.8rem;
    margin-top: 0.95rem;
    font-size: 0.68rem;
    color: rgba(244, 234, 212, 0.72);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.temple-core {
    width: min(100%, 1080px);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(0.3rem, 0.8vw, 0.8rem);
    padding-top: clamp(0.8rem, 2vh, 3.6rem);
    padding-bottom: clamp(0.6rem, 1.5vh, 1.5rem);
    min-height: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.core-halo {
    position: absolute;
    inset: 20% 24%;
    background: radial-gradient(circle, rgba(226, 194, 122, 0.16), transparent 62%);
    filter: blur(40px);
    opacity: 0.22;
    pointer-events: none;
}

.altar-panel {
    position: relative;
    z-index: 2;
    width: var(--panel-width);
    max-width: calc(100vw - 1.5rem);
    padding: clamp(0.7rem, 1.5vw, 1.1rem) clamp(0.7rem, 1.5vw, 1.1rem) clamp(0.6rem, 1.2vw, 0.95rem);
    text-align: center;
    background: transparent;
    border: none;
    border-radius: 14px;
    max-height: none;
    overflow: visible;
    -webkit-overflow-scrolling: touch;
    transition: opacity 1.6s cubic-bezier(0.22, 1, 0.36, 1),
                transform 1.6s cubic-bezier(0.22, 1, 0.36, 1),
                filter 1.6s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform, filter;
}

/* clean solid backdrop — keeps content readable */
.altar-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: 14px;
    background:
        radial-gradient(circle at 50% 8%, rgba(182, 146, 68, 0.06), transparent 60%),
        linear-gradient(160deg, var(--obsidian) 0%, #050404 100%);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.9);
    pointer-events: none;
}

/* canvas-drawn spinning torus border — disabled */
.torus-canvas {
    display: none;
}

.altar-panel::-webkit-scrollbar {
    display: none;
}

.altar-panel.dissolved {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
    filter: blur(4px);
    pointer-events: none;
    transition: opacity 2s cubic-bezier(0.22, 1, 0.36, 1),
                transform 2s cubic-bezier(0.22, 1, 0.36, 1),
                filter 2s cubic-bezier(0.22, 1, 0.36, 1);
}

/* When restoring (dissolved class removed), come back a bit faster */
.altar-panel:not(.dissolved) {
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.8s cubic-bezier(0.22, 1, 0.36, 1),
                filter 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.altar-panel.dissolved::before,
.altar-panel.dissolved .torus-canvas {
    opacity: 0;
}

.altar-panel.dissolved.restore-hint::after {
    content: '';
    /* hint dot stays invisible while panel dissolved */
}

.portrait-altar {
    width: clamp(78px, 9vw, 108px);
    aspect-ratio: 1;
    border-radius: 50%;
    padding: 5px;
    background: conic-gradient(from 0deg, rgba(226, 194, 122, 0.05), rgba(226, 194, 122, 0.55), rgba(64, 98, 128, 0.26), rgba(226, 194, 122, 0.05));
    box-shadow: 0 0 0 1px rgba(226, 194, 122, 0.18), 0 0 18px rgba(182, 146, 68, 0.16);
    margin: 0 auto clamp(0.25rem, 0.6vh, 0.55rem);
}

.portrait-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 50%;
    filter: grayscale(0.1) contrast(1.05) brightness(0.88);
}

.artist-subtitle {
    margin-top: 0.1rem;
    font-family: 'Cinzel', serif;
    color: var(--gold-hot);
    letter-spacing: 0.42em;
    font-size: 0.62rem;
    text-transform: uppercase;
}

.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin: clamp(0.35rem, 0.8vh, 0.75rem) 0 clamp(0.4rem, 1vh, 0.9rem);
}

.divider-line {
    width: 40px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(226, 194, 122, 0.4), transparent);
}

.divider-symbol {
    color: rgba(226, 194, 122, 0.72);
    font-size: 0.6rem;
}

.manifesto {
    display: grid;
    gap: clamp(0.18rem, 0.4vh, 0.36rem);
    margin-bottom: clamp(0.45rem, 1vh, 0.95rem);
}

.manifesto p {
    font-size: 0.7rem;
    line-height: 1.55;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(244, 234, 212, 0.78);
}

.subtitle,
.core-copy,
.audio-status,
.track-code {
    color: rgba(244, 234, 212, 0.74);
}

.mandala-shell {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: min(90vmin, 860px);
    max-width: 100vw;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    pointer-events: none;
    z-index: 1;
}

#mandala-canvas {
    width: 100%;
    height: 100%;
    display: block;
    opacity: 0.5;
    /* Static shadow — dynamic CSS-var filter forces GPU compositing repaint every frame */
    filter: drop-shadow(0 0 28px rgba(226, 194, 122, 0.18));
}

.mandala-inscription {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.64rem;
    font-family: 'Space Grotesk', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: rgba(244, 234, 212, 0.38);
    white-space: nowrap;
}

.mandala-inscription--top {
    top: 7%;
}

.mandala-inscription--bottom {
    bottom: 6%;
}

.control-row {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: 0.85rem;
    margin-bottom: clamp(0.4rem, 0.8vh, 0.75rem);
}

.portal-link {
    position: relative;
    min-height: 50px;
    padding: 0.8rem 1.4rem;
    border-radius: 8px;
    border: 1px solid rgba(226, 194, 122, 0.28);
    background:
        linear-gradient(145deg, rgba(24, 18, 11, 0.95), rgba(12, 10, 7, 0.88));
    color: var(--gold-hot);
    text-decoration: none;
    box-shadow:
        0 0 0 1px rgba(255, 244, 221, 0.04),
        0 0 20px rgba(182, 146, 68, 0.12),
        0 8px 28px rgba(0, 0, 0, 0.4);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                color 0.3s ease,
                box-shadow 0.4s ease,
                border-color 0.3s ease;
    overflow: hidden;
}

/* subtle shimmer overlay */
.portal-link::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        105deg,
        transparent 38%,
        rgba(226, 194, 122, 0.07) 42%,
        rgba(226, 194, 122, 0.12) 50%,
        rgba(226, 194, 122, 0.07) 58%,
        transparent 62%
    );
    background-size: 250% 100%;
    background-position: 100% 0;
    transition: background-position 0.8s ease;
    pointer-events: none;
}

.portal-link:hover::before,
.portal-link:focus-visible::before {
    background-position: 0 0;
}

.portal-link:hover,
.portal-link:focus-visible {
    color: #fff;
    border-color: rgba(226, 194, 122, 0.5);
    box-shadow:
        0 0 0 1px rgba(255, 244, 221, 0.06),
        0 0 28px rgba(182, 146, 68, 0.22),
        0 10px 36px rgba(0, 0, 0, 0.44);
    transform: translateY(-2px);
}

.portal-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    font-family: 'Cinzel', serif;
    font-size: 0.72rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

.portal-link__text {
    position: relative;
    z-index: 1;
}

.portal-link__arrow {
    position: relative;
    z-index: 1;
    opacity: 0.5;
    transition: opacity 0.3s ease, transform 0.3s ease;
    flex-shrink: 0;
}

.portal-link:hover .portal-link__arrow,
.portal-link:focus-visible .portal-link__arrow {
    opacity: 1;
    transform: translate(2px, -2px);
}

.audio-status {
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: 0.08em;
    font-size: 0.64rem;
    text-transform: uppercase;
}

/* ── AUDIO PLAYER ── */
.player-wrap {
    position: relative;
    z-index: 12;
    width: min(100%, 340px);
    max-width: calc(100vw - 2rem);
    margin-bottom: clamp(0.4rem, 1vh, 0.85rem);
    padding: 0.55rem 0.85rem 0.45rem;
    border-radius: 10px;
    background:
        linear-gradient(145deg, rgba(20, 16, 12, 0.6), rgba(8, 7, 6, 0.5));
    border: 1px solid rgba(226, 194, 122, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 244, 221, 0.03);
    transition: padding 0.5s ease, background 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease, opacity 0.5s ease;
}

/* ── PLAYER DISPLAY / MARQUEE ── */
.player-display {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 24px;
    margin-bottom: 0.45rem;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(226, 194, 122, 0.08);
    /* fade edges */
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 8%, black 92%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0%, black 8%, black 92%, transparent 100%);
}

.player-marquee {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.marquee-text {
    position: absolute;
    top: 0;
    left: 0;
    white-space: nowrap;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold-hot);
    line-height: 24px;
    text-shadow: 0 0 8px rgba(226, 194, 122, 0.3);
    /* JS drives the transform — start centered via JS */
    will-change: transform;
}

/* ── PLAYER INNER (collapsible) ── */
.player-inner {
    overflow: hidden;
    max-height: 200px; /* generous max for open state */
    opacity: 1;
    transition: max-height 0.55s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.4s ease,
                margin 0.55s ease;
}

.player-wrap.collapsed .player-inner {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
    pointer-events: none;
}

.player-wrap.collapsed {
    padding: 0;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

/* ── TRIANGLE TOGGLE ── */
.player-toggle {
    display: none; /* hidden until player gets has-toggle */
    width: 100%;
    padding: 10px 0;
    border: 1px solid rgba(226, 194, 122, 0.14);
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(20, 16, 12, 0.6), rgba(8, 7, 6, 0.5));
    box-shadow: inset 0 1px 0 rgba(255, 244, 221, 0.03);
    color: var(--gold);
    cursor: pointer;
    line-height: 0;
    margin-top: 6px;
    opacity: 1;
    transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease,
                opacity 0.5s ease, transform 0.3s ease;
}

.player-toggle svg {
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.player-wrap.has-toggle .player-toggle {
    display: block;
}

.player-wrap.collapsed .player-toggle svg {
    transform: rotate(180deg);
}

.player-toggle:hover,
.player-toggle:focus-visible {
    color: var(--gold-hot);
    border-color: rgba(226, 194, 122, 0.3);
}

/* ── DOCK PORTAL: always fixed at viewport bottom ── */
.dock-portal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: flex;
    justify-content: center;
    pointer-events: none;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.dock-portal:empty {
    display: none;
}

/* The toggle button when it lives inside the dock portal */
.dock-portal .player-toggle {
    display: block;
    pointer-events: auto;
    width: min(55vw, 220px);
    margin: 0;
    border-radius: 10px 10px 0 0;
    opacity: 0.35;
    padding: 8px 0;
    border: 1px solid rgba(226, 194, 122, 0.14);
    background: linear-gradient(145deg, rgba(20, 16, 12, 0.6), rgba(8, 7, 6, 0.5));
    box-shadow: inset 0 1px 0 rgba(255, 244, 221, 0.03);
    color: var(--gold);
    cursor: pointer;
    line-height: 0;
    transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease,
                opacity 0.5s ease, transform 0.3s ease;
}

.dock-portal .player-toggle:hover,
.dock-portal .player-toggle:focus-visible {
    opacity: 0.8;
    color: var(--gold-hot);
    border-color: rgba(226, 194, 122, 0.3);
}

.dock-portal .player-toggle svg {
    transform: rotate(180deg);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.player-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.45rem;
}

.player-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(226, 194, 122, 0.18);
    background: linear-gradient(145deg, rgba(24, 18, 11, 0.92), rgba(8, 7, 5, 0.82));
    color: var(--ivory);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
    flex-shrink: 0;
}

.player-btn:hover,
.player-btn:focus-visible {
    color: var(--gold-hot);
    border-color: rgba(226, 194, 122, 0.42);
    transform: scale(1.12);
    box-shadow: 0 0 14px rgba(182, 146, 68, 0.22);
}

.player-btn--skip {
    width: 34px;
    height: 34px;
}

.player-btn--play {
    width: 46px;
    height: 46px;
    border-width: 1.5px;
    border-color: rgba(226, 194, 122, 0.3);
    box-shadow: 0 0 16px rgba(182, 146, 68, 0.1);
}

.player-btn--play .player-icon {
    display: block;
}

.player-btn--play.is-playing .icon-play {
    display: none;
}

.player-btn--play.is-playing .icon-pause {
    display: block !important;
}

/* seek / scrubber bar */
.player-seek {
    position: relative;
    padding: 8px 0;
    cursor: pointer;
    touch-action: none;
}

.seek-track {
    position: relative;
    width: 100%;
    height: 3px;
    border-radius: 2px;
    background: rgba(244, 234, 212, 0.1);
    overflow: visible;
}

.seek-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--gold), var(--gold-hot));
    box-shadow: 0 0 6px rgba(226, 194, 122, 0.25);
    transition: box-shadow 0.3s ease;
}

.seek-head {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gold-hot);
    border: 2px solid var(--obsidian);
    box-shadow: 0 0 6px rgba(226, 194, 122, 0.35);
    transform: translate(-50%, -50%);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    pointer-events: none;
}

.player-seek:hover .seek-head,
.player-seek:active .seek-head {
    transform: translate(-50%, -50%) scale(1.35);
    box-shadow: 0 0 14px rgba(226, 194, 122, 0.6);
}

.player-seek:hover .seek-fill {
    box-shadow: 0 0 10px rgba(226, 194, 122, 0.4);
}

.player-time {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    color: rgba(244, 234, 212, 0.45);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    padding-top: 0.1rem;
}

.time-sep {
    margin: 0 0.2em;
    opacity: 0.35;
}

.social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: clamp(0.3rem, 0.6vh, 0.7rem);
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    color: rgba(244, 234, 212, 0.55);
    text-decoration: none;
    border: 1px solid rgba(226, 194, 122, 0.12);
    background: rgba(255, 255, 255, 0.02);
    transition: color 0.3s ease, border-color 0.3s ease, transform 0.3s ease, background 0.3s ease;
}

/* Icon-only social buttons (Instagram, SoundCloud) */
.social-icon--ig,
.social-icon--sc {
    padding: 0;
    border-radius: 50%;
    width: 2.2rem;
    height: 2.2rem;
    min-width: 2.2rem;
    min-height: 2.2rem;
    flex-shrink: 0;
    box-sizing: border-box;
}

.social-icon--ig svg,
.social-icon--sc svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.social-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.58rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 500;
}

.social-icon:hover,
.social-icon:focus-visible {
    color: var(--gold-hot);
    border-color: rgba(226, 194, 122, 0.34);
    background: rgba(226, 194, 122, 0.06);
    transform: translateY(-1px);
}

.shoutout {
    margin-bottom: 0.45rem;
    color: rgba(244, 234, 212, 0.34);
    font-size: 0.5rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.track-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
    align-items: baseline;
    justify-content: space-between;
}

.track-name {
    font-size: clamp(0.92rem, 1.8vw, 1.28rem);
}

.track-code {
    font-family: 'Space Grotesk', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.7rem;
}

.orbital-card--south {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
}

.orbital-card--south .orbital-label {
    margin-bottom: 0;
    flex-shrink: 0;
}

.temple-stats {
    margin-top: 0;
    justify-content: flex-end;
}

.noscript-panel {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 20;
    padding: 1rem 1.25rem;
    border-radius: 14px;
}

body.state-dormant .orbital-card {
    transform: translateY(0);
}

body.state-invocation .core-halo {
    opacity: calc(0.34 + var(--audio-energy) * 0.52);
}

/* Square glow border on temple-core removed */

body.state-transcendence .orbital-card {
    border-color: rgba(226, 194, 122, 0.26);
}

body.quality-c #shader-container {
    opacity: 0;
}

body.quality-c #fallback-layer {
    opacity: 0.34;
}

body.quality-b .fallback-sigil {
    opacity: 0.72;
}

body.long-pressing .portal-link {
    border-color: rgba(226, 194, 122, 0.42);
    box-shadow: 0 0 22px rgba(182, 146, 68, 0.18);
}

body.long-pressing .logo-fluid {
    transform: translateX(-50%) scale(1.015);
}

body.state-invocation .logo-fluid,
body.state-resonance .logo-fluid,
body.state-transcendence .logo-fluid {
    animation: logoBreath 6s ease-in-out infinite;
}

body.performance-guard #mandala-canvas {
    filter: none;
    opacity: 0.36;
}

body.performance-guard .logo-fluid {
    animation: none !important;
    filter:
        drop-shadow(0 0 4px rgba(255, 255, 255, 0.16))
        drop-shadow(0 0 10px rgba(255, 255, 255, 0.12));
}

body.performance-guard .marquee-text {
    will-change: auto;
}

@keyframes logoBreath {
    0%,
    100% {
        transform: translateX(-50%) translateY(0) scale(1);
    }
    50% {
        transform: translateX(-50%) translateY(-1px) scale(1.012);
    }
}

@media (hover: hover) {
    .orbital-card,
    .portal-link {
        transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
    }

    .orbital-card:hover {
        transform: translateY(-2px);
        border-color: rgba(226, 194, 122, 0.24);
    }

    .brand-logo-wrap:hover .logo-fluid {
        transform: translateX(-50%) scale(1.018);
    }
}

@media (max-width: 1280px) {
    :root {
        --shell-padding: clamp(0.9rem, 1.8vw, 1.25rem);
    }

    .brand-logo {
        width: min(100%, 280px);
    }
}

@media (max-width: 1080px) {
    .mandala-shell {
        width: min(96vw, 760px);
    }
}

@media (max-width: 900px) {
    .temple-shell {
        gap: 0.9rem;
    }

    .orbital-card,
    .temple-core {
        padding: 1rem;
    }

    .core-copy {
        max-width: 48ch;
    }

    .brand-logo {
        width: min(100%, 260px);
    }

    .altar-panel {
        width: min(92vw, 450px);
    }

    .orbital-card--south {
        flex-direction: column;
        align-items: flex-start;
    }

    .temple-stats {
        justify-content: flex-start;
    }
}

@media (max-width: 680px) {
    .temple-shell {
        padding: 0.5rem;
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
        gap: 0;
        justify-content: flex-start;
        min-height: auto;
    }

    .orbital-card,
    .temple-core {
        border-radius: 18px;
    }

    .temple-core {
        padding: 0.5rem 0.6rem 0.6rem;
        padding-top: clamp(0.4rem, 1.2vh, 0.8rem);
        width: 100%;
    }

    .portrait-altar {
        width: 68px;
        margin-bottom: clamp(0.15rem, 0.4vh, 0.35rem);
    }

    .brand-logo-wrap {
        margin-bottom: clamp(0.1rem, 0.3vh, 0.25rem);
    }

    .mandala-shell {
        width: min(100vw, 620px);
    }

    .mandala-inscription {
        font-size: 0.58rem;
        letter-spacing: 0.18em;
    }

    .orbital-copy {
        font-size: 0.78rem;
    }

    .control-row {
        width: 100%;
        gap: 0.6rem;
        margin-bottom: clamp(0.3rem, 0.6vh, 0.5rem);
    }

    .portal-link {
        width: 100%;
        min-height: 44px;
        padding: 0.6rem 0.8rem;
    }

    .brand-logo {
        width: min(100%, 200px);
        margin-inline: auto;
    }

    .altar-panel {
        padding: 0.55rem 0.65rem 0.45rem;
        width: min(94vw, 420px);
        max-width: calc(100vw - 1rem);
    }

    .divider {
        margin: clamp(0.2rem, 0.5vh, 0.45rem) 0 clamp(0.25rem, 0.6vh, 0.5rem);
    }

    .manifesto {
        gap: clamp(0.12rem, 0.3vh, 0.25rem);
        margin-bottom: clamp(0.3rem, 0.7vh, 0.6rem);
    }

    .manifesto p {
        font-size: 0.65rem;
    }

    .social-links {
        margin-bottom: clamp(0.2rem, 0.4vh, 0.4rem);
    }

    .shoutout {
        margin-bottom: 0.25rem;
    }

    .player-wrap {
        width: min(100%, 320px);
        max-width: calc(100vw - 1rem);
        padding: 0.4rem 0.65rem 0.35rem;
        margin-bottom: 0.5rem;
    }

    .player-top {
        gap: 0.75rem;
    }

    .status-row,
    .track-meta,
    .temple-stats,
    .micro-grid,
    .social-links {
        gap: 0.4rem 0.5rem;
    }
}

@media (max-width: 480px) {
    :root {
        --shell-padding: 0.4rem;
        --panel-width: min(96vw, 400px);
    }

    .temple-shell {
        justify-content: flex-start;
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0.5rem));
    }

    .orbital-card,
    .temple-core {
        border-radius: 16px;
    }

    .temple-core {
        padding: 0.35rem 0.5rem 0.5rem;
        padding-top: 0.4rem;
        width: 100%;
    }

    .brand-logo-wrap {
        margin-bottom: 0.1rem;
    }

    .brand-logo {
        width: min(100%, 170px);
    }

    .portrait-altar {
        width: 60px;
        padding: 3px;
        margin-bottom: 0.1rem;
    }

    .artist-subtitle {
        font-size: 0.52rem;
        letter-spacing: 0.28em;
    }

    .divider {
        margin: 0.2rem 0 0.25rem;
    }

    .divider-line {
        width: 30px;
    }

    .manifesto {
        gap: 0.1rem;
        margin-bottom: 0.3rem;
    }

    .manifesto p {
        font-size: 0.58rem;
        letter-spacing: 0.06em;
        line-height: 1.45;
    }

    .control-row {
        gap: 0.5rem;
        margin-bottom: 0.25rem;
    }

    .portal-link {
        min-height: 44px;
        padding: 0.5rem 0.7rem;
        letter-spacing: 0.14em;
        font-size: 0.62rem;
    }

    .social-icon--linktree {
        padding: 0.35rem 0.85rem;
    }

    .social-icon--ig,
    .social-icon--sc {
        width: 2.2rem;
        height: 2.2rem;
        min-width: 2.2rem;
        min-height: 2.2rem;
        padding: 0;
    }

    .social-links {
        gap: 0.5rem;
        margin-bottom: 0.15rem;
    }

    .shoutout {
        margin-bottom: 0.15rem;
        font-size: 0.42rem;
    }

    .orbital-copy,
    .audio-status {
        font-size: 0.72rem;
    }

    .status-pill,
    .track-code,
    .temple-stats,
    .micro-grid {
        font-size: 0.62rem;
    }

    .mandala-inscription {
        display: none;
    }

    .altar-panel {
        padding: 0.45rem 0.55rem 0.35rem;
        width: min(96vw, 400px);
        max-width: calc(100vw - 0.8rem);
    }

    .player-wrap {
        width: min(100%, 290px);
        max-width: calc(100vw - 1rem);
        padding: 0.35rem 0.55rem 0.3rem;
        margin-bottom: 0.4rem;
    }

    .player-display {
        height: 22px;
        margin-bottom: 0.3rem;
    }

    .marquee-text {
        font-size: 0.6rem;
        line-height: 22px;
    }

    .player-top {
        gap: 0.6rem;
        margin-bottom: 0.25rem;
    }

    .player-btn--skip {
        width: 34px;
        height: 34px;
    }

    .player-btn--play {
        width: 44px;
        height: 44px;
    }

    .player-seek {
        padding: 8px 0;
    }

    .player-time {
        font-size: 0.52rem;
        padding-top: 0;
    }

    .player-toggle {
        padding: 7px 0;
        margin-top: 4px;
        min-height: 44px;
    }

    .mandala-shell {
        width: min(96vw, 520px);
    }
}

@media (max-width: 380px) {
    :root {
        --panel-width: min(98vw, 360px);
    }

    .temple-core {
        padding: 0.25rem 0.35rem 0.35rem;
        padding-top: 0.25rem;
    }

    .brand-logo {
        width: min(100%, 140px);
    }

    .portrait-altar {
        width: 50px;
    }

    .artist-subtitle {
        font-size: 0.46rem;
        letter-spacing: 0.2em;
    }

    .manifesto p {
        font-size: 0.52rem;
    }

    .portal-link {
        font-size: 0.56rem;
        min-height: 42px;
        padding: 0.45rem 0.6rem;
    }

    .social-icon--linktree {
        padding: 0.3rem 0.7rem;
    }

    .social-icon--ig,
    .social-icon--sc {
        width: 2rem;
        height: 2rem;
        min-width: 2rem;
        min-height: 2rem;
        padding: 0;
    }

    .altar-panel {
        padding: 0.3rem 0.4rem 0.25rem;
        max-width: calc(100vw - 0.5rem);
    }

    .player-wrap {
        width: min(100%, 250px);
        max-width: calc(100vw - 0.8rem);
        padding: 0.25rem 0.45rem 0.2rem;
    }

    .player-btn--skip {
        width: 32px;
        height: 32px;
    }

    .player-btn--play {
        width: 40px;
        height: 40px;
    }

    .mandala-shell {
        width: min(98vw, 420px);
    }
}

/* Ultra-small screens (Galaxy Fold, etc.) */
@media (max-width: 320px) {
    :root {
        --panel-width: 100vw;
        --shell-padding: 0.25rem;
    }

    .temple-core {
        padding: 0.2rem 0.25rem 0.3rem;
    }

    .brand-logo {
        width: min(100%, 120px);
    }

    .portrait-altar {
        width: 44px;
        padding: 2px;
    }

    .artist-subtitle {
        font-size: 0.42rem;
        letter-spacing: 0.16em;
    }

    .manifesto p {
        font-size: 0.48rem;
    }

    .portal-link {
        font-size: 0.52rem;
        min-height: 40px;
    }

    .altar-panel {
        padding: 0.25rem 0.3rem 0.2rem;
        border-radius: 10px;
        max-width: calc(100vw - 0.5rem);
    }

    .player-wrap {
        width: calc(100vw - 1.5rem);
        padding: 0.2rem 0.4rem;
    }

    .social-icon--linktree {
        padding: 0.25rem 0.6rem;
    }

    .social-icon--ig,
    .social-icon--sc {
        width: 1.9rem;
        height: 1.9rem;
        min-width: 1.9rem;
        min-height: 1.9rem;
        padding: 0;
    }

    .social-links {
        gap: 0.35rem;
    }
}

@media (max-height: 760px) {
    .temple-shell {
        justify-content: flex-start;
        min-height: auto;
    }

    .mandala-shell {
        width: min(52vmin, 390px);
    }
}

@media (max-height: 680px) {
    .temple-shell {
        justify-content: flex-start;
        min-height: auto;
    }

    .temple-core {
        padding-top: 0.3rem;
    }

    .brand-logo-wrap {
        margin-bottom: 0.05rem;
    }

    .portrait-altar {
        width: 56px;
    }

    .divider {
        margin: 0.15rem 0 0.2rem;
    }

    .manifesto {
        gap: 0.08rem;
        margin-bottom: 0.25rem;
    }

    .manifesto p {
        font-size: 0.56rem;
    }

    .control-row {
        margin-bottom: 0.2rem;
    }

    .social-links {
        margin-bottom: 0.1rem;
    }

    .shoutout {
        margin-bottom: 0.1rem;
    }
}

/* Very short screens — e.g. landscape on small phones */
@media (max-height: 500px) {
    .temple-shell {
        min-height: auto;
        padding-top: 0.2rem;
    }

    .brand-logo {
        width: min(100%, 120px);
    }

    .portrait-altar {
        width: 44px;
    }

    .artist-subtitle {
        font-size: 0.44rem;
    }

    .manifesto p {
        font-size: 0.48rem;
    }

    .mandala-shell {
        width: min(40vmin, 300px);
    }
}

@media (orientation: landscape) and (max-height: 560px) {
    .temple-shell {
        gap: 0;
        justify-content: flex-start;
        min-height: auto;
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
    }

    .temple-core {
        padding-top: 0.25rem;
        flex-direction: column;
        width: 100%;
    }

    .portrait-altar {
        width: 48px;
    }

    .core-copy {
        line-height: 1.55;
    }

    .brand-logo {
        width: min(100%, 130px);
    }

    .altar-panel {
        padding: 0.4rem 0.6rem 0.3rem;
        width: min(60vw, 380px);
    }

    .manifesto {
        gap: 0.1rem;
        margin-bottom: 0.25rem;
    }

    .manifesto p {
        font-size: 0.54rem;
    }

    .divider {
        margin: 0.1rem 0 0.15rem;
    }

    .control-row {
        margin-bottom: 0.2rem;
    }

    .social-links {
        margin-bottom: 0.1rem;
    }

    .shoutout {
        margin-bottom: 0.08rem;
        font-size: 0.38rem;
    }

    .player-wrap {
        width: min(100%, 280px);
        padding: 0.25rem 0.45rem 0.2rem;
        margin-bottom: 0.25rem;
    }

    .player-display {
        height: 18px;
        margin-bottom: 0.2rem;
    }

    .marquee-text {
        font-size: 0.54rem;
        line-height: 18px;
    }

    .player-top {
        gap: 0.5rem;
        margin-bottom: 0.15rem;
    }

    .player-seek {
        padding: 4px 0;
    }

    .player-time {
        font-size: 0.48rem;
        padding-top: 0;
    }

    .mandala-shell {
        width: min(45vmin, 340px);
    }

    .brand-logo-wrap {
        margin-bottom: 0;
    }
}

/* Landscape on phones with taller screens */
@media (orientation: landscape) and (max-height: 450px) {
    .portrait-altar {
        width: 40px;
    }

    .brand-logo {
        width: min(100%, 100px);
    }

    .manifesto p {
        font-size: 0.5rem;
    }

    .altar-panel {
        padding: 0.3rem 0.5rem 0.25rem;
        width: min(55vw, 340px);
    }

    .mandala-shell {
        width: min(38vmin, 280px);
    }

    .player-wrap {
        width: min(100%, 240px);
        padding: 0.2rem 0.4rem 0.15rem;
    }

    .player-btn--skip {
        width: 28px;
        height: 28px;
    }

    .player-btn--play {
        width: 36px;
        height: 36px;
    }
}

@media (pointer: coarse) {
    .portal-link,
    .social-link,
    .status-pill {
        min-height: 44px;
    }

    .social-icon--linktree {
        padding: 0.5rem 1.1rem;
        min-height: 44px;
    }

    .social-icon--ig,
    .social-icon--sc {
        width: 2.5rem;
        height: 2.5rem;
        min-width: 2.5rem;
        min-height: 2.5rem;
        padding: 0;
    }

    .social-icon--ig svg,
    .social-icon--sc svg {
        width: 18px;
        height: 18px;
    }

    .player-btn--skip {
        width: 42px;
        height: 42px;
    }

    .player-btn--play {
        width: 54px;
        height: 54px;
    }

    .seek-track {
        height: 6px;
    }

    .seek-head {
        width: 18px;
        height: 18px;
    }

    .player-seek {
        padding: 14px 0;
    }

    .player-display {
        height: 28px;
    }

    .marquee-text {
        line-height: 28px;
    }

    .player-toggle {
        min-height: 44px;
    }

    .dock-portal {
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
    }

    .dock-portal .player-toggle {
        min-height: 48px;
    }

    /* Ensure adequate spacing between tap targets */
    .social-links {
        gap: 0.75rem;
    }

    .player-top {
        gap: 1.2rem;
    }
}

@supports not (display: grid) {
    .temple-shell {
        position: relative;
        display: block;
        padding: 1rem;
    }

    .orbital-card,
    .temple-core {
        margin-bottom: 1rem;
    }
}

@supports not (aspect-ratio: 1) {
    .fallback-sigil,
    .mandala-shell,
    .portrait-altar {
        height: auto;
    }
}

@supports not ((filter: drop-shadow(0 0 2px #000))) {
    .logo-fluid {
        filter: none;
    }

    .brand-logo-wrap::before,
    #mandala-canvas,
    .fallback-sigil {
        filter: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
        scroll-behavior: auto !important;
    }

    body {
        --pointer-energy: 0;
    }

    #fallback-layer {
        opacity: 0.3;
    }
}