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

:root {
    --accent-cream: #d4b896;
    --accent-tan: #b8956f;
    --accent-warm: #c4a078;
    --accent-brown: #8a6d4f;
    --accent-deep: #5c4a38;
    --accent-coffee: #3a2218;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    color: #8a8a8a;
    font-family: "Share Tech Mono", monospace;
    cursor: none;
}

.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ── Intro screen ── */

.intro {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    cursor: none;
    transition: opacity 1.2s ease;
}

.intro.fade-out {
    opacity: 0;
    pointer-events: none;
}

.intro-text {
    font-family: "Special Elite", cursive;
    font-size: 0.72rem;
    letter-spacing: 0.35em;
    text-transform: lowercase;
    color: #b8b8b8;
    animation: breathe 3s ease-in-out infinite;
    user-select: none;
}

.intro-text::before {
    content: "[ ";
    color: #666;
}

.intro-text::after {
    content: " ]";
    color: #666;
}

@keyframes breathe {

    0%,
    100% {
        opacity: 0.65;
    }

    50% {
        opacity: 1;
    }
}

/* ── Main layout ── */

.main {
    position: fixed;
    inset: 0;
    background: #000;
    transition: opacity 1.4s ease;
}

.main.visible {
    opacity: 1;
    pointer-events: auto;
}

/* ── Atmosphere overlays ── */

.grain {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 180px;
}

.vignette {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.85) 100%);
}

.scanlines {
    position: fixed;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.12) 2px,
            rgba(0, 0, 0, 0.12) 4px);
    opacity: 0.3;
}

/* ── Glitch title ── */

