/* ============================================
   lowest.dev - Art-Deco Geological Descent
   Palette: #0B0E1A, #1A1040, #00F0FF, #FF2D95,
            #E8EDF5, #FFB830, #3A3F5C, #8B5CF6
   Fonts: Zilla Slab, Source Sans 3, IBM Plex Mono
   ============================================ */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background: #1A1040;
    color: #E8EDF5;
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 1.72;
    overflow-x: hidden;
    position: relative;
}

/* ============================================
   Background Gradient
   ============================================ */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(0, 240, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(255, 45, 149, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 40%),
        linear-gradient(180deg, #1A1040 0%, #0B0E1A 40%, #0B0E1A 70%, #1A1040 100%);
    z-index: -2;
    pointer-events: none;
}

/* ============================================
   Topographic Contour Lines
   ============================================ */
.contour-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* ============================================
   Depth Pulse
   ============================================ */
.depth-pulse {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.03) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
    opacity: 0;
}

.depth-pulse.active {
    animation: depthPulseAnim 3s ease-out forwards;
}

@keyframes depthPulseAnim {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 240vw;
        height: 240vw;
        opacity: 0;
    }
}

/* ============================================
   Navigation (Hexagonal Band)
   ============================================ */
.hex-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 2px;
    z-index: 100;
    padding: 12px 20px;
    background: linear-gradient(180deg, rgba(11, 14, 26, 0.9) 0%, rgba(11, 14, 26, 0) 100%);
}

.hex-nav-cell {
    position: relative;
    padding: 8px 24px;
    cursor: pointer;
    clip-path: polygon(10% 0%, 90% 0%, 100% 50%, 90% 100%, 10% 100%, 0% 50%);
    background: rgba(58, 63, 92, 0.25);
    border: none;
    transition: background 0.3s ease, transform 0.3s ease;
}

.hex-nav-cell:hover {
    background: rgba(0, 240, 255, 0.15);
    transform: scale(1.05);
}

.hex-nav-cell.active {
    background: rgba(0, 240, 255, 0.2);
}

.hex-nav-cell.active::after {
    content: '';
    position: absolute;
    inset: 0;
    clip-path: polygon(10% 0%, 90% 0%, 100% 50%, 90% 100%, 10% 100%, 0% 50%);
    box-shadow: inset 0 0 15px rgba(0, 240, 255, 0.3);
    pointer-events: none;
}

.nav-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #E8EDF5;
    white-space: nowrap;
}

/* ============================================
   SECTION 1: SURFACE LAYER
   ============================================ */
.section-surface {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Mountain SVG */
.mountain-svg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    z-index: 1;
}

.mountain-layer {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.mountain-layer.visible {
    opacity: 1;
}

/* Ridgeline path-draw animation */
.ridgeline {
    stroke-dasharray: 3000;
    stroke-dashoffset: 3000;
    transition: stroke-dashoffset 2s ease-in-out;
}

.ridgeline.drawn {
    stroke-dashoffset: 0;
}

/* Hero Hexagonal Frame */
.hero-hex-frame {
    position: relative;
    width: min(600px, 85vw);
    height: min(520px, 74vw);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
}

.hero-hex-frame.visible {
    opacity: 1;
    transform: scale(1);
}

.hex-border-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hex-border-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 1.5s ease-in-out 0.5s;
    filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.4));
}

.hero-hex-frame.visible .hex-border-path {
    stroke-dashoffset: 0;
}

.hero-content {
    text-align: center;
    z-index: 3;
    padding: 40px;
}

.hero-title {
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    font-size: clamp(3rem, 10vw, 6rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #E8EDF5;
    line-height: 1.1;
    margin-bottom: 16px;
}

.hero-title .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.hero-title .letter.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-subtitle {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    color: rgba(232, 237, 245, 0.7);
    letter-spacing: 0.04em;
    margin-bottom: 20px;
}

.sunburst-ornament {
    display: flex;
    justify-content: center;
    opacity: 0.6;
}

.sunburst-ornament svg {
    width: 200px;
    height: 50px;
}

/* Chevron Scroll Indicator */
.chevron-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    opacity: 0.8;
}

.chevron-indicator svg {
    width: 40px;
    height: 60px;
}

.chevron-line {
    opacity: 0;
    animation: chevronPulse 2s infinite;
}

.chevron-1 {
    animation-delay: 0s;
}

.chevron-2 {
    animation-delay: 0.15s;
}

.chevron-3 {
    animation-delay: 0.3s;
}

@keyframes chevronPulse {
    0% {
        opacity: 0;
        transform: translateY(-4px);
    }
    30% {
        opacity: 1;
    }
    60% {
        opacity: 0.3;
        transform: translateY(4px);
    }
    100% {
        opacity: 0;
        transform: translateY(4px);
    }
}

