/* ============================================
   GeoNDC Website - Global Styles
   Design: Dark theme, tech-focused
   ============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600;700&family=Inter:wght@300;400;500;600&family=Space+Mono:wght@400;700&display=swap');

/* CSS Variables */
:root {
    --bg-primary: #04080f;
    --bg-secondary: #0a1019;
    --bg-card: #0d1520;
    --accent-primary: #00e5ff;
    --accent-secondary: #7fff6e;
    --accent-tertiary: #ff6b6b;
    --text-primary: #e8edf5;
    --text-secondary: #8a9bb5;
    --text-muted: #4a5568;
    --border-color: rgba(0, 229, 255, 0.12);
    --border-hover: rgba(0, 229, 255, 0.4);

    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'Space Mono', monospace;

    --nav-height: 72px;
    --max-width: 1200px;
    --border-radius: 12px;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.25rem; }

p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--text-primary);
    text-shadow: 0 0 20px var(--accent-primary);
}

code, pre {
    font-family: var(--font-mono);
    background: var(--bg-secondary);
    border-radius: 6px;
}

code {
    padding: 0.2em 0.4em;
    font-size: 0.9em;
    color: var(--accent-secondary);
}

pre {
    padding: 1.5rem;
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

pre code {
    padding: 0;
    background: none;
}

/* Layout */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 5rem 0;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(4, 8, 15, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.nav-container {
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.nav-logo-img {
    height: 32px;
    width: auto;
}

.nav-logo span {
    color: var(--accent-primary);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-primary);
    border-radius: 2px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.btn-primary:hover {
    background: #33ebff;
    color: var(--bg-primary);
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
}

.btn-secondary:hover {
    background: rgba(0, 229, 255, 0.1);
    color: var(--accent-primary);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding-top: var(--nav-height);
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(0, 229, 255, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(127, 255, 110, 0.05) 0%, transparent 50%),
        linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    z-index: -1;
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 229, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}

.hero-content {
    text-align: center;
    max-width: 1100px;
    padding: 0 2rem;
}

.hero-title {
    font-size: 5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-stats {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    margin-bottom: 0;
}

.hero-pipeline {
    margin-bottom: 2.5rem;
    margin-top: 1rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Section Styles */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.card-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 1.5rem;
    color: var(--accent-primary);
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.card-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Grid Layouts */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

/* Tags */
.tag {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 4px;
    background: rgba(0, 229, 255, 0.1);
    color: var(--accent-primary);
    border: 1px solid rgba(0, 229, 255, 0.2);
}

.tag-success {
    background: rgba(127, 255, 110, 0.1);
    color: var(--accent-secondary);
    border-color: rgba(127, 255, 110, 0.2);
}

.tag-warning {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border-color: rgba(255, 193, 7, 0.2);
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0;
    margin-top: 5rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--accent-primary);
}

/* Page Header */
.page-header {
    padding-top: calc(var(--nav-height) + 4rem);
    padding-bottom: 3rem;
    text-align: center;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.page-title {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.page-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Responsive */
@media (max-width: 1024px) {
    h1 { font-size: 2.5rem; }
    .hero-title { font-size: 3.5rem; }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    .hero-title { font-size: 2.5rem; }
    .hero-buttons { flex-direction: column; }
    .nav-links { display: none; }
    .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .footer-content { flex-direction: column; gap: 1.5rem; text-align: center; }
    .hero-pipeline { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-fadeInUp {
    animation: fadeInUp 0.8s ease forwards;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ============================================
   Pipeline Animation - How It Works
   ============================================ */

.pipeline-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: rgba(10, 16, 25, 0.6);
    padding: 1.5rem 1rem;
}

.pipeline-svg {
    display: block;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    height: auto;
}

/* Shimmer highlight sweep */
.pipeline-shimmer {
    opacity: 0;
}

.pipeline-animated .pipeline-shimmer {
    animation: shimmerSweep 3s ease-in-out 0.5s infinite;
}

@keyframes shimmerSweep {
    0%   { transform: translateX(0);    opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { transform: translateX(2200px); opacity: 0; }
}

/* Stage entrance — opacity only, no transform (would override SVG translate) */
.pipeline-stage {
    opacity: 0;
}

.pipeline-animated .pipeline-stage {
    animation: stageFadeIn 0.6s ease forwards;
}

.pipeline-animated .stage-cube  { animation-delay: 0.3s; }
.pipeline-animated .stage-nn    { animation-delay: 1.5s; }
.pipeline-animated .stage-file  { animation-delay: 2.6s; }
.pipeline-animated .stage-query { animation-delay: 3.6s; }

@keyframes stageFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Cube layers stack in — opacity only */
.cube-layer {
    opacity: 0;
}

.pipeline-animated .cube-layer {
    animation: stackIn 0.5s ease forwards;
    animation-delay: calc(0.3s + var(--layer-i) * 0.15s);
}

@keyframes stackIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Flow lines draw in */
.flow-line {
    opacity: 0;
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
}

.pipeline-animated .flow-line-1 {
    animation: flowLineIn 0.5s ease forwards 1.0s;
}

.pipeline-animated .flow-line-2 {
    animation: flowLineIn 0.5s ease forwards 2.1s;
}

.pipeline-animated .flow-line-3 {
    animation: flowLineIn 0.4s ease forwards 3.2s;
}

@keyframes flowLineIn {
    0%   { opacity: 1; stroke-dashoffset: 200; }
    100% { opacity: 1; stroke-dashoffset: 0; }
}

/* Flow particles hidden until animated */
.flow-particle {
    opacity: 0;
}

.pipeline-animated .fp-1a,
.pipeline-animated .fp-1b {
    animation: particleFadeIn 0.3s ease forwards 1.4s;
}

.pipeline-animated .fp-2a {
    animation: particleFadeIn 0.3s ease forwards 2.5s;
}

.pipeline-animated .fp-3a {
    animation: particleFadeIn 0.3s ease forwards 3.5s;
}

@keyframes particleFadeIn {
    to { opacity: 1; }
}

/* Neural network nodes appear by column */
.nn-node {
    opacity: 0;
}

.nn-connections {
    opacity: 0;
}

.pipeline-animated .nn-connections {
    animation: nnConnectionsPulse 4s ease-in-out infinite;
}

.pipeline-animated .nn-node.nn-col-0 {
    animation: nnColPulse 4s ease-in-out infinite;
}
.pipeline-animated .nn-node.nn-col-1 {
    animation: nnColPulse 4s ease-in-out infinite;
    animation-delay: 0.6s;
}
.pipeline-animated .nn-node.nn-col-2 {
    animation: nnColPulse 4s ease-in-out infinite;
    animation-delay: 1.2s;
}
.pipeline-animated .nn-node.nn-col-3 {
    animation: nnColPulse 4s ease-in-out infinite;
    animation-delay: 1.8s;
}

@keyframes nnConnectionsPulse {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 0.4; }
}

@keyframes nnColPulse {
    0%, 12% { opacity: 0.2; }
    25%, 35% { opacity: 1; }
    50%, 100% { opacity: 0.2; }
}

/* .gndc file glow pulse */
.pipeline-animated .stage-file g[filter] {
    animation: glowPulse 2s ease-in-out infinite 3.2s;
}

@keyframes glowPulse {
    0%, 100% { filter: url(#glowGreen); }
    50% { filter: url(#glowGreen) brightness(1.4); }
}

/* Responsive: Tablet */
@media (max-width: 1024px) {
    .pipeline-svg {
        max-width: 100%;
    }
}

/* Responsive: Mobile */
@media (max-width: 768px) {
    .pipeline-svg {
        min-width: 700px;
    }

    .flow-particle {
        display: none;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .pipeline-stage,
    .cube-layer,
    .nn-node,
    .nn-connections {
        opacity: 1 !important;
        animation: none !important;
    }

    .nn-node {
        fill: rgba(0, 229, 255, 0.3);
    }

    .flow-line {
        stroke-dashoffset: 0 !important;
        animation: none !important;
    }

    .flow-particle,
    .pipeline-shimmer {
        display: none;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-accent { color: var(--accent-primary); }
.text-success { color: var(--accent-secondary); }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
