/* ============================================================
   hanun.ai — Styles
   Surreal Dreamscape Processor
   ============================================================ */

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

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

body {
    background: #0D0A1A;
    color: #D8C8E8;
    font-family: 'Lexend', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.7;
    overflow-x: hidden;
    /* Full-page atmospheric gradient */
    background: linear-gradient(
        to top,
        #0D0A1A 0%,
        #1A1232 25%,
        #2D1F4E 60%,
        #3D2A6E 85%,
        rgba(244, 198, 215, 0.08) 100%
    );
    background-attachment: fixed;
}

/* --- Aurora SVG Layer --- */
#aurora-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    mix-blend-mode: screen;
}

#aurora-svg {
    width: 100%;
    height: 100%;
}

.aurora-trail {
    fill: none;
    stroke-width: 0.8;
    filter: url(#aurora-glow);
    opacity: 0;
    transition: opacity 6s ease;
}

.aurora-trail.visible {
    opacity: 1;
}

.aurora-trail.thick {
    stroke-width: 2;
    filter: url(#aurora-glow-thick);
}

/* --- Cloud Particles Canvas --- */
#cloud-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* --- Dissolving Geometry Layer --- */
#geometry-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

#geometry-svg {
    width: 100%;
    height: 100%;
}

.dissolving-shape {
    opacity: 0.05;
    fill: #C4A7D7;
    mask: url(#dissolve-mask);
}

/* --- Altitude Indicator --- */
#altitude-indicator {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 60vh;
}

#altitude-track {
    width: 3px;
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(to top, #D4607A, #7B9EC7, #F4C6D7);
    position: relative;
    opacity: 0.4;
}

#altitude-marker {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #E8739E;
    box-shadow: 0 0 12px rgba(232, 115, 158, 0.6);
    transition: bottom 0.3s ease-out;
}

#altitude-labels {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: 0;
}

.altitude-label {
    background: none;
    border: none;
    color: #7B9EC7;
    font-family: 'Martian Mono', monospace;
    font-weight: 300;
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    cursor: pointer;
    opacity: 0.3;
    transition: opacity 0.6s ease, color 0.6s ease;
    text-align: left;
    padding: 0;
    white-space: nowrap;
}

.altitude-label.active {
    opacity: 1;
    color: #E8739E;
}

/* --- Zones (Sections) --- */
.zone {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zone-content {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
}

/* --- Zone 1: Ground Layer --- */
#zone-1 {
    min-height: 100vh;
}

.zone-1-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    position: relative;
}

#site-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 200;
    font-size: clamp(3rem, 7vw, 6rem);
    color: #F0E6F6;
    letter-spacing: 0.08em;
    line-height: 1.08;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#site-title.revealed {
    opacity: 1;
    transform: translateY(0);
}

#site-subtitle {
    font-family: 'Fraunces', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1rem, 2vw, 1.5rem);
    letter-spacing: 0.02em;
    line-height: 1.35;
    margin-top: 1.2rem;
    overflow: hidden;
}

#site-subtitle .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    background: linear-gradient(90deg, #E8739E, #7B9EC7, #E8739E);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: subtitleGradientShift 8s linear infinite;
    animation-play-state: paused;
}

#site-subtitle .char.revealed {
    opacity: 1;
    transform: translateY(0);
    animation-play-state: running;
}

#site-subtitle .char.space-char {
    width: 0.3em;
}

@keyframes subtitleGradientShift {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

#scroll-chevron {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    animation: chevronPulse 2.5s ease-in-out infinite;
    animation-delay: 4s;
}

#scroll-chevron.visible {
    opacity: 1;
}

@keyframes chevronPulse {
    0%, 100% { opacity: 0.3; transform: translateX(-50%) translateY(0); }
    50% { opacity: 0.8; transform: translateX(-50%) translateY(6px); }
}

/* --- Zone 2: Troposphere --- */
#zone-2 {
    min-height: 100vh;
    padding: 4rem 0;
}

.zone-2-content {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    align-items: flex-end;
    padding-right: 4rem;
}

.diagonal-panel {
    background: rgba(26, 18, 50, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(240, 230, 246, 0.08);
    transform: skewY(-12deg);
    padding: 2.5rem 3rem;
    max-width: 36rem;
    width: 100%;
    opacity: 0;
    transform: skewY(-12deg) translateX(60px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                border-color 0.4s ease;
    position: relative;
}

.diagonal-panel.revealed {
    opacity: 1;
    transform: skewY(-12deg) translateX(0);
}

.diagonal-panel:hover {
    border-color: rgba(232, 115, 158, 0.3);
}

.panel-inner {
    transform: skewY(12deg);
}

.panel-heading {
    font-family: 'Fraunces', serif;
    font-weight: 300;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    color: #C4A7D7;
    letter-spacing: 0.02em;
    line-height: 1.35;
    margin-bottom: 1rem;
}

.panel-text {
    font-family: 'Lexend', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    color: #D8C8E8;
    line-height: 1.7;
    max-width: 38em;
}

.panel-1 { transition-delay: 0ms; }
.panel-2 { transition-delay: 200ms; }
.panel-3 { transition-delay: 400ms; }

/* --- Zone 3: Stratosphere --- */
#zone-3 {
    min-height: 100vh;
    padding: 6rem 0;
}

.zone-3-content {
    display: flex;
    justify-content: center;
}

.stratosphere-panel {
    max-width: 48rem;
    width: 100%;
    padding: 3rem;
    background: rgba(26, 18, 50, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(240, 230, 246, 0.06);
    border-radius: 2px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.strato-heading {
    font-family: 'Fraunces', serif;
    font-weight: 300;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    color: #F0E6F6;
    letter-spacing: 0.02em;
    line-height: 1.2;
    margin-bottom: 2rem;
}

.strato-body {
    font-family: 'Lexend', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    color: #D8C8E8;
    line-height: 1.7;
    max-width: 38em;
    margin-bottom: 1.5rem;
}

.strato-quote {
    font-family: 'Fraunces', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.2rem, 2.2vw, 1.8rem);
    color: #E8739E;
    line-height: 1.4;
    border-left: 2px solid rgba(232, 115, 158, 0.3);
    padding-left: 1.5rem;
    margin: 2rem 0;
    max-width: 36em;
}

/* --- Zone 4: Mesosphere --- */
#zone-4 {
    min-height: 100vh;
    padding: 0;
}

.zone-4-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    min-height: 100vh;
    gap: 0;
    padding: 0;
}

