/* ============================================================
   heisei.boo --- A Ghost of Eras Past
   Stylesheet: nostalgic Heisei chronicle
   ============================================================ */

:root {
    /* Color palette from DESIGN.md */
    --crt-black: #0a0a14;
    --bubble-pink: #f5d5d5;
    --keitai-lavender: #e5d5f5;
    --digital-mint: #d5f5e5;
    --ghost-white: #f8f5ff;
    --heisei-dark: #2a2535;
    --memory-gray: #6a6578;
    --os-blue: #a8c8f0;
    --os-purple: #c8a8f0;
    --tamagotchi-pink: #f08ca0;
    --gameboy-green: #88c868;
    --akiba-electric: #68a8f0;
    --spirit-purple: #b898d8;
    --static-white: #ffffff;

    /* Aqua gradient mid-tones */
    --aqua-light: #d0e0ff;
    --aqua-mid: #90b0e0;

    /* Typography */
    --font-display: "Righteous", "Inter", system-ui, sans-serif;
    --font-body: "M PLUS Rounded 1c", "Inter", system-ui, sans-serif;
    --font-mono: "VT323", "Courier New", monospace;
    --font-serif: "Shippori Mincho", "Inter", Georgia, serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--heisei-dark);
    line-height: 1.8;
    background: var(--crt-black);
    overflow-x: hidden;
}

/* ============================================================
   SECTION FRAMEWORK
   ============================================================ */

.section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    padding: clamp(4rem, 10vh, 8rem) clamp(1rem, 4vw, 3rem);
    overflow: hidden;
}

.section__inner {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    z-index: 5;
}

/* ============================================================
   SECTION 1: BOOT SCREEN
   ============================================================ */

.section--boot {
    background: var(--crt-black);
    color: var(--spirit-purple);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* Faint scanlines on boot screen */
.section--boot::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(255, 255, 255, 0.04) 0px,
        rgba(255, 255, 255, 0.04) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
    z-index: 2;
}

/* Subtle CRT vignette */
.section--boot::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at center,
        transparent 50%,
        rgba(0, 0, 0, 0.6) 100%
    );
    pointer-events: none;
    z-index: 3;
}

.boot-terminal {
    position: relative;
    z-index: 5;
    width: min(90vw, 700px);
    font-family: var(--font-mono);
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: var(--spirit-purple);
    margin-bottom: 3rem;
}

.boot-line {
    margin-bottom: 0.4rem;
    opacity: 0;
}

.boot-line.is-visible {
    opacity: 1;
}

.boot-prompt {
    color: var(--gameboy-green);
    margin-right: 0.5rem;
}

.boot-text-success {
    color: var(--gameboy-green);
}

