/* ============================================
   JJUGGL.com - Scandinavian Frost Design System
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    /* Color palette */
    --snowfield: #EFF3F6;
    --charcoal-wool: #2B3640;
    --slate-mist: #6B7D8D;
    --nordic-blue: #4A90B8;
    --lingonberry: #C4616A;
    --fjord-dark: #1E2A35;
    --sky-fade-start: #EFF3F6;
    --sky-fade-mid: #D6E4ED;
    --sky-fade-end: #C8D8E4;
    --lavender-wash: #E8E4EF;
    --constellation-line: #B8C9D6;

    /* Glassmorphic surfaces */
    --frost-pane: rgba(255, 255, 255, 0.45);
    --ice-edge: rgba(255, 255, 255, 0.65);
    --card-shadow: 0 8px 32px rgba(30, 42, 53, 0.08);
    --card-shadow-hover: 0 16px 48px rgba(30, 42, 53, 0.14);

    /* Dark section surfaces */
    --frost-pane-dark: rgba(255, 255, 255, 0.08);
    --ice-edge-dark: rgba(255, 255, 255, 0.12);

    /* Typography */
    --font-display: 'Josefin Sans', sans-serif;
    --font-secondary: 'Geologica', sans-serif;
    --font-body: 'DM Sans', sans-serif;

    /* Spacing (8px grid) */
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 32px;
    --space-lg: 64px;
    --space-xl: 96px;

    /* Scroll-driven gradient */
    --bg-color-1: #EFF3F6;
    --bg-color-2: #D6E4ED;
    --bg-color-3: #C8D8E4;

    /* Animation */
    --ease-elastic: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-float: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: 17px;
    font-weight: 400;
    line-height: 1.7;
    color: var(--charcoal-wool);
    background: var(--snowfield);
    overflow-x: hidden;
    position: relative;
}

/* --- Background Layers --- */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(160deg, var(--bg-color-1) 0%, var(--bg-color-2) 50%, var(--bg-color-3) 100%);
    z-index: -3;
    transition: background 0.1s linear;
}

.bg-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    opacity: 0.03;
    background-image:
        radial-gradient(circle at 0 0, #2B3640 1px, transparent 1px),
        radial-gradient(circle at 24px 14px, #2B3640 1px, transparent 1px);
    background-size: 48px 28px;
    pointer-events: none;
}

/* --- Juggle Orbs (Background floating elements) --- */
.juggle-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
}

.orb-primary {
    background: radial-gradient(circle, rgba(74, 144, 184, 0.15), transparent 70%);
}

.orb-secondary {
    background: radial-gradient(circle, rgba(196, 97, 106, 0.1), transparent 70%);
}

.orb-1 {
    width: 96px;
    height: 96px;
    top: 8%;
    left: 15%;
    animation: orbDrift1 28s ease-in-out infinite;
}

.orb-2 {
    width: 72px;
    height: 72px;
    top: 22%;
    right: 20%;
    animation: orbDrift2 34s ease-in-out infinite;
}

.orb-3 {
    width: 56px;
    height: 56px;
    top: 35%;
    left: 60%;
    animation: orbDrift3 24s ease-in-out infinite;
}

.orb-4 {
    width: 80px;
    height: 80px;
    top: 48%;
    left: 25%;
    animation: orbDrift1 32s ease-in-out infinite reverse;
}

.orb-5 {
    width: 64px;
    height: 64px;
    top: 60%;
    right: 30%;
    animation: orbDrift2 26s ease-in-out infinite;
}

.orb-6 {
    width: 48px;
    height: 48px;
    top: 72%;
    left: 45%;
    animation: orbDrift3 30s ease-in-out infinite;
}

.orb-7 {
    width: 88px;
    height: 88px;
    top: 82%;
    right: 15%;
    animation: orbDrift1 36s ease-in-out infinite;
}

.orb-8 {
    width: 60px;
    height: 60px;
    top: 90%;
    left: 10%;
    animation: orbDrift2 22s ease-in-out infinite reverse;
}

