/* ============================================
   aiice.io — Frutiger Aero Glass Terraces
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    /* Palette */
    --sky-cerulean: #3AAFDB;
    --amber-glow: #F2A93B;
    --dawn-mist: #E8F4FD;
    --warm-ivory: #FFF8EE;
    --frost-white: #FFFFFF; /* used at 60% opacity on glass panels */
    --deep-marine: #1B3A4B;
    --slate-dusk: #5A7D8A;
    --leaf-refraction: #6ECF94;
    --solar-flare: #F7CE68;
    --glass-shadow: rgba(27, 58, 75, 0.12);
    --warm-highlight-mid: #FFF3E0;
    --soft-blue: #D4EDFC;

    /* Typography */
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Nunito Sans', 'Segoe UI', sans-serif;

    /* Layout */
    --panel-radius: 24px;
    --glass-blur: 20px;
}

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

html {
    scroll-snap-type: y proximity;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    color: var(--deep-marine);
    background: linear-gradient(170deg, #E8F4FD 0%, #D4EDFC 30%, #FFF3E0 70%, #FFF8EE 100%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    animation: hueShift 30s ease-in-out infinite alternate;
}

@keyframes hueShift {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(15deg); }
}

/* --- Bokeh Background --- */
.bokeh-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bokeh {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.8), transparent 70%);
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-direction: alternate;
}

.bokeh-1 {
    width: 18px; height: 18px;
    top: 8%; left: 12%;
    animation: bokehDrift1 18s ease-in-out infinite alternate, bokehPulse 4s ease-in-out infinite alternate;
}
.bokeh-2 {
    width: 14px; height: 14px;
    top: 22%; left: 78%;
    animation: bokehDrift2 22s ease-in-out infinite alternate, bokehPulse 5s ease-in-out infinite alternate 1s;
}
.bokeh-3 {
    width: 20px; height: 20px;
    top: 35%; left: 42%;
    animation: bokehDrift3 15s ease-in-out infinite alternate, bokehPulse 3.5s ease-in-out infinite alternate 0.5s;
}
.bokeh-4 {
    width: 12px; height: 12px;
    top: 48%; left: 88%;
    animation: bokehDrift4 25s ease-in-out infinite alternate, bokehPulse 6s ease-in-out infinite alternate 2s;
}
.bokeh-5 {
    width: 16px; height: 16px;
    top: 62%; left: 25%;
    animation: bokehDrift5 20s ease-in-out infinite alternate, bokehPulse 4.5s ease-in-out infinite alternate 0.8s;
}
.bokeh-6 {
    width: 15px; height: 15px;
    top: 75%; left: 65%;
    animation: bokehDrift6 17s ease-in-out infinite alternate, bokehPulse 5.5s ease-in-out infinite alternate 1.5s;
}
.bokeh-7 {
    width: 19px; height: 19px;
    top: 15%; left: 55%;
    animation: bokehDrift7 23s ease-in-out infinite alternate, bokehPulse 4s ease-in-out infinite alternate 0.3s;
}
.bokeh-8 {
    width: 13px; height: 13px;
    top: 85%; left: 35%;
    animation: bokehDrift8 19s ease-in-out infinite alternate, bokehPulse 5s ease-in-out infinite alternate 2.5s;
}
.bokeh-9 {
    width: 16px; height: 16px;
    top: 55%; left: 8%;
    animation: bokehDrift9 21s ease-in-out infinite alternate, bokehPulse 3.8s ease-in-out infinite alternate 1.2s;
}
.bokeh-10 {
    width: 14px; height: 14px;
    top: 40%; left: 92%;
    animation: bokehDrift10 16s ease-in-out infinite alternate, bokehPulse 4.2s ease-in-out infinite alternate 0.7s;
}

@keyframes bokehDrift1  { from { transform: translate(0, 0); } to { transform: translate(30px, 20px); } }
@keyframes bokehDrift2  { from { transform: translate(0, 0); } to { transform: translate(-25px, 15px); } }
@keyframes bokehDrift3  { from { transform: translate(0, 0); } to { transform: translate(20px, -25px); } }
@keyframes bokehDrift4  { from { transform: translate(0, 0); } to { transform: translate(-15px, 30px); } }
@keyframes bokehDrift5  { from { transform: translate(0, 0); } to { transform: translate(25px, -10px); } }
@keyframes bokehDrift6  { from { transform: translate(0, 0); } to { transform: translate(-20px, -20px); } }
@keyframes bokehDrift7  { from { transform: translate(0, 0); } to { transform: translate(15px, 25px); } }
@keyframes bokehDrift8  { from { transform: translate(0, 0); } to { transform: translate(-30px, 10px); } }
@keyframes bokehDrift9  { from { transform: translate(0, 0); } to { transform: translate(20px, 15px); } }
@keyframes bokehDrift10 { from { transform: translate(0, 0); } to { transform: translate(-10px, -30px); } }

@keyframes bokehPulse {
    0%   { opacity: 0.3; }
    100% { opacity: 0.6; }
}

