:root {
    --bg-deep: #050a08;
    --bg-surface: #0a120f;
    --accent-primary: #2dd4a0;
    --accent-secondary: #0d9488;
    --accent-tertiary: #134e4a;
    --accent-glow: rgba(45, 212, 160, 0.4);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #475569;
}

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

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    cursor: none;
}

body::after {
    content: '';
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    opacity: 0.5;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

body:hover::after {
    opacity: 0;
}

.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background:
        radial-gradient(ellipse at 20% 80%, var(--accent-tertiary) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(13, 148, 136, 0.2) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 50%, var(--bg-surface) 0%, var(--bg-deep) 100%);
    animation: ambientShift 30s ease-in-out infinite;
}

@keyframes ambientShift {
    0%, 100% {
        filter: hue-rotate(0deg) brightness(1);
    }
    50% {
        filter: hue-rotate(15deg) brightness(1.1);
    }
}

header {
    width: 100%;
    padding: 1.5rem 2rem;
}

.tool-nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--text-secondary);
}

.nav-link.active {
    color: var(--accent-primary);
    background: rgba(45, 212, 160, 0.1);
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    max-width: 600px;
}

h1 {
    font-size: 3rem;
    font-weight: 200;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 0.05em;
    margin-bottom: 3rem;
}

.stillness-container {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.stillness-ring {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--accent-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.5s ease-out, box-shadow 0.5s ease-out;
    --glow-intensity: 0;
    box-shadow:
        0 0 calc(20px * var(--glow-intensity)) var(--accent-glow),
        0 0 calc(40px * var(--glow-intensity)) rgba(45, 212, 160, 0.2),
        0 0 calc(80px * var(--glow-intensity)) rgba(45, 212, 160, 0.1),
        inset 0 0 calc(30px * var(--glow-intensity)) rgba(45, 212, 160, 0.05);
}

.stillness-core {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    opacity: 0.8;
    --pulse-speed: 3s;
    animation: corePulse var(--pulse-speed) ease-in-out infinite;
}

@keyframes corePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.9;
    }
}

.stillness-pulse {
    position: absolute;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 1px solid var(--accent-primary);
    opacity: 0;
    animation: pulseExpand 3s ease-out infinite;
    pointer-events: none;
}

.stillness-pulse.visible {
    opacity: 1;
}

@keyframes pulseExpand {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.stillness-level {
    position: absolute;
    bottom: -10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.level-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
}

.level-value {
    font-size: 1.25rem;
    font-weight: 300;
    color: var(--accent-primary);
    font-variant-numeric: tabular-nums;
}

.status-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    min-height: 1.5em;
    font-weight: 300;
    letter-spacing: 0.05em;
    transition: opacity 0.3s ease;
}

.drift-button {
    padding: 1rem 2.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    background: transparent;
    border: 1px solid var(--accent-secondary);
    color: var(--accent-primary);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 3rem;
}

.drift-button:hover {
    background: rgba(45, 212, 160, 0.1);
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px var(--accent-glow);
}

.drift-button.active {
    background: var(--accent-primary);
    color: var(--bg-deep);
    border-color: var(--accent-primary);
}

.layers-display {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.layer {
    width: 40px;
    height: 6px;
    background: var(--bg-surface);
    border: 1px solid var(--accent-tertiary);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
    transition: all 0.5s ease;
    --intensity: 0;
}

.layer::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-primary);
    transform: scaleX(var(--intensity));
    transform-origin: left;
    transition: transform 0.3s ease;
}

.layer.active {
    border-color: var(--accent-secondary);
    box-shadow: 0 0 10px var(--accent-glow);
}

.layer::after {
    content: attr(data-name);
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.55rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.layer.active::after {
    opacity: 1;
    color: var(--text-secondary);
}

.hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    max-width: 300px;
    line-height: 1.6;
    transition: opacity 0.5s ease;
}

footer {
    padding: 2rem;
}

footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
}

footer .credits {
    margin-top: 0.5rem;
    font-size: 0.65rem;
    opacity: 0.6;
}

/* Responsive */
@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }

    .stillness-container {
        width: 160px;
        height: 160px;
    }

    .stillness-ring {
        width: 120px;
        height: 120px;
    }

    .stillness-core {
        width: 45px;
        height: 45px;
    }

    .stillness-pulse {
        width: 120px;
        height: 120px;
    }

    .layers-display {
        gap: 0.5rem;
    }

    .layer {
        width: 30px;
    }

    .layer::after {
        display: none;
    }
}

/* Hide cursor when still (JavaScript controlled) */
body.is-still {
    cursor: none;
}