@keyframes orbDrift1 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(15px, -12px); }
    50% { transform: translate(-8px, -20px); }
    75% { transform: translate(12px, -8px); }
}

@keyframes orbDrift2 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-12px, 10px); }
    50% { transform: translate(18px, -6px); }
    75% { transform: translate(-10px, -15px); }
}

@keyframes orbDrift3 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(10px, 15px); }
    50% { transform: translate(-15px, 8px); }
    75% { transform: translate(8px, -10px); }
}

/* --- Section Indicator (3-dot nav) --- */
.section-indicator {
    position: fixed;
    top: 50%;
    right: 32px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 100;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--slate-mist);
    opacity: 0.35;
    transition: opacity 0.4s ease, transform 0.4s var(--ease-elastic), background 0.4s ease;
    cursor: pointer;
}

.indicator-dot.active {
    opacity: 1;
    transform: scale(1.5);
    background: var(--nordic-blue);
}

.section-indicator.inverted .indicator-dot {
    background: var(--snowfield);
}

.section-indicator.inverted .indicator-dot.active {
    background: var(--lingonberry);
}

/* --- Sections (General) --- */
.section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl) var(--space-lg);
}

/* --- Glassmorphic Card Base --- */
.glass-card {
    background: var(--frost-pane);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border: 1px solid var(--ice-edge);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    padding: var(--space-lg) var(--space-lg);
    position: relative;
    transition: transform 0.4s var(--ease-elastic),
                box-shadow 0.4s var(--ease-elastic),
                backdrop-filter 0.4s ease;
}

.glass-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--card-shadow-hover);
    backdrop-filter: blur(24px) saturate(1.3);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
}

.glass-card-dark {
    background: var(--frost-pane-dark);
    backdrop-filter: blur(16px) saturate(1.1);
    -webkit-backdrop-filter: blur(16px) saturate(1.1);
    border: 1px solid var(--ice-edge-dark);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    padding: var(--space-md) var(--space-md);
    position: relative;
    transition: transform 0.4s var(--ease-elastic),
                box-shadow 0.4s var(--ease-elastic);
}

.glass-card-dark:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

/* --- Card Reveal Animation --- */
.card-reveal {
    opacity: 0;
    transform: translateY(30px);
}

.card-reveal.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s var(--ease-float),
                transform 0.6s var(--ease-float);
    transition-delay: var(--card-offset, 0ms);
}

.card-reveal.visible:hover {
    transform: translateY(-6px);
}

/* --- Corner Ornaments --- */
.corner-ornament {
    position: absolute;
    top: 16px;
    left: 16px;
    opacity: 1;
}

.corner-ornament-border {
    top: 12px;
    left: 12px;
}

/* --- Typography --- */
.card-title {
    font-family: var(--font-secondary);
    font-size: 28px;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--charcoal-wool);
    margin-bottom: var(--space-md);
    padding-left: 48px;
}

.card-title-sm {
    font-family: var(--font-secondary);
    font-size: 22px;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--charcoal-wool);
    margin-bottom: var(--space-sm);
}

.card-title-light {
    color: var(--snowfield);
}

.card-body {
    font-family: var(--font-body);
    font-size: 17px;
    font-weight: 400;
    line-height: 1.7;
    color: var(--charcoal-wool);
    max-width: 580px;
}

.card-body-sm {
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.7;
    color: var(--slate-mist);
}

.card-body-light {
    color: rgba(239, 243, 246, 0.75);
}

.card-label {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--nordic-blue);
    margin-top: var(--space-md);
}

/* --- Section 1: Hero --- */
.section-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 12%;
}

.hero-content {
    position: relative;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(56px, 8vw, 80px);
    font-weight: 300;
    letter-spacing: 0.04em;
    color: var(--charcoal-wool);
    line-height: 1.1;
}

.hero-tagline {
    font-family: var(--font-body);
    font-size: clamp(16px, 2vw, 20px);
    font-weight: 400;
    color: var(--slate-mist);
    margin-top: var(--space-md);
    max-width: 440px;
    line-height: 1.7;
}

