/* ============================================
   IVA-CORTEX DESIGN SYSTEM
   Dark theme with red accent
   ============================================ */

:root {
    /* === Surface Palette === */
    --canvas: #0a0a14;
    --canvas-soft: #0d0d18;
    --surface-1: #12121e;
    --surface-2: #161625;
    --surface-3: #1a1a2e;
    --surface-4: #1e1e35;

    --hairline: #222238;
    --hairline-strong: #2e2e48;
    --hairline-tertiary: #3a3a55;

    /* === Ink (text) === */
    --ink: #f0f0f5;
    --ink-90: rgba(240, 240, 245, 0.9);
    --ink-70: rgba(240, 240, 245, 0.7);
    --ink-50: rgba(240, 240, 245, 0.5);
    --ink-30: rgba(240, 240, 245, 0.3);
    --ink-15: rgba(240, 240, 245, 0.15);
    --ink-08: rgba(240, 240, 245, 0.08);

    /* === Brand === */
    --accent: #e94560;
    --accent-hover: #d63050;
    --accent-glow: rgba(233, 69, 96, 0.15);
    --accent-subtle: rgba(233, 69, 96, 0.08);

    /* === Semantic === */
    --success: #34d399;
    --warning: #fbbf24;
    --error: #f87171;
    --info: #60a5fa;

    /* === Typography === */
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* === Font Sizes === */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;

    /* === Spacing === */
    --sp-2xs: 4px;
    --sp-xs: 8px;
    --sp-sm: 12px;
    --sp-md: 16px;
    --sp-lg: 24px;
    --sp-xl: 32px;
    --sp-2xl: 48px;
    --sp-3xl: 64px;

    /* === Border Radius === */
    --r-sm: 6px;
    --r-md: 8px;
    --r-lg: 12px;
    --r-xl: 16px;
    --r-full: 9999px;

    /* === Transitions === */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 400ms;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--canvas);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color var(--duration-fast); }
a:hover { color: var(--ink); }

img { max-width: 100%; height: auto; }

/* === Typography === */
.heading-hero {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.heading-1 { font-size: var(--text-3xl); font-weight: 700; line-height: 1.2; }
.heading-2 { font-size: var(--text-2xl); font-weight: 600; line-height: 1.3; }
.heading-3 { font-size: var(--text-xl); font-weight: 600; line-height: 1.4; }
.heading-4 { font-size: var(--text-lg); font-weight: 600; line-height: 1.4; }

.body-lg { font-size: var(--text-lg); line-height: 1.7; }
.body-md { font-size: var(--text-base); line-height: 1.6; }
.body-sm { font-size: var(--text-sm); line-height: 1.5; }

.caption {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
}

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

/* === Layout === */
.container { max-width: 1200px; margin: 0 auto; padding: 0 var(--sp-lg); }
.text-center { text-align: center; }
.mb-xs { margin-bottom: var(--sp-xs); }
.mb-sm { margin-bottom: var(--sp-sm); }
.mb-md { margin-bottom: var(--sp-md); }
.mb-lg { margin-bottom: var(--sp-lg); }
.mb-xl { margin-bottom: var(--sp-xl); }
.mb-2xl { margin-bottom: var(--sp-2xl); }
.mt-xs { margin-top: var(--sp-xs); }
.mt-sm { margin-top: var(--sp-sm); }
.mt-md { margin-top: var(--sp-md); }
.mt-lg { margin-top: var(--sp-lg); }
.mt-xl { margin-top: var(--sp-xl); }

/* === Cards === */
.card {
    background: var(--surface-1);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    padding: var(--sp-lg);
    transition: all var(--duration-normal) var(--ease-out);
}

.card:hover {
    border-color: var(--hairline-strong);
    transform: translateY(-2px);
}

.card-glow {
    position: relative;
    overflow: hidden;
}

.card-glow::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, var(--accent), transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity var(--duration-slow);
}

.card-glow:hover::before { opacity: 0.4; }

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-xs);
    padding: 12px 24px;
    border-radius: var(--r-md);
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all var(--duration-normal) var(--ease-out);
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-secondary {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--hairline-strong);
}

.btn-secondary:hover {
    background: var(--surface-3);
    border-color: var(--ink-15);
    color: var(--ink);
}

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

.btn-ghost:hover {
    color: var(--ink);
    border-color: var(--ink-15);
}

.btn-lg { padding: 16px 32px; font-size: var(--text-base); }
.btn-sm { padding: 8px 16px; font-size: var(--text-xs); }
.btn-block { width: 100%; }

/* === Forms === */
.form-group { margin-bottom: var(--sp-md); }

.form-label {
    display: block;
    font-size: var(--text-sm);
    color: var(--ink-50);
    margin-bottom: var(--sp-xs);
    font-weight: 500;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface-3);
    border: 1px solid var(--hairline);
    border-radius: var(--r-md);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    outline: none;
    transition: border-color var(--duration-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--accent);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--ink-30);
}

.form-textarea { resize: vertical; min-height: 100px; }

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* === Navigation === */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 10, 20, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--hairline);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--sp-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.nav-logo {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: var(--sp-lg);
    align-items: center;
}

.nav-links a {
    color: var(--ink-50);
    text-decoration: none;
    font-size: var(--text-sm);
    transition: color var(--duration-fast);
}

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

.nav-cta {
    background: var(--accent);
    color: #fff !important;
    padding: 8px 20px;
    border-radius: var(--r-md);
    font-weight: 600;
}

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

/* === Sections === */
.section {
    padding: 128px 0;
}

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

.section-header {
    text-align: center;
    margin-bottom: var(--sp-3xl);
}

/* === Badges === */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-xs);
    padding: 6px 16px;
    border: 1px solid var(--hairline);
    border-radius: var(--r-full);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--ink-50);
}

.badge-accent {
    border-color: var(--accent);
    color: var(--accent);
}

/* === Grid === */
.grid { display: grid; gap: var(--sp-lg); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* === Animations === */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-in {
    animation: fadeInUp 0.6s var(--ease-out) both;
}

/* === Responsive === */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .section { padding: 64px 0; }
    .container { padding: 0 var(--sp-md); }
}
