:root {
    --bg-surface: #2b3a42;
    --bg-mid: #1e2a30;
    --bg-abyss: #0f1a1e;
    --text-primary: #e8dbc4;
    --accent: #c9a84c;
    --text-secondary: #8a9e92;
    --border-subtle: #7a6d4e;
    --hover-gold: #dfc070;

    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Libre Baskerville', serif;
    --font-mono: 'Space Mono', monospace;
}

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

html {
    scroll-behavior: smooth;
}

body.p9r-station {
    background: var(--bg-surface);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.1vw, 1.15rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* ==================== BUBBLE FIELD ==================== */

.bubble-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.bubble-field svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ==================== DEPTH GAUGE ==================== */

.depth-gauge {
    position: fixed;
    right: 1.5rem;
    top: 0;
    bottom: 0;
    width: 1px;
    z-index: 10;
    pointer-events: none;
}

.depth-gauge__line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(201, 168, 76, 0.12);
}

.depth-gauge__ticks {
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
}

.depth-tick {
    position: absolute;
    right: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    transform: translateY(-50%);
}

.depth-tick__mark {
    width: 8px;
    height: 1px;
    background: rgba(201, 168, 76, 0.25);
}

.depth-tick__label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    opacity: 0.5;
    white-space: nowrap;
}

/* ==================== ZONES ==================== */

.zone {
    position: relative;
    min-height: 100vh;
    z-index: 2;
}

.zone--surface {
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.zone--mid {
    background: linear-gradient(to bottom, var(--bg-surface), var(--bg-mid) 20%);
    padding: 10rem 0;
}

.zone--abyss {
    background: linear-gradient(to bottom, var(--bg-mid), var(--bg-abyss) 30%);
    min-height: 100vh;
    padding: 10rem 0 6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ==================== HERO ==================== */

.hero {
    text-align: center;
    position: relative;
}

.hero__title {
    font-family: var(--font-display);
    font-size: clamp(5rem, 12vw, 9rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    filter: url(#refract);
    position: relative;
}

.hero__tagline {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    margin-top: 1.5rem;
}

.hero__rule {
    width: min(60vw, 400px);
    height: 1px;
    background: rgba(201, 168, 76, 0.3);
    margin: 3rem auto 0;
}

/* ==================== SONAR PING ==================== */

.sonar-ping {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.sonar-ping--deep {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 6rem;
    width: 300px;
    height: 300px;
}

.sonar-ping__ring {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid var(--accent);
    opacity: 0;
    animation: sonar-expand 4s ease-out infinite;
}

.sonar-ping__ring:nth-child(2) {
    animation-delay: 1.3s;
}

.sonar-ping__ring:nth-child(3) {
    animation-delay: 2.6s;
}

.sonar-ping.paused .sonar-ping__ring {
    animation-play-state: paused;
}

@keyframes sonar-expand {
    0% {
        width: 10px;
        height: 10px;
        opacity: 0.2;
    }
    100% {
        width: 600px;
        height: 600px;
        opacity: 0;
        margin-top: -295px;
        margin-left: -295px;
    }
}

/* ==================== PANELS ==================== */

.panel {
    position: relative;
    max-width: 60%;
    margin-left: 8%;
    padding: 2.5rem 3rem;
    background: rgba(30, 42, 48, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(201, 168, 76, 0.15);
    border-radius: 2px;
    margin-bottom: 10rem;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.panel.visible {
    opacity: 1;
    transform: translateY(0);
}

.panel--right {
    max-width: 55%;
    margin-left: auto;
    margin-right: 10%;
}

.panel--center {
    max-width: 50%;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    margin-bottom: 0;
}

/* Corner brackets */
.panel::before,
.panel::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-color: rgba(122, 109, 78, 0.3);
    border-style: solid;
}

.panel::before {
    top: -1px;
    left: -1px;
    border-width: 1px 0 0 1px;
}

.panel::after {
    bottom: -1px;
    right: -1px;
    border-width: 0 1px 1px 0;
}

.panel__code {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    opacity: 0.6;
    display: inline-block;
    margin-bottom: 1.2rem;
}

.panel__heading {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.panel__text {
    color: var(--text-primary);
    opacity: 0.85;
}

.panel__contact {
    margin-top: 2rem;
}

.panel__meta {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.panel__link {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent);
    letter-spacing: 0.02em;
    transition: color 0.3s ease;
}

.panel__link:hover {
    color: var(--hover-gold);
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
    .panel,
    .panel--right,
    .panel--center {
        max-width: 90%;
        margin-left: 5%;
        margin-right: 5%;
    }

    .depth-gauge {
        display: none;
    }

    .hero__title {
        font-size: clamp(3rem, 15vw, 5rem);
    }
}
