/* =============================================
   GlobalToneCheck - Frutiger Aero Ocean Descent
   ============================================= */

/* CSS Custom Properties */
:root {
    --sky-surface: #E8F5FA;
    --shallow-water: #7EC8C8;
    --mid-depth: #2A9D8F;
    --deep-current: #0B3D5B;
    --abyss: #061E2E;
    --accent-coral: #F4845F;
    --accent-cyan: #00E5CC;
    --text-light: #E0F4FF;
    --text-dark: #1A3A4A;
    --glass-bg: rgba(126, 200, 200, 0.15);
    --glass-border: rgba(224, 244, 255, 0.2);
    --scroll-progress: 0;

    --font-heading: 'Barlow Condensed', sans-serif;
    --font-body: 'DM Sans', sans-serif;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--text-light);
    background: var(--abyss);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* =============================================
   Caustic Light Overlay
   ============================================= */
.caustic-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    mix-blend-mode: overlay;
    opacity: 0.35;
    background:
        radial-gradient(ellipse 600px 400px at 20% 30%, rgba(126, 200, 200, 0.4), transparent),
        radial-gradient(ellipse 500px 350px at 70% 60%, rgba(42, 157, 143, 0.3), transparent),
        radial-gradient(ellipse 400px 300px at 50% 80%, rgba(0, 229, 204, 0.2), transparent);
    animation: causticDrift 18s ease-in-out infinite alternate;
}

@keyframes causticDrift {
    0% {
        background-position: 0% 0%, 100% 100%, 50% 50%;
    }
    33% {
        background-position: 30% 20%, 70% 80%, 20% 60%;
    }
    66% {
        background-position: 60% 40%, 40% 20%, 80% 30%;
    }
    100% {
        background-position: 100% 100%, 0% 0%, 50% 50%;
    }
}

/* =============================================
   Bubble Container
   ============================================= */
.bubble-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4;
    overflow: hidden;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, transparent 40%, rgba(224, 244, 255, 0.4) 100%);
    border: 1px solid rgba(224, 244, 255, 0.15);
    animation: bubbleRise linear infinite;
}

@keyframes bubbleRise {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(-110vh) translateX(var(--drift-x, 20px));
        opacity: 0;
    }
}

/* =============================================
   Tone Compass
   ============================================= */
.tone-compass {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    z-index: 100;
    border-radius: 50%;
    background: rgba(6, 30, 46, 0.7);
    backdrop-filter: blur(12px) saturate(120%);
    border: 1px solid rgba(0, 229, 204, 0.3);
    box-shadow: 0 4px 20px rgba(6, 30, 46, 0.5), 0 0 30px rgba(0, 229, 204, 0.1);
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.compass-ring {
    position: relative;
    width: 100%;
    height: 100%;
}

.compass-pip {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #7EC8C8;
    opacity: 0.5;
    border: none;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    padding: 0;
}

.compass-pip:hover {
    opacity: 1;
    background: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 229, 204, 0.6);
    transform: scale(1.3);
}

.compass-pip.active {
    background: var(--accent-cyan);
    opacity: 1;
    box-shadow: 0 0 8px rgba(0, 229, 204, 0.5);
}

.pip-north {
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
}

.pip-east {
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
}

.pip-south {
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
}

.pip-west {
    top: 50%;
    left: 4px;
    transform: translateY(-50%);
}

.pip-label {
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-right: 12px;
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    color: var(--text-light);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.tone-compass:hover .pip-label {
    opacity: 0.8;
}

.compass-needle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 2px;
    background: var(--accent-cyan);
    border-radius: 1px;
    transform-origin: left center;
    transform: translate(0, -50%) rotate(0deg);
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 0 6px rgba(0, 229, 204, 0.5);
}

/* =============================================
   Ocean Layers (Common)
   ============================================= */
.ocean-layer {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
}

.section-heading {
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: clamp(2.5rem, 5vw, 5rem);
    color: var(--text-light);
    text-align: center;
    margin-bottom: 3rem;
}

.section-heading--light {
    color: var(--text-light);
}