.header {
    position: fixed;
    top: 2.5rem;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.title {
    font-family: "Special Elite", cursive;
    font-size: clamp(2.4rem, 7vw, 4.5rem);
    font-weight: 400;
    letter-spacing: 0.55em;
    text-indent: 0.55em;
    text-transform: lowercase;
    position: relative;
    display: inline-block;
}

.title-main,
.title-outline,
.title-glitch {
    font: inherit;
    letter-spacing: inherit;
    text-indent: inherit;
    text-transform: inherit;
}

.title-main {
    position: relative;
    z-index: 3;
    color: #fff;
    animation: warm-glow 4s ease-in-out infinite, title-shake 3.5s infinite steps(1);
}

.title-outline {
    position: absolute;
    inset: 0;
    z-index: 1;
    color: transparent;
    -webkit-text-stroke: 1.5px var(--accent-tan);
    filter: drop-shadow(0 0 8px rgba(184, 149, 111, 0.35));
}

.title-glitch {
    position: absolute;
    inset: 0;
    z-index: 2;
    opacity: 0;
    pointer-events: none;
}

.title-glitch-a {
    color: var(--accent-cream);
    -webkit-text-stroke: 0.5px var(--accent-cream);
    animation: glitch-a 3.5s infinite steps(1);
}

.title-glitch-b {
    color: var(--accent-brown);
    -webkit-text-stroke: 0.5px var(--accent-brown);
    animation: glitch-b 4s infinite steps(1);
}

@keyframes warm-glow {

    0%,
    100% {
        text-shadow:
            0 0 6px rgba(255, 255, 255, 0.55),
            0 0 14px rgba(212, 184, 150, 0.6),
            0 0 28px rgba(184, 149, 111, 0.4),
            0 0 50px rgba(138, 109, 79, 0.22);
    }

    50% {
        text-shadow:
            0 0 8px rgba(255, 255, 255, 0.65),
            0 0 18px rgba(196, 160, 120, 0.7),
            0 0 36px rgba(184, 149, 111, 0.5),
            0 0 64px rgba(92, 74, 56, 0.28);
    }
}

@keyframes title-shake {

    0%,
    78%,
    86%,
    100% {
        transform: translate(0);
    }

    79% {
        transform: translate(-3px, 1px);
    }

    80% {
        transform: translate(3px, -2px);
    }

    81% {
        transform: translate(-2px, 0);
    }

    82% {
        transform: translate(2px, 1px);
    }

    88% {
        transform: translate(-2px, -1px);
    }

    89% {
        transform: translate(3px, 1px);
    }

    90% {
        transform: translate(-3px, 0);
    }
}

@keyframes glitch-a {

    0%,
    78%,
    86%,
    100% {
        opacity: 0;
        transform: translate(0);
        clip-path: inset(0 0 100% 0);
    }

    79% {
        opacity: 1;
        transform: translate(-7px, 2px);
        clip-path: inset(8% 0 52% 0);
    }

    80% {
        opacity: 0.95;
        transform: translate(6px, -3px);
        clip-path: inset(55% 0 5% 0);
    }

    81% {
        opacity: 0.85;
        transform: translate(-5px, 1px);
        clip-path: inset(30% 0 35% 0);
    }

    82% {
        opacity: 0.7;
        transform: translate(4px, -1px);
        clip-path: inset(68% 0 10% 0);
    }

    87% {
        opacity: 1;
        transform: translate(-6px, -2px);
        clip-path: inset(15% 0 60% 0);
    }

    88% {
        opacity: 0.9;
        transform: translate(5px, 2px);
        clip-path: inset(58% 0 8% 0);
    }

    89% {
        opacity: 0.75;
        transform: translate(-4px, 0);
        clip-path: inset(42% 0 30% 0);
    }
}

@keyframes glitch-b {

    0%,
    76%,
    84%,
    100% {
        opacity: 0;
        transform: translate(0);
        clip-path: inset(0 0 100% 0);
    }

    77% {
        opacity: 0.95;
        transform: translate(8px, -2px);
        clip-path: inset(5% 0 68% 0);
    }

    78% {
        opacity: 0.85;
        transform: translate(-6px, 3px);
        clip-path: inset(45% 0 22% 0);
    }

    79% {
        opacity: 0.7;
        transform: translate(5px, -1px);
        clip-path: inset(70% 0 4% 0);
    }

    80% {
        opacity: 0.55;
        transform: translate(-3px, 2px);
        clip-path: inset(22% 0 48% 0);
    }

    85% {
        opacity: 1;
        transform: translate(-7px, 1px);
        clip-path: inset(10% 0 65% 0);
    }

    86% {
        opacity: 0.9;
        transform: translate(6px, -2px);
        clip-path: inset(50% 0 18% 0);
    }

    87% {
        opacity: 0.8;
        transform: translate(-5px, 2px);
        clip-path: inset(75% 0 3% 0);
    }
}

/* ── Left-side links ── */

.links {
    position: fixed;
    left: clamp(1.5rem, 5vw, 4rem);
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.link {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    text-decoration: none;
    color: #a8a8a8;
    font-size: 0.78rem;
    letter-spacing: 0.2em;
    text-transform: lowercase;
    padding: 0.5rem 0;
    border: none;
    border-left: 1px solid transparent;
    padding-left: 0.8rem;
    background: none;
    font-family: "Share Tech Mono", monospace;
    transition: color 0.35s ease, border-color 0.35s ease, text-shadow 0.35s ease, transform 0.35s ease;
    cursor: none;
}

.link:hover,
.link:focus-visible {
    color: var(--accent-cream);
    border-left-color: var(--accent-tan);
    text-shadow: 0 0 12px rgba(184, 149, 111, 0.45);
    transform: translateX(4px);
    outline: none;
}

.link:hover .link-index,
.link:focus-visible .link-index {
    color: var(--accent-warm);
}

.link:hover .link-label::after,
.link:focus-visible .link-label::after {
    width: 100%;
}

.link:hover .link-arrow,
.link:focus-visible .link-arrow {
    opacity: 1;
    transform: translateX(0);
}

.link-index {
    font-size: 0.6rem;
    color: #666;
    letter-spacing: 0.1em;
    transition: color 0.35s ease;
}

.link-label {
    position: relative;
}

.link-label::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 1px;
    background: var(--accent-tan);
    transition: width 0.4s ease;
}

.link-arrow {
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.35s ease, transform 0.35s ease;
    color: var(--accent-cream);
    font-size: 0.7rem;
}

/* ── Email card modal ── */

.email-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s ease;
}

