/* parallengine.com - Punk Botanical Laboratory */
/* Colors: Abyssal Navy #0B1628, Oxidized Silver #8A99B2, Midnight Ink #162038,
   Tarnished Copper #B87333, Pressed Linen #E8E2D6, Mineral White #D4DAE4,
   Root Dark #1A1F2E, Rebel Magenta #C93D6E */

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #0B1628;
    color: #D4DAE4;
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    line-height: 1.72;
    letter-spacing: 0.005em;
    overflow-x: hidden;
}

/* Glyph Anchor */
#glyph-anchor {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 100;
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

#glyph-anchor:hover {
    opacity: 1;
}

/* Hero Section */
.hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #0B1628;
}

.hero-crystal-svg {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

#crystal-growth {
    width: 100%;
    height: 100%;
}

.crystal-line {
    stroke: #8A99B2;
    stroke-width: 1;
    fill: none;
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    animation: drawCrystal 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.c1 { animation-delay: 0s; }
.c2 { animation-delay: 0.1s; }
.c3 { animation-delay: 0.2s; }
.c4 { animation-delay: 0.3s; }
.c5 { animation-delay: 0.15s; }
.c6 { animation-delay: 0.25s; }
.c7 { animation-delay: 0.35s; }
.c8 { animation-delay: 0.4s; }
.c9 { animation-delay: 0.45s; }
.c10 { animation-delay: 0.6s; }
.c11 { animation-delay: 0.65s; }
.c12 { animation-delay: 0.7s; }
.c13 { animation-delay: 0.8s; }
.c14 { animation-delay: 0.85s; }

.root-line {
    stroke: #B87333;
    stroke-width: 1.5;
    fill: none;
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    animation: drawRoot 2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.r1 { animation-delay: 1.0s; }
.r2 { animation-delay: 1.1s; }
.r3 { animation-delay: 1.2s; }
.r4 { animation-delay: 1.3s; }
.r5 { animation-delay: 1.15s; }
.r6 { animation-delay: 1.4s; }
.r7 { animation-delay: 1.5s; }
.r8 { animation-delay: 1.6s; }
.r9 { animation-delay: 1.7s; }
.r10 { animation-delay: 1.8s; }
.r11 { animation-delay: 1.9s; }
.r12 { animation-delay: 2.0s; }

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

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

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    pointer-events: none;
}

.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(3.5rem, 8vw, 7rem);
    letter-spacing: -0.03em;
    line-height: 1.0;
    color: #D4DAE4;
    background: repeating-linear-gradient(
        45deg,
        #8A99B2 0px,
        #8A99B2 1px,
        transparent 1px,
        transparent 8px
    ),
    repeating-linear-gradient(
        -45deg,
        #8A99B2 0px,
        #8A99B2 1px,
        transparent 1px,
        transparent 8px
    ),
    linear-gradient(180deg, #D4DAE4, #8A99B2);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmerText 8s ease-in-out infinite alternate;
}

@keyframes shimmerText {
    0% { background-position: 0% 0%; }
    100% { background-position: 100% 100%; }
}

.rebel-dot {
    color: #C93D6E;
    -webkit-text-fill-color: #C93D6E;
}

.hero-tagline {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: #8A99B2;
    margin-top: 1.5rem;
    letter-spacing: 0.02em;
    pointer-events: none;
}

/* Elastic Gutters */
.elastic-gutter {
    width: 100%;
    height: 80px;
    position: relative;
    overflow: hidden;
    background: transparent;
}

.gutter-svg {
    width: 100%;
    height: 100%;
    transition: transform 0.1s linear;
}

/* Content Panels */
.content-panel {
    position: relative;
    width: 100%;
    padding: 80px 0;
    overflow: hidden;
}

.crystal-panel {
    background: #0B1628;
    color: #D4DAE4;
}

.botanical-panel {
    background: #E8E2D6;
    color: #1A1F2E;
}

.panel-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 40px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.content-panel[data-direction='left'] .panel-content {
    transform: translateX(-30px) translateY(30px);
}

.content-panel[data-direction='right'] .panel-content {
    transform: translateX(30px) translateY(30px);
}

.content-panel.visible .panel-content {
    opacity: 1;
    transform: translateX(0) translateY(0);
}

.section-header {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(1.8rem, 4vw, 3rem);
    letter-spacing: 0.01em;
    line-height: 1.15;
    text-transform: lowercase;
    margin-bottom: 2.5rem;
}

.crystal-panel .section-header {
    color: #D4DAE4;
}

.botanical-panel .section-header {
    color: #1A1F2E;
}

.panel-body {
    display: flex;
    gap: 60px;
    align-items: flex-start;
}

.panel-text {
    flex: 1.2;
}

.panel-text p {
    margin-bottom: 1.5rem;
}

.panel-text em {
    font-style: italic;
    color: #B87333;
}

.botanical-panel .panel-text em {
    color: #B87333;
}

.code-annotation {
    margin-top: 1rem;
}

.mono-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    opacity: 0.7;
}

