@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg-color: #000000;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.4);
    
    --card-bg: #09090b;
    --card-border: rgba(255, 255, 255, 0.08);
    --card-border-hover: rgba(255, 255, 255, 0.2);
    
    --radius-bento: 32px;
    --radius-btn: 100px;
}

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

html {
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

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

/* Background Canvas */
#bg-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: -2;
    pointer-events: none;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.header {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 48px);
    max-width: 1000px;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 100px;
    z-index: 100;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
}

.logo {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.logo-dot {
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 12px 2px rgba(255,255,255,0.8);
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s;
}
.nav-links a:hover { color: #fff; }

.btn-nav {
    background: #fff;
    color: #000;
    padding: 10px 24px;
    border-radius: var(--radius-btn);
    font-weight: 600;
    font-size: 0.85rem;
    transition: transform 0.2s, background 0.2s;
}
.btn-nav:hover { transform: scale(1.03); background: #e2e8f0; }

/* Hero */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    scroll-snap-align: start;
    overflow: hidden;
}

.hero-badge {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 32px;
    color: #e2e8f0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 24px;
    color: #fff;
}
.hero h1 .gradient {
    background: linear-gradient(135deg, #fff 0%, #71717a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 650px;
    margin: 0 auto 40px;
}

/* CTA Buttons */
.hero-cta {
    display: flex;
    justify-content: center;
    gap: 16px;
}
.btn-primary {
    background: #fff;
    color: #000;
    padding: 14px 32px;
    border-radius: var(--radius-btn);
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s;
    box-shadow: 0 0 20px rgba(255,255,255,0.2);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(255,255,255,0.4);
}
.btn-secondary {
    background: rgba(255,255,255,0.05);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.1);
    padding: 14px 32px;
    border-radius: var(--radius-btn);
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s;
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
}

/* Bento Grid */
.bento-section {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 80px 0 0 0;
    scroll-snap-align: start;
    overflow: hidden;
}
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(300px, auto);
    gap: 24px;
}
.bento-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-bento);
    padding: 40px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}
.bento-card:hover {
    border-color: var(--card-border-hover);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4), inset 0 0 0 1px rgba(255,255,255,0.05);
}

.span-2x2 { grid-column: span 2; grid-row: span 2; }
.span-2x1 { grid-column: span 2; grid-row: span 1; }
.span-1x1 { grid-column: span 1; grid-row: span 1; }
.span-1x2 { grid-column: span 1; grid-row: span 2; }

.bento-card h3 {
    font-size: 1.75rem;
    margin-bottom: 12px;
    color: #fff;
    z-index: 2;
}
.bento-card p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
    z-index: 2;
}
.bento-icon {
    font-size: 2.5rem;
    margin-bottom: 24px;
    z-index: 2;
}

/* Small Cards specific (fix emptiness) */
.card-center {
    justify-content: center;
    align-items: center;
    text-align: center;
}
.card-center h3 { font-size: 1.5rem; }
.bg-watermark {
    position: absolute;
    font-size: 12rem;
    opacity: 0.02;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1;
}

/* Chart */
.bento-chart {
    flex: 1;
    margin-top: 32px;
    border-radius: 16px;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 150px;
}
.chart-bar {
    flex: 1;
    background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.02) 100%);
    border-radius: 8px 8px 0 0;
    transition: height 1s ease-in-out;
    position: relative;
}
.chart-bar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 2px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
}
.chart-bar.active { 
    background: linear-gradient(180deg, rgba(99,102,241,0.6) 0%, rgba(99,102,241,0.1) 100%); 
}
.chart-bar.active::before {
    background: #818cf8;
    box-shadow: 0 0 15px #818cf8;
}