.email-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.email-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.email-card {
    position: relative;
    z-index: 1;
    width: min(92vw, 340px);
    padding: 1.35rem 1.25rem 1.15rem;
    background: rgba(12, 12, 12, 0.95);
    border: 1px solid rgba(138, 109, 79, 0.22);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    transform: translateY(10px);
    opacity: 0;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.email-modal.is-open .email-card {
    transform: translateY(0);
    opacity: 1;
}

.email-card-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #666;
    font-size: 1.25rem;
    line-height: 1;
    cursor: none;
    transition: color 0.25s ease;
}

.email-card-close:hover {
    color: var(--accent-cream);
}

.email-card-title {
    font-family: "Share Tech Mono", monospace;
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: lowercase;
    color: #888;
    margin-bottom: 1rem;
}

.email-card-address {
    display: block;
    font-family: "Share Tech Mono", monospace;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    color: #e0e0e0;
    text-decoration: none;
    padding: 0.7rem 0.85rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(138, 109, 79, 0.15);
    border-radius: 10px;
    transition: color 0.25s ease, border-color 0.25s ease;
    cursor: none;
}

.email-card-address:hover {
    color: var(--accent-cream);
    border-color: rgba(138, 109, 79, 0.3);
}

.email-card-actions {
    display: flex;
    gap: 0.5rem;
}

