/* ============================================================
   GGIGGL.com - Temporal Collision Aesthetic
   Frutiger Aero + Classical Marble + Aged Paper
   ============================================================ */

:root {
    /* Dark Palette */
    --void-obsidian: #0a0a12;
    --fracture-magenta: #ff2d6b;
    --circuit-mint: #3dffa0;
    --aether-violet: #6b5cff;

    /* Warm Palette */
    --aged-vellum: #f5edd6;
    --parchment-shadow: #d4c4a8;
    --carrara-mist: #e8e4df;
    --travertine-grey: #8a7e72;

    /* Glass */
    --aero-haze: rgba(106, 92, 255, 0.12);

    /* Text */
    --warm-ivory: #e8e0d4;
    --deep-midnight: #1a1a2e;

    /* Fonts */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'DM Sans', 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
}

/* ============================================================
   RESET & BASE
   ============================================================ */

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

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

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 18px;
    line-height: 1.72;
    background: var(--void-obsidian);
    color: var(--warm-ivory);
    overflow-x: hidden;
}

/* ============================================================
   PAPER TEXTURES (CSS-generated)
   ============================================================ */

.paper-overlay-dark,
.paper-overlay-warm {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.paper-overlay-dark {
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    opacity: 0.5;
}

.paper-overlay-warm {
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.55' numOctaves='5' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0.3'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23p)' opacity='0.15'/%3E%3C/svg%3E");
    opacity: 0.4;
}

/* ============================================================
   MARBLE TEXTURE (CSS-generated for text fills)
   ============================================================ */

.marble-text {
    background-image:
        linear-gradient(135deg, #e8e4df 0%, #d4c4a8 20%, #e8e4df 35%, #8a7e72 45%, #e8e4df 55%, #d4c4a8 70%, #8a7e72 80%, #e8e4df 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.02 0.06' numOctaves='3' seed='5'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23m)'/%3E%3C/svg%3E");
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-attachment: fixed;
}

/* ============================================================
   SECTIONS
   ============================================================ */

.section {
    position: relative;
    min-height: 100vh;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.section-dark {
    background: var(--void-obsidian);
    color: var(--warm-ivory);
}

.section-warm {
    background: var(--aged-vellum);
    color: var(--deep-midnight);
}

/* ============================================================
   FLOATING GLASS-PILL NAVIGATION
   ============================================================ */

.glass-nav {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: var(--aero-haze);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 40px;
    padding: 10px 28px;
    display: flex;
    align-items: center;
    gap: 0;
    transition: all 0.4s ease;
    cursor: pointer;
    overflow: hidden;
}

.glass-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.nav-logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -0.03em;
    background-image: linear-gradient(135deg, #e8e4df, #d4c4a8, #8a7e72, #e8e4df);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    gap: 16px;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-width 0.5s ease, opacity 0.3s ease, margin-left 0.5s ease;
    margin-left: 0;
}

.glass-nav:hover .nav-links,
.glass-nav.nav-open .nav-links {
    max-width: 400px;
    opacity: 1;
    margin-left: 20px;
}

.nav-link {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--circuit-mint);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--fracture-magenta);
}

/* Glitch crack on nav hover */
.glass-nav:hover {
    border-color: rgba(255, 45, 107, 0.3);
    box-shadow: 0 0 15px rgba(255, 45, 107, 0.1);
}

/* ============================================================
   THE AWAKENING (HERO)
   ============================================================ */

.section-awakening {
    flex-direction: column;
}

.hero-glow {
    position: absolute;
    width: 500px;
    height: 500px;
    left: 30%;
    top: 35%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, var(--aether-violet) 0%, transparent 70%);
    opacity: 0.15;
    z-index: 1;
    pointer-events: none;
}

.hero-panel {
    position: relative;
    z-index: 10;
    padding: 60px 80px;
    text-align: center;
    max-width: 700px;
    margin-left: -10%;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 96px;
    letter-spacing: -0.03em;
    line-height: 1.05;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 12px;
    letter-spacing: 0.2em;
}

.neon-sigil {
    position: absolute;
    top: 18%;
    right: 12%;
    z-index: 10;
    width: 80px;
    height: 80px;
    opacity: 0.8;
    filter: drop-shadow(0 0 8px rgba(61, 255, 160, 0.4));
    animation: sigil-pulse 4s ease-in-out infinite;
}

@keyframes sigil-pulse {
    0%, 100% { opacity: 0.8; filter: drop-shadow(0 0 8px rgba(61, 255, 160, 0.4)); }
    50% { opacity: 1; filter: drop-shadow(0 0 16px rgba(61, 255, 160, 0.6)); }
}

/* ============================================================
   GLASS PANELS (Frutiger Aero)
   ============================================================ */

