/* ============================================
   archaic.works - Geological Holography
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --deep-obsidian: #0A0A14;
    --basalt-gray: #1C1C28;
    --mineral-silver: #C8CBD0;
    --neon-cyan: #00FFD1;
    --holo-violet: #7B61FF;
    --plasma-magenta: #FF2E97;
    --solar-gold: #FFD500;
    --frost-white: #FFFFFF;

    --gradient-holographic: linear-gradient(135deg, #7B61FF 0%, #00FFD1 35%, #FF2E97 65%, #FFD500 100%);
    --gradient-depth: linear-gradient(180deg, #0A0A14 0%, #1C1C28 40%, #2A1040 100%);
    --gradient-fissure-glow: radial-gradient(ellipse at center, #00FFD1 0%, transparent 70%);

    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Albert Sans', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;

    --ease-reveal: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background: var(--deep-obsidian);
    color: var(--mineral-silver);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 17px;
    line-height: 1.65;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Parallax Container --- */
.parallax-container {
    perspective: 1px;
    height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* --- Depth Planes --- */
.plane {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    will-change: transform;
    backface-visibility: hidden;
}

.plane-deep-core {
    transform: translateZ(-4px) scale(5);
    z-index: 1;
}

.plane-background {
    transform: translateZ(-3px) scale(4);
    z-index: 2;
}

.plane-mid-far {
    transform: translateZ(-2px) scale(3);
    z-index: 3;
}

.plane-mid-near {
    transform: translateZ(-1px) scale(2);
    z-index: 4;
}

.plane-foreground {
    transform: translateZ(0px);
    z-index: 5;
    position: relative;
}

/* --- Deep Core Gradient --- */
.deep-core-gradient {
    width: 100%;
    height: 600vh;
    background: var(--gradient-depth);
    position: relative;
}

.deep-core-gradient::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120%;
    height: 50%;
    background: radial-gradient(ellipse at 50% 100%, rgba(255, 45, 151, 0.15) 0%, rgba(255, 213, 0, 0.08) 40%, transparent 70%);
}

/* --- Basalt Texture Background --- */
.basalt-texture {
    width: 100%;
    height: 600vh;
    background: var(--basalt-gray);
    position: relative;
}

.basalt-texture::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(10, 10, 20, 0.3) 2px,
        rgba(10, 10, 20, 0.3) 4px
    );
    opacity: 0.5;
}

/* --- Crystalline Geometry --- */
.crystal-geo {
    position: absolute;
    width: 300px;
    height: 300px;
    opacity: 0.15;
    animation: crystal-drift 30s ease-in-out infinite;
}

.crystal-geo-1 {
    top: 15%;
    right: 10%;
    animation-delay: 0s;
}

.crystal-geo-2 {
    top: 45%;
    left: 5%;
    animation-delay: -10s;
    width: 250px;
    height: 250px;
}

.crystal-geo-3 {
    top: 75%;
    right: 20%;
    animation-delay: -20s;
    width: 200px;
    height: 200px;
}

@keyframes crystal-drift {
    0%, 100% { transform: rotate(0deg) translateY(0); }
    50% { transform: rotate(5deg) translateY(-20px); }
}

/* --- Holographic Bands (Mid-Far Plane) --- */
.holographic-band {
    position: absolute;
    width: 100%;
    height: 100vh;
    background: var(--gradient-holographic);
    opacity: 0.06;
}

.holographic-band-1 {
    top: 20%;
    animation: holographic-shift 12s ease-in-out infinite;
}

.holographic-band-2 {
    top: 50%;
    animation: holographic-shift 10s ease-in-out infinite;
    animation-delay: -3s;
}

.holographic-band-3 {
    top: 80%;
    animation: holographic-shift 8s ease-in-out infinite;
    animation-delay: -6s;
    opacity: 0.1;
}

@keyframes holographic-shift {
    0%   { filter: hue-rotate(0deg); }
    50%  { filter: hue-rotate(30deg); }
    100% { filter: hue-rotate(0deg); }
}

/* --- Mountain Photos (Mid-Near Plane) --- */
.mountain-photo {
    position: absolute;
    width: 100%;
    height: 100vh;
    filter: blur(1px);
    opacity: 0.2;
}

.mountain-photo-summit {
    top: 0;
    background: linear-gradient(
        180deg,
        var(--deep-obsidian) 0%,
        var(--basalt-gray) 30%,
        var(--deep-obsidian) 60%,
        var(--basalt-gray) 100%
    );
}

.mountain-photo-fracture {
    top: 120vh;
    background: linear-gradient(
        135deg,
        var(--deep-obsidian) 0%,
        rgba(123, 97, 255, 0.1) 50%,
        var(--deep-obsidian) 100%
    );
}