/* ============================================
   SECTION 2: DESCENT
   ============================================ */
.section-descent {
    position: relative;
    min-height: 200vh;
    padding: 80px 20px;
    z-index: 2;
}

/* ============================================
   SECTION 3: BEDROCK
   ============================================ */
.section-bedrock {
    position: relative;
    min-height: 150vh;
    padding: 80px 20px;
    z-index: 2;
    background: linear-gradient(180deg, transparent 0%, rgba(11, 14, 26, 0.5) 20%, rgba(11, 14, 26, 0.8) 50%, rgba(11, 14, 26, 0.5) 80%, transparent 100%);
}

/* ============================================
   SECTION 4: ASCENT
   ============================================ */
.section-ascent {
    position: relative;
    min-height: 80vh;
    padding: 80px 20px 120px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.mountain-inverted {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 400px;
    z-index: 0;
    opacity: 0.5;
}

/* ============================================
   Chevron Dividers
   ============================================ */
.chevron-divider {
    display: flex;
    justify-content: center;
    margin: 40px 0;
}

.chevron-divider svg {
    width: min(600px, 90vw);
    height: 40px;
}

/* ============================================
   Honeycomb Grid System
   ============================================ */
.honeycomb-grid {
    max-width: 1200px;
    margin: 0 auto;
    transform: rotate(-2deg);
}

.hex-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: -20px;
}

.hex-row-even {
    margin-left: 70px;
}

.hex-row-odd {
    margin-left: 0;
}

/* Hexagonal Cells */
.hex-cell {
    position: relative;
    width: 280px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.hex-cell.visible {
    opacity: 1;
}

.hex-row-odd .hex-cell {
    transform: translateX(-100px);
    transition: opacity 0.4s ease, transform 0.6s ease;
}

.hex-row-odd .hex-cell.visible {
    transform: translateX(0);
}

.hex-row-even .hex-cell {
    transform: translateX(100px);
    transition: opacity 0.4s ease, transform 0.6s ease;
}

.hex-row-even .hex-cell.visible {
    transform: translateX(0);
}

.hex-cell-inner {
    position: relative;
    padding: 30px 24px;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    background: rgba(58, 63, 92, 0.25);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, transform 0.3s ease;
}

.hex-cell:hover .hex-cell-inner {
    background: rgba(26, 16, 64, 0.6);
    transform: scale(1.02);
}

.hex-cell-border {
    position: absolute;
    inset: 0;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    border: 1px solid rgba(0, 240, 255, 0.4);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.hex-cell.visible .hex-cell-border {
    opacity: 1;
}

.hex-cell:hover .hex-cell-border {
    border-color: #00F0FF;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}

.hex-cell-content {
    position: relative;
    z-index: 1;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease 0.2s;
    width: 100%;
}

.hex-cell.visible .hex-cell-content {
    opacity: 1;
}

/* Anchor Cells (1.5x) */
.anchor-cell {
    width: 420px;
}

.anchor-cell .hex-cell-inner {
    min-height: 280px;
    box-shadow: inset 0 0 30px rgba(0, 240, 255, 0.08);
}

/* Lattice Cells */
.lattice-cell {
    width: 200px;
}

.lattice-cell .hex-cell-inner {
    min-height: 180px;
}

/* Dense Cells (Bedrock) */
.honeycomb-dense .hex-cell {
    width: 180px;
}

.honeycomb-dense .anchor-cell {
    width: 300px;
}

.honeycomb-dense .hex-cell-inner {
    min-height: 140px;
    padding: 20px 16px;
}

.honeycomb-dense .anchor-cell .hex-cell-inner {
    min-height: 220px;
}

.honeycomb-dense .hex-row {
    gap: 8px;
    margin-bottom: -15px;
}

.honeycomb-dense .hex-row-even {
    margin-left: 50px;
}

/* Dense cell glow in bedrock */
.honeycomb-dense .hex-cell .hex-cell-inner {
    background: rgba(58, 63, 92, 0.2);
}

.honeycomb-dense .hex-cell:hover .hex-cell-inner {
    background: rgba(0, 240, 255, 0.08);
}

/* Dimming adjacent cells on hover */
.hex-row:has(.hex-cell:hover) .hex-cell:not(:hover) {
    opacity: 0.85;
}

/* ============================================
   Typography within Cells
   ============================================ */
.section-header {
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 4.5vw, 2.5rem);
    letter-spacing: 0.04em;
    color: #E8EDF5;
    margin-bottom: 12px;
    line-height: 1.2;
}

.honeycomb-dense .section-header {
    font-size: clamp(1.1rem, 3vw, 1.6rem);
}

.hex-cell p {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(0.85rem, 1.5vw, 1rem);
    line-height: 1.6;
    color: rgba(232, 237, 245, 0.85);
}

.cell-label {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(0, 240, 255, 0.7);
    margin-bottom: 4px;
}

.cell-mono {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85em;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: #E8EDF5;
}

.counter-value {
    display: block;
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    color: #00F0FF;
    line-height: 1.2;
}

/* Ziggurat List */
.ziggurat-list {
    list-style: none;
    text-align: left;
    padding: 0 10px;
}

.ziggurat-list li {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(0.85rem, 1.5vw, 1rem);
    color: rgba(232, 237, 245, 0.85);
    padding: 6px 0 6px 24px;
    position: relative;
    line-height: 1.5;
}

.ziggurat-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #FFB830 0%, rgba(255, 184, 48, 0.3) 100%);
    clip-path: polygon(20% 0%, 80% 0%, 100% 33%, 100% 66%, 80% 100%, 20% 100%, 0% 66%, 0% 33%);
}

/* Stepped Pyramid */
.stepped-pyramid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.pyramid-step {
    height: 6px;
    background: linear-gradient(90deg, rgba(255, 184, 48, 0.3), rgba(255, 184, 48, 0.6), rgba(255, 184, 48, 0.3));
    border-radius: 1px;
}

.stepped-pyramid.small .pyramid-step {
    height: 4px;
}

/* Geo Cross-Section */
.geo-cross-section {
    width: 100%;
    max-width: 120px;
    height: auto;
}

/* Decorative Elements */
.deco-chevrons svg,
.deco-sunburst svg {
    width: 100%;
    max-width: 100px;
    height: auto;
}

.deco-chevrons.small svg,
.deco-sunburst.small svg {
    max-width: 60px;
}

/* ============================================
   Floating Hexagons (Ascent)
   ============================================ */
.floating-hexagons {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.floating-hex {
    position: absolute;
    bottom: -100px;
    left: var(--float-x);
    width: var(--float-size);
    height: var(--float-size);
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.15);
    animation: floatUp 12s ease-in-out infinite;
    animation-delay: var(--float-delay);
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    80% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-120vh) rotate(30deg);
        opacity: 0;
    }
}

