/* lupine.day - Holographic Wolf-Tracking Interface */
/* Fonts: Space Grotesk, IBM Plex Mono, Share Tech Mono */

:root {
    --void: #0a0e27;
    --depth: #0f1538;
    --structure: #1e3a5f;
    --body-text: #8ba4b8;
    --heading-primary: #7ec8e3;
    --heading-secondary: #4a7fa5;
    --accent-hot: #9b59d6;
    --accent-warm: #d4a843;
    --accent-label: #3d6b8e;
    --alert-pulse: #2dd4a8;
    --darkest: #060919;
}

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

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

body {
    background: var(--void);
    color: var(--body-text);
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.875rem, 1.1vw, 1.05rem);
    line-height: 1.75;
    letter-spacing: 0.02em;
    overflow-x: hidden;
}

/* ===== PLANES ===== */

#plane-void {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--void);
    z-index: 0;
}

/* Noise texture overlay */
#plane-void::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    opacity: 0.04;
    pointer-events: none;
}

#constellation-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
    opacity: 0.04;
    transition: opacity 0.8s ease;
}

#constellation-grid.visible {
    opacity: 0.07;
}

#plane-far {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2;
    pointer-events: none;
}

.landscape-silhouette {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: var(--depth);
}

.landscape-1 {
    height: 15vh;
    clip-path: polygon(0% 100%, 0% 60%, 5% 55%, 15% 40%, 25% 45%, 35% 30%, 45% 35%, 55% 20%, 65% 25%, 75% 15%, 85% 30%, 95% 25%, 100% 35%, 100% 100%);
    opacity: 0.6;
}

.landscape-2 {
    height: 12vh;
    clip-path: polygon(0% 100%, 0% 70%, 10% 50%, 20% 55%, 30% 40%, 40% 45%, 50% 30%, 60% 35%, 70% 25%, 80% 40%, 90% 35%, 100% 45%, 100% 100%);
    opacity: 0.4;
}

.landscape-3 {
    height: 8vh;
    clip-path: polygon(0% 100%, 0% 80%, 8% 65%, 20% 70%, 35% 55%, 50% 60%, 65% 50%, 80% 55%, 90% 45%, 100% 55%, 100% 100%);
    opacity: 0.25;
}

/* ===== SCAN LINES ===== */

#plane-scan {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10;
    pointer-events: none;
    overflow: hidden;
}

.scan-line {
    position: absolute;
    left: 0;
    width: 100vw;
    height: 1px;
    background: rgba(126, 200, 227, 0.08);
}

.scan-line-1 {
    animation: scanDrift 14s linear infinite;
    animation-delay: 0s;
}

.scan-line-2 {
    animation: scanDrift 16s linear infinite;
    animation-delay: -4s;
}

.scan-line-3 {
    animation: scanDrift 18s linear infinite;
    animation-delay: -8s;
}

@keyframes scanDrift {
    0% { transform: translateY(-100vh); }
    100% { transform: translateY(100vh); }
}

/* ===== EDGE LEAKS ===== */

#edge-leak-left {
    position: fixed;
    top: 0;
    left: 0;
    width: 10px;
    height: 100vh;
    background: linear-gradient(to right, rgba(155, 89, 214, 0.15), transparent);
    z-index: 11;
    pointer-events: none;
}

#edge-leak-right {
    position: fixed;
    top: 0;
    right: 0;
    width: 10px;
    height: 100vh;
    background: linear-gradient(to left, rgba(126, 200, 227, 0.1), transparent);
    z-index: 11;
    pointer-events: none;
}

/* ===== HUD FRAME ===== */

#hud-frame {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 100;
    pointer-events: none;
}

#hud-border-top,
#hud-border-bottom,
#hud-border-left,
#hud-border-right {
    position: absolute;
    background: var(--structure);
}

#hud-border-top {
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
}

#hud-border-bottom {
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
}

#hud-border-left {
    top: 0;
    left: 0;
    width: 1px;
    height: 100%;
}

#hud-border-right {
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
}

