/* ============================================
   Zed & Co — Design System
   ============================================ */

:root {
    /* Palette */
    --bg:          #0a0a0b;
    --bg-alt:      #0f0f11;
    --surface:     #161618;
    --border:      #1e1e22;
    --border-hover:#2a2a30;
    --text:        #e8e8ec;
    --text-muted:  #8a8a96;
    --text-dim:    #55555f;
    --accent:      #a78bfa;
    --accent-glow: rgba(167, 139, 250, 0.15);
    --accent-2:    #818cf8;
    --white:       #ffffff;

    /* Typography */
    --font:      'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

    /* Spacing */
    --section-pad: clamp(80px, 12vw, 160px);
}

/* ============================================
   Reset & Base
   ============================================ */

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ============================================
   Ambient Canvas
   ============================================ */

.ambient-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

img { max-width: 100%; display: block; }

/* ============================================
   Container
   ============================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(20px, 5vw, 48px);
}

/* ============================================
   Typography Utilities
   ============================================ */

.text-gradient {
    background: linear-gradient(135deg, var(--accent), var(--accent-2), #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mono {
    font-family: var(--font-mono);
    font-size: 0.875em;
    color: var(--accent);
}

.section-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 24px;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 20px;
}

.section-desc {
    color: var(--text-muted);
    font-size: 1.125rem;
    max-width: 600px;
    line-height: 1.7;
    margin-bottom: 48px;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: var(--bg);
    box-shadow: 0 0 24px var(--accent-glow), 0 1px 2px rgba(0,0,0,0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 40px rgba(167, 139, 250, 0.25), 0 4px 12px rgba(0,0,0,0.4);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    border-color: var(--border-hover);
    background: var(--surface);
}

.btn-lg {
    padding: 18px 36px;
    font-size: 1.0625rem;
    border-radius: 12px;
}

/* ============================================
   Navigation
   ============================================ */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0 clamp(20px, 5vw, 48px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav.scrolled {
    background: rgba(10, 10, 11, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 1.0625rem;
    letter-spacing: -0.02em;
}

.logo-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: var(--bg);
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 8px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 36px;
}

.nav-links a {
    font-size: 0.875rem;
    color: var(--text-muted);
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text);
}

.nav-cta {
    padding: 8px 20px !important;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text) !important;
    transition: all 0.2s !important;
}

.nav-cta:hover {
    border-color: var(--accent) !important;
    background: var(--accent-glow);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 1.5px;
    background: var(--text);
    transition: all 0.3s;
}

/* Mobile menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 11, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 99;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
}

.mobile-menu.open {
    display: flex;
}

.mobile-menu a {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s;
}

.mobile-menu a:hover {
    color: var(--text);
}

/* ============================================
   Hero
   ============================================ */

.hero {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 72px;
    overflow: hidden;
}

.hero-glow {
    position: absolute;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 600px;
    background: radial-gradient(
        ellipse at center,
        rgba(167, 139, 250, 0.12) 0%,
        rgba(129, 140, 248, 0.06) 40%,
        transparent 70%
    );
    pointer-events: none;
}

.hero-grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at 50% 50%, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 50%, black 20%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 720px;
}

.hero-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 28px;
    opacity: 0;
    animation: fadeUp 0.8s 0.2s forwards;
}

.hero-title {
    font-size: clamp(3rem, 7vw, 5.5rem);
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1.05;
    margin-bottom: 28px;
    opacity: 0;
    animation: fadeUp 0.8s 0.35s forwards;
}

.hero-subtitle {
    font-size: clamp(1.0625rem, 2vw, 1.25rem);
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 540px;
    margin-bottom: 44px;
    opacity: 0;
    animation: fadeUp 0.8s 0.5s forwards;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeUp 0.8s 0.65s forwards;
}

/* ============================================
   Sections
   ============================================ */

.section {
    position: relative;
    z-index: 1;
    padding: var(--section-pad) 0;
}

.section-alt {
    background: var(--bg-alt);
}

.footer {
    position: relative;
    z-index: 1;
}

/* ============================================
   About
   ============================================ */

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: start;
}

.about-statement h2 {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.about-detail p {
    color: var(--text-muted);
    font-size: 1.0625rem;
    line-height: 1.75;
    margin-bottom: 20px;
}

/* ============================================
   Services
   ============================================ */

.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: 48px;
}

.service-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Gradient shimmer on hover */
.service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(167, 139, 250, 0.06),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.5s;
}

.service-card:hover::before {
    opacity: 1;
}

/* Accent border glow */
.service-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 24px;
    right: 24px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
    transform: scaleX(0);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover::after {
    transform: scaleX(1);
}

.service-card:hover {
    border-color: rgba(167, 139, 250, 0.2);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 20px var(--accent-glow);
}

.service-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--accent-glow);
    color: var(--accent);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.service-card:hover .service-icon {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: var(--bg);
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--accent-glow);
}

.service-card h3 {
    font-size: 1.25rem;
    transition: color 0.4s;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.service-card p {
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.7;
}

/* ============================================
   Open Source
   ============================================ */

.oss-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px 48px;
    gap: 32px;
}

.oss-banner-content p {
    color: var(--text-muted);
    margin-top: 8px;
    font-size: 0.9375rem;
}

/* ============================================
   Products
   ============================================ */

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: 48px;
}

.product-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 48px 40px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.product-badge {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-glow);
    padding: 6px 12px;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 24px;
}

.product-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.product-card p {
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.7;
}

.product-line {
    position: absolute;
    bottom: 0;
    left: 40px;
    right: 40px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    opacity: 0;
    transition: opacity 0.4s;
}

.product-card:hover .product-line {
    opacity: 1;
}

/* ============================================
   Contact
   ============================================ */

.contact-block {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-block .section-desc {
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   Footer
   ============================================ */

.footer {
    border-top: 1px solid var(--border);
    padding: 48px 0;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 24px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.9375rem;
}

.footer-brand .logo-mark {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
    border-radius: 6px;
}

.footer-links {
    display: flex;
    gap: 28px;
}

.footer-links a {
    font-size: 0.875rem;
    color: var(--text-muted);
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--text);
}

.footer-copy {
    font-size: 0.8125rem;
    color: var(--text-dim);
}

/* ============================================
   Animations
   ============================================ */

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .services-grid,
    .products-grid {
        grid-template-columns: 1fr;
    }

    .oss-banner {
        flex-direction: column;
        text-align: center;
        padding: 32px;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
}