.boot-cursor {
    display: inline-block;
    color: var(--spirit-purple);
    animation: blink 1s steps(2) infinite;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.boot-dots {
    display: inline-block;
    min-width: 2.5em;
}

/* Boot window */
.window--boot {
    position: relative;
    z-index: 5;
    width: min(90vw, 700px);
    transform: scale(0);
    opacity: 0;
    transition: transform 500ms cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 300ms ease-out;
}

.window--boot.is-open {
    transform: scale(1);
    opacity: 1;
}

.window__body--boot {
    text-align: center;
    padding: clamp(2rem, 6vw, 4rem) clamp(1.5rem, 4vw, 3rem);
    background: linear-gradient(180deg, #1a1a28 0%, #0f0f1a 100%);
    color: var(--ghost-white);
    border: 1px solid var(--spirit-purple);
}

.boot-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.02em;
    line-height: 1;
    background: linear-gradient(90deg, var(--os-blue) 0%, var(--os-purple) 50%, var(--tamagotchi-pink) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    margin-bottom: 0.5rem;
    opacity: 0;
    transition: opacity 600ms ease-out 200ms;
}

.boot-subtitle {
    font-family: var(--font-mono);
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: var(--os-blue);
    margin-bottom: 0.4rem;
    opacity: 0;
    transition: opacity 600ms ease-out 400ms;
}

.boot-tagline {
    font-family: var(--font-body);
    font-style: italic;
    color: var(--spirit-purple);
    font-size: clamp(0.95rem, 1.4vw, 1.1rem);
    margin-bottom: 2rem;
    opacity: 0;
    transition: opacity 600ms ease-out 600ms;
}

.window--boot.is-open .boot-title,
.window--boot.is-open .boot-subtitle,
.window--boot.is-open .boot-tagline,
.window--boot.is-open .boot-scrollhint {
    opacity: 1;
}

.boot-scrollhint {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--os-blue);
    opacity: 0;
    transition: opacity 600ms ease-out 800ms;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.boot-scrollhint__arrow {
    font-size: 1.4rem;
    animation: bob 2s ease-in-out infinite;
}

@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* ============================================================
   WINDOWS (general)
   ============================================================ */

.window {
    background: #fefefe;
    border: 1px solid var(--memory-gray);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.window__titlebar {
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1;
    color: var(--heisei-dark);
    user-select: none;
}

.window__title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-top: 4px;
}

.window__buttons {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.window__btn {
    display: inline-block;
    width: 16px;
    height: 14px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--memory-gray);
}

.window__btn--close {
    background: var(--tamagotchi-pink);
}

.window__body {
    padding: clamp(1rem, 2.5vw, 1.75rem);
    background: rgba(255, 255, 255, 0.7);
    color: var(--heisei-dark);
    font-size: clamp(0.95rem, 1.1vw, 1.05rem);
    line-height: 1.8;
}

.window__heading {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: var(--heisei-dark);
    margin-bottom: 0.5rem;
    letter-spacing: 0.01em;
}

.window__list {
    list-style: none;
    margin-top: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--memory-gray);
}

.window__list li {
    padding: 0.2rem 0;
    border-bottom: 1px dashed rgba(106, 101, 120, 0.3);
}

.window__list li:last-child {
    border-bottom: none;
}

/* 90s window style */
.window--90s {
    border-radius: 0;
    box-shadow: 4px 4px 0 rgba(42, 37, 53, 0.18);
}

.window__titlebar--90s {
    background: linear-gradient(90deg, var(--os-blue) 0%, var(--os-purple) 100%);
    border-bottom: 1px solid var(--memory-gray);
}

/* 00s window style: glossy Aqua */
.window--00s {
    border-radius: 4px;
    box-shadow: 2px 6px 18px rgba(42, 37, 53, 0.12);
}

.window__titlebar--aqua {
    background: linear-gradient(180deg,
        var(--aqua-light) 0%,
        var(--os-blue) 45%,
        var(--aqua-mid) 55%,
        var(--os-blue) 100%
    );
    border-bottom: 1px solid var(--aqua-mid);
    height: 30px;
    color: var(--heisei-dark);
}

.window__btn--aqua {
    border-radius: 50%;
    width: 12px;
    height: 12px;
    border: 1px solid rgba(42, 37, 53, 0.3);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.6);
}

.window__btn--aqua.window__btn--min { background: var(--gameboy-green); }
.window__btn--aqua.window__btn--max { background: #f5d068; }
.window__btn--aqua.window__btn--close { background: var(--tamagotchi-pink); }

/* 10s window style: flat */
.window--10s {
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(42, 37, 53, 0.08);
    border: 1px solid rgba(106, 101, 120, 0.25);
}

.window__titlebar--flat {
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid rgba(106, 101, 120, 0.15);
    height: 32px;
    color: var(--memory-gray);
}

.window__btn--flat {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(106, 101, 120, 0.25);
    border: none;
}

/* Window entry animations */
.js-window {
    opacity: 0;
    transform: translateY(20px) rotate(-2deg);
    transition: opacity 500ms ease-out, transform 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.js-window[data-era="00s"] {
    transform: translateY(20px) translateX(10px) rotate(-2deg);
}

.js-window[data-era="10s"] {
    transform: translateY(20px);
    transition-duration: 300ms;
    transition-timing-function: ease-out;
}

.js-window.is-visible {
    opacity: 1;
    transform: translateY(0) translateX(0) rotate(0);
}

/* Grab interaction on title bars */
.js-grab {
    cursor: grab;
}

.js-grab:active {
    cursor: grabbing;
}

.window.is-wiggling {
    animation: wiggle 600ms ease-in-out;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0); }
    16% { transform: rotate(-1deg); }
    33% { transform: rotate(1deg); }
    50% { transform: rotate(-1deg); }
    66% { transform: rotate(1deg); }
    83% { transform: rotate(-0.5deg); }
}

/* ============================================================
   SECTION 2: 1990s
   ============================================================ */

.section--90s {
    background: var(--bubble-pink);
    padding-bottom: 8rem;
}

.window-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(1rem, 2vw, 2rem);
}

.window--wide {
    grid-column: 1 / -1;
}

@media (max-width: 720px) {
    .window-grid {
        grid-template-columns: 1fr;
    }
    .window--wide {
        grid-column: auto;
    }
}

/* Decade headers */
.decade-header {
    margin-bottom: clamp(2rem, 4vw, 3.5rem);
    text-align: left;
    position: relative;
    z-index: 5;
}

