/* ================================================
   eyes.team - Styles
   Palette:
     Abyss Black:    #0A0A12
     Iris Violet:    #7B61FF
     Deep Burgundy:  #4A1942
     Neural Gold:    #C9A84C
     Retinal White:  #E8E4F0
     Synapse Cyan:   #3DD6D0
     Cornea Blush:   #D4708F
   Fonts:
     Headlines: Playfair Display 700 / 400i
     Body:      Karla 400 / 700
     Data:      Fira Code 400
   ================================================ */

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0A0A12;
    color: #E8E4F0;
    font-family: 'Karla', sans-serif;
    font-weight: 400;
    font-size: clamp(15px, 1.5vw, 18px);
    line-height: 1.75;
}

/* ------------------------------------------------
   Opening Overlay
   ------------------------------------------------ */
#opening-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 100;
    background: #0A0A12;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#opening-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#opening-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#opening-title {
    position: relative;
    z-index: 2;
    text-align: center;
    opacity: 0;
}

#opening-title.visible {
    opacity: 1;
}

.title-letter {
    display: inline-block;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(48px, 10vw, 120px);
    letter-spacing: -0.02em;
    color: #E8E4F0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.title-letter.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Each letter has a different vertical offset for the staggered look */
.title-letter[data-index="0"] { transform: translateY(20px); }
.title-letter[data-index="1"] { transform: translateY(28px); }
.title-letter[data-index="2"] { transform: translateY(14px); }
.title-letter[data-index="3"] { transform: translateY(24px); }

.title-letter.visible[data-index="0"] { transform: translateY(0px); }
.title-letter.visible[data-index="1"] { transform: translateY(8px); }
.title-letter.visible[data-index="2"] { transform: translateY(-6px); }
.title-letter.visible[data-index="3"] { transform: translateY(4px); }

.title-subtitle {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(18px, 3vw, 36px);
    color: #7B61FF;
    letter-spacing: 0.15em;
    opacity: 0;
    transition: opacity 0.4s ease;
    margin-top: 4px;
}

.title-subtitle.visible {
    opacity: 1;
}

/* ------------------------------------------------
   Horizontal Scroll Container
   ------------------------------------------------ */
#horizontal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.6s ease;
}

#horizontal-container.visible {
    opacity: 1;
}

#scroll-wrapper {
    display: flex;
    width: max-content;
    height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

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

/* ------------------------------------------------
   Panels
   ------------------------------------------------ */
