/* monopoleai.com - Deep Ocean Descent Sonar Interface */
/* Colors: #0B1D26 Midnight Trench, #020A0E Hadal Black, #0EEBD3 Sonar Green,
   #0A7E8C Deep Teal, #C8E6EC Glacial Teal, #8BB8C4 Sonar Pale,
   #FF4E50 Anomaly Red, #2A3A42 Submarine Gray, #0C3547 Abyssal Blue */

:root {
    --midnight-trench: #0B1D26;
    --hadal-black: #020A0E;
    --sonar-green: #0EEBD3;
    --deep-teal: #0A7E8C;
    --glacial-teal: #C8E6EC;
    --sonar-pale: #8BB8C4;
    --anomaly-red: #FF4E50;
    --submarine-gray: #2A3A42;
    --abyssal-blue: #0C3547;
    --scroll-depth: 0;
    --current-station: 1;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--midnight-trench);
    color: var(--sonar-pale);
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    overflow-x: hidden;
    cursor: default;
}

/* Grain Overlay */
#grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    pointer-events: none;
    opacity: 0.25;
    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyBAMAAADsEZWCAAAAGFBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANOCYcAAAACHRSTlMzMzMzMzMzM85JBgUAAAA0SURBVDjLY2CgNmBhYGBkYGBiYGBmYGBhANJMDAxMQJqZgYGFAUgzMTAwM6CmxlEw8AEAO2cB+TfNoMUAAAAASUVORK5CYII=");
}

/* HUD System */
#hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 50;
    pointer-events: none;
}

/* Sonar Sweep */
#sonar-sweep {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 180px;
    height: 180px;
}

.sonar-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid var(--deep-teal);
    background: radial-gradient(circle, rgba(10, 126, 140, 0.05) 0%, transparent 70%);
}

.sonar-circle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--deep-teal);
    opacity: 0.3;
}

.sonar-circle::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--deep-teal);
    opacity: 0.3;
}

.sonar-line {
    position: absolute;
    width: 50%;
    height: 1px;
    top: 50%;
    left: 50%;
    transform-origin: left center;
    background: linear-gradient(to right, var(--sonar-green), transparent);
    animation: sweep 4s linear infinite;
    box-shadow: 0 0 8px var(--sonar-green);
}

.sonar-echo {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    top: 0;
    left: 0;
    opacity: 0;
}

.sonar-echo-1 {
    background: conic-gradient(from 0deg, transparent 0deg, rgba(14, 235, 211, 0.08) 5deg, transparent 30deg);
    animation: echo-fade 4s linear infinite;
    animation-delay: -1s;
}

.sonar-echo-2 {
    background: conic-gradient(from 0deg, transparent 0deg, rgba(14, 235, 211, 0.05) 5deg, transparent 30deg);
    animation: echo-fade 4s linear infinite;
    animation-delay: -2s;
}

.sonar-echo-3 {
    background: conic-gradient(from 0deg, transparent 0deg, rgba(14, 235, 211, 0.03) 5deg, transparent 30deg);
    animation: echo-fade 4s linear infinite;
    animation-delay: -3s;
}

.sonar-blip {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--sonar-green);
    top: 35%;
    left: 60%;
    opacity: 0;
    box-shadow: 0 0 10px var(--sonar-green), 0 0 20px var(--sonar-green);
    transition: opacity 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.sonar-blip.active {
    opacity: 1;
    animation: blip-pulse 2s ease-in-out infinite;
}

.sonar-blip.detected {
    background: var(--anomaly-red);
    box-shadow: 0 0 10px var(--anomaly-red), 0 0 20px var(--anomaly-red);
}

@keyframes sweep {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes echo-fade {
    0% { opacity: 0.1; transform: rotate(0deg); }
    25% { opacity: 0.05; }
    50% { opacity: 0; }
    75% { opacity: 0; }
    100% { opacity: 0.1; transform: rotate(360deg); }
}

@keyframes blip-pulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.3); }
}

/* Depth Gauge */
#depth-gauge {
    position: absolute;
    left: 20px;
    top: 80px;
    bottom: 80px;
    width: 24px;
}

.gauge-track {
    position: relative;
    width: 100%;
    height: 100%;
    border: 1px solid var(--deep-teal);
    background: rgba(10, 126, 140, 0.05);
}

.gauge-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(to top, var(--anomaly-red), var(--deep-teal));
    transition: height 0.3s ease;
    animation: gauge-pulse 2s ease-in-out infinite;
}

@keyframes gauge-pulse {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1; }
}

.gauge-tick {
    position: absolute;
    left: 100%;
    width: 10px;
    height: 1px;
    background: var(--deep-teal);
    margin-left: 2px;
}