.meso-element {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.meso-element.revealed {
    opacity: 1;
    transform: translateY(0);
}

.meso-dream-word {
    font-family: 'Outfit', sans-serif;
    font-weight: 200;
    font-size: clamp(4rem, 10vw, 8rem);
    color: #F0E6F6;
    letter-spacing: 0.08em;
    line-height: 1.08;
}

.meso-phrase {
    font-family: 'Fraunces', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.1rem, 2.5vw, 1.8rem);
    color: #C4A7D7;
    letter-spacing: 0.02em;
    line-height: 1.35;
    text-align: center;
}

.meso-shape {
    display: flex;
    align-items: center;
    justify-content: center;
}

.dissolving-hexagon {
    animation: hexRotate 60s linear infinite;
}

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

/* --- Zone 5: Exosphere --- */
#zone-5 {
    min-height: 100vh;
}

.zone-5-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    gap: 2rem;
}

.exo-logotype {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.exo-logotype.revealed {
    opacity: 1;
    transform: translateY(0);
}

.exo-title {
    font-family: 'Fraunces', serif;
    font-weight: 200;
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: #F0E6F6;
    letter-spacing: 0.04em;
    line-height: 1.1;
}

.exo-status {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.5s,
                transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.5s;
}

.exo-status.revealed {
    opacity: 1;
    transform: translateY(0);
}

.exo-status.faded {
    opacity: 0.4;
    transition: opacity 4s ease;
}

.exo-label {
    font-family: 'Martian Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #7B9EC7;
}

/* --- Responsive: Mobile --- */
@media (max-width: 768px) {
    #altitude-indicator {
        position: fixed;
        right: auto;
        left: 0;
        bottom: 0;
        top: auto;
        transform: none;
        width: 100%;
        height: auto;
        flex-direction: column;
        gap: 4px;
        padding: 8px 12px;
        background: rgba(13, 10, 26, 0.8);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        z-index: 100;
    }

    #altitude-track {
        width: 100%;
        height: 3px;
        background: linear-gradient(to right, #D4607A, #7B9EC7, #F4C6D7);
    }

    #altitude-marker {
        bottom: auto;
        top: 50%;
        left: 0;
        transform: translateY(-50%);
        transition: left 0.3s ease-out;
    }

    #altitude-labels {
        flex-direction: row-reverse;
        width: 100%;
        height: auto;
    }

    .altitude-label {
        font-size: 0.5rem;
    }

    .zone-2-content {
        padding-right: 1rem;
        padding-left: 1rem;
        align-items: center;
    }

    .diagonal-panel {
        transform: skewY(-6deg) translateX(60px);
        max-width: 100%;
    }

    .diagonal-panel.revealed {
        transform: skewY(-6deg) translateX(0);
    }

    .panel-inner {
        transform: skewY(6deg);
    }

    .diagonal-panel {
        padding: 1.5rem 2rem;
    }

    .stratosphere-panel {
        padding: 2rem 1.5rem;
    }

    .zone-content {
        padding: 1rem;
    }
}

/* --- Dissolving geometry shapes (positioned via JS) --- */
.geo-shape {
    position: fixed;
    pointer-events: none;
    z-index: 1;
    opacity: 0.05;
    animation: geoFloat 30s ease-in-out infinite alternate;
}

.geo-shape svg {
    fill: #C4A7D7;
    opacity: 0.5;
}

@keyframes geoFloat {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(15px, -20px) rotate(8deg); }
}

.geo-shape:nth-child(2n) {
    animation-duration: 45s;
}

.geo-shape:nth-child(3n) {
    animation-duration: 60s;
    animation-direction: alternate-reverse;
}

/* --- Initial intro aurora trail --- */
.intro-trail {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawTrail 3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    opacity: 1;
}

@keyframes drawTrail {
    to { stroke-dashoffset: 0; }
}

.intro-trail-glow {
    animation: trailPulse 4s ease-in-out infinite;
}

@keyframes trailPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* --- Selection --- */
::selection {
    background: rgba(232, 115, 158, 0.3);
    color: #F0E6F6;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: #0D0A1A;
}

::-webkit-scrollbar-thumb {
    background: rgba(123, 158, 199, 0.3);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(123, 158, 199, 0.5);
}
