/* ===================================
   GGIGGL.com — Deep Ocean Design System
   =================================== */

:root {
    --color-abyss: #0a1628;
    --color-twilight: #0f2847;
    --color-deep-edge: #060d1a;
    --color-surface: rgba(20, 60, 110, 0.35);
    --color-cyan: #00e5ff;
    --color-violet: #b388ff;
    --color-coral: #ff6f91;
    --color-text: #eaf0f7;
    --color-muted: #8aa4c1;
    --color-midground: #1a3a5c;
    --font-heading: 'Space Grotesk', system-ui, -apple-system, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --radius-capsule: 24px;
    --radius-bubble: 50%;
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-spring: cubic-bezier(0.25, 1.8, 0.5, 1);
    --glow-cyan: 0 0 30px rgba(0, 229, 255, 0.25), 0 0 60px rgba(179, 136, 255, 0.1);
    --glow-cyan-soft: 0 0 20px rgba(0, 229, 255, 0.3);
}

/* ===================================
   Reset & Base
   =================================== */

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

html, body {
    height: 100%;
    overflow: hidden;
    background: var(--color-abyss);
    color: var(--color-text);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===================================
   Background Layers
   =================================== */

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

#bg-bubbles {
    z-index: 1;
}

#bg-sonar {
    z-index: 2;
}

/* Canvas cursor trail */
#cursor-trail {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

/* ===================================
   Horizontal Scroll Rail
   =================================== */

#scroll-rail {
    display: flex;
    width: max-content;
    height: 100vh;
    scroll-snap-type: x mandatory;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    position: relative;
    z-index: 10;
}

#scroll-rail::-webkit-scrollbar {
    display: none;
}

/* ===================================
   Scene Base
   =================================== */

.scene {
    min-width: 100vw;
    height: 100vh;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: radial-gradient(ellipse at center, var(--color-twilight) 0%, var(--color-deep-edge) 100%);
}

/* ===================================
   Content Capsules
   =================================== */

.capsule {
    background: var(--color-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 229, 255, 0.15);
    border-radius: var(--radius-capsule);
    padding: 48px;
    position: relative;
    opacity: 0;
    transform: translateY(30px) scale(0.85);
    transition: opacity 0.6s var(--ease-bounce), transform 0.6s var(--ease-bounce);
}

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

/* ===================================
   Scene 1: Hero
   =================================== */

.scene-hero {
    flex-direction: column;
}

.capsule-hero {
    text-align: center;
    padding: 64px 80px;
    border-radius: 48px;
    max-width: 640px;
    z-index: 5;
}

.logotype {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 6rem;
    letter-spacing: 0.15em;
    color: var(--color-text);
    line-height: 1.1;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--color-cyan), var(--color-violet));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1.15rem;
    color: var(--color-muted);
    max-width: 380px;
    margin: 0 auto;
}

/* Sonar Rings */
.sonar-rings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    pointer-events: none;
}

.sonar-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    margin-top: -50px;
    margin-left: -50px;
    border: 1px solid var(--color-cyan);
    border-radius: 50%;
    opacity: 0;
    animation: sonar-pulse 8s infinite ease-out;
}

.sonar-ring:nth-child(1) { animation-delay: 0s; }
.sonar-ring:nth-child(2) { animation-delay: 2s; }
.sonar-ring:nth-child(3) { animation-delay: 4s; }
.sonar-ring:nth-child(4) { animation-delay: 6s; }

@keyframes sonar-pulse {
    0% {
        width: 100px;
        height: 100px;
        margin-top: -50px;
        margin-left: -50px;
        opacity: 0.08;
    }
    100% {
        width: 700px;
        height: 700px;
        margin-top: -350px;
        margin-left: -350px;
        opacity: 0;
    }
}

/* Scroll Hint Arrow */
.scroll-hint {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    animation: bounce-right 1.8s infinite ease-in-out;
    z-index: 20;
    opacity: 0.6;
}

@keyframes bounce-right {
    0%, 100% { transform: translateY(-50%) translateX(0); }
    50% { transform: translateY(-50%) translateX(10px); }
}

/* ===================================
   Scene 2: What We Do
   =================================== */

.scene-what {
    align-items: center;
    justify-content: center;
}

.capsule-trio {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    padding: 0 40px;
}