/* =============================================
   SURFACE LAYER
   ============================================= */
.surface-layer {
    height: 100vh;
    background: linear-gradient(180deg, #E8F5FA 0%, #7EC8C8 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.surface-water {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse 80% 50% at 30% 70%, rgba(126, 200, 200, 0.5), transparent),
        radial-gradient(ellipse 60% 40% at 70% 40%, rgba(232, 245, 250, 0.4), transparent),
        radial-gradient(ellipse 90% 60% at 50% 60%, rgba(42, 157, 143, 0.2), transparent);
    animation: surfaceRipple 12s ease-in-out infinite alternate;
}

@keyframes surfaceRipple {
    0% {
        background-position: 0% 0%, 100% 0%, 50% 50%;
        opacity: 0.6;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        background-position: 100% 100%, 0% 100%, 50% 0%;
        opacity: 0.6;
    }
}

.surface-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 0 2rem;
}

.site-title {
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: clamp(3rem, 8vw, 7rem);
    color: var(--deep-current);
    margin-bottom: 1rem;
    text-shadow: 0 2px 20px rgba(126, 200, 200, 0.4);
}

.site-tagline {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 2vw, 1.25rem);
    line-height: 1.65;
    color: var(--text-dark);
    max-width: 500px;
    margin: 0 auto;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    animation: buoyBob 2.5s ease-in-out infinite;
}

@keyframes buoyBob {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(12px);
    }
}

.buoy-arrow {
    opacity: 0.6;
}

/* =============================================
   SHALLOWS LAYER
   ============================================= */