.email-card-copy,
.email-card-send {
    flex: 1;
    padding: 0.5rem 0.6rem;
    font-family: "Share Tech Mono", monospace;
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: lowercase;
    text-align: center;
    text-decoration: none;
    border: 1px solid rgba(138, 109, 79, 0.25);
    border-radius: 10px;
    cursor: none;
    transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.email-card-copy {
    background: rgba(138, 109, 79, 0.1);
    color: var(--accent-cream);
}

.email-card-copy:hover {
    border-color: var(--accent-tan);
    background: rgba(138, 109, 79, 0.16);
}

.email-card-copy.is-copied {
    color: #fff;
    border-color: var(--accent-tan);
}

.email-card-send {
    background: transparent;
    color: #aaa;
}

.email-card-send:hover {
    color: var(--accent-cream);
    border-color: rgba(138, 109, 79, 0.4);
}

/* ── Guestbook IRC ── */

.guestbook-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.guestbook-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.guestbook-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.guestbook-panel {
    position: relative;
    z-index: 1;
    width: min(94vw, 560px);
    border: 1px solid rgba(138, 109, 79, 0.28);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.8),
        0 18px 40px rgba(0, 0, 0, 0.7),
        inset 0 0 24px rgba(138, 109, 79, 0.04);
    transform: translateY(8px) scale(0.98);
    opacity: 0;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.guestbook-modal.is-open .guestbook-panel {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.guestbook-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.45rem 0.6rem;
    background: linear-gradient(180deg, rgba(138, 109, 79, 0.12) 0%, rgba(8, 8, 8, 0.98) 100%);
    border-bottom: 1px solid rgba(138, 109, 79, 0.18);
}

.guestbook-header-left {
    display: flex;
    align-items: baseline;
    gap: 0.65rem;
    min-width: 0;
}

.guestbook-channel {
    font-family: "Share Tech Mono", monospace;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    color: var(--accent-cream);
    text-shadow: 0 0 8px rgba(184, 149, 111, 0.25);
}

.guestbook-server {
    font-family: "Share Tech Mono", monospace;
    font-size: 0.58rem;
    letter-spacing: 0.08em;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.guestbook-close {
    flex-shrink: 0;
    border: 1px solid rgba(138, 109, 79, 0.25);
    padding: 0.15rem 0.45rem;
    background: rgba(0, 0, 0, 0.35);
    color: #666;
    font-family: "Share Tech Mono", monospace;
    font-size: 0.62rem;
    line-height: 1.2;
    cursor: none;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.guestbook-close:hover {
    color: var(--accent-cream);
    border-color: rgba(184, 149, 111, 0.38);
    background: rgba(138, 109, 79, 0.1);
}

.guestbook-feed {
    max-height: 210px;
    overflow-y: auto;
    padding: 0.5rem 0.55rem;
    background:
        repeating-linear-gradient(0deg,
            rgba(138, 109, 79, 0.025) 0,
            rgba(138, 109, 79, 0.025) 1px,
            transparent 1px,
            transparent 3px),
        rgba(0, 0, 0, 0.95);
    scrollbar-width: thin;
    scrollbar-color: rgba(138, 109, 79, 0.35) transparent;
}

.guestbook-feed::-webkit-scrollbar {
    width: 6px;
}

.guestbook-feed::-webkit-scrollbar-thumb {
    background: rgba(138, 109, 79, 0.35);
}

.guestbook-empty {
    font-family: "Share Tech Mono", monospace;
    font-size: 0.64rem;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: #666;
    padding: 0.75rem 0.25rem;
}

.guestbook-status {
    padding: 0.45rem 0.65rem;
    font-family: "Share Tech Mono", monospace;
    font-size: 0.62rem;
    line-height: 1.45;
    letter-spacing: 0.02em;
    color: var(--accent-warm);
    background: rgba(138, 109, 79, 0.08);
    border-bottom: 1px solid rgba(138, 109, 79, 0.14);
}

.guestbook-status[hidden] {
    display: none;
}

.guestbook-line {
    display: block;
    padding: 0.12rem 0;
    font-family: "Share Tech Mono", monospace;
    font-size: 0.68rem;
    line-height: 1.55;
    word-break: break-word;
}

.guestbook-time {
    color: #555;
    margin-right: 0.35rem;
}

.guestbook-name {
    margin-right: 0.35rem;
    font-weight: 400;
}

.guestbook-name.is-anonymous {
    color: #666 !important;
}

.guestbook-text {
    color: #c8c8c8;
}

.guestbook-compose {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.5rem;
    background: rgba(8, 8, 8, 0.98);
    border-top: 1px solid rgba(138, 109, 79, 0.18);
}

.guestbook-bracket {
    flex-shrink: 0;
    font-family: "Share Tech Mono", monospace;
    font-size: 0.72rem;
    color: var(--accent-brown);
}

.guestbook-nick-input {
    width: 78px;
    flex-shrink: 0;
    padding: 0.38rem 0.35rem;
    font-family: "Share Tech Mono", monospace;
    font-size: 0.64rem;
    letter-spacing: 0.04em;
    color: var(--accent-cream);
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(138, 109, 79, 0.18);
    outline: none;
    cursor: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.guestbook-msg {
    flex: 1;
    min-width: 0;
    padding: 0.38rem 0.45rem;
    font-family: "Share Tech Mono", monospace;
    font-size: 0.66rem;
    letter-spacing: 0.03em;
    color: #ddd;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(138, 109, 79, 0.18);
    outline: none;
    cursor: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.guestbook-nick-input::placeholder,
.guestbook-msg::placeholder {
    color: #555;
}

.guestbook-nick-input:focus,
.guestbook-msg:focus {
    border-color: rgba(184, 149, 111, 0.38);
    box-shadow: 0 0 0 1px rgba(184, 149, 111, 0.08);
}

.guestbook-send {
    flex-shrink: 0;
    padding: 0.38rem 0.65rem;
    border: 1px solid rgba(138, 109, 79, 0.25);
    background: rgba(138, 109, 79, 0.1);
    color: var(--accent-cream);
    font-family: "Share Tech Mono", monospace;
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: lowercase;
    line-height: 1;
    cursor: none;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.guestbook-send:hover {
    border-color: var(--accent-tan);
    color: var(--accent-cream);
    background: rgba(138, 109, 79, 0.18);
}

.guestbook-send:active {
    background: rgba(138, 109, 79, 0.08);
}

.guestbook-send:disabled {
    opacity: 0.45;
}

/* ── Sky: stars & birds ── */

.sky {
    position: fixed;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    overflow: hidden;
}

.stars {
    position: absolute;
    inset: 0;
}

.shooting-stars {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.shooting-star {
    position: absolute;
    height: 1px;
    border-radius: 1px;
    opacity: 0;
    transform: rotate(var(--shoot-angle, -32deg));
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.95) 0%,
            rgba(212, 184, 150, 0.55) 35%,
            transparent 100%);
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.25);
    animation: shooting-star-fly var(--shoot-duration, 1s) ease-out forwards;
}

.shooting-star::after {
    content: "";
    position: absolute;
    left: 0;
    top: -1px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.45);
}

@keyframes shooting-star-fly {
    0% {
        opacity: 0;
        transform: rotate(var(--shoot-angle, -32deg)) translateX(0) scaleX(0.4);
    }

    8% {
        opacity: var(--shoot-opacity, 0.85);
    }

    100% {
        opacity: 0;
        transform: rotate(var(--shoot-angle, -32deg)) translateX(var(--shoot-distance, 220px)) scaleX(1);
    }
}

.star {
    position: absolute;
    border-radius: 50%;
    background: #c8c8c8;
    animation: twinkle var(--duration, 4s) ease-in-out infinite;
    animation-delay: var(--delay, 0s);
}

@keyframes twinkle {

    0%,
    100% {
        opacity: var(--base-opacity, 0.15);
        transform: scale(1);
    }

    50% {
        opacity: calc(var(--base-opacity, 0.15) + 0.35);
        transform: scale(1.3);
    }
}

.birds {
    position: absolute;
    inset: 0;
}

.bird {
    position: absolute;
    opacity: 0;
    animation: bird-fly var(--duration, 18s) linear infinite;
    animation-delay: var(--delay, 0s);
}

.bird svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: #2a2a2a;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bird-wing {
    transform-origin: center;
    animation: wing-flap 0.6s ease-in-out infinite;
}

@keyframes bird-fly {
    0% {
        opacity: 0;
        transform: translateX(-30px) translateY(0);
    }

    5% {
        opacity: var(--bird-opacity, 0.35);
    }

    95% {
        opacity: var(--bird-opacity, 0.35);
    }

    100% {
        opacity: 0;
        transform: translateX(calc(100vw + 30px)) translateY(var(--drift, 20px));
    }
}

@keyframes wing-flap {

    0%,
    100% {
        transform: scaleY(1);
    }

    50% {
        transform: scaleY(0.55);
    }
}

/* ── Bottom-right: noir coffee scene ── */

.corner-scene {
    position: fixed;
    right: clamp(0.75rem, 2.5vw, 2rem);
    bottom: 0;
    z-index: 10;
    pointer-events: none;
    width: clamp(195px, 28vw, 330px);
    display: flex;
    align-items: flex-end;
}

.desk-surface {
    position: fixed;
    right: 0;
    bottom: 0;
    width: min(42vw, 360px);
    height: 1px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(92, 74, 56, 0.15) 20%,
            rgba(138, 109, 79, 0.35) 50%,
            rgba(92, 74, 56, 0.2) 80%,
            transparent 100%);
    box-shadow: 0 0 12px rgba(184, 149, 111, 0.08);
}

.scene-glow {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 150%;
    height: 75%;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at bottom, rgba(184, 149, 111, 0.18) 0%, rgba(92, 74, 56, 0.06) 45%, transparent 72%);
    animation: glow-breathe 5s ease-in-out infinite;
}