.capsule-feature {
    width: 260px;
    text-align: center;
    padding: 40px 32px;
    border-radius: 32px;
}

.capsule-feature:nth-child(2) {
    margin-top: -40px;
}

.feature-icon {
    margin-bottom: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s var(--ease-spring) 0.2s, transform 0.4s var(--ease-spring) 0.2s;
}

.capsule.visible .feature-icon {
    opacity: 1;
    transform: translateY(0);
}

.feature-icon svg {
    transition: transform 0.3s ease, filter 0.3s ease;
}

.feature-icon:hover svg {
    transform: translateY(-2px);
    filter: drop-shadow(0 0 12px rgba(0, 229, 255, 0.5));
}

.feature-title {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-cyan);
    margin-bottom: 12px;
}

.feature-desc {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 0.95rem;
    color: var(--color-muted);
    line-height: 1.65;
}

/* ===================================
   Scene 3: Deep Dive
   =================================== */

.scene-deep {
    justify-content: center;
    align-items: center;
    gap: 60px;
}

.capsule-narrative {
    max-width: 65vw;
    border-radius: 36px;
    padding: 56px 64px;
    z-index: 5;
}

.section-heading {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 3.5rem;
    letter-spacing: -0.02em;
    color: var(--color-text);
    margin-bottom: 24px;
}

.narrative-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1.1rem;
    line-height: 1.75;
    color: var(--color-muted);
}

/* Jellyfish decoration */
.jellyfish-deco {
    position: absolute;
    right: 8%;
    top: 20%;
    animation: jelly-bob 4s infinite ease-in-out;
    opacity: 0.55;
    z-index: 4;
}

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

/* ===================================
   Scene 4: Signals
   =================================== */

.scene-signals {
    flex-direction: column;
    gap: 40px;
}

.signals-heading {
    text-align: center;
}

.honeycomb-cluster {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 360px;
}

.signal-badge {
    width: 96px;
    height: 96px;
    border-radius: var(--radius-bubble);
    background: var(--color-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 229, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: transform 0.35s var(--ease-bounce), box-shadow 0.35s ease;
    opacity: 0;
    transform: scale(0.7);
}

.signal-badge.visible {
    opacity: 1;
    transform: scale(1);
}

.signal-badge:hover {
    transform: scale(1.12);
    box-shadow: var(--glow-cyan);
}

/* Tooltip */
.signal-badge::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-cyan);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.signal-badge:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Offset honeycomb rows */
.signal-badge:nth-child(4),
.signal-badge:nth-child(5),
.signal-badge:nth-child(6) {
    transform: translateX(12px) scale(0.7);
}

.signal-badge:nth-child(4).visible,
.signal-badge:nth-child(5).visible,
.signal-badge:nth-child(6).visible {
    transform: translateX(12px) scale(1);
}

.signal-badge:nth-child(4):hover,
.signal-badge:nth-child(5):hover,
.signal-badge:nth-child(6):hover {
    transform: translateX(12px) scale(1.12);
}

/* ===================================
   Scene 5: Contact
   =================================== */

.scene-contact {
    background: radial-gradient(ellipse at center, var(--color-midground) 0%, var(--color-twilight) 60%, var(--color-deep-edge) 100%);
    flex-direction: column;
}

.capsule-contact {
    text-align: center;
    padding: 56px 64px;
    border-radius: 36px;
    max-width: 500px;
    z-index: 5;
}

.contact-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1rem;
    color: var(--color-muted);
    margin-bottom: 28px;
}

.contact-form {
    width: 100%;
}

.input-group {
    display: flex;
    gap: 0;
    border-radius: 48px;
    overflow: hidden;
    border: 1px solid rgba(0, 229, 255, 0.2);
    background: rgba(10, 22, 40, 0.6);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-group:focus-within {
    border-color: rgba(0, 229, 255, 0.5);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.15);
}

.pill-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 0.95rem;
    color: var(--color-text);
    padding: 14px 24px;
}

.pill-input::placeholder {
    color: var(--color-muted);
    opacity: 0.6;
}