.gauge-tick::after {
    content: attr(data-depth);
    position: absolute;
    left: 14px;
    top: -6px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    color: var(--deep-teal);
    letter-spacing: 0.08em;
    white-space: nowrap;
}

/* Depth Counter */
#depth-counter {
    position: absolute;
    top: 20px;
    left: 60px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.depth-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.6rem, 0.8vw, 0.75rem);
    color: var(--deep-teal);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.depth-value {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    color: var(--sonar-green);
    letter-spacing: 0.12em;
    text-shadow: 0 0 8px rgba(14, 235, 211, 0.4);
}

/* HUD Corner Brackets */
.hud-bracket {
    position: absolute;
    width: 40px;
    height: 40px;
    border-color: var(--deep-teal);
    border-style: solid;
    border-width: 0;
    opacity: 0.6;
}

.hud-bracket-tl {
    top: 15px;
    left: 15px;
    border-top-width: 1px;
    border-left-width: 1px;
}

.hud-bracket-tr {
    top: 15px;
    right: 15px;
    border-top-width: 1px;
    border-right-width: 1px;
}

.hud-bracket-bl {
    bottom: 50px;
    left: 15px;
    border-bottom-width: 1px;
    border-left-width: 1px;
}

.hud-bracket-br {
    bottom: 50px;
    right: 15px;
    border-bottom-width: 1px;
    border-right-width: 1px;
}

/* Status Bar */
#status-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: rgba(11, 29, 38, 0.9);
    border-top: 1px solid var(--deep-teal);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
}

.status-text {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.65rem, 0.85vw, 0.8rem);
    color: var(--sonar-green);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(14, 235, 211, 0.4);
}

#status-state {
    color: var(--sonar-green);
    transition: color 0.5s ease;
}

#status-state.anomaly {
    color: var(--anomaly-red);
    text-shadow: 0 0 12px rgba(255, 78, 80, 0.6);
    animation: status-flash 1s ease-in-out infinite;
}

@keyframes status-flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-timestamp {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.6rem, 0.75vw, 0.7rem);
    color: var(--deep-teal);
    letter-spacing: 0.1em;
}

/* Bubble Container */
#bubble-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 1s ease;
}

#bubble-container.active {
    opacity: 1;
}

.bubble {
    position: absolute;
    bottom: -20px;
    border-radius: 50%;
    background: rgba(14, 235, 211, 0.15);
    animation: rise linear infinite;
}

@keyframes rise {
    0% { bottom: -20px; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { bottom: 110vh; opacity: 0; }
}

/* Magnetometer Traces */
#magnetometer-container {
    position: fixed;
    bottom: 50px;
    left: 0;
    width: 100%;
    height: 80px;
    z-index: 10;
    pointer-events: none;
    opacity: 0.6;
}

.magnetometer-trace {
    position: absolute;
    width: 200%;
    height: 30px;
    bottom: 10px;
}

.trace-1 { bottom: 30px; }
.trace-2 { bottom: 5px; opacity: 0; transition: opacity 0.5s ease; }
.trace-2.active { opacity: 1; }

.mag-line {
    fill: none;
    stroke: var(--deep-teal);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.mag-line-spike {
    stroke: var(--sonar-green);
}

.trace-1 {
    animation: trace-scroll 20s linear infinite;
}

.trace-2 {
    animation: trace-scroll 15s linear infinite reverse;
}

@keyframes trace-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Depth Stations */
.depth-station {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 80px 80px 80px;
    overflow: hidden;
}

.station-1 { background: var(--midnight-trench); }
.station-2 { background: linear-gradient(to bottom, var(--midnight-trench), var(--abyssal-blue)); }
.station-3 { background: linear-gradient(to bottom, var(--abyssal-blue), #071820); }
.station-4 { background: linear-gradient(to bottom, #071820, var(--hadal-black)); }
.station-5 { background: var(--hadal-black); }

.station-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    width: 100%;
}

.station-1 .station-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.station-2 .station-content,
.station-3 .station-content,
.station-4 .station-content {
    padding-left: 0;
    max-width: 600px;
    margin-left: 10%;
}

.station-5 .station-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Station Titles */
.station-title {
    font-family: 'Cabin', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    color: var(--glacial-teal);
    letter-spacing: 0.08em;
    line-height: 1.0;
    text-transform: uppercase;
    margin-bottom: 0.3em;
}

.station-subtitle {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    color: var(--deep-teal);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 2em;
}

/* Domain Display */
.domain-display {
    font-family: 'Cabin', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--glacial-teal);
    letter-spacing: 0.08em;
    margin-bottom: 1em;
    text-shadow: 0 0 30px rgba(14, 235, 211, 0.2);
}

.station-hud-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.65rem, 0.85vw, 0.8rem);
    color: var(--sonar-green);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(14, 235, 211, 0.4);
    margin-bottom: 3em;
}

/* Station Text */
.station-text {
    max-width: 38ch;
}

.station-1 .station-text {
    text-align: left;
}

.station-text p {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.3vw, 1.15rem);
    color: var(--sonar-pale);
    opacity: 0.85;
    line-height: 1.75;
    letter-spacing: 0.01em;
    margin-bottom: 1.5em;
}