.coffee-scene {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0.94;
    filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 20px rgba(184, 149, 111, 0.12));
}

.steam {
    transform-origin: center bottom;
}

.steam-a {
    animation: steam-rise 4.5s ease-in-out infinite;
}

.steam-b {
    animation: steam-rise 5.5s ease-in-out infinite 1.2s;
}

.steam-c {
    animation: steam-rise 4s ease-in-out infinite 2.4s;
}

@keyframes glow-breathe {

    0%,
    100% {
        opacity: 0.6;
        transform: translateX(-50%) scale(1);
    }

    50% {
        opacity: 1;
        transform: translateX(-50%) scale(1.08);
    }
}

@keyframes steam-rise {
    0% {
        opacity: 0;
        transform: translateY(8px) translateX(0);
    }

    20% {
        opacity: 1;
    }

    80% {
        opacity: 0.6;
    }

    100% {
        opacity: 0;
        transform: translateY(-14px) translateX(var(--steam-drift, 3px));
    }
}

.steam-a {
    --steam-drift: -4px;
}

.steam-b {
    --steam-drift: 2px;
}

.steam-c {
    --steam-drift: 5px;
}

/* ── Volume control ── */

.volume-control {
    position: fixed;
    left: 50%;
    bottom: clamp(1.25rem, 3.5vw, 2.25rem);
    transform: translateX(-50%) translateY(14px);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    cursor: none;
    opacity: 0;
    transition: opacity 1.1s ease 0.9s, transform 1.1s ease 0.9s;
}