/* Hero juggle orbs animation */
.hero-juggle-arc {
    position: relative;
    width: 200px;
    height: 80px;
    margin-bottom: var(--space-md);
}

.hero-orb {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--nordic-blue);
    opacity: 0.6;
}

.hero-orb-1 {
    animation: juggleArc1 3s cubic-bezier(0.45, 0, 0.55, 1) infinite;
    left: 20px;
}

.hero-orb-2 {
    animation: juggleArc2 3s cubic-bezier(0.45, 0, 0.55, 1) infinite;
    left: 90px;
    animation-delay: -1s;
}

.hero-orb-3 {
    animation: juggleArc3 3s cubic-bezier(0.45, 0, 0.55, 1) infinite;
    left: 160px;
    animation-delay: -2s;
    background: var(--lingonberry);
}

@keyframes juggleArc1 {
    0% { transform: translate(0, 60px); opacity: 0.6; }
    15% { transform: translate(30px, -10px); opacity: 0.9; }
    30% { transform: translate(60px, -40px); opacity: 0.9; }
    45% { transform: translate(90px, -10px); opacity: 0.9; }
    60% { transform: translate(120px, 60px); opacity: 0.6; }
    60.01%, 100% { transform: translate(120px, 60px); opacity: 0; }
}

@keyframes juggleArc2 {
    0% { transform: translate(0, 60px); opacity: 0.6; }
    15% { transform: translate(25px, -15px); opacity: 0.9; }
    30% { transform: translate(50px, -45px); opacity: 0.9; }
    45% { transform: translate(75px, -15px); opacity: 0.9; }
    60% { transform: translate(100px, 60px); opacity: 0.6; }
    60.01%, 100% { transform: translate(100px, 60px); opacity: 0; }
}

@keyframes juggleArc3 {
    0% { transform: translate(0, 60px); opacity: 0.6; }
    15% { transform: translate(-25px, -10px); opacity: 0.9; }
    30% { transform: translate(-50px, -40px); opacity: 0.9; }
    45% { transform: translate(-75px, -10px); opacity: 0.9; }
    60% { transform: translate(-100px, 60px); opacity: 0.6; }
    60.01%, 100% { transform: translate(-100px, 60px); opacity: 0; }
}

/* --- Section: Float --- */
.section-float {
    justify-content: flex-start;
    padding-left: 8%;
}

.section-float .float-card {
    max-width: 620px;
    transform: rotate(-1.5deg) translateY(30px);
}

.section-float .float-card.visible {
    transform: rotate(-1.5deg) translateY(0);
}

.section-float .float-card.visible:hover {
    transform: rotate(-1.5deg) translateY(-6px);
}

.section-float-right {
    justify-content: flex-end;
    padding-left: 0;
    padding-right: 8%;
}

.section-float-right .float-card {
    transform: rotate(1.2deg) translateY(30px);
}

.section-float-right .float-card.visible {
    transform: rotate(1.2deg) translateY(0);
}

.section-float-right .float-card.visible:hover {
    transform: rotate(1.2deg) translateY(-6px);
}

/* --- Section: Constellation --- */
.section-constellation {
    padding: var(--space-xl) var(--space-md);
}

.constellation-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    height: 80vh;
    min-height: 600px;
}

.constellation-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    color: #B8C9D6;
}

.constellation-card {
    position: absolute;
    left: var(--card-x, 0);
    top: var(--card-y, 0);
}

.card-small {
    width: 260px;
    padding: var(--space-md);
}

.card-medium {
    width: 340px;
    padding: var(--space-md) var(--space-lg);
}

/* --- Divider Patterns --- */
.divider-pattern {
    width: 100%;
    padding: var(--space-md) 0;
    overflow: hidden;
}

.divider-svg {
    width: 100%;
    height: 24px;
    display: block;
}