.station-text p:last-child {
    margin-bottom: 0;
}

/* Blur-Focus Reveal */
.blur-reveal {
    filter: blur(12px);
    opacity: 0;
    transform: translateY(10px);
    transition: filter 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.blur-reveal.revealed {
    filter: blur(0);
    opacity: 1;
    transform: translateY(0);
}

/* Archival Frames */
.archival-frame {
    position: absolute;
    width: 200px;
    height: 160px;
    border-radius: 2px;
    border: 1px solid var(--submarine-gray);
    outline: 1px solid var(--deep-teal);
    outline-offset: 4px;
    overflow: hidden;
    filter: grayscale(1) contrast(1.3) brightness(0.6) blur(8px);
    transition: filter 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0.5;
}

.archival-frame.focused {
    filter: grayscale(1) contrast(1.3) brightness(0.6) blur(0);
    opacity: 0.7;
}

.archival-inner {
    width: 100%;
    height: 100%;
}

.archival-frame-1 {
    top: 15%;
    right: -30px;
}

.archival-frame-1 .archival-inner {
    background: 
        radial-gradient(circle at 30% 40%, rgba(10, 126, 140, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(42, 58, 66, 0.5) 0%, transparent 40%),
        linear-gradient(135deg, #0C3547 0%, #0B1D26 50%, #2A3A42 100%);
}

.archival-frame-2 {
    top: 10%;
    right: -20px;
}

.archival-frame-2 .archival-inner {
    background:
        repeating-linear-gradient(90deg, transparent, transparent 8px, rgba(10, 126, 140, 0.1) 8px, rgba(10, 126, 140, 0.1) 9px),
        radial-gradient(ellipse at 50% 50%, rgba(14, 235, 211, 0.1) 0%, transparent 60%),
        linear-gradient(180deg, #2A3A42 0%, #0B1D26 100%);
}

.archival-frame-3 {
    top: 8%;
    right: -25px;
}

.archival-frame-3 .archival-inner {
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 78, 80, 0.05) 0%, transparent 30%),
        radial-gradient(circle at 20% 80%, rgba(10, 126, 140, 0.2) 0%, transparent 40%),
        linear-gradient(to right, #0B1D26, #2A3A42, #0C3547);
}

.archival-frame-4 {
    top: 12%;
    right: -15px;
}

.archival-frame-4 .archival-inner {
    background:
        repeating-linear-gradient(0deg, transparent, transparent 4px, rgba(14, 235, 211, 0.05) 4px, rgba(14, 235, 211, 0.05) 5px),
        repeating-linear-gradient(90deg, transparent, transparent 6px, rgba(10, 126, 140, 0.08) 6px, rgba(10, 126, 140, 0.08) 7px),
        linear-gradient(135deg, #020A0E 0%, #2A3A42 50%, #0C3547 100%);
}

/* Hull Rivets */
.hull-rivets {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    display: flex;
    justify-content: center;
    gap: 40px;
    align-items: center;
}

.hull-rivets::before,
.hull-rivets::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: 1px solid var(--submarine-gray);
}

/* Final Domain Display */
.final-domain {
    margin-top: 4em;
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.final-domain-text {
    font-family: 'Cabin', sans-serif;
    font-weight: 700;
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: var(--glacial-teal);
    letter-spacing: 0.08em;
}

.cursor-blink {
    font-family: 'Share Tech Mono', monospace;
    color: var(--sonar-green);
    animation: blink 1s step-end infinite;
    text-shadow: 0 0 8px rgba(14, 235, 211, 0.4);
}

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

/* Responsive */
@media (max-width: 768px) {
    .depth-station {
        padding: 60px 30px 60px 50px;
    }
    
    .station-2 .station-content,
    .station-3 .station-content,
    .station-4 .station-content {
        margin-left: 0;
    }
    
    #sonar-sweep {
        width: 120px;
        height: 120px;
        top: 20px;
        right: 20px;
    }
    
    .archival-frame {
        width: 140px;
        height: 110px;
        right: -10px;
    }
    
    #depth-gauge {
        left: 10px;
    }
    
    #depth-counter {
        left: 45px;
    }
    
    #status-bar {
        padding: 0 15px;
    }
}