.shallows-layer {
    min-height: 100vh;
    background: linear-gradient(180deg, #7EC8C8 0%, #2A9D8F 100%);
    padding: 8vh 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shallows-content {
    position: relative;
    width: 100%;
    max-width: 1100px;
    min-height: 80vh;
}

/* Frosted Glass Panels */
.glass-panel {
    position: absolute;
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    width: clamp(260px, 30vw, 340px);
    box-shadow:
        0 4px 30px rgba(6, 30, 46, 0.15),
        inset 0 1px 0 rgba(224, 244, 255, 0.15);
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.glass-panel.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Freeform positioned panels - triangular formation */
.panel-1 {
    top: 12%;
    left: 5%;
}

.panel-2 {
    top: 5%;
    left: 50%;
    transform: translateX(-50%) translateY(40px);
}

.panel-2.revealed {
    transform: translateX(-50%) translateY(0);
}

.panel-3 {
    top: 45%;
    right: 5%;
    left: auto;
}

.panel-icon {
    width: 120px;
    height: 120px;
    margin-bottom: 1.5rem;
}

.iso-icon {
    width: 100%;
    height: 100%;
    filter: drop-shadow(4px 4px 12px rgba(6, 30, 46, 0.25));
}

.panel-label {
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.panel-desc {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.875rem, 1.1vw, 1rem);
    line-height: 1.65;
    color: #C8E6F5;
}

/* =============================================
   MID-DEPTH LAYER
   ============================================= */
.mid-depth-layer {
    min-height: 150vh;
    background: linear-gradient(180deg, #2A9D8F 0%, #0B3D5B 100%);
    padding: 10vh 2rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.mid-depth-content {
    width: 100%;
    max-width: 900px;
    padding-top: 5vh;
}

.narrative-column {
    max-width: 720px;
    margin: 0 auto;
}

.narrative-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.25vw, 1.125rem);
    line-height: 1.65;
    color: #C8E6F5;
    margin-bottom: 2rem;
}

/* Underline-draw links */
.inline-link {
    position: relative;
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
}

.inline-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-coral);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.inline-link:hover::after {
    transform: scaleX(1);
}

/* Inline isometric illustrations */
.inline-iso {
    width: 100%;
    max-width: 400px;
    margin: 3rem auto;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.inline-iso.revealed {
    opacity: 1;
    transform: translateY(0);
}

.iso-inline-icon {
    width: 100%;
    height: auto;
    filter: drop-shadow(4px 4px 12px rgba(6, 30, 46, 0.25));
}

/* =============================================
   ABYSS LAYER
   ============================================= */
.abyss-layer {
    min-height: 100vh;
    background: linear-gradient(180deg, #0B3D5B 0%, #061E2E 100%);
    padding: 10vh 2rem 5vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.abyss-content {
    width: 100%;
    max-width: 1000px;
    text-align: center;
}

.sonar-station-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto 4rem;
}

.sonar-station {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 30px rgba(0, 229, 204, 0.15));
}

/* Screen waveform animation */
.screen-wave {
    animation: screenPulse 3s ease-in-out infinite;
}

@keyframes screenPulse {
    0%, 100% {
        opacity: 0.9;
        d: path("M148 150 Q155 140 162 150 Q169 160 176 150 Q183 140 190 150");
    }
    50% {
        opacity: 0.6;
        d: path("M148 150 Q155 145 162 150 Q169 155 176 150 Q183 145 190 150");
    }
}

/* Fish swimming animation */
.fish-1 {
    animation: fishSwim1 12s ease-in-out infinite;
}

.fish-2 {
    animation: fishSwim2 15s ease-in-out infinite;
}

.fish-3 {
    animation: fishSwim3 18s ease-in-out infinite;
}

@keyframes fishSwim1 {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(15px) translateY(-5px); }
    50% { transform: translateX(30px) translateY(3px); }
    75% { transform: translateX(10px) translateY(-8px); }
}

@keyframes fishSwim2 {
    0%, 100% { transform: translateX(0) translateY(0); }
    30% { transform: translateX(-20px) translateY(8px); }
    60% { transform: translateX(-10px) translateY(-5px); }
}

@keyframes fishSwim3 {
    0%, 100% { transform: translateX(0) translateY(0); }
    40% { transform: translateX(25px) translateY(10px); }
    70% { transform: translateX(5px) translateY(-3px); }
}

/* SVG path-draw lines */
.draw-line {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 0.8s ease;
}

.draw-line.drawn {
    stroke-dashoffset: 0;
}

/* Annotations */
.annotation {
    position: absolute;
    max-width: 180px;
    opacity: 0;
    transition: opacity 0.6s ease 0.4s;
}

.annotation.visible {
    opacity: 1;
}

.annotation-text {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: clamp(0.7rem, 1vw, 0.8rem);
    letter-spacing: 0.06em;
    color: var(--accent-cyan);
    line-height: 1.5;
}

.annotation-1 {
    top: 18%;
    right: -5%;
}

.annotation-2 {
    top: 22%;
    left: -5%;
}

.annotation-3 {
    bottom: 8%;
    right: 15%;
}

/* Resurface CTA */
.resurface-cta {
    margin-top: 4rem;
}

.resurface-link {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.resurface-link:hover {
    transform: translateY(-4px);
}

.resurface-arrow {
    animation: resurfaceBob 2s ease-in-out infinite;
}

@keyframes resurfaceBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.resurface-text {
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.85rem;
    color: var(--accent-cyan);
    position: relative;
}

.resurface-text::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-coral);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.resurface-link:hover .resurface-text::after {
    transform: scaleX(1);
}

/* =============================================
   Responsive Design
   ============================================= */
@media (max-width: 768px) {
    .shallows-content {
        min-height: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2rem;
        padding-top: 2rem;
    }

    .glass-panel {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        bottom: auto;
        width: 100%;
        max-width: 340px;
    }

    .panel-2 {
        transform: translateY(40px);
    }

    .panel-2.revealed {
        transform: translateY(0);
    }

    .section-heading {
        font-size: clamp(2rem, 6vw, 3rem);
    }

    .site-title {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }

    .annotation {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        bottom: auto;
        max-width: 100%;
        text-align: center;
        margin: 1rem 0;
    }

    .sonar-station-container {
        max-width: 100%;
    }

    .tone-compass {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
    }
}

@media (max-width: 480px) {
    .glass-panel {
        padding: 1.5rem 1.25rem;
    }

    .panel-icon {
        width: 80px;
        height: 80px;
    }

    .mid-depth-layer {
        min-height: 120vh;
    }
}
