/* ==========================================================================
   nullhex // Engineering Noir Design System
   ========================================================================== */

/* CSS Custom Properties */
:root {
    /* Colors */
    --bg-color: #0f0f14;
    --text-color: #e0e0e0;
    --void-black: #0f0f14;
    --void-darker: #0a0e27;
    --void-accent: #1a2332;
    --cyber-green: #4AF626;
    --cyber-green-dim: rgba(74, 246, 38, 0.6);
    --cyber-green-glow: rgba(74, 246, 38, 0.15);
    --glass-white: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: rgba(255, 255, 255, 0.9);
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.3);

    /* Typography */
    --font-mono: 'JetBrains Mono', monospace;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 8rem;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 600ms ease;
}

/* Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background: radial-gradient(ellipse at center, var(--void-black) 0%, var(--void-darker) 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Subtle grid background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(74, 246, 38, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(74, 246, 38, 0.015) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -1;
}

/* Subtle grain texture */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMDAiIGhlaWdodD0iMzAwIj48ZmlsdGVyIGlkPSJhIiB4PSIwIiB5PSIwIj48ZmVUdXJidWxlbmNlIGJhc2VGcmVxdWVuY3k9Ii43NSIgc3RpdGNoVGlsZXM9InN0aXRjaCIgdHlwZT0iZnJhY3RhbE5vaXNlIi8+PGZlQ29sb3JNYXRyaXggdHlwZT0ic2F0dXJhdGUiIHZhbHVlcz0iMCIvPjwvZmlsdGVyPjxwYXRoIGQ9Ik0wIDBoMzAwdjMwMEgweiIgZmlsdGVyPSJ1cmwoI2EpIiBvcGFjaXR5PSIuMDUiLz48L3N2Zz4=');
    opacity: 0.03;
    pointer-events: none;
    z-index: -1;
    animation: grain 8s steps(10) infinite;
}

@keyframes grain {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-5%, -10%); }
    20% { transform: translate(-15%, 5%); }
    30% { transform: translate(7%, -25%); }
    40% { transform: translate(-5%, 25%); }
    50% { transform: translate(-15%, 10%); }
    60% { transform: translate(15%, 0%); }
    70% { transform: translate(0%, 15%); }
    80% { transform: translate(3%, 35%); }
    90% { transform: translate(-10%, 10%); }
}

/* ==========================================================================
   Scanning Line Animation
   ========================================================================== */

.scan-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg,
            transparent 0%,
            var(--cyber-green) 50%,
            transparent 100%);
    opacity: 0;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 0 30px var(--cyber-green), 0 0 60px var(--cyber-green-dim), 0 0 90px var(--cyber-green-glow);
}

.scan-line.active {
    animation: scanDown 2s ease-in-out forwards;
}

@keyframes scanDown {
    0% {
        top: 0;
        opacity: 0;
    }

    5% {
        opacity: 1;
    }

    95% {
        opacity: 1;
    }

    100% {
        top: 100vh;
        opacity: 0;
    }
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--space-lg) var(--space-md);
    position: relative;
}

.hero-content {
    text-align: center;
    max-width: 800px;
}

/* Logo */
.logo-container {
    margin-bottom: var(--space-lg);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo {
    width: 600px;
    height: auto;
    max-width: 90vw;
    display: block;
    margin: 0 auto;
    object-fit: contain;
    object-position: center;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter var(--transition-base);
    filter: drop-shadow(0 0 15px rgba(74, 246, 38, 0.2));
    will-change: opacity;
    opacity: 0;
    animation: logoFlickerOn 3.5s ease-out 0.3s forwards;
}

.logo-container:hover .logo {
    filter: drop-shadow(0 0 30px rgba(74, 246, 38, 0.4)) drop-shadow(0 0 60px rgba(74, 246, 38, 0.2));
}

@keyframes logoFlickerOn {
    0% {
        opacity: 0;
    }
    5% {
        opacity: 0.4;
    }
    8% {
        opacity: 0;
    }
    12% {
        opacity: 0.7;
    }
    15% {
        opacity: 0.1;
    }
    20% {
        opacity: 0.9;
    }
    23% {
        opacity: 0.3;
    }
    28% {
        opacity: 1;
    }
    31% {
        opacity: 0.5;
    }
    36% {
        opacity: 1;
    }
    39% {
        opacity: 0.6;
    }
    44% {
        opacity: 1;
    }
    47% {
        opacity: 0.8;
    }
    52% {
        opacity: 1;
    }
    55% {
        opacity: 0.9;
    }
    100% {
        opacity: 1;
    }
}

.thorax-hex {
    animation: hexPulse 3s ease-in-out infinite;
}

@keyframes hexPulse {

    0%,
    100% {
        filter: url(#strongGlow);
        stroke: var(--cyber-green);
    }

    50% {
        filter: url(#strongGlow);
        stroke: var(--cyber-green-dim);
    }
}

/* Typography */
.headline {
    font-family: var(--font-mono);
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-md);
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--cyber-green) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 20px rgba(74, 246, 38, 0.3);
    position: relative;
}

.headline::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--cyber-green) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: blur(20px);
    opacity: 0.5;
}