.pill-button {
    background: linear-gradient(135deg, var(--color-cyan), var(--color-violet));
    border: none;
    outline: none;
    color: var(--color-abyss);
    cursor: pointer;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.pill-button:hover {
    box-shadow: var(--glow-cyan);
}

.pill-button:active {
    transform: scale(0.95);
}

/* Final bubble cluster */
.bubble-cluster-final {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.deco-bubble {
    position: absolute;
    border-radius: 50%;
    background: var(--color-cyan);
    opacity: 0.06;
    animation: float-up-final linear infinite;
}

.db-1 { width: 40px; height: 40px; left: 10%; bottom: -40px; animation-duration: 18s; animation-delay: 0s; }
.db-2 { width: 20px; height: 20px; left: 25%; bottom: -20px; animation-duration: 22s; animation-delay: 3s; }
.db-3 { width: 55px; height: 55px; left: 45%; bottom: -55px; animation-duration: 25s; animation-delay: 1s; opacity: 0.04; }
.db-4 { width: 15px; height: 15px; left: 60%; bottom: -15px; animation-duration: 16s; animation-delay: 5s; }
.db-5 { width: 30px; height: 30px; left: 75%; bottom: -30px; animation-duration: 20s; animation-delay: 2s; }
.db-6 { width: 8px; height: 8px; left: 85%; bottom: -8px; animation-duration: 14s; animation-delay: 7s; background: var(--color-violet); opacity: 0.08; }
.db-7 { width: 45px; height: 45px; left: 35%; bottom: -45px; animation-duration: 28s; animation-delay: 4s; opacity: 0.03; }

@keyframes float-up-final {
    0% { transform: translateY(0); opacity: 0; }
    10% { opacity: 0.06; }
    90% { opacity: 0.06; }
    100% { transform: translateY(-110vh); opacity: 0; }
}

/* ===================================
   Navigation Bubble Bar
   =================================== */

#nav-bubbles {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 16px;
    z-index: 200;
    padding: 10px 20px;
    border-radius: 48px;
    background: rgba(10, 22, 40, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 229, 255, 0.08);
}

.nav-bubble {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-muted);
    opacity: 0.4;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.nav-bubble.active {
    transform: scale(1.5);
    opacity: 1;
    background: var(--color-cyan);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.5), 0 0 24px rgba(0, 229, 255, 0.2);
}

.nav-bubble:hover:not(.active) {
    opacity: 0.7;
    transform: scale(1.2);
}

/* ===================================
   Floating Background Bubbles (JS-generated)
   =================================== */

.bg-bubble {
    position: absolute;
    border-radius: 50%;
    background: var(--color-cyan);
    pointer-events: none;
    animation: float-up linear infinite;
}

@keyframes float-up {
    0% {
        transform: translateY(0) translateX(0);
        opacity: var(--bubble-opacity, 0.05);
    }
    25% {
        transform: translateY(-25vh) translateX(10px);
    }
    50% {
        transform: translateY(-50vh) translateX(-8px);
    }
    75% {
        transform: translateY(-75vh) translateX(12px);
    }
    100% {
        transform: translateY(-110vh) translateX(0);
        opacity: 0;
    }
}

/* ===================================
   Responsive: Mobile Vertical Stack
   =================================== */

@media (max-width: 768px) {
    #scroll-rail {
        flex-direction: column;
        width: 100%;
        height: auto;
        overflow-x: hidden;
        overflow-y: auto;
        scroll-snap-type: y mandatory;
    }

    .scene {
        min-width: 100vw;
        min-height: 100vh;
        height: 100vh;
        scroll-snap-align: start;
    }

    .capsule-hero {
        padding: 40px 32px;
    }

    .logotype {
        font-size: 3.5rem;
    }

    .tagline {
        font-size: 1rem;
    }

    .capsule-trio {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .capsule-feature {
        width: 85vw;
        max-width: 320px;
    }

    .capsule-feature:nth-child(2) {
        margin-top: 0;
    }

    .capsule-narrative {
        max-width: 90vw;
        padding: 36px 28px;
    }

    .section-heading {
        font-size: 2.2rem;
    }

    .jellyfish-deco {
        right: 5%;
        top: 10%;
        opacity: 0.35;
    }

    .honeycomb-cluster {
        gap: 16px;
        max-width: 280px;
    }

    .signal-badge {
        width: 72px;
        height: 72px;
    }

    .capsule-contact {
        max-width: 90vw;
        padding: 36px 28px;
    }

    .scroll-hint {
        display: none;
    }

    #nav-bubbles {
        bottom: 16px;
    }

    .sonar-ring {
        display: none;
    }
}