/* --- Navigation Pill --- */
.nav-pill {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50px;
    box-shadow: 0 4px 16px rgba(27, 58, 75, 0.08);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.nav-pill.visible {
    opacity: 1;
    transform: translateY(0);
}

.nav-pill__item {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: clamp(0.75rem, 0.9vw, 0.9rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--deep-marine);
    cursor: pointer;
    transition: color 0.3s ease;
}

.nav-pill__item:hover {
    color: var(--amber-glow);
}

.nav-pill__divider {
    width: 1px;
    height: 14px;
    background: rgba(27, 58, 75, 0.2);
}

/* --- Scenes (Full-Viewport Sections) --- */
.scene {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    scroll-snap-align: start;
}

/* --- Glass Panel System --- */
.glass-panel {
    position: relative;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--panel-radius);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.8),
        0 8px 32px var(--glass-shadow);
    padding: 40px;
    transform: rotate(var(--panel-rotation, 0deg));
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.3s ease;
    overflow: hidden;
}

.glass-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--panel-radius);
    opacity: 0;
    background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%),
        rgba(58, 175, 219, 0.15), transparent 70%);
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.glass-panel:hover::before {
    opacity: 1;
}

.glass-panel:hover {
    transform: rotate(var(--panel-rotation, 0deg)) translateY(-2px);
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.9),
        0 12px 40px rgba(27, 58, 75, 0.16);
}

.glass-panel--large {
    max-width: 680px;
    width: 90%;
}

.glass-panel--medium {
    max-width: 480px;
    width: 85%;
}

.glass-panel--small {
    max-width: 280px;
    width: 70%;
}

/* Panel accent wave (watermark in upper-right) */
.panel-accent-wave {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 80px;
    height: 24px;
    opacity: 0.7;
}

/* --- Scene Panel Animations --- */
.scene__panel {
    opacity: 0;
    transform: rotate(var(--panel-rotation, 0deg)) translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.scene__panel.animate-in {
    opacity: 1;
    transform: rotate(var(--panel-rotation, 0deg)) translateY(0);
}

.scene__panel .heading-section,
.scene__panel .text-body,
.scene__panel .text-poetic,
.scene__panel .title-hero {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.scene__panel.animate-in .heading-section,
.scene__panel.animate-in .text-body,
.scene__panel.animate-in .text-poetic,
.scene__panel.animate-in .title-hero {
    opacity: 1;
    transform: translateY(0);
}

.scene__panel.animate-in .title-hero,
.scene__panel.animate-in .heading-section {
    transition-delay: 0.15s;
}

.scene__panel.animate-in .text-body {
    transition-delay: 0.3s;
}

.scene__panel.animate-in .text-poetic {
    transition-delay: 0.45s;
}

.scene__panel .panel-accent-wave path {
    stroke-dasharray: 120;
    stroke-dashoffset: 120;
    transition: stroke-dashoffset 0.8s ease-in-out 0.3s;
}

.scene__panel.animate-in .panel-accent-wave path {
    stroke-dashoffset: 0;
}

/* --- Typography --- */
.title-hero {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(2.5rem, 7vw, 6rem);
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--deep-marine);
    margin-bottom: 24px;
}

.title-hero__dot {
    color: var(--sky-cerulean);
}

.heading-section {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.5rem, 3.5vw, 3rem);
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--deep-marine);
    margin-bottom: 16px;
}

.heading-section--light {
    font-weight: 300;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    letter-spacing: 0.01em;
    line-height: 1.4;
}

.text-body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.75;
    letter-spacing: 0.005em;
    color: var(--deep-marine);
    max-width: 560px;
}

.text-poetic {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    letter-spacing: 0.01em;
    line-height: 1.4;
    color: var(--slate-dusk);
    margin-top: 8px;
}

.text-poetic--small {
    font-size: clamp(1rem, 1.5vw, 1.4rem);
    margin-top: 20px;
    color: var(--amber-glow);
}

/* --- Section 1: Sunrise Gateway --- */
.scene--sunrise {
    background: transparent;
    flex-direction: column;
    padding: 0 5%;
}

.hero-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 400px;
    z-index: 0;
    pointer-events: none;
}

.scene--sunrise .scene__panel--primary {
    position: relative;
    z-index: 2;
    align-self: flex-end;
    margin-right: 5%;
    margin-top: 10vh;
}

.scene--sunrise .scene__panel--secondary {
    position: relative;
    z-index: 1;
    align-self: flex-start;
    margin-left: 10%;
    margin-top: -40px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.wave-form-small {
    width: 100%;
    height: 60px;
}

/* --- Section Dividers --- */
.section-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    z-index: 3;
}

.divider-wave {
    width: 100%;
    height: 40px;
    transition: transform 0.6s ease;
}

/* --- Section 2: The Prism --- */
.scene--prism {
    padding: 0 5%;
}