.panel {
    position: relative;
    width: 100vw;
    height: 100vh;
    flex-shrink: 0;
    scroll-snap-align: start;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* Unique gradient mesh backgrounds per panel */
#panel-0 .panel-bg {
    background:
        radial-gradient(ellipse at 20% 30%, rgba(123, 97, 255, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 70%, rgba(74, 25, 66, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 90%, rgba(61, 214, 208, 0.08) 0%, transparent 40%),
        #0A0A12;
}

#panel-1 .panel-bg {
    background:
        radial-gradient(ellipse at 70% 20%, rgba(61, 214, 208, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse at 30% 80%, rgba(123, 97, 255, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 60%, rgba(201, 168, 76, 0.1) 0%, transparent 45%),
        #0A0A12;
}

#panel-2 .panel-bg {
    background:
        radial-gradient(ellipse at 40% 50%, rgba(201, 168, 76, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse at 10% 20%, rgba(74, 25, 66, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(212, 112, 143, 0.1) 0%, transparent 40%),
        #0A0A12;
}

#panel-3 .panel-bg {
    background:
        radial-gradient(ellipse at 60% 40%, rgba(212, 112, 143, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse at 20% 70%, rgba(61, 214, 208, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 15%, rgba(123, 97, 255, 0.1) 0%, transparent 45%),
        #0A0A12;
}

#panel-4 .panel-bg {
    background:
        radial-gradient(ellipse at 50% 30%, rgba(74, 25, 66, 0.25) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 60%, rgba(123, 97, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 15% 85%, rgba(201, 168, 76, 0.08) 0%, transparent 40%),
        #0A0A12;
}

#panel-5 .panel-bg {
    background:
        radial-gradient(ellipse at 50% 50%, rgba(123, 97, 255, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 20%, rgba(61, 214, 208, 0.15) 0%, transparent 45%),
        radial-gradient(ellipse at 80% 80%, rgba(201, 168, 76, 0.12) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 50%, rgba(74, 25, 66, 0.15) 0%, transparent 60%),
        #0A0A12;
}

/* ------------------------------------------------
   Panel Eye (Generative Iris)
   ------------------------------------------------ */
.panel-eye {
    position: absolute;
    width: clamp(200px, 35vw, 500px);
    height: clamp(200px, 35vw, 500px);
    border-radius: 50%;
    z-index: 1;
    left: 55%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
}

.iris {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    animation: iris-rotate 30s linear infinite, iris-morph 8s ease-in-out infinite;
}

/* Unique iris patterns per panel */
[data-iris="0"] {
    background: conic-gradient(
        from 0deg,
        #7B61FF 0deg,
        #3DD6D0 45deg,
        #7B61FF 90deg,
        #C9A84C 135deg,
        #7B61FF 180deg,
        #3DD6D0 225deg,
        #C9A84C 270deg,
        #7B61FF 315deg,
        #7B61FF 360deg
    );
}

[data-iris="1"] {
    background: conic-gradient(
        from 30deg,
        #3DD6D0 0deg,
        #7B61FF 60deg,
        #3DD6D0 120deg,
        #E8E4F0 150deg,
        #3DD6D0 180deg,
        #7B61FF 240deg,
        #3DD6D0 300deg,
        #C9A84C 330deg,
        #3DD6D0 360deg
    );
}

[data-iris="2"] {
    background: conic-gradient(
        from 60deg,
        #C9A84C 0deg,
        #7B61FF 50deg,
        #C9A84C 100deg,
        #3DD6D0 150deg,
        #C9A84C 200deg,
        #D4708F 250deg,
        #C9A84C 300deg,
        #7B61FF 350deg,
        #C9A84C 360deg
    );
}

[data-iris="3"] {
    background: conic-gradient(
        from 90deg,
        #D4708F 0deg,
        #7B61FF 55deg,
        #3DD6D0 110deg,
        #D4708F 165deg,
        #C9A84C 220deg,
        #D4708F 275deg,
        #7B61FF 330deg,
        #D4708F 360deg
    );
}

[data-iris="4"] {
    background: conic-gradient(
        from 120deg,
        #4A1942 0deg,
        #7B61FF 50deg,
        #4A1942 100deg,
        #D4708F 150deg,
        #4A1942 200deg,
        #C9A84C 250deg,
        #7B61FF 300deg,
        #4A1942 350deg,
        #4A1942 360deg
    );
}

.pupil {
    position: relative;
    width: 30%;
    height: 30%;
    background: radial-gradient(circle at 40% 40%, #1a1a2e, #0A0A12 70%);
    border-radius: 50%;
    z-index: 2;
    transition: transform 0.3s ease-out;
    box-shadow: 0 0 30px rgba(10, 10, 18, 0.8);
}

.pupil::after {
    content: '';
    position: absolute;
    width: 20%;
    height: 20%;
    background: rgba(232, 228, 240, 0.4);
    border-radius: 50%;
    top: 25%;
    left: 30%;
}

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

@keyframes iris-morph {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(0deg) scale(1.02); }
}

/* Iris outer glow ring */
.panel-eye::before {
    content: '';
    position: absolute;
    width: 110%;
    height: 110%;
    border-radius: 50%;
    border: 1px solid rgba(123, 97, 255, 0.2);
    animation: glow-pulse 4s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.03); }
}

/* ------------------------------------------------
   Panel Content
   ------------------------------------------------ */
.panel-content {
    position: relative;
    z-index: 3;
    max-width: 400px;
    padding: 40px;
    margin-left: -15%;
}

.panel-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(28px, 5vw, 64px);
    letter-spacing: -0.02em;
    color: #E8E4F0;
    margin-bottom: 16px;
    line-height: 1.1;
}

.panel-text {
    font-family: 'Karla', sans-serif;
    font-weight: 400;
    font-size: clamp(15px, 1.5vw, 18px);
    line-height: 1.75;
    color: rgba(232, 228, 240, 0.8);
    margin-bottom: 20px;
}

.panel-coord {
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    font-size: 13px;
    color: #3DD6D0;
    opacity: 0.6;
    letter-spacing: 0.05em;
}

/* ------------------------------------------------
   Convergence Panel (Final)
   ------------------------------------------------ */
.panel-convergence {
    flex-direction: column;
}

#compound-eye {
    position: relative;
    width: clamp(300px, 45vw, 600px);
    height: clamp(300px, 45vw, 600px);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hex-grid {
    position: relative;
    width: 100%;
    height: 100%;
}

.hex-cell {
    position: absolute;
    width: 60px;
    height: 60px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    animation: iris-rotate 30s linear infinite;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.hex-cell.visible {
    opacity: 1;
    transform: scale(1);
}

.convergence-content {
    margin-left: 0;
    text-align: center;
    margin-top: 30px;
}

.convergence-content .panel-title {
    color: #C9A84C;
}

.convergence-content .panel-coord {
    color: #7B61FF;
}

/* ------------------------------------------------
   Minimap
   ------------------------------------------------ */
#minimap {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 60px;
    z-index: 50;
    background: linear-gradient(to top, rgba(10, 10, 18, 0.95), rgba(10, 10, 18, 0));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

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

#minimap-svg {
    width: min(600px, 80vw);
    height: 40px;
}

.minimap-node {
    fill: #4A1942;
    transition: fill 0.3s ease, r 0.3s ease;
}

.minimap-node.active {
    fill: #7B61FF;
}

.minimap-line {
    stroke: rgba(61, 214, 208, 0.3);
    stroke-width: 1;
    transition: stroke-opacity 0.3s ease;
}

.minimap-line.active {
    stroke: rgba(61, 214, 208, 0.8);
    stroke-width: 1.5;
}

.minimap-node-glow {
    fill: none;
    stroke: #7B61FF;
    stroke-width: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.minimap-node-glow.active {
    opacity: 1;
    animation: minimap-pulse 2s ease-in-out infinite;
}

@keyframes minimap-pulse {
    0%, 100% { opacity: 0.4; stroke-width: 1; }
    50% { opacity: 1; stroke-width: 2; }
}

/* ------------------------------------------------
   Particle Canvas (background)
   ------------------------------------------------ */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 5;
    pointer-events: none;
}

/* ------------------------------------------------
   Neural Connection Lines (per panel)
   ------------------------------------------------ */
.panel-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* ------------------------------------------------
   Scroll hint
   ------------------------------------------------ */
.scroll-hint {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 55;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    color: rgba(61, 214, 208, 0.5);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.scroll-hint.visible {
    opacity: 1;
    animation: hint-fade 3s ease-in-out infinite;
}

@keyframes hint-fade {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* ------------------------------------------------
   Neural connection SVG lines (opening)
   ------------------------------------------------ */
.connection-line {
    stroke: rgba(61, 214, 208, 0.3);
    stroke-width: 1;
    fill: none;
}

.eye-node {
    fill: #0A0A12;
    stroke: rgba(123, 97, 255, 0.5);
    stroke-width: 1;
}

/* ------------------------------------------------
   Responsive
   ------------------------------------------------ */
@media (max-width: 768px) {
    .panel-eye {
        width: clamp(150px, 50vw, 280px);
        height: clamp(150px, 50vw, 280px);
        left: 50%;
        top: 30%;
    }

    .panel-content {
        margin-left: 0;
        margin-top: 30%;
        text-align: center;
        padding: 20px;
    }

    .convergence-content {
        margin-top: 15px;
    }

    #compound-eye {
        width: clamp(200px, 70vw, 350px);
        height: clamp(200px, 70vw, 350px);
    }

    .hex-cell {
        width: 40px;
        height: 40px;
    }
}