/* --- Section: Horizon (Immersive Quote) --- */
.section-horizon {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.horizon-band {
    width: 100%;
    background: var(--frost-pane);
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    border-top: 1px solid var(--ice-edge);
    border-bottom: 1px solid var(--ice-edge);
    padding: var(--space-xl) var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.horizon-quote p {
    font-family: var(--font-display);
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 300;
    font-style: italic;
    color: var(--charcoal-wool);
    text-align: center;
    max-width: 800px;
    letter-spacing: 0.02em;
    line-height: 1.4;
}

/* --- Section: Close (Dark) --- */
.section-close {
    min-height: 100vh;
    background: var(--fjord-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl) var(--space-lg);
    position: relative;
    overflow: hidden;
}

.close-constellation {
    position: relative;
    width: 100%;
    max-width: 1100px;
    height: 70vh;
    min-height: 500px;
}

.close-card {
    position: absolute;
    left: var(--card-x, 0);
    top: var(--card-y, 0);
    width: 300px;
}

/* Close orbs (descending) */
.close-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.close-orb-1 {
    width: 48px;
    height: 48px;
    background: radial-gradient(circle, rgba(74, 144, 184, 0.2), transparent 70%);
    top: 10%;
    right: 20%;
    animation: orbDescend 20s ease-in-out infinite;
}

.close-orb-2 {
    width: 64px;
    height: 64px;
    background: radial-gradient(circle, rgba(196, 97, 106, 0.15), transparent 70%);
    top: 30%;
    left: 30%;
    animation: orbDescend 28s ease-in-out infinite reverse;
}

.close-orb-3 {
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, rgba(74, 144, 184, 0.18), transparent 70%);
    bottom: 20%;
    right: 35%;
    animation: orbDescend 24s ease-in-out infinite;
    animation-delay: -8s;
}

@keyframes orbDescend {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-10px, 15px); }
    50% { transform: translate(8px, 20px); }
    75% { transform: translate(-5px, 10px); }
}

/* --- Footer --- */
.site-footer {
    position: absolute;
    bottom: var(--space-md);
    left: 0;
    right: 0;
    text-align: center;
}

.footer-text {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(239, 243, 246, 0.4);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .section-hero {
        padding-left: 8%;
    }

    .constellation-container {
        height: auto;
        min-height: auto;
        display: flex;
        flex-direction: column;
        gap: var(--space-md);
        padding: var(--space-md);
    }

    .constellation-card {
        position: relative;
        left: auto;
        top: auto;
        width: 100%;
        max-width: 400px;
    }

    .constellation-lines {
        display: none;
    }

    .close-constellation {
        height: auto;
        min-height: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: var(--space-md);
        padding: var(--space-lg) 0;
    }

    .close-card {
        position: relative;
        left: auto;
        top: auto;
        width: 100%;
        max-width: 360px;
    }
}

@media (max-width: 768px) {
    :root {
        --space-lg: 32px;
        --space-xl: 48px;
    }

    .section {
        padding: var(--space-xl) var(--space-md);
    }

    .section-hero {
        padding-left: var(--space-md);
        justify-content: center;
    }

    .hero-title {
        font-size: 48px;
    }

    .section-float {
        padding-left: var(--space-md);
        padding-right: var(--space-md);
        justify-content: center;
    }

    .section-float-right {
        padding-right: var(--space-md);
    }

    .section-float .float-card,
    .section-float-right .float-card {
        transform: rotate(0deg) translateY(30px);
        max-width: 100%;
    }

    .section-float .float-card.visible,
    .section-float-right .float-card.visible {
        transform: rotate(0deg) translateY(0);
    }

    .section-float .float-card.visible:hover,
    .section-float-right .float-card.visible:hover {
        transform: rotate(0deg) translateY(-6px);
    }

    .card-title {
        font-size: 24px;
        padding-left: 0;
    }

    .horizon-band {
        padding: var(--space-lg) var(--space-md);
    }

    .section-indicator {
        right: 16px;
    }

    .close-card {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .hero-juggle-arc {
        width: 150px;
    }

    .hero-title {
        font-size: 40px;
    }

    .card-small,
    .card-medium {
        width: 100%;
    }
}