/* graphers.dev - Retro-Futuristic Data Cinema */

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

:root {
    --bg-deep: #0A0F14;
    --bg-panel: #111B22;
    --grid: #1E3A3A;
    --accent: #00D4AA;
    --coral: #FF6B3D;
    --periwinkle: #7B68EE;
    --text: #B0C4B8;
    --text-muted: #5A7A72;
    --mint: #00FFD0;
    --border: #3A5F5F;
}

body {
    font-family: 'IBM Plex Sans', sans-serif;
    background: var(--bg-deep);
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.7;
}

/* Coordinate Grid */
.coord-grid {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        repeating-linear-gradient(0deg, var(--grid) 0, var(--grid) 1px, transparent 1px, transparent 40px),
        repeating-linear-gradient(90deg, var(--grid) 0, var(--grid) 1px, transparent 1px, transparent 40px);
    opacity: 0.03;
    pointer-events: none;
}

/* Y-Axis Nav */
.y-axis-nav {
    position: fixed;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.axis-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    letter-spacing: 0.02em;
    writing-mode: vertical-lr;
    transform: rotate(180deg);
    transition: color 400ms ease;
    position: relative;
}

.axis-label:hover {
    color: var(--accent);
}

.axis-label:hover::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 100%;
    width: 100vw;
    height: 1px;
    border-top: 1px dashed var(--border);
    opacity: 0.15;
}

/* Sections */
.section {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 80px 80px 60px;
    gap: 40px;
    flex-wrap: wrap;
}

.closing {
    min-height: 80vh;
}

/* Panels */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    padding: 40px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
    transform: perspective(1200px) rotateY(-2deg) rotateX(1deg);
}

.hero-panel {
    max-width: 500px;
}

.offset-panel {
    max-width: 480px;
    flex: 1;
    min-width: 280px;
}

.wide-panel {
    width: 100%;
    max-width: 900px;
    transform: perspective(1200px) rotateY(-1deg);
}

.closing-panel {
    max-width: 600px;
    text-align: center;
    transform: none;
}

/* Reveal */
.reveal {
    opacity: 0;
    transform: perspective(1200px) rotateY(-2deg) rotateX(1deg) translateY(24px);
    transition: opacity 700ms ease-out, transform 700ms ease-out;
    transition-delay: var(--d, 0ms);
}

.reveal.visible {
    opacity: 1;
    transform: perspective(1200px) rotateY(-2deg) rotateX(1deg) translateY(0);
}

/* Typography */
.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 10vw, 7rem);
    color: var(--accent);
    letter-spacing: -0.02em;
    line-height: 1.05;
}

.dot-accent {
    color: var(--coral);
}

.hero-sub {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    color: var(--text);
    margin-top: 16px;
    line-height: 1.7;
}

.mono-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    display: block;
    margin-bottom: 12px;
}

.section-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(1.25rem, 2.5vw, 2.25rem);
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin-bottom: 16px;
}

.body-text {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    color: var(--text);
    line-height: 1.7;
}

/* Hero Graph */
.hero-graph {
    max-width: 500px;
    flex: 1;
    min-width: 300px;
}

.graph-svg {
    width: 100%;
    height: auto;
}

.trace-path {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    animation: traceDraw 2.5s ease forwards 0.5s;
}

.secondary-trace {
    animation-delay: 1s;
}

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

.data-point {
    opacity: 0;
    animation: pointAppear 0.4s ease forwards;
}

.data-point:nth-child(n+8) { animation-delay: 0.8s; }
.data-point:nth-child(n+10) { animation-delay: 1.2s; }
.data-point:nth-child(n+12) { animation-delay: 1.6s; }

@keyframes pointAppear {
    0% { opacity: 0; transform: scale(0); }
    100% { opacity: 1; transform: scale(1); }
}

/* Grid Divider */
.grid-divider {
    height: 60px;
    background:
        repeating-linear-gradient(0deg, var(--grid) 0, var(--grid) 1px, transparent 1px, transparent 5px);
    opacity: 0.12;
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

.feature-item {
    padding: 24px;
    border: 1px solid rgba(58,95,95,0.3);
}

.feature-num {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    color: var(--accent);
    display: block;
    margin-bottom: 8px;
}

.feature-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 1.2rem;
    color: var(--text);
    margin-bottom: 8px;
}

.feature-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.closing-text {
    font-family: 'IBM Plex Mono', monospace;
    color: var(--accent);
    font-size: 0.85rem;
    margin-top: 16px;
    letter-spacing: 0.02em;
}

/* Reactive Points */
.reactive-points {
    position: fixed;
    inset: 0;
    z-index: 5;
    pointer-events: none;
}

.r-point {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: background 400ms ease, transform 400ms ease;
}

.r-point.active {
    background: var(--accent);
    transform: scale(1.4);
}

/* Responsive */
@media (max-width: 768px) {
    .section {
        padding: 60px 24px;
        flex-direction: column;
    }

    .y-axis-nav { display: none; }

    .panel {
        transform: none;
    }

    .reveal {
        transform: translateY(24px);
    }

    .reveal.visible {
        transform: translateY(0);
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .hero-graph {
        min-width: auto;
        width: 100%;
    }
}