.crystal-panel .mono-label {
    color: #8A99B2;
}

.botanical-panel .mono-label {
    color: #1A1F2E;
    opacity: 0.5;
}

.panel-illustration {
    flex: 0.8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crystal-illustration,
.botanical-illustration {
    width: 100%;
    max-width: 280px;
    height: auto;
}

/* Root Tendrils */
.root-tendril {
    position: absolute;
    width: 100px;
    height: 200px;
    pointer-events: none;
}

.tendril-left {
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.tendril-right {
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

/* Root Map Section */
.root-map-section {
    background: #0B1628;
    padding: 80px 40px;
    text-align: center;
}

.root-map-title {
    color: #D4DAE4;
    margin-bottom: 3rem;
}

.root-map-container {
    max-width: 900px;
    margin: 0 auto;
}

#root-network {
    width: 100%;
    height: auto;
}

.root-path {
    stroke: #8A99B2;
    stroke-width: 1;
    fill: none;
    transition: stroke 0.3s ease, stroke-width 0.3s ease;
}

.root-path.active {
    stroke: #C93D6E;
    stroke-width: 2.5;
}

.root-node circle {
    fill: #0B1628;
    stroke: #8A99B2;
    stroke-width: 1.5;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), stroke 0.3s ease, r 0.3s ease;
    cursor: pointer;
}

.root-node:hover circle {
    stroke: #C93D6E;
    fill: #162038;
}

.node-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    fill: #8A99B2;
    text-anchor: middle;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.root-node:hover .node-label,
.root-node.active .node-label {
    opacity: 1;
}

.root-node.active circle {
    stroke: #C93D6E;
    fill: #162038;
}

.root-map-note {
    margin-top: 2rem;
    font-size: 0.85rem;
}

.root-map-note .mono-label {
    color: #8A99B2;
    opacity: 0.5;
}

/* Crystal Shards */
.crystal-shards-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.crystal-shard {
    position: absolute;
    opacity: 0;
    animation: drift 12s ease-in-out infinite alternate, shardFade 4s ease-in-out infinite alternate;
}

@keyframes drift {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(15deg); }
}

@keyframes shardFade {
    0% { opacity: 0.15; }
    50% { opacity: 0.4; }
    100% { opacity: 0.15; }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .panel-body {
        flex-direction: column;
        gap: 30px;
    }

    .panel-illustration {
        order: -1;
        max-width: 200px;
        margin: 0 auto;
    }

    .content-panel {
        padding: 50px 0;
    }

    .panel-content {
        padding: 0 24px;
    }

    .elastic-gutter {
        height: 40px;
    }

    .root-map-section {
        padding: 50px 20px;
    }

    .root-map-container {
        overflow-x: auto;
    }

    #glyph-anchor {
        top: 16px;
        left: 16px;
    }

    .hero-tagline {
        padding: 0 20px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(2.5rem, 12vw, 4rem);
    }
}