.main.visible .volume-control {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.volume-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: "Share Tech Mono", monospace;
    font-size: 0.82rem;
    letter-spacing: 0.18em;
    text-transform: lowercase;
    color: #888;
    cursor: none;
}

.volume-index {
    font-size: 0.74rem;
    color: #666;
    letter-spacing: 0.12em;
    transition: color 0.35s ease;
}

.volume-text {
    color: #999;
    transition: color 0.35s ease, text-shadow 0.35s ease;
}

.volume-readout {
    font-size: 0.76rem;
    color: var(--accent-warm);
    letter-spacing: 0.06em;
    opacity: 0.7;
    min-width: 2em;
    text-align: right;
    transition: opacity 0.35s ease, color 0.35s ease, text-shadow 0.35s ease;
}

.volume-readout.pulse {
    animation: readout-pulse 0.45s ease;
}

@keyframes readout-pulse {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.12);
        color: var(--accent-cream);
        text-shadow: 0 0 10px rgba(184, 149, 111, 0.5);
    }

    100% {
        transform: scale(1);
    }
}

.volume-control:hover .volume-index,
.volume-control:focus-within .volume-index {
    color: var(--accent-brown);
}

.volume-control:hover .volume-text,
.volume-control:focus-within .volume-text {
    color: var(--accent-cream);
    text-shadow: 0 0 10px rgba(184, 149, 111, 0.35);
}

.volume-control:hover .volume-readout,
.volume-control:focus-within .volume-readout {
    opacity: 1;
    color: var(--accent-cream);
}

.volume-track {
    --vol-fill: 60%;
    position: relative;
    width: clamp(140px, 22vw, 220px);
    padding: 0.55rem 0.85rem 0.5rem;
    border: 1px solid rgba(138, 109, 79, 0.22);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.5);
    box-shadow:
        0 0 20px rgba(0, 0, 0, 0.45),
        inset 0 0 16px rgba(184, 149, 111, 0.04);
    overflow: hidden;
    transition: border-color 0.4s ease, box-shadow 0.4s ease, transform 0.4s ease;
}

.volume-track::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: var(--vol-fill);
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-tan), var(--accent-cream));
    box-shadow: 0 0 10px rgba(184, 149, 111, 0.45);
    transition: width 0.15s ease;
}

.volume-track-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 50%, rgba(184, 149, 111, 0.08) 0%, transparent 65%);
    animation: vol-glow-breathe 5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes vol-glow-breathe {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

.volume-eq {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    height: 14px;
    margin-bottom: 0.45rem;
    pointer-events: none;
}

.volume-eq span {
    width: 3px;
    height: 4px;
    border-radius: 1px;
    background: linear-gradient(to top, var(--accent-brown), var(--accent-cream));
    opacity: 0.3;
    transform-origin: bottom;
    transition: height 0.08s ease-out, opacity 0.1s ease-out;
}

.volume-control.is-live .volume-eq span {
    box-shadow: 0 0 6px rgba(184, 149, 111, 0.25);
}

.volume-control:hover .volume-eq span,
.volume-control:focus-within .volume-eq span {
    opacity: 0.55;
}

.volume-control:hover .volume-track,
.volume-control:focus-within .volume-track {
    border-color: rgba(184, 149, 111, 0.38);
    box-shadow:
        0 0 28px rgba(184, 149, 111, 0.1),
        inset 0 0 18px rgba(184, 149, 111, 0.06);
    transform: translateY(-2px);
}

.volume-control.is-dragging .volume-track {
    border-color: rgba(212, 184, 150, 0.45);
    box-shadow:
        0 0 32px rgba(184, 149, 111, 0.15),
        inset 0 0 20px rgba(184, 149, 111, 0.08);
}

.volume-slider {
    --vol-fill: 60%;
    position: relative;
    z-index: 1;
    width: 100%;
    height: 3px;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    cursor: none;
    outline: none;
}

.volume-slider::-webkit-slider-runnable-track {
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg,
            var(--accent-tan) 0%,
            var(--accent-warm) calc(var(--vol-fill) - 2%),
            var(--accent-cream) var(--vol-fill),
            rgba(30, 30, 30, 0.95) var(--vol-fill),
            rgba(30, 30, 30, 0.95) 100%);
    box-shadow: 0 0 10px rgba(184, 149, 111, 0.25);
    transition: box-shadow 0.3s ease;
}