/* --- Stratum Sections (Foreground) --- */
.stratum {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* --- Stratum I: The Summit --- */
.stratum-summit {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.summit-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.summit-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: clamp(56px, 10vw, 96px);
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: var(--frost-white);
    mix-blend-mode: difference;
    position: relative;
}

.summit-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-holographic);
    opacity: 0.6;
}

.summit-subtitle {
    margin-top: 40px;
    display: flex;
    gap: 40px;
    justify-content: center;
    flex-wrap: wrap;
}

.mono-label {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--holo-violet);
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: var(--neon-cyan);
    box-shadow: 0 0 6px var(--neon-cyan), 0 0 18px rgba(0, 255, 209, 0.25);
    animation: scroll-pulse 2s ease-in-out infinite;
}

@keyframes scroll-pulse {
    0%, 100% { opacity: 1; height: 60px; }
    50% { opacity: 0.4; height: 40px; }
}

/* --- Stratum II: The Fracture Zone --- */
.stratum-fracture {
    min-height: 120vh;
    display: flex;
    align-items: center;
    padding: 80px 0;
}

.fracture-layout {
    display: flex;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 60px;
    gap: 0;
    align-items: stretch;
}

.fracture-left {
    flex: 0 0 62%;
    padding-right: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.fracture-left .mono-label {
    margin-bottom: 30px;
}

.fracture-heading {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: clamp(36px, 5vw, 72px);
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: var(--frost-white);
    margin-bottom: 30px;
}

.body-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 17px;
    line-height: 1.65;
    letter-spacing: 0.01em;
    color: var(--mineral-silver);
    margin-bottom: 20px;
}

.fracture-fissure {
    flex: 0 0 3%;
    display: flex;
    justify-content: center;
    align-items: stretch;
    position: relative;
}

.neon-line-vertical {
    width: 1px;
    height: 100%;
    min-height: 400px;
    background: var(--neon-cyan);
    box-shadow: 0 0 6px var(--neon-cyan), 0 0 18px rgba(0, 255, 209, 0.25);
    position: relative;
}

.neon-line-vertical::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    background: var(--gradient-fissure-glow);
    opacity: 0.3;
    pointer-events: none;
}

.fracture-right {
    flex: 0 0 35%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 40px;
}

/* --- Duotone Treatment --- */
.duotone-container {
    position: relative;
    background: var(--deep-obsidian);
    overflow: hidden;
    aspect-ratio: 3/4;
}

.duotone-image {
    width: 100%;
    height: 100%;
    filter: grayscale(100%) contrast(1.2);
    mix-blend-mode: multiply;
}

.fracture-image {
    background: linear-gradient(
        160deg,
        #333 0%,
        #666 20%,
        #222 40%,
        #555 60%,
        #111 80%,
        #444 100%
    );
}

.duotone-cyan .duotone-overlay,
.duotone-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--neon-cyan);
    mix-blend-mode: screen;
    opacity: 0.6;
}

.duotone-violet .duotone-overlay {
    background: var(--holo-violet);
}

.image-caption {
    margin-top: 16px;
    display: block;
}

/* --- Stratum III: The Vein --- */
.stratum-vein {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: var(--gradient-holographic);
    animation: holographic-shift 12s ease-in-out infinite;
}

.stratum-vein::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 20, 0.55);
}

.noise-overlay {
    position: absolute;
    inset: 0;
    filter: url(#noise-filter);
    opacity: 0.04;
    pointer-events: none;
    z-index: 1;
}

.vein-content {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px;
}

.vein-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: clamp(48px, 8vw, 96px);
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: var(--frost-white);
    text-align: center;
}

.vein-label {
    position: absolute;
}

.vein-label-tl {
    top: 80px;
    left: 80px;
}

.vein-label-tr {
    top: 80px;
    right: 80px;
}

.vein-label-bl {
    bottom: 80px;
    left: 80px;
}

.vein-label-br {
    bottom: 80px;
    right: 80px;
}

/* --- Neon Fault Lines (Section Boundaries) --- */
.stratum-fracture::before,
.stratum-vein::after,
.stratum-archive::before,
.stratum-core::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--neon-cyan);
    box-shadow: 0 0 6px var(--neon-cyan), 0 0 18px rgba(0, 255, 209, 0.25);
    z-index: 10;
}

.stratum-vein::after {
    top: auto;
    bottom: 0;
}

/* --- Stratum IV: The Archive --- */
.stratum-archive {
    min-height: 150vh;
    padding: 120px 60px;
    position: relative;
}

.archive-header {
    max-width: 1400px;
    margin: 0 auto 80px;
}

.archive-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: clamp(36px, 5vw, 64px);
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: var(--neon-cyan);
    margin-top: 16px;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.archive-card {
    position: relative;
    background: var(--deep-obsidian);
    padding: 2px;
    transform: translateY(calc(var(--stagger) * 40px));
}

.card-border-glow {
    position: absolute;
    inset: 0;
    background: var(--gradient-holographic);
    z-index: 0;
    opacity: 0.6;
    transition: opacity 0.4s ease;
}