#hud-wordmark {
    position: absolute;
    top: 16px;
    left: 20px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #3d6b8e;
    pointer-events: auto;
}

#scroll-progress {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    pointer-events: auto;
}

.scroll-tick {
    width: 6px;
    height: 6px;
    border: 1px solid var(--structure);
    background: transparent;
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.scroll-tick.active {
    background: var(--heading-primary);
    border-color: var(--heading-primary);
}

.scroll-tick.final-active {
    background: var(--accent-warm);
    border-color: var(--accent-warm);
}

#scroll-track {
    position: absolute;
    width: 1px;
    height: 100%;
    background: var(--structure);
    opacity: 0.3;
    z-index: -1;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
}

/* ===== MAIN CONTENT ===== */

#plane-content {
    position: relative;
    z-index: 5;
}

.content-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    will-change: transform, opacity;
}

.section-inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 40px;
    position: relative;
}

/* ===== SECTION TRANSITIONS - Chromatic Aberration ===== */

.chromatic-active h1,
.chromatic-active h2,
.chromatic-active p {
    filter: drop-shadow(2px 0 0 rgba(155, 89, 214, 0.3)) drop-shadow(-2px 0 0 rgba(126, 200, 227, 0.3));
    transition: filter 0.15s ease;
}

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

h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 5rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--heading-primary);
    line-height: 1.1;
}

h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
    color: var(--heading-secondary);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 2rem;
}

.caption-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.75rem, 0.9vw, 0.9rem);
    color: var(--body-text);
    line-height: 1.75;
    letter-spacing: 0.02em;
}

/* ===== SECTION 1 - SIGNAL ACQUISITION ===== */

#section-1 {
    min-height: 100vh;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: 0.12em;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.hero-subtitle {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #3d6b8e;
    opacity: 0;
    transition: opacity 0.6s ease 0.3s;
    margin-top: 1rem;
}

.hero-subtitle.visible {
    opacity: 0.6;
}

/* ===== SKELETON LOADERS ===== */

.skeleton-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
}

.skeleton-bar {
    width: 100%;
    height: 2px;
    background: transparent;
    border-radius: 1px;
    position: relative;
    overflow: hidden;
}

.skeleton-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(45, 212, 168, 0.3), transparent);
    animation: skeletonPulse 1.2s ease-in-out 3;
}

.skeleton-bar-1::after { animation-delay: 0s; }
.skeleton-bar-2::after { animation-delay: 0.2s; }
.skeleton-bar-3::after { animation-delay: 0.4s; }

@keyframes skeletonPulse {
    0% { left: -100%; }
    100% { left: 100%; }
}

.skeleton-loader.done {
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

/* Skeleton blocks for section 3 */
.skeleton-block {
    width: 80%;
    height: 40px;
    background: transparent;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    margin: 0 auto;
}

.skeleton-block::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(45, 212, 168, 0.08), transparent);
    animation: skeletonPulse 1.5s ease-in-out 3;
}

.skeleton-block-1::after { animation-delay: 0s; }
.skeleton-block-2::after { animation-delay: 0.3s; }
.skeleton-block-3::after { animation-delay: 0.6s; }
.skeleton-block-4::after { animation-delay: 0.9s; }

/* ===== HIDDEN STATE ===== */

.hidden {
    opacity: 0;
    pointer-events: none;
}

.section-content {
    transition: opacity 1s ease;
}

.section-content.visible {
    opacity: 1;
    pointer-events: auto;
}

/* ===== WOLF SILHOUETTES ===== */

.wolf-silhouette {
    position: relative;
}

.wolf-primary {
    fill: var(--depth);
}

.wolf-echo {
    fill: var(--heading-primary);
    opacity: 0.2;
}

.wolf-echo-strong {
    opacity: 0.25;
}

.wolf-eye {
    fill: var(--accent-warm);
}