/* Code Mockup */
.code-mockup {
    background: #09090b;
    border-radius: 16px;
    margin-top: 32px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: #a1a1aa;
    flex: 1;
    border: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.mockup-header {
    background: rgba(255,255,255,0.03);
    padding: 12px 16px;
    display: flex;
    gap: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.mockup-header i {
    width: 12px; height: 12px; border-radius: 50%;
}
.mockup-header i:nth-child(1) { background: #ff5f56; }
.mockup-header i:nth-child(2) { background: #ffbd2e; }
.mockup-header i:nth-child(3) { background: #27c93f; }
.mockup-body { padding: 24px; line-height: 1.7; }
.mockup-body span.keyword { color: #ff7b72; }
.mockup-body span.string { color: #a5d6ff; }
.mockup-body span.func { color: #d2a8ff; }
.mockup-body span.const { color: #79c0ff; }

/* Security Section */
.security-section {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 80px 0 0 0;
    scroll-snap-align: start;
    overflow: hidden;
}
.security-grid {
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 24px;
}
.alibi-card {
    background: #09090b;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-bento);
    padding: 60px;
    position: relative;
}
.alibi-card:hover {
    border-color: rgba(255,255,255,0.2);
}
.alibi-content {
    display: flex;
    gap: 40px;
    align-items: center;
}
.alibi-left {
    flex: 0 0 30%;
}
.alibi-left h3 {
    font-size: 2rem;
    color: #fff;
}
.alibi-left .bento-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}
.alibi-right {
    flex: 1;
    border-left: 1px solid rgba(255,255,255,0.1);
    padding-left: 40px;
}
.alibi-right p { font-size: 1.1rem; color: var(--text-muted); }

/* Footer */
.site-footer {
    border-top: 1px solid var(--card-border);
    background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, transparent 100%);
    height: 100vh;
    display: flex;
    flex-direction: column;
    scroll-snap-align: start;
    overflow: hidden;
    padding: 0;
}
.site-footer .container {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.footer-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 80px;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.footer-col h4 {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 8px;
}
.footer-col a {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color 0.2s;
}
.footer-col a:hover {
    color: #fff;
}
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 32px 0;
    border-top: 1px solid rgba(255,255,255,0.05);
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: auto;
}
.footer-socials {
    display: flex;
    gap: 24px;
}
.footer-socials a {
    color: var(--text-muted);
    transition: color 0.2s;
}
.footer-socials a:hover {
    color: #fff;
}

/* Scroll to Top Button */
.scroll-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 48px;
    height: 48px;
    background: #09090b;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.scroll-top:hover {
    background: #6366f1;
    border-color: #818cf8;
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}
/* Footer Links Grid */
.footer-links-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    max-width: 900px;
    margin: 0 auto 48px;
    text-align: left;
}

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

/* Tablet */
@media (max-width: 1024px) {
    .bento-grid { grid-template-columns: repeat(2, 1fr); }
    .span-2x2, .span-2x1 { grid-column: span 2; }
    .span-1x2 { grid-column: span 1; grid-row: span 1; }
    .alibi-content { flex-direction: column; align-items: flex-start; gap: 24px; }
    .alibi-right { border-left: none; padding-left: 0; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 24px; }
    .bento-section, .security-section { height: auto; min-height: 100vh; overflow: visible; }
    .alibi-card { padding: 40px; }
    .footer-links-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }
}

/* Mobile */
@media (max-width: 768px) {
    /* Disable scroll-snap on mobile */
    html { scroll-snap-type: none; }

    /* All sections become auto-height */
    .hero, .bento-section, .security-section, .site-footer {
        height: auto;
        min-height: auto;
        overflow: visible;
        scroll-snap-align: none;
    }

    /* Hero */
    .hero {
        padding: 120px 0 60px;
    }
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 0.95rem; margin-bottom: 32px; }
    .hero-badge { font-size: 0.7rem; padding: 6px 12px; margin-bottom: 24px; }
    .hero-cta { flex-direction: column; align-items: center; gap: 12px; }
    .hero-cta .btn-primary,
    .hero-cta .btn-secondary { width: 100%; text-align: center; padding: 14px 24px; }

    /* Header */
    .header {
        top: 12px;
        width: calc(100% - 24px);
    }
    .nav-wrapper { padding: 10px 16px; }
    .nav-links { display: none; }
    .logo { font-size: 1rem; }
    .btn-nav { padding: 8px 16px; font-size: 0.8rem; }

    /* Container */
    .container { padding: 0 16px; }

    /* Bento Grid */
    .bento-section { padding: 60px 0 40px; }
    .bento-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        gap: 16px;
    }
    .span-2x2, .span-2x1, .span-1x1, .span-1x2 {
        grid-column: span 1;
        grid-row: auto;
    }
    .bento-card {
        padding: 24px;
        border-radius: 20px;
    }
    .bento-card h3 { font-size: 1.3rem; }
    .bento-card p { font-size: 0.9rem; }
    .bento-icon { margin-bottom: 16px; }
    .bento-chart { height: 100px; margin-top: 20px; }

    /* Small cards — compact on mobile */
    .card-center {
        text-align: left;
        align-items: flex-start;
        padding: 24px;
    }
    .card-center h3 { font-size: 1.3rem !important; }
    .bg-watermark { display: none; }

    /* Code mockup */
    .code-mockup { font-size: 0.75rem; margin-top: 20px; }
    .mockup-body { padding: 16px; line-height: 1.5; }

    /* Security Section */
    .security-section { padding: 60px 0 40px; }
    .section-header h2 { font-size: 1.8rem !important; }
    .section-header p { font-size: 0.9rem !important; }
    .security-section .bento-grid { margin-bottom: 16px !important; }
    .security-grid { grid-template-columns: 1fr; }
    .alibi-card {
        padding: 20px;
        border-radius: 20px;
    }
    .alibi-content { flex-direction: row; gap: 16px; align-items: flex-start; }
    .alibi-left { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; flex-direction: column; }
    .alibi-left h3 { font-size: 1.1rem; }
    .alibi-left .bento-icon { margin-bottom: 0; }
    .alibi-left .bento-icon svg { width: 28px !important; height: 28px !important; }
    .alibi-right { border-left: none; padding-left: 0; border-top: none; padding-top: 0; }
    .alibi-right p { font-size: 0.8rem !important; line-height: 1.5; }

    /* Footer */
    .site-footer { padding: 60px 0 0; }
    .footer-main { padding-top: 60px; }
    .footer-main h2 { font-size: 1.8rem !important; }
    .footer-main > p { font-size: 0.95rem !important; }
    .footer-links-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 32px 16px;
        margin-bottom: 32px;
        text-align: left !important;
    }
    .footer-col { gap: 12px; }
    .footer-col h4 { font-size: 0.9rem; margin-bottom: 4px; }
    .footer-col a { font-size: 0.85rem; }
    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
        padding: 24px 0;
    }
    .footer-socials { flex-wrap: wrap; justify-content: center; gap: 16px; }

    /* Scroll-top button */
    .scroll-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }
}

/* Small phones */
@media (max-width: 420px) {
    .hero h1 { font-size: 1.7rem; }
    .bento-card { padding: 20px; }
    .alibi-card { padding: 16px; }
}