.glass-panel {
    background: var(--aero-haze);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.glass-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    z-index: 2;
}

.glass-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.08) 50%, transparent 60%);
    background-size: 250% 100%;
    background-position: -100% 0;
    z-index: 1;
    pointer-events: none;
    border-radius: 16px;
}

/* ============================================================
   GLITCH CRACK SVGs
   ============================================================ */

.glitch-crack {
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 60px;
    z-index: 20;
    filter: drop-shadow(0 0 4px rgba(255, 45, 107, 0.6));
    opacity: 0.7;
    animation: glitch-idle 400ms steps(4) infinite paused;
}

.glitch-crack.active {
    animation-play-state: running;
}

@keyframes glitch-idle {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-2px, 1px); }
    50% { transform: translate(3px, -2px); }
    75% { transform: translate(-1px, 3px); }
    100% { transform: translate(2px, -1px); }
}

.crack-hero {
    bottom: -5px;
    height: 40px;
}

.crack-archive {
    position: absolute;
    right: 20%;
    left: auto;
    width: 200px;
    height: 100%;
    top: 0;
    bottom: auto;
    opacity: 0.5;
}

.crack-fracture {
    bottom: -2px;
}

/* ============================================================
   THE ARCHIVE
   ============================================================ */

.section-archive {
    align-items: center;
    justify-content: center;
}

.archive-content {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 60px;
    max-width: 1100px;
    width: 100%;
    padding: 0 80px;
    align-items: center;
}

.archive-card {
    background: var(--parchment-shadow);
    border-radius: 8px;
    padding: 48px;
    box-shadow:
        0 2px 20px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(138, 126, 114, 0.2);
    position: relative;
}

.archive-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 8px;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.6' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0.2'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23f)' opacity='0.08'/%3E%3C/svg%3E");
    opacity: 0.6;
    pointer-events: none;
}

.section-label {
    display: inline-block;
    margin-bottom: 20px;
}

.section-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 56px;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 24px;
    color: var(--deep-midnight);
}

.body-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 18px;
    line-height: 1.72;
    color: var(--deep-midnight);
    margin-bottom: 16px;
}

.body-text:last-of-type {
    margin-bottom: 0;
}

.body-text-light {
    color: var(--warm-ivory);
}

/* Marble frame / image placeholder */
.marble-frame {
    display: flex;
    align-items: center;
    justify-content: center;
}

.marble-surface {
    width: 260px;
    height: 280px;
    border-radius: 12px;
    background:
        linear-gradient(135deg, #e8e4df 0%, #d4c4a8 30%, #e8e4df 50%, #8a7e72 65%, #e8e4df 80%, #d4c4a8 100%);
    background-size: 200% 200%;
    border: 2px solid var(--travertine-grey);
    box-shadow:
        0 4px 30px rgba(0, 0, 0, 0.1),
        inset 0 2px 4px rgba(255, 255, 255, 0.4),
        inset 0 -2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.marble-surface::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='v'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.015 0.04' numOctaves='3' seed='8'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.3'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23v)'/%3E%3C/svg%3E");
    opacity: 0.5;
    pointer-events: none;
}

.marble-inner {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.marble-icon {
    width: 100%;
    height: 100%;
}

/* ============================================================
   ACCENT TYPOGRAPHY
   ============================================================ */

.accent-mono {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--fracture-magenta);
}

.neon-text-mint {
    color: var(--circuit-mint);
}

.neon-text-magenta {
    color: var(--fracture-magenta);
}

/* ============================================================
   THE FRACTURE
   ============================================================ */

.section-fracture {
    flex-direction: row;
    gap: 60px;
    padding: 0 80px;
}

.fracture-content {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 60px;
    max-width: 1200px;
    width: 100%;
}

.fracture-panel {
    flex: 1;
    padding: 56px 64px;
    max-width: 800px;
}

.fracture-panel .section-heading {
    color: var(--circuit-mint);
    font-size: 64px;
}

.fracture-panel .section-label {
    position: relative;
    z-index: 5;
}

.fracture-panel .body-text {
    position: relative;
    z-index: 5;
}

.fracture-panel .section-heading {
    position: relative;
    z-index: 5;
}

.crack-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    overflow: hidden;
    border-radius: 16px;
}

.fracture-cracks {
    width: 100%;
    height: 100%;
}

/* Marble medallion */
.marble-medallion {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background:
        linear-gradient(135deg, #e8e4df 0%, #d4c4a8 40%, #8a7e72 60%, #e8e4df 100%);
    background-size: 200% 200%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow:
        0 2px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
    position: relative;
}

.marble-medallion::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='md'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.03 0.08' numOctaves='2' seed='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.25'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23md)'/%3E%3C/svg%3E");
    pointer-events: none;
}