/* Wolf positions */
.wolf-standing {
    position: absolute;
    right: -5%;
    top: 50%;
    transform: translateY(-50%);
    width: 300px;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.wolf-standing.visible {
    opacity: 1;
}

.wolf-running {
    width: 350px;
    margin: 2rem auto;
    opacity: 0;
    transform: translateX(-100px);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.wolf-running.visible {
    opacity: 1;
    transform: translateX(0);
}

.wolf-pack {
    width: 70vw;
    max-width: 700px;
    margin: 0 auto;
}

.wolf-howling {
    width: 280px;
    margin: 2rem auto;
    position: relative;
}

.wolf-crouching {
    width: 300px;
    margin: 0 auto 2rem;
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 100%);
    mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 100%);
}

/* ===== HOWL ARCS ===== */

.howl-arcs {
    position: absolute;
    top: -30%;
    right: -60%;
    width: 300px;
    height: 300px;
}

.arc-svg {
    width: 100%;
    height: 100%;
}

.howl-arc {
    opacity: 0;
}

.howl-arc.animating {
    animation: howlPulse 3s ease-out infinite;
}

.arc-1.animating { animation-delay: 0s; }
.arc-2.animating { animation-delay: 0.5s; }
.arc-3.animating { animation-delay: 1s; }
.arc-4.animating { animation-delay: 1.5s; }
.arc-5.animating { animation-delay: 2s; }

@keyframes howlPulse {
    0% {
        opacity: 0.3;
        transform: scale(0.5);
        transform-origin: center;
    }
    100% {
        opacity: 0;
        transform: scale(1);
        transform-origin: center;
    }
}

/* ===== DATA TRACES ===== */

.data-trace {
    width: 100%;
    height: 40px;
    margin-top: 3rem;
}

.data-trace svg {
    width: 100%;
    height: 100%;
}

.trace-line {
    fill: none;
    stroke: var(--structure);
    stroke-width: 1;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 2s ease;
}

.trace-line.drawn {
    stroke-dashoffset: 0;
}

.trace-glow {
    fill: var(--heading-primary);
    opacity: 0;
    transition: opacity 0.3s ease 1.8s;
}

.trace-glow.visible {
    opacity: 0.8;
    animation: glowPulse 1.5s ease-in-out 1;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ===== TEXT COLUMNS ===== */

.text-column {
    max-width: 45ch;
}

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

.text-column h2 {
    margin-bottom: 2rem;
}

/* Slide animations */
.slide-in-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

/* ===== SECTION 3 LAYOUT ===== */

.section-3-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.section-3-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    width: 100%;
}

.text-column-left,
.text-column-right {
    max-width: 30ch;
    flex-shrink: 0;
}

.text-column-left {
    text-align: right;
}

.text-column-right {
    text-align: left;
}

/* ===== SECTION 4 - DARKEST ===== */

.section-darkest {
    background: var(--darkest);
}

#section-4 .text-column {
    max-width: 45ch;
}

/* ===== SECTION 5 - SIGNAL LOSS ===== */

.section-5-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.signal-fade {
    text-align: center;
    margin-top: 3rem;
}

.fade-domain {
    display: block;
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.2rem;
    color: var(--heading-primary);
    letter-spacing: 0.1em;
    animation: signalPulse 4s ease-in-out infinite;
}

@keyframes signalPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
}

.fade-end {
    display: block;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--structure);
    margin-top: 1.5rem;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    .section-inner {
        padding: 40px 20px;
    }

    .wolf-standing {
        width: 180px;
        right: -10%;
    }

    .wolf-running {
        width: 250px;
    }

    .wolf-howling {
        width: 200px;
    }

    .wolf-crouching {
        width: 200px;
    }

    .section-3-content {
        flex-direction: column;
    }

    .text-column-left,
    .text-column-right {
        text-align: center;
        max-width: 45ch;
    }

    .howl-arcs {
        right: -30%;
        width: 200px;
        height: 200px;
    }

    #scroll-progress {
        right: 10px;
    }

    #hud-wordmark {
        font-size: 10px;
        left: 12px;
        top: 12px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(2rem, 10vw, 3.5rem);
    }

    .wolf-standing {
        width: 140px;
    }

    .text-column {
        max-width: 100%;
    }
}
