:root {
    --bg: #000000;
    --bg-grid: #050a06;
    --surface: #0a0a0a;
    --surface-alt: #000000;
    --border-dim: rgba(0, 255, 65, 0.2);
    --border-bright: #00ff41;
    --accent: #00ff41;
    /* Matrix Green */
    --accent-secondary: #00f3ff;
    /* Cyber Cyan */
    --text-main: #f0f0f0;
    --text-dim: #708090;
    --font-mono: "JetBrains Mono", "Courier New", monospace;
    --font-sans: "Inter", system-ui, sans-serif;
    --header-height: 70px;
    --container-width: 1200px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    background-color: var(--bg);
}

body {
    margin: 0;
    padding: 0;
    background-color: transparent;
    /* Allow canvas at z-index 0 to show */
    color: var(--text-main);
    font-family: var(--font-sans);
    overflow-x: hidden;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(0deg,
            rgba(0, 0, 0, 0.15),
            rgba(0, 0, 0, 0.15) 1px,
            transparent 1px,
            transparent 2px);
    pointer-events: none;
    z-index: 9999;
    opacity: 0.3;
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    /* Changed from -1 to 0 for visibility */
    pointer-events: none;
}

/* Typography */
h1,
h2,
h3,
.logo,
.eyebrow,
.nav-cta,
.metric-value,
.hero-chip {
    font-family: var(--font-mono);
    letter-spacing: -0.02em;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Layout */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 2;
}

.section {
    padding: 120px 0;
    position: relative;
    z-index: 1;
    border-bottom: 1px solid rgba(0, 255, 65, 0.05);
}

.section-alt {
    background-color: #020202;
}

/* Header */
.site-header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    border-bottom: 1px solid var(--border-dim);
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.header-inner {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

.main-nav {
    display: flex;
    gap: 32px;
}

.main-nav a {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-dim);
    transition: color 0.2s;
    letter-spacing: 0.05em;
    font-family: var(--font-mono);
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--accent);
    text-shadow: 0 0 8px rgba(0, 255, 65, 0.4);
}

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--header-height);
}

.hero-inner {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 60px;
    align-items: center;
}

.eyebrow {
    display: block;
    font-size: 0.9rem;
    color: var(--accent-secondary);
    margin-bottom: 16px;
    text-transform: uppercase;
    position: relative;
    padding-left: 14px;
}

.eyebrow::before {
    content: ">";
    position: absolute;
    left: 0;
    color: var(--accent);
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
    margin: 0 0 24px;
    background: linear-gradient(to right, #fff, #aaa);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.lead {
    font-size: 1.05rem;
    color: var(--text-dim);
    line-height: 1.8;
    max-width: 38em;
    margin-bottom: 40px;
}

/* Buttons */
.hero-actions {
    display: flex;
    gap: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 28px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    text-transform: uppercase;
    border: 1px solid var(--accent);
    color: var(--accent);
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--accent);
    transition: left 0.3s ease;
    z-index: -1;
}

.btn:hover {
    color: #000;
}

.btn:hover::before {
    left: 0;
}

.btn.ghost {
    border-color: var(--text-dim);
    color: var(--text-dim);
}

.btn.ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: #fff;
}

.btn.ghost::before {
    display: none;
}

/* HUD Card (Hero Visual) */
.hero-card {
    position: relative;
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid var(--border-dim);
    padding: 24px;
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.05);
}

/* HUD Corners */
.hero-card::after,
.hero-card::before,
.card-grid .card::after,
.card-grid .card::before {
    content: "";
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.hero-card::before {
    top: -1px;
    left: -1px;
    border-top-color: var(--accent);
    border-left-color: var(--accent);
}

.hero-card::after {
    bottom: -1px;
    right: -1px;
    border-bottom-color: var(--accent);
    border-right-color: var(--accent);
}

.hero-chip {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--bg);
    background: var(--accent-secondary);
    padding: 4px 12px;
    margin-bottom: 20px;
    font-weight: 700;
}

.hero-metrics {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-dim);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.metric-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.metric-value {
    font-size: 1.5rem;
    color: var(--text-main);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.hero-grid span {
    font-size: 0.8rem;
    font-family: var(--font-mono);
    color: var(--accent-secondary);
    border: 1px solid rgba(0, 243, 255, 0.3);
    padding: 8px;
    text-align: center;
    background: rgba(0, 243, 255, 0.05);
}

/* Sections */
.section-header {
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2rem;
    margin: 10px 0;
    text-transform: uppercase;
}

/* Cards (Approach / Services / Works) */
.card-grid,
.works-grid {
    display: grid;
    gap: 24px;
}

.card-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.works-grid {
    grid-template-columns: repeat(3, 1fr);
}

.card {
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-dim);
    padding: 32px;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.1);
    transform: translateY(-2px);
}

.card h3 {
    font-size: 1.1rem;
    margin: 0 0 12px;
    color: var(--accent-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card p {
    font-size: 0.95rem;
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 0;
}

.card .text-muted {
    font-size: 0.9rem;
    margin-top: 12px;
    display: block;
}

.work-tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 2px 8px;
    display: inline-block;
    margin-bottom: 12px;
}

/* About Layout */
.about-layout {
    border-left: 2px solid var(--border-dim);
    padding-left: 40px;
}

/* Footer */
.site-footer {
    padding: 40px 0;
    border-top: 1px solid var(--border-dim);
    text-align: center;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

/* Glitch Animation Class (Applied via JS or specific elements) */
.glitch-text {
    position: relative;
}

/* Simple glitch hover effect for headers */
h2:hover {
    animation: glitch-anim 0.3s infinite;
}

@keyframes glitch-anim {
    0% {
        transform: translate(0, 0);
    }

    20% {
        transform: translate(-2px, 2px);
    }

    40% {
        transform: translate(-2px, -2px);
    }

    60% {
        transform: translate(2px, 2px);
    }

    80% {
        transform: translate(2px, -2px);
    }

    100% {
        transform: translate(0, 0);
    }
}

/* Responsive */
@media (max-width: 900px) {
    .hero-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-visual {
        display: flex;
        justify-content: center;
        margin-top: 40px;
    }

    .works-grid {
        grid-template-columns: 1fr;
    }

    .eyebrow {
        display: inline-block;
    }

    .main-nav {
        display: none;
    }

    /* Simplified for mobile */
}

/* Stagger & Reveal base styles */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}