.sub-headline {
    font-family: var(--font-sans);
    font-size: 1.125rem;
    font-weight: 300;
    color: var(--text-secondary);
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.8;
}

.sub-headline .brand {
    font-family: var(--font-mono);
    color: var(--cyber-green);
    font-weight: 500;
}

.sub-headline .emphasis {
    color: var(--text-primary);
    font-weight: 400;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, var(--cyber-green), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {

    0%,
    100% {
        opacity: 0.3;
        transform: scaleY(1);
    }

    50% {
        opacity: 1;
        transform: scaleY(1.2);
    }
}

/* ==========================================================================
   Builds Section
   ========================================================================== */

.builds {
    padding: var(--space-xl) var(--space-md);
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    margin-bottom: var(--space-lg);
}

.tag {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--cyber-green);
    display: block;
    margin-bottom: var(--space-sm);
}

.section-header h2 {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Build Cards Grid */
.builds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
    gap: var(--space-md);
}

.build-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.build-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
    will-change: transform;
}

.build-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 1px;
    background: linear-gradient(135deg, var(--glass-border), transparent 50%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.build-card::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 12px;
    padding: 2px;
    background: linear-gradient(135deg, rgba(74, 246, 38, 0.3), transparent 50%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.build-card:hover {
    transform: translateY(-8px);
    border-color: rgba(74, 246, 38, 0.2);
    box-shadow:
        0 0 40px rgba(74, 246, 38, 0.2),
        0 0 80px rgba(74, 246, 38, 0.1),
        0 20px 60px rgba(0, 0, 0, 0.3);
}

.build-card:hover::after {
    opacity: 1;
}

.card-inner {
    background: var(--glass-white);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    padding: var(--space-md);
    height: 100%;
    border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.system-name {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--cyber-green);
    letter-spacing: -0.02em;
}

.version {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 4px 8px;
    background: rgba(74, 246, 38, 0.1);
    border-radius: 4px;
    transition: box-shadow var(--transition-base), background-color var(--transition-base);
}

.build-card:hover .version {
    background: rgba(74, 246, 38, 0.15);
    box-shadow: 0 0 10px rgba(74, 246, 38, 0.2);
}

.system-description {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    line-height: 1.7;
}

.card-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.stack-tag {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    background: transparent;
    padding: 3px 8px;
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    text-transform: lowercase;
    letter-spacing: 0em;
    white-space: nowrap;
    transition: border-color var(--transition-fast), color var(--transition-fast);
}

.stack-tag:hover {
    border-color: rgba(74, 246, 38, 0.3);
    color: var(--text-secondary);
}

/* ==========================================================================
   Philosophy Section
   ========================================================================== */

.philosophy {
    padding: var(--space-xl) var(--space-md);
    max-width: 800px;
    margin: 0 auto;
}

/* Terminal Block */
.terminal-block {
    background: var(--void-darker);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: var(--space-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--glass-border);
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
}

.terminal-dot:nth-child(1) {
    background: #ff6159;
}

.terminal-dot:nth-child(2) {
    background: #ffc02f;
}

.terminal-dot:nth-child(3) {
    background: #28cd41;
}

.terminal-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: auto;
    transition: color var(--transition-base), text-shadow var(--transition-base);
}

.terminal-block:hover .terminal-title {
    color: var(--cyber-green);
    text-shadow: 0 0 10px rgba(74, 246, 38, 0.5);
}

.terminal-body {
    padding: var(--space-md);
}

.status-line {
    font-family: var(--font-mono);
    font-size: 1rem;
    margin-bottom: var(--space-xs);
    display: flex;
    gap: 4px;
}

.bracket {
    color: var(--text-muted);
}

.key {
    color: var(--cyber-green);
}

.value {
    color: var(--text-primary);
}

/* Philosophy Text */
.philosophy-text p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.9;
    text-align: center;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
    padding: var(--space-lg) var(--space-md);
    border-top: 1px solid var(--glass-border);
    background: linear-gradient(to bottom, transparent, rgba(74, 246, 38, 0.01));
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.footer-brand {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.separator {
    color: var(--cyber-green);
    margin: 0 4px;
}

.system-status {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--cyber-green);
    border-radius: 50%;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(74, 246, 38, 0.6);
    }

    50% {
        box-shadow: 0 0 0 12px rgba(74, 246, 38, 0);
    }
}

.status-text {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Reveal Animations
   ========================================================================== */

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--transition-slow) cubic-bezier(0.34, 1.56, 0.64, 1),
                transform var(--transition-slow) cubic-bezier(0.34, 1.56, 0.64, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    /* Hide grid on mobile for better performance */
    body::before {
        display: none;
    }

    /* Reduce grain animation complexity */
    body::after {
        animation: none;
    }

    /* Simplify glassmorphism on mobile */
    .card-inner {
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
    }

    .builds-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .hero {
        padding: var(--space-md);
    }

    .logo {
        width: 80vw;
        max-width: 400px;
    }

    /* Reduce hover effects on mobile (they're less useful) */
    .build-card:hover {
        transform: translateY(-4px);
    }

    /* Ensure touch targets meet minimum size */
    .terminal-dot {
        width: 12px;
        height: 12px;
    }

    .status-dot {
        width: 10px;
        height: 10px;
    }
}