.prism-layout {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.prism__panel {
    position: absolute;
}

.prism__panel--1 {
    top: 10%;
    right: 8%;
    left: auto;
}

.prism__panel--2 {
    top: 36%;
    left: 50%;
    transform: translateX(-50%) rotate(var(--panel-rotation, 0deg));
}

.prism__panel--2.animate-in {
    transform: translateX(-50%) rotate(var(--panel-rotation, 0deg)) translateY(0);
}

.prism__panel--3 {
    bottom: 10%;
    left: 8%;
}

/* --- Section 3: Convergence --- */
.scene--convergence {
    padding: 0 5%;
}

.convergence-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 0;
    position: relative;
}

.convergence__panel {
    flex: 0 0 auto;
    width: 42%;
    max-width: 520px;
}

.convergence__panel--left {
    margin-right: -10px;
}

.convergence__panel--right {
    margin-left: -10px;
}

.convergence__gap {
    flex: 0 0 20px;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.gap-wave {
    width: 20px;
    height: 100%;
}

/* --- Section 4: Horizon --- */
.scene--horizon {
    flex-direction: column;
    justify-content: flex-end;
    padding: 0 5% 8vh;
}

.horizon-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.horizon__panel {
    width: 80%;
    max-width: 900px;
    text-align: center;
}

/* --- Glass Badges --- */
.badges-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.glass-badge {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(16px) saturate(1.3);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.7),
        0 4px 12px rgba(27, 58, 75, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-badge:nth-child(1) { transform: translateY(4px); }
.glass-badge:nth-child(2) { transform: translateY(-6px); }
.glass-badge:nth-child(3) { transform: translateY(2px); }
.glass-badge:nth-child(4) { transform: translateY(-8px); }
.glass-badge:nth-child(5) { transform: translateY(5px); }

.glass-badge:hover {
    transform: translateY(-4px) scale(1.1);
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.9),
        0 8px 20px rgba(27, 58, 75, 0.15);
}

/* --- Parallax on panels (applied via JS) --- */
.scene__panel[data-parallax] {
    will-change: transform;
}

/* --- Responsive: Mobile --- */
@media (max-width: 768px) {
    .nav-pill {
        top: auto;
        bottom: 16px;
        right: 50%;
        transform: translateX(50%) translateY(10px);
        font-size: 0.7rem;
        padding: 8px 16px;
        gap: 8px;
    }

    .nav-pill.visible {
        transform: translateX(50%) translateY(0);
    }

    .scene {
        min-height: 100svh;
        padding: 20px 4%;
    }

    .glass-panel {
        padding: 28px;
        width: 95%;
    }

    .glass-panel--large,
    .glass-panel--medium,
    .glass-panel--small {
        max-width: 100%;
        width: 95%;
    }

    /* Reduce rotation on mobile */
    .scene--sunrise .scene__panel--primary {
        align-self: center;
        margin-right: 0;
        --panel-rotation: 0deg;
    }

    .scene--sunrise .scene__panel--secondary {
        align-self: center;
        margin-left: 0;
        margin-top: 16px;
        --panel-rotation: 0deg;
    }

    /* Prism panels stack */
    .prism-layout {
        position: relative;
        height: auto;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 20px;
        padding: 10vh 0;
    }

    .prism__panel {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        bottom: auto;
        --panel-rotation: 0.5deg;
    }

    .prism__panel--2 {
        transform: rotate(var(--panel-rotation, 0deg));
    }

    .prism__panel--2.animate-in {
        transform: rotate(var(--panel-rotation, 0deg));
    }

    .prism__panel--3 {
        --panel-rotation: -0.5deg;
    }

    /* Convergence stacks */
    .convergence-layout {
        flex-direction: column;
        gap: 16px;
    }

    .convergence__panel {
        width: 95%;
        max-width: 100%;
        margin: 0;
    }

    .convergence__panel--left,
    .convergence__panel--right {
        margin: 0;
        --panel-rotation: 0deg;
    }

    .convergence__gap {
        height: 60px;
        width: 100%;
        flex: 0 0 60px;
    }

    .convergence__gap .gap-wave {
        width: 100%;
        height: 60px;
    }

    /* Horizon */
    .horizon__panel {
        width: 95%;
    }

    .badges-row {
        gap: 16px;
    }

    /* Reduce bokeh */
    .bokeh-7,
    .bokeh-8,
    .bokeh-9,
    .bokeh-10 {
        display: none;
    }

    .title-hero {
        font-size: clamp(2rem, 10vw, 3.5rem);
    }
}

/* --- Utility: Glass Glow overlays --- */
.scene::before {
    content: '';
    position: absolute;
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.scene--sunrise::before {
    background: radial-gradient(ellipse at center, rgba(58, 175, 219, 0.15), transparent 70%);
}

.scene--prism::before {
    background: radial-gradient(ellipse at center, rgba(242, 169, 59, 0.12), transparent 60%);
    top: 30%;
    left: 30%;
    width: 50%;
    height: 50%;
}

.scene--convergence::before {
    background: radial-gradient(ellipse at center, rgba(110, 207, 148, 0.1), transparent 65%);
}

.scene--horizon::before {
    background: radial-gradient(ellipse at center, rgba(242, 169, 59, 0.12), transparent 60%);
    top: 10%;
}