.decade-marker {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--memory-gray);
    background: rgba(255, 255, 255, 0.6);
    padding: 0.2rem 0.7rem;
    border: 1px solid var(--memory-gray);
    margin-bottom: 0.75rem;
    letter-spacing: 0.05em;
}

.decade-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: 0.02em;
    line-height: 1;
    color: var(--heisei-dark);
    margin-bottom: 0.5rem;
}

.section--90s .decade-title {
    background: linear-gradient(90deg, var(--tamagotchi-pink), var(--os-purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.section--00s .decade-title {
    background: linear-gradient(90deg, var(--akiba-electric), var(--os-purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.section--10s .decade-title {
    color: var(--memory-gray);
}

.decade-sub {
    font-family: var(--font-mono);
    color: var(--memory-gray);
    font-size: clamp(0.95rem, 1.3vw, 1.1rem);
}

.decade-header--cool .decade-marker {
    background: rgba(255, 255, 255, 0.5);
}

/* ============================================================
   SCANLINES
   ============================================================ */

.scanlines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 4;
    background: repeating-linear-gradient(
        0deg,
        rgba(255, 255, 255, 0.05) 0px,
        rgba(255, 255, 255, 0.05) 1px,
        transparent 1px,
        transparent 3px
    );
}

.scanlines--strong {
    background: repeating-linear-gradient(
        0deg,
        rgba(255, 255, 255, 0.08) 0px,
        rgba(255, 255, 255, 0.08) 1px,
        transparent 1px,
        transparent 3px
    );
}

.scanlines--medium {
    background: repeating-linear-gradient(
        0deg,
        rgba(255, 255, 255, 0.035) 0px,
        rgba(255, 255, 255, 0.035) 1px,
        transparent 1px,
        transparent 3px
    );
}

/* ============================================================
   TILE PATTERNS
   ============================================================ */

.tile-pattern {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0.5;
}

.tile-pattern--diamonds {
    background-image:
        linear-gradient(45deg, var(--tamagotchi-pink) 25%, transparent 25%),
        linear-gradient(-45deg, var(--tamagotchi-pink) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--tamagotchi-pink) 75%),
        linear-gradient(-45deg, transparent 75%, var(--tamagotchi-pink) 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    opacity: 0.06;
}

.tile-pattern--circles {
    background-image: radial-gradient(circle at 50% 50%, var(--spirit-purple) 1.5px, transparent 2px);
    background-size: 18px 18px;
    opacity: 0.18;
}

.tile-pattern--dots {
    background-image: radial-gradient(circle at 50% 50%, var(--memory-gray) 1px, transparent 1.5px);
    background-size: 24px 24px;
    opacity: 0.15;
}

/* ============================================================
   GHOSTLY WIREFRAMES
   ============================================================ */

.wireframe {
    position: absolute;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.5s ease-out;
}

.wireframe.is-visible {
    opacity: 0.07;
}

/* 1990s desktop computer */
.wireframe--desktop {
    top: 18%;
    right: 4%;
    width: clamp(220px, 28vw, 380px);
    color: var(--heisei-dark);
}

.wf-monitor {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3.6;
    border: 3px solid currentColor;
    border-radius: 6px;
    background: transparent;
    margin-bottom: 8px;
}

.wf-screen {
    position: absolute;
    inset: 8% 8% 24% 8%;
    border: 2px solid currentColor;
    border-radius: 4px;
}

.wf-stand {
    position: absolute;
    bottom: 6%;
    left: 50%;
    transform: translateX(-50%);
    width: 24%;
    height: 8%;
    border: 2px solid currentColor;
    border-top: none;
}

.wf-base {
    position: absolute;
    bottom: -8%;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 6%;
    border: 2px solid currentColor;
    border-radius: 4px 4px 0 0;
}

.wf-tower {
    position: relative;
    width: 70%;
    aspect-ratio: 5 / 7;
    border: 3px solid currentColor;
    border-radius: 4px;
    margin: 30px auto 0;
}

.wf-tower-slot {
    width: 70%;
    height: 6%;
    border: 2px solid currentColor;
    margin: 12% auto 4%;
    border-radius: 2px;
}

.wf-tower-disk {
    width: 25%;
    height: 5%;
    border: 2px solid currentColor;
    margin: 12% auto 0;
    border-radius: 50%;
}

/* 2000s flip phone */
.wireframe--flipphone {
    top: 12%;
    left: 6%;
    width: clamp(140px, 18vw, 220px);
    color: var(--spirit-purple);
}

.wf-flip-top {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    border: 3px solid currentColor;
    border-radius: 24px 24px 4px 4px;
    background: transparent;
}

.wf-flip-screen {
    position: absolute;
    inset: 12% 8% 12% 8%;
    border: 2px solid currentColor;
    border-radius: 4px;
}

.wf-flip-camera {
    position: absolute;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.wf-flip-hinge {
    width: 60%;
    height: 4px;
    border: 1px solid currentColor;
    margin: 4px auto;
    border-radius: 2px;
}

.wf-flip-bottom {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    border: 3px solid currentColor;
    border-radius: 4px 4px 24px 24px;
    padding: 14% 12%;
}

.wf-flip-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8%;
    width: 100%;
    height: 100%;
}

.wf-key {
    border: 2px solid currentColor;
    border-radius: 4px;
}

/* 2010s smartphone */
.wireframe--smartphone {
    top: 10%;
    right: 8%;
    width: clamp(140px, 16vw, 200px);
    color: var(--memory-gray);
}

.wf-phone {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 19;
    border: 3px solid currentColor;
    border-radius: 24px;
}

.wf-phone-notch {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 36%;
    height: 14px;
    background: transparent;
    border: 2px solid currentColor;
    border-radius: 0 0 12px 12px;
    border-top: none;
}

.wf-phone-screen {
    position: absolute;
    inset: 36px 12px 56px 12px;
    border: 2px solid currentColor;
    border-radius: 8px;
}

.wf-phone-home {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 30%;
    height: 4px;
    background: currentColor;
    border-radius: 2px;
}

/* ============================================================
   2000s DECORATIONS
   ============================================================ */

.section--00s {
    background: var(--keitai-lavender);
    padding-bottom: 8rem;
}

.player-bar {
    margin-top: 1rem;
    height: 14px;
    background: linear-gradient(180deg, #fff, var(--aqua-light));
    border: 1px solid var(--aqua-mid);
    border-radius: 7px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.player-bar__progress {
    height: 100%;
    width: 62%;
    background: linear-gradient(180deg, var(--os-blue), var(--akiba-electric));
    border-radius: 7px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Pixel art mini-grid in 90s */
.pixel-grid {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 18px);
    gap: 2px;
    width: 80px;
    border: 2px solid var(--heisei-dark);
    padding: 2px;
    background: var(--bubble-pink);
}

.pixel {
    background: rgba(255, 255, 255, 0.4);
}

.pixel--yellow { background: #f5d068; }
.pixel--red { background: var(--tamagotchi-pink); }
.pixel--black { background: var(--heisei-dark); }

/* ============================================================
   2010s DECORATIONS
   ============================================================ */

.section--10s {
    background: var(--digital-mint);
    padding-bottom: 10rem;
}

.section--10s .window-grid {
    gap: clamp(1.5rem, 3vw, 3rem);
}

.section--10s .window__body {
    background: rgba(255, 255, 255, 0.92);
    font-size: clamp(0.9rem, 1vw, 1rem);
}

/* ============================================================
   DIAGONAL DIVIDERS (between sections)
   ============================================================ */

.diagonal-divider {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 80px;
    z-index: 6;
    pointer-events: none;
}

.diagonal-divider--90s-to-00s {
    background: var(--keitai-lavender);
    clip-path: polygon(0 60%, 100% 30%, 100% 100%, 0 100%);
}

.diagonal-divider--00s-to-10s {
    background: var(--digital-mint);
    clip-path: polygon(0 30%, 100% 60%, 100% 100%, 0 100%);
}

.diagonal-divider--10s-to-farewell {
    background: linear-gradient(180deg, var(--keitai-lavender), var(--ghost-white));
    clip-path: polygon(0 50%, 100% 25%, 100% 100%, 0 100%);
}

/* ============================================================
   SECTION 5: FAREWELL
   ============================================================ */

.section--farewell {
    background: linear-gradient(180deg, var(--keitai-lavender) 0%, var(--ghost-white) 60%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 8rem 1rem 4rem;
    position: relative;
}

.farewell__inner {
    position: relative;
    z-index: 5;
    max-width: 720px;
}

.farewell__text {
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: clamp(1.8rem, 5vw, 3.4rem);
    color: var(--heisei-dark);
    line-height: 1.5;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 1500ms ease-out, transform 1500ms ease-out;
}

.farewell__text.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.farewell__date {
    font-family: var(--font-mono);
    font-size: clamp(1rem, 1.6vw, 1.2rem);
    color: var(--memory-gray);
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
    opacity: 0;
    transition: opacity 1200ms ease-out 800ms;
}

.farewell__date.is-visible {
    opacity: 1;
}

.farewell__caption {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: clamp(0.95rem, 1.4vw, 1.15rem);
    color: var(--spirit-purple);
    opacity: 0;
    transition: opacity 1200ms ease-out 1400ms;
}

.farewell__caption.is-visible {
    opacity: 1;
}

/* ============================================================
   FLOATING GHOSTS
   ============================================================ */

.ghosts {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 3;
}

.ghost {
    position: absolute;
    bottom: -160px;
    opacity: 0.32;
    animation-name: ghostFloat;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

.ghost__body {
    position: relative;
    width: 60px;
    height: 70px;
    background: var(--spirit-purple);
    border-radius: 30px 30px 6px 6px;
}

.ghost__eye {
    position: absolute;
    top: 24px;
    width: 8px;
    height: 10px;
    background: var(--ghost-white);
    border-radius: 50%;
}

.ghost__eye--left { left: 16px; }
.ghost__eye--right { right: 16px; }

.ghost__mouth {
    position: absolute;
    top: 42px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 6px;
    background: var(--ghost-white);
    border-radius: 0 0 5px 5px;
}

.ghost__tail {
    display: flex;
    width: 60px;
    margin-top: -3px;
}

.ghost__tail span {
    flex: 1;
    height: 12px;
    background: var(--spirit-purple);
    border-radius: 0 0 50% 50%;
}

.ghost__tail span:nth-child(2),
.ghost__tail span:nth-child(4) {
    height: 8px;
}

.ghost--1 { left: 12%; animation-duration: 16s; animation-delay: 0s; }
.ghost--2 { left: 28%; animation-duration: 22s; animation-delay: 3s; transform: scale(0.7); }
.ghost--3 { left: 50%; animation-duration: 14s; animation-delay: 1s; transform: scale(1.2); }
.ghost--4 { left: 70%; animation-duration: 19s; animation-delay: 5s; transform: scale(0.85); }
.ghost--5 { left: 86%; animation-duration: 17s; animation-delay: 7s; transform: scale(0.95); }

@keyframes ghostFloat {
    0% {
        transform: translateY(0) scale(var(--gs, 1));
        opacity: 0;
    }
    10% { opacity: 0.3; }
    90% { opacity: 0.3; }
    100% {
        transform: translateY(-120vh) scale(var(--gs, 1));
        opacity: 0;
    }
}

/* Variants need their own keyframes for scaling */
.ghost--2 { animation-name: ghostFloat2; }
.ghost--3 { animation-name: ghostFloat3; }
.ghost--4 { animation-name: ghostFloat4; }
.ghost--5 { animation-name: ghostFloat5; }

@keyframes ghostFloat2 {
    0% { transform: translateY(0) scale(0.7); opacity: 0; }
    10% { opacity: 0.28; }
    90% { opacity: 0.28; }
    100% { transform: translateY(-120vh) scale(0.7); opacity: 0; }
}

@keyframes ghostFloat3 {
    0% { transform: translateY(0) scale(1.2); opacity: 0; }
    10% { opacity: 0.34; }
    90% { opacity: 0.34; }
    100% { transform: translateY(-120vh) scale(1.2); opacity: 0; }
}

@keyframes ghostFloat4 {
    0% { transform: translateY(0) scale(0.85); opacity: 0; }
    10% { opacity: 0.3; }
    90% { opacity: 0.3; }
    100% { transform: translateY(-120vh) scale(0.85); opacity: 0; }
}

@keyframes ghostFloat5 {
    0% { transform: translateY(0) scale(0.95); opacity: 0; }
    10% { opacity: 0.32; }
    90% { opacity: 0.32; }
    100% { transform: translateY(-120vh) scale(0.95); opacity: 0; }
}

/* Ghosts hidden until activated */
.ghosts:not(.is-active) .ghost {
    animation-play-state: paused;
    opacity: 0;
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
    position: relative;
    z-index: 5;
    margin-top: 4rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--memory-gray);
    text-align: center;
}

.site-footer__line {
    display: inline-flex;
    gap: 0.6rem;
    align-items: center;
}

.site-footer__domain {
    font-weight: 500;
    color: var(--spirit-purple);
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */

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

    .window--boot {
        transform: scale(1);
        opacity: 1;
    }

    .js-window {
        opacity: 1;
        transform: none;
    }

    .boot-title,
    .boot-subtitle,
    .boot-tagline,
    .boot-scrollhint,
    .farewell__text,
    .farewell__date,
    .farewell__caption {
        opacity: 1 !important;
        transform: none !important;
    }

    .wireframe {
        opacity: 0.07;
    }
}