.volume-control:hover .volume-slider::-webkit-slider-runnable-track,
.volume-control:focus-within .volume-slider::-webkit-slider-runnable-track {
    box-shadow: 0 0 14px rgba(184, 149, 111, 0.35);
}

.volume-slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 11px;
    height: 11px;
    margin-top: -4px;
    border-radius: 50%;
    border: 1px solid var(--accent-brown);
    background: radial-gradient(circle at 35% 35%, var(--accent-cream), var(--accent-tan));
    box-shadow:
        0 0 8px rgba(212, 184, 150, 0.65),
        0 0 16px rgba(184, 149, 111, 0.3);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    animation: thumb-glow 3s ease-in-out infinite;
}

@keyframes thumb-glow {

    0%,
    100% {
        box-shadow: 0 0 8px rgba(212, 184, 150, 0.55), 0 0 16px rgba(184, 149, 111, 0.25);
    }

    50% {
        box-shadow: 0 0 12px rgba(212, 184, 150, 0.8), 0 0 24px rgba(184, 149, 111, 0.4);
    }
}

.volume-slider:active::-webkit-slider-thumb,
.volume-slider:hover::-webkit-slider-thumb {
    transform: scale(1.2);
}

.volume-slider::-moz-range-track {
    height: 3px;
    border: none;
    border-radius: 2px;
    background: rgba(30, 30, 30, 0.95);
    box-shadow: 0 0 10px rgba(184, 149, 111, 0.2);
}

.volume-slider::-moz-range-progress {
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent-tan), var(--accent-warm), var(--accent-cream));
    box-shadow: 0 0 10px rgba(184, 149, 111, 0.3);
}

.volume-slider::-moz-range-thumb {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 1px solid var(--accent-brown);
    background: var(--accent-tan);
    box-shadow: 0 0 10px rgba(184, 149, 111, 0.45);
    cursor: none;
}

/* ── osu-style cursor ── */

#cursor-trail {
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
}

.cursor-ball {
    position: fixed;
    top: 0;
    left: 0;
    width: 11px;
    height: 11px;
    margin: -5.5px 0 0 -5.5px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    background: #fff;
    transition: width 0.2s ease, height 0.2s ease, margin 0.2s ease, opacity 0.3s ease;
    animation: cursor-glow 1.8s ease-in-out infinite;
}

@keyframes cursor-glow {

    0%,
    100% {
        box-shadow:
            0 0 6px rgba(255, 255, 255, 0.95),
            0 0 14px rgba(255, 255, 255, 0.7),
            0 0 28px rgba(255, 255, 255, 0.35),
            0 0 48px rgba(255, 255, 255, 0.12);
    }

    50% {
        box-shadow:
            0 0 10px rgba(255, 255, 255, 1),
            0 0 22px rgba(255, 255, 255, 0.85),
            0 0 40px rgba(255, 255, 255, 0.5),
            0 0 64px rgba(255, 255, 255, 0.2);
    }
}

body.cursor-active .cursor-ball {
    opacity: 1;
}

body.cursor-hover .cursor-ball {
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
}

/* ── Responsive ── */

@media (max-width: 600px) {
    .title {
        letter-spacing: 0.35em;
        text-indent: 0.35em;
    }

    .links {
        left: 1.2rem;
        gap: 1rem;
    }

    .link {
        font-size: 0.7rem;
    }

    .corner-scene {
        width: 170px;
    }

    .volume-control {
        bottom: 1rem;
        left: 38%;
        transform: translateX(-50%);
    }

    .volume-track {
        width: 110px;
        padding: 0.4rem 0.6rem;
    }
}