/* =====================================================
   CSS Custom Properties
   ===================================================== */
:root {
    --bg:            #080d1a;
    --bg-alt:        #0d1526;
    --surface:       #111827;
    --surface-2:     #162033;
    --border:        #1e293b;
    --border-2:      #253347;

    --text:          #e2e8f0;
    --text-muted:    #8892a4;
    --text-dim:      #3d4f62;

    --primary:       #6366f1;
    --primary-soft:  #818cf8;
    --primary-glow:  rgba(99, 102, 241, 0.25);
    --cyan:          #06b6d4;
    --purple:        #a855f7;
    --success:       #10b981;

    --grad-brand:    linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --grad-text:     linear-gradient(135deg, #818cf8 0%, #c084fc 55%, #38bdf8 100%);

    --radius-sm:  8px;
    --radius:     12px;
    --radius-lg:  20px;
    --radius-xl:  28px;

    --shadow:     0 4px 32px rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 48px rgba(99, 102, 241, 0.18);

    --ease:       200ms ease;
    --ease-slow:  400ms ease;

    --font:       'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono:       'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

    --header-h:   72px;
    --max-w:      1200px;
}

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

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

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

a { color: inherit; text-decoration: none; }
img, svg { display: block; }
ul { list-style: none; }

.mono { font-family: var(--mono); }

/* =====================================================
   Layout
   ===================================================== */
.container {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 28px;
}

/* =====================================================
   Header & Nav
   ===================================================== */
.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    height: var(--header-h);
    display: flex;
    align-items: center;
    transition: background-color var(--ease), backdrop-filter var(--ease), border-color var(--ease);
    border-bottom: 1px solid transparent;
}

.header--scrolled {
    background-color: rgba(8, 13, 26, 0.88);
    backdrop-filter: blur(20px) saturate(1.2);
    border-bottom-color: var(--border);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    flex-shrink: 0;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--grad-brand);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.logo-accent {
    background: var(--grad-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.nav-links a {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color var(--ease), background-color var(--ease);
}

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

.nav-cta {
    display: flex !important;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border-2) !important;
    color: var(--text) !important;
}

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

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background-color var(--ease);
}

.nav-toggle:hover { background-color: var(--surface); }

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform var(--ease), opacity var(--ease);
    transform-origin: center;
}

.nav-toggle.is-open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.is-open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* =====================================================
   Hero
   ===================================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: calc(var(--header-h) + 48px) 0 100px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 90% 60% at 50% -5%,  rgba(99, 102, 241, 0.22) 0%, transparent 60%),
        radial-gradient(ellipse 55% 45% at 85% 65%,  rgba(168, 85, 247, 0.13) 0%, transparent 55%),
        radial-gradient(ellipse 65% 55% at -10% 80%, rgba(6, 182, 212, 0.09)  0%, transparent 50%);
}

.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(30, 41, 59, 0.25) 1px, transparent 1px),
        linear-gradient(90deg, rgba(30, 41, 59, 0.25) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 75%);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 760px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 10px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.28);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--primary-soft);
    margin-bottom: 28px;
    letter-spacing: 0.025em;
}

.badge-dot {
    width: 7px;
    height: 7px;
    background: var(--primary-soft);
    border-radius: 50%;
    animation: dotPulse 2.4s ease infinite;
}

@keyframes dotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.45; transform: scale(0.75); }
}

.hero-title {
    font-size: clamp(2.4rem, 5.5vw, 4.6rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
}

.gradient-text {
    background: var(--grad-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    color: var(--text-muted);
    max-width: 580px;
    margin-bottom: 40px;
    line-height: 1.75;
    font-weight: 400;
}

/* Buttons */
.hero-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 64px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: transform var(--ease), box-shadow var(--ease), opacity var(--ease), background-color var(--ease), border-color var(--ease);
    white-space: nowrap;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--grad-brand);
    color: #fff;
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.5);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border-color: var(--border-2);
}

.btn-outline:hover {
    background: var(--surface);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.btn--lg {
    padding: 14px 26px;
    font-size: 1rem;
}

/* Hero stats */
.hero-stats {
    display: flex;
    align-items: center;
    gap: 36px;
    flex-wrap: wrap;
}

.stat { text-align: left; }

.stat-value {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
    letter-spacing: -0.02em;
}

.stat-growing {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-dim);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-dim);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-top: 3px;
}

.stat-divider {
    width: 1px;
    height: 38px;
    background: var(--border);
}

/* Scroll indicator */
.hero-scroll {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-dim);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.scroll-line {
    width: 1px;
    height: 44px;
    background: linear-gradient(to bottom, var(--text-dim), transparent);
    animation: scrollAnim 2s ease infinite;
}

@keyframes scrollAnim {
    0%         { transform: scaleY(0); transform-origin: top; opacity: 1; }
    50%        { transform: scaleY(1); transform-origin: top; opacity: 1; }
    50.001%    { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
    100%       { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}

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

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

.section--cta {
    padding: 72px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-tag {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.22);
    border-radius: 100px;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--primary-soft);
    letter-spacing: 0.07em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.section-title {
    font-size: clamp(1.8rem, 3.2vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.15;
    margin-bottom: 14px;
}

.section-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.7;
}

/* =====================================================
   Scroll-in Animations (requires .js-animations on body)
   ===================================================== */
.js-animations .animate-in {
    opacity: 0;
    transform: translateY(22px);
}

.js-animations .animate-in.is-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

/* =====================================================
   Projects Grid
   ===================================================== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 24px;
    align-items: start;
}

/* Base project card */
.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease);
}

/* Featured card */
.project-card--featured {
    background: linear-gradient(145deg, var(--surface) 0%, rgba(99, 102, 241, 0.04) 100%);
    border-color: var(--border-2);
}

.project-card--featured:hover {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: var(--shadow-glow);
    transform: translateY(-5px);
}

/* Card header row */
.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.card-icon {
    width: 54px;
    height: 54px;
    flex-shrink: 0;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18) 0%, rgba(168, 85, 247, 0.12) 100%);
    border: 1px solid rgba(99, 102, 241, 0.28);
    color: var(--primary-soft);
}

.card-badges {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    justify-content: flex-end;
    padding-top: 2px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.73rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.badge--live {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.28);
    color: #34d399;
}

.badge--platform {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.22);
    color: #22d3ee;
}

.badge-pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #34d399;
    animation: livePulse 2s ease infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
    60%       { opacity: 0.7; box-shadow: 0 0 0 4px rgba(52, 211, 153, 0); }
}

/* Card body */
.card-body { flex: 1; }

.card-title {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.022em;
    line-height: 1.25;
    margin-bottom: 12px;
}

.card-description {
    color: var(--text-muted);
    font-size: 0.94rem;
    line-height: 1.75;
    margin-bottom: 20px;
}

.card-tags {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.tag {
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.73rem;
    font-weight: 500;
    color: var(--text-dim);
    font-family: var(--mono);
    letter-spacing: 0.02em;
    transition: color var(--ease), border-color var(--ease);
}

.project-card--featured:hover .tag {
    color: var(--text-muted);
    border-color: var(--border-2);
}

/* Card footer buttons */
.card-footer {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    transition: transform var(--ease), box-shadow var(--ease), background-color var(--ease), opacity var(--ease);
    flex: 1;
    min-width: 160px;
    border: 1px solid transparent;
}

.card-btn--primary {
    background: var(--grad-brand);
    color: #fff;
}

.card-btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    opacity: 0.9;
}

.card-btn--secondary {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border-2);
}

.card-btn--secondary:hover {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border-2);
}

/* Upcoming card */
.project-card--upcoming {
    background: transparent;
    border: 2px dashed var(--border);
    align-items: center;
    justify-content: center;
    min-height: 320px;
    transition: border-color var(--ease);
}

.project-card--upcoming:hover {
    border-color: var(--border-2);
}

.upcoming-inner {
    text-align: center;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.upcoming-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    margin-bottom: 20px;
}

.upcoming-inner h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.upcoming-inner p {
    font-size: 0.9rem;
    color: var(--text-dim);
    max-width: 260px;
    line-height: 1.65;
    margin-bottom: 24px;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-soft);
    border: 1px solid rgba(99, 102, 241, 0.28);
    transition: background-color var(--ease), border-color var(--ease);
}

