:root {
    color-scheme: dark;
    --ink: #f4d9ee;
    --stone: rgba(20, 15, 18, 0.7);
    --stone-edge: rgba(255, 234, 245, 0.12);
    --focus-ring: rgba(255, 152, 214, 0.9);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #080508;
}

body {
    font-family: "Avenir Next Condensed", "Trebuchet MS", "Gill Sans", sans-serif;
}

.app-shell {
    position: fixed;
    inset: 0;
    width: 100vw;
    width: 100dvw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    outline: none;
    background:
        radial-gradient(circle at 50% 35%, rgba(42, 14, 33, 0.32), transparent 48%),
        radial-gradient(circle at 50% 65%, rgba(12, 6, 12, 0.9), rgba(5, 4, 6, 1) 72%);
    touch-action: none;
}

.app-shell:focus-visible .title-plaque,
.app-shell:focus-within .title-plaque {
    border-color: rgba(255, 214, 238, 0.22);
    box-shadow:
        0 0 0 1px rgba(255, 214, 238, 0.06),
        0 18px 36px rgba(0, 0, 0, 0.25);
}

#scene {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.hud {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding:
        calc(env(safe-area-inset-top, 0px) + 1rem)
        calc(env(safe-area-inset-right, 0px) + 1rem)
        calc(env(safe-area-inset-bottom, 0px) + 1rem)
        calc(env(safe-area-inset-left, 0px) + 1rem);
}

.title-plaque {
    max-width: min(28rem, 42vw);
    padding: 0.95rem 1.1rem 1rem;
    border: 1px solid rgba(255, 219, 239, 0.11);
    border-radius: 1rem 1rem 1.1rem 1rem;
    background:
        linear-gradient(180deg, rgba(36, 28, 33, 0.68), rgba(12, 9, 11, 0.54)),
        rgba(9, 7, 9, 0.36);
    backdrop-filter: blur(10px);
    box-shadow:
        0 24px 48px rgba(0, 0, 0, 0.24),
        inset 0 1px 0 rgba(255, 244, 249, 0.05);
    transition: opacity 600ms ease, transform 600ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.title-plaque.is-muted {
    opacity: 0.55;
    transform: translateY(-0.35rem);
}

.eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.74rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(255, 213, 236, 0.62);
}

.title-plaque h1 {
    margin: 0;
    font-family: "Iowan Old Style", "Palatino Linotype", "URW Palladio L", serif;
    font-size: clamp(1.2rem, 1.75vw, 1.72rem);
    line-height: 1.05;
    font-weight: 500;
    color: rgba(255, 236, 245, 0.94);
}

.hint-text {
    margin: 0.55rem 0 0;
    max-width: 27rem;
    font-size: 0.92rem;
    line-height: 1.4;
    color: rgba(242, 214, 232, 0.78);
    transition: opacity 600ms ease;
}

.hint-text.is-muted {
    opacity: 0.34;
}

.control-cluster {
    display: flex;
    gap: 0.65rem;
    align-self: flex-end;
    pointer-events: auto;
}

.slate-button {
    appearance: none;
    border: 1px solid rgba(255, 219, 239, 0.14);
    border-radius: 999px;
    padding: 0.72rem 1rem;
    font: inherit;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    color: rgba(255, 236, 245, 0.88);
    background:
        linear-gradient(180deg, rgba(40, 31, 37, 0.92), rgba(13, 10, 12, 0.84));
    box-shadow:
        0 12px 22px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 245, 250, 0.05);
    cursor: pointer;
    transition:
        transform 180ms ease,
        border-color 180ms ease,
        background 180ms ease,
        color 180ms ease;
}

.slate-button:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 224, 242, 0.24);
}

.slate-button:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

.slate-button[data-muted="true"] {
    color: rgba(255, 217, 238, 0.78);
    background:
        linear-gradient(180deg, rgba(66, 25, 48, 0.96), rgba(31, 8, 20, 0.88));
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 860px) {
    .hud {
        flex-direction: column;
        gap: 0.9rem;
        justify-content: space-between;
    }

    .title-plaque {
        max-width: min(30rem, calc(100vw - 2rem));
        padding: 0.9rem 0.95rem 0.95rem;
    }

    .control-cluster {
        align-self: stretch;
        justify-content: flex-end;
        gap: 0.5rem;
    }
}

@media (max-width: 620px) {
    .hud {
        padding:
            calc(env(safe-area-inset-top, 0px) + 0.75rem)
            calc(env(safe-area-inset-right, 0px) + 0.75rem)
            calc(env(safe-area-inset-bottom, 0px) + 0.85rem)
            calc(env(safe-area-inset-left, 0px) + 0.75rem);
    }

    .title-plaque {
        max-width: min(100%, 22rem);
        padding: 0.82rem 0.88rem;
        border-radius: 0.9rem;
        backdrop-filter: blur(6px);
    }

    .title-plaque h1 {
        font-size: 1.06rem;
    }

    .hint-text {
        font-size: 0.84rem;
    }

    .slate-button {
        padding: 0.68rem 0.88rem;
        font-size: 0.83rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .title-plaque,
    .slate-button {
        transition: none;
    }
}