.archive-card:hover .card-border-glow {
    opacity: 1;
    animation: border-rotate 3s linear infinite;
}

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

.card-content {
    position: relative;
    z-index: 1;
    background: var(--deep-obsidian);
    padding: 36px;
    height: 100%;
}

.card-meta {
    display: block;
    margin-bottom: 20px;
}

.card-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 24px;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--frost-white);
    margin-bottom: 16px;
}

.card-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0.01em;
    color: var(--neon-cyan);
    margin-top: 12px;
}

.peak-marker {
    width: 12px;
    height: 10px;
    display: inline-block;
}

/* Topographic contours */
.topo-contours {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.4;
    z-index: 0;
}

/* --- Stratum V: The Core --- */
.stratum-core {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: radial-gradient(ellipse at 50% 80%, rgba(255, 45, 151, 0.12) 0%, rgba(255, 213, 0, 0.06) 30%, transparent 60%),
                var(--gradient-depth);
}

.core-content {
    text-align: center;
    max-width: 800px;
    padding: 80px 40px;
    position: relative;
    z-index: 2;
}

.core-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: clamp(36px, 6vw, 72px);
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: var(--frost-white);
    margin-top: 20px;
    margin-bottom: 30px;
    animation: core-shimmer 8s ease-in-out infinite;
}

@keyframes core-shimmer {
    0%, 100% { filter: hue-rotate(0deg) brightness(1); }
    25% { filter: hue-rotate(10deg) brightness(1.05); }
    50% { filter: hue-rotate(20deg) brightness(1.1); }
    75% { filter: hue-rotate(10deg) brightness(1.05); }
}

.core-body {
    max-width: 600px;
    margin: 0 auto 40px;
}

.neon-line-horizontal {
    width: 120px;
    height: 1px;
    margin: 40px auto;
    background: var(--neon-cyan);
    box-shadow: 0 0 6px var(--neon-cyan), 0 0 18px rgba(0, 255, 209, 0.25);
}

.core-footer {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-top: 40px;
}

/* --- Pip Navigation --- */
.pip-nav {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 100;
}

.pip {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-direction: row-reverse;
}

.pip-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gradient-holographic);
    opacity: 0.4;
    transition: all 0.3s ease;
    box-shadow: 0 0 4px rgba(0, 255, 209, 0.2);
    flex-shrink: 0;
}

.pip:hover .pip-dot,
.pip.active .pip-dot {
    opacity: 1;
    transform: scale(1.5);
    box-shadow: 0 0 8px var(--neon-cyan), 0 0 20px rgba(0, 255, 209, 0.3);
}

.pip-label {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--neon-cyan);
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    white-space: nowrap;
    pointer-events: none;
}

.pip:hover .pip-label {
    opacity: 1;
    transform: translateX(0);
}

/* --- Fade-Reveal Animation --- */
.reveal-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--ease-reveal), transform 0.8s var(--ease-reveal);
}

.reveal-element.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- Mountain Silhouette Ridge --- */
.stratum-fracture::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background:
        linear-gradient(135deg, transparent 33.33%, var(--mineral-silver) 33.33%, var(--mineral-silver) 33.5%, transparent 33.5%),
        linear-gradient(225deg, transparent 33.33%, var(--mineral-silver) 33.33%, var(--mineral-silver) 33.5%, transparent 33.5%);
    background-size: 60px 80px;
    opacity: 0.08;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .fracture-layout {
        flex-direction: column;
        padding: 0 40px;
    }

    .fracture-left {
        flex: none;
        padding-right: 0;
        margin-bottom: 40px;
    }

    .fracture-fissure {
        flex: none;
        height: 1px;
        width: 100%;
    }

    .neon-line-vertical {
        width: 100%;
        height: 1px;
        min-height: auto;
    }

    .neon-line-vertical::before {
        width: 120px;
        height: 2px;
    }

    .fracture-right {
        flex: none;
        padding-left: 0;
        margin-top: 40px;
    }

    .archive-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .archive-card {
        transform: translateY(calc(var(--stagger) * 20px));
    }

    .vein-label-tl, .vein-label-tr,
    .vein-label-bl, .vein-label-br {
        position: static;
        display: block;
        text-align: center;
        margin-bottom: 10px;
    }

    .vein-content {
        flex-direction: column;
        padding: 40px;
    }
}

@media (max-width: 768px) {
    .archive-grid {
        grid-template-columns: 1fr;
    }

    .archive-card {
        transform: translateY(0);
    }

    .stratum-archive {
        padding: 80px 24px;
    }

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

    .summit-subtitle {
        flex-direction: column;
        gap: 12px;
    }

    .core-footer {
        flex-direction: column;
        gap: 12px;
    }

    .pip-nav {
        right: 16px;
    }
}

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

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

    .core-title {
        font-size: 32px;
    }
}