.btn-ghost:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.5);
}

/* =====================================================
   Focus Cards
   ===================================================== */
.focus-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
}

.focus-card {
    padding: 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: transform var(--ease), border-color var(--ease);
}

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

.focus-icon {
    width: 48px;
    height: 48px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-soft);
    margin-bottom: 20px;
}

.focus-card h3 {
    font-size: 1.08rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    margin-bottom: 10px;
}

.focus-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.72;
}

/* =====================================================
   CTA Section
   ===================================================== */
.cta-card {
    background: linear-gradient(145deg, var(--surface) 0%, rgba(99, 102, 241, 0.05) 100%);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-xl);
    padding: 48px 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    flex-wrap: wrap;
}

.cta-content {
    display: flex;
    align-items: center;
    gap: 24px;
    flex: 1;
    min-width: 260px;
}

.cta-icon {
    width: 68px;
    height: 68px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
}

.cta-content h2 {
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    font-weight: 700;
    letter-spacing: -0.022em;
    margin-bottom: 6px;
}

.cta-content p {
    color: var(--text-muted);
    font-size: 0.93rem;
    line-height: 1.6;
    max-width: 400px;
}

/* =====================================================
   Footer
   ===================================================== */
.footer {
    background-color: var(--bg-alt);
    border-top: 1px solid var(--border);
    padding: 64px 0 32px;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    gap: 48px;
    flex-wrap: wrap;
    margin-bottom: 48px;
}

.footer-brand {
    max-width: 280px;
}

.footer-logo {
    margin-bottom: 14px;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.7;
}

.footer-nav {
    display: flex;
    gap: 60px;
    flex-wrap: wrap;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-col h4 {
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.footer-col a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text-muted);
    transition: color var(--ease);
    line-height: 1.5;
}

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

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}

.footer-bottom p {
    font-size: 0.83rem;
    color: var(--text-dim);
}

.footer-url {
    font-size: 0.78rem !important;
    letter-spacing: 0.02em;
}

/* =====================================================
   Responsive — Tablet (≤ 900px)
   ===================================================== */
@media (max-width: 900px) {
    .cta-card {
        padding: 36px;
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =====================================================
   Responsive — Mobile (≤ 768px)
   ===================================================== */
@media (max-width: 768px) {
    :root { --header-h: 64px; }

    .container { padding: 0 20px; }

    /* Mobile nav */
    .nav-links {
        display: none;
        position: fixed;
        top: var(--header-h);
        left: 0; right: 0;
        background: rgba(8, 13, 26, 0.97);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border);
        padding: 12px 20px 20px;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }

    .nav-links.is-open { display: flex; }

    .nav-links a {
        padding: 12px 14px;
        font-size: 0.95rem;
    }

    .nav-toggle { display: flex; }

    .hero { padding-top: calc(var(--header-h) + 40px); padding-bottom: 80px; }

    .hero-stats { gap: 18px 28px; }
    .stat-divider { display: none; }

    .section { padding: 80px 0; }
    .section-header { margin-bottom: 48px; }

    .projects-grid { grid-template-columns: 1fr; }
    .focus-grid    { grid-template-columns: 1fr; }

    .footer-top { flex-direction: column; gap: 36px; }
    .footer-brand { max-width: 100%; }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

/* =====================================================
   Responsive — Small Mobile (≤ 480px)
   ===================================================== */
@media (max-width: 480px) {
    .hero-actions { flex-direction: column; }
    .btn { justify-content: center; }

    .card-footer { flex-direction: column; }
    .card-btn { min-width: unset; }

    .cta-card { padding: 28px 20px; }
    .cta-icon { display: none; }
    .cta-content { flex-direction: column; align-items: flex-start; gap: 16px; }

    .footer-nav { gap: 32px; }
}

/* =====================================================
   Print
   ===================================================== */
@media print {
    .header, .hero-scroll, .nav-toggle { display: none !important; }
    body { background: white; color: black; }
    a { color: inherit; }
}