.medallion-icon {
    width: 60px;
    height: 60px;
    position: relative;
    z-index: 2;
}

/* ============================================================
   THE REMNANT
   ============================================================ */

.section-remnant {
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.remnant-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 700px;
    padding: 0 40px;
}

.pilaster-frame {
    position: relative;
    padding: 60px 80px;
}

.pilaster-left,
.pilaster-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 20px;
    background:
        linear-gradient(180deg, var(--carrara-mist) 0%, var(--parchment-shadow) 30%, var(--travertine-grey) 50%, var(--parchment-shadow) 70%, var(--carrara-mist) 100%);
    opacity: 0.5;
}

.pilaster-left {
    left: 0;
    border-radius: 4px 0 0 4px;
    box-shadow: inset -2px 0 4px rgba(0, 0, 0, 0.05);
}

.pilaster-right {
    right: 0;
    border-radius: 0 4px 4px 0;
    box-shadow: inset 2px 0 4px rgba(0, 0, 0, 0.05);
}

.remnant-text-block {
    text-align: center;
}

.remnant-heading {
    color: var(--deep-midnight);
}

.remnant-sigil {
    margin-top: 40px;
    width: 80px;
    height: 80px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.5;
}

.remnant-sigil-svg {
    width: 100%;
    height: 100%;
}

.neon-bottom-line {
    width: 100%;
    max-width: 600px;
    height: 2px;
    margin-top: 60px;
    background: linear-gradient(90deg, transparent 0%, var(--circuit-mint) 30%, var(--fracture-magenta) 70%, transparent 100%);
    opacity: 0.6;
    filter: drop-shadow(0 0 6px rgba(61, 255, 160, 0.4));
}

/* ============================================================
   ENTRY ANIMATIONS
   ============================================================ */

.animate-entry {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 800ms ease-out, transform 800ms ease-out;
}

.animate-entry.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Paper fold animation for warm sections */
.section-warm {
    perspective: 1200px;
}

.section-warm .archive-content,
.section-warm .remnant-content {
    transform: rotateX(3deg);
    transform-origin: bottom center;
    transition: transform 600ms ease-out;
}

.section-warm.in-view .archive-content,
.section-warm.in-view .remnant-content {
    transform: rotateX(0deg);
}

/* Glass shimmer animation */
@keyframes shimmer {
    0% { background-position: -100% 0; }
    100% { background-position: 200% 0; }
}

.glass-panel:hover .glass-shimmer,
.glass-shimmer.active {
    animation: shimmer 8s linear infinite;
}

/* ============================================================
   NEON FLICKER
   ============================================================ */

.neon-flicker-magenta {
    color: var(--fracture-magenta);
    text-shadow: 0 0 8px rgba(255, 45, 107, 0.4);
}

.neon-flicker-mint {
    color: var(--circuit-mint);
    text-shadow: 0 0 8px rgba(61, 255, 160, 0.4);
}

@keyframes neon-flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ============================================================
   RESPONSIVE (< 768px)
   ============================================================ */

@media (max-width: 768px) {
    .hero-title {
        font-size: 56px;
    }

    .hero-panel {
        padding: 40px 32px;
        margin-left: 0;
    }

    .hero-glow {
        left: 50%;
        width: 300px;
        height: 300px;
    }

    .neon-sigil {
        top: 10%;
        right: 8%;
        width: 56px;
        height: 56px;
    }

    .archive-content {
        grid-template-columns: 1fr;
        padding: 0 24px;
        gap: 40px;
    }

    .archive-card {
        padding: 32px;
    }

    .marble-frame {
        justify-content: center;
    }

    .marble-surface {
        width: 200px;
        height: 220px;
    }

    .section-heading {
        font-size: 40px;
    }

    .section-fracture {
        padding: 0 24px;
    }

    .fracture-content {
        flex-direction: column;
        gap: 30px;
    }

    .fracture-panel {
        padding: 36px 28px;
    }

    .fracture-panel .section-heading {
        font-size: 44px;
    }

    .marble-medallion {
        width: 56px;
        height: 56px;
    }

    .medallion-icon {
        width: 40px;
        height: 40px;
    }

    .pilaster-frame {
        padding: 40px 48px;
    }

    .remnant-content {
        padding: 0 20px;
    }

    .glass-nav {
        padding: 8px 20px;
    }

    .nav-logo {
        font-size: 14px;
    }

    .glass-panel {
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .crack-archive {
        display: none;
    }

    .body-text {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 42px;
    }

    .section-heading {
        font-size: 32px;
    }

    .fracture-panel .section-heading {
        font-size: 36px;
    }
}