/* ============================================
   Ascent Message
   ============================================ */
.ascent-message {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 700px;
    padding: 60px 30px;
}

.ascent-message .section-header {
    color: #8B5CF6;
    margin-bottom: 20px;
}

.ascent-message p {
    font-family: 'Source Sans 3', sans-serif;
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: rgba(232, 237, 245, 0.75);
    margin-bottom: 40px;
    line-height: 1.8;
}

.ascent-tagline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.ascent-tagline .cell-mono {
    display: inline;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(232, 237, 245, 0.5);
}

.ascent-separator {
    width: 40px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #8B5CF6, transparent);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .hex-row {
        flex-wrap: wrap;
    }

    .hex-row-even {
        margin-left: 40px;
    }

    .hex-cell {
        width: 220px;
    }

    .anchor-cell {
        width: 320px;
    }

    .lattice-cell {
        width: 160px;
    }

    .honeycomb-dense .hex-cell {
        width: 140px;
    }

    .honeycomb-dense .anchor-cell {
        width: 240px;
    }
}

@media (max-width: 768px) {
    .hex-nav {
        gap: 0;
        padding: 8px 10px;
    }

    .hex-nav-cell {
        padding: 6px 14px;
    }

    .nav-label {
        font-size: 0.6rem;
    }

    .honeycomb-grid {
        transform: rotate(0deg);
    }

    .hex-row {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        margin-bottom: 8px;
    }

    .hex-row-even {
        margin-left: 30px;
    }

    .hex-cell,
    .anchor-cell,
    .lattice-cell {
        width: min(320px, 90vw);
    }

    .hex-cell-inner {
        min-height: 160px;
    }

    .anchor-cell .hex-cell-inner {
        min-height: 200px;
    }

    .honeycomb-dense .hex-cell,
    .honeycomb-dense .anchor-cell {
        width: min(280px, 85vw);
    }

    .honeycomb-dense .hex-cell-inner {
        min-height: 120px;
    }

    .honeycomb-dense .anchor-cell .hex-cell-inner {
        min-height: 180px;
    }

    .honeycomb-dense .hex-row {
        gap: 6px;
        margin-bottom: 6px;
    }

    .honeycomb-dense .hex-row-even {
        margin-left: 20px;
    }

    .section-descent {
        padding: 60px 10px;
    }

    .section-bedrock {
        padding: 60px 10px;
    }
}

@media (max-width: 480px) {
    .hex-nav-cell {
        padding: 5px 10px;
    }

    .nav-label {
        font-size: 0.55rem;
    }

    .hex-row-even {
        margin-left: 15px;
    }
}
