:root {
    --bg-base: #080a09;
    --bg-surface: #0e1210;
    --bg-hover: #1a1f1c;
    --bg-elevated: #222826;
    
    --border-subtle: #1a1f1c;
    --border-standard: #262e2a;
    --border-prominent: #313b36;
    
    --text-primary: #fafafa;
    --text-secondary: #a8b0ac;
    --text-muted: #6b746f;
    
    --accent: #00e57c;
    --accent-hover: #0bf18b;
    --accent-dim: rgba(0, 229, 124, 0.15);
    --accent-border: rgba(0, 229, 124, 0.25);
    
    --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
    
    --radius-pill: 9999px;
    --radius-card: 16px;
    --radius-sm: 6px;
    
    --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    min-height: 100dvh;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    overflow-x: hidden;
}

/* Subtle noise texture overlay */
body::after {
    content: '';
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Breathing ambient glow */
@keyframes breathe {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.4; }
    50% { transform: translateX(-50%) scale(1.08); opacity: 0.7; }
}

body::before {
    content: '';
    position: absolute;
    top: -350px;
    left: 50%;
    transform: translateX(-50%);
    width: 1000px;
    height: 800px;
    background: radial-gradient(ellipse at center top, var(--accent-dim), transparent 70%);
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
    animation: breathe 8s ease-in-out infinite;
}

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

/* ─── Navbar ──────────────────────────────────────────── */
.navbar {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: rgba(8, 10, 9, 0.7);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.nav-container {
    height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo { display: flex; align-items: center; gap: 8px; }
.logo-img { width: 20px; height: 20px; }
.logo-text { font-weight: 500; font-size: 1rem; color: var(--text-primary); }

.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a:not(.btn) {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}
.nav-links a:not(.btn):hover { color: var(--text-primary); }

/* ─── Buttons ─────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 0.875rem; font-weight: 500;
    text-decoration: none; transition: var(--transition);
    cursor: pointer;
}

.btn-pill {
    background: var(--text-primary);
    color: var(--bg-base);
    padding: 10px 36px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--text-primary);
    position: relative;
}

.btn-pill:hover {
    opacity: 0.92;
    box-shadow: 0 0 24px rgba(0, 229, 124, 0.15);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-standard);
    padding: 10px 28px;
    border-radius: var(--radius-pill);
}
.btn-outline:hover {
    border-color: var(--border-prominent);
    background: rgba(255,255,255,0.02);
}

.btn-ghost {
    background: transparent;
    color: var(--text-primary);
    padding: 6px 12px;
    border: 1px solid transparent;
}
.btn-ghost:hover { background: rgba(255,255,255,0.05); }

/* ─── Language Dropdown ───────────────────────────────── */
.custom-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-right: 8px;
    color: var(--text-muted);
}

.dropdown-trigger .chevron {
    width: 14px; height: 14px;
    color: var(--text-muted);
    transition: transform 0.3s;
}

.custom-dropdown.open .chevron {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    width: 160px;
    background: var(--bg-surface);
    border: 1px solid var(--border-standard);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--transition);
    z-index: 100;
    max-height: 300px;
    overflow-y: auto;
}

.custom-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.lang-option:hover, .lang-option.active {
    background: rgba(255,255,255,0.04);
    color: var(--text-primary);
}

/* ─── Hero Section ────────────────────────────────────── */
.hero {
    padding: 160px 24px 100px;
    text-align: left;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.hero-title {
    font-size: clamp(3rem, 7vw, 5.5rem);
    font-weight: 400;
    line-height: 1.0;
    letter-spacing: -0.04em;
    margin-bottom: 24px;
    color: var(--text-primary);
    max-width: 800px;
}

/* Shimmer sweep on the hero title */
@keyframes shimmer {
    0% { background-position: 200% center; }
    100% { background-position: -200% center; }
}

.shimmer-text {
    background: linear-gradient(
        110deg,
        var(--text-primary) 0%,
        var(--text-primary) 35%,
        var(--accent) 42%,
        var(--text-primary) 49%,
        var(--text-primary) 100%
    );
    background-size: 300% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: shimmer 6s ease-in-out infinite;
}

/* Aurora gradient for localized <span> within hero title */
.hero-title span {
    background-image: linear-gradient(135deg, #FF0080, #7928CA, #0070F3, #38bdf8, #FF0080);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: aurora 8s linear infinite;
    display: inline-block;
}

@keyframes aurora {
    to { background-position: 200% center; }
}

.hero-desc {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin: 0 0 48px 0;
    max-width: 600px;
}

.hero-actions {
    display: flex; gap: 16px; justify-content: flex-start; flex-wrap: wrap; margin-bottom: 32px;
}

.tech-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
}

/* ─── Stagger Entrance Animations ─────────────────────── */
@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero children: immediately animate in on page load */
.hero-animation-area > .stagger-item {
    animation: fade-up 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.hero-animation-area > .stagger-item:nth-child(1) { animation-delay: 0.05s; }
.hero-animation-area > .stagger-item:nth-child(2) { animation-delay: 0.15s; }
.hero-animation-area > .stagger-item:nth-child(3) { animation-delay: 0.25s; }
.hero-animation-area > .stagger-item:nth-child(4) { animation-delay: 0.35s; }

/* Below-the-fold groups: hidden until IntersectionObserver triggers */
.features-grid .stagger-item {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.features-grid.in-view .stagger-item {
    opacity: 1;
    transform: translateY(0);
}

.features-grid.in-view .stagger-item:nth-child(1) { transition-delay: 0.05s; }
.features-grid.in-view .stagger-item:nth-child(2) { transition-delay: 0.12s; }
.features-grid.in-view .stagger-item:nth-child(3) { transition-delay: 0.19s; }
.features-grid.in-view .stagger-item:nth-child(4) { transition-delay: 0.26s; }

/* ─── Sticky Scroll Story ─────────────────────────────── */
.story-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

@media (max-width: 900px) {
    .story-layout { grid-template-columns: 1fr; gap: 40px; }
}

.story-text {
    padding-bottom: 50vh;
}

.story-step {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 0.2;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s;
    transform: translateX(-10px);
}

.story-step.is-active {
    opacity: 1;
    transform: translateX(0);
}

.step-marker {
    width: 2px;
    height: 40px;
    background: var(--border-standard);
    margin-bottom: 16px;
    position: relative;
    transition: background 0.4s, box-shadow 0.4s;
}
.story-step.is-active .step-marker {
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent-border);
}

.story-step h3 {
    font-size: 2rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    line-height: 1.2;
}

.story-step p {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* ─── Sticky Terminal ─────────────────────────────────── */
.story-visual {
    position: relative;
    height: 100%;
}

.sticky-terminal {
    position: sticky;
    top: max(20vh, 120px);
    background: linear-gradient(160deg, #0d100e 0%, #060806 100%);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    overflow: hidden;
    height: 420px;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 40px 80px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255,255,255,0.03) inset,
        0 1px 0 rgba(255,255,255,0.04) inset;
}

/* CRT scanlines */
.sticky-terminal::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 1px,
        rgba(0, 0, 0, 0.15) 1px,
        rgba(0, 0, 0, 0.15) 2px
    );
    pointer-events: none;
    z-index: 3;
    opacity: 0.3;
}

.term-header {
    background: rgba(255,255,255,0.015);
    border-bottom: 1px solid var(--border-subtle);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.term-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border-prominent); }
.term-dot:nth-child(1) { background: #ff5f57; }
.term-dot:nth-child(2) { background: #febc2e; }
.term-dot:nth-child(3) { background: #28c840; }

.term-title {
    flex: 1; text-align: center; font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted);
}

.term-body {
    padding: 24px;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--text-primary);
    overflow-y: auto;
    flex: 1;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.term-body::-webkit-scrollbar {
    display: none;
}

.t-line { opacity: 0; padding-bottom: 8px; }
.t-line.visible { opacity: 1; }

.t-prompt { color: var(--accent); margin-right: 8px; font-weight: 500; }
.t-wait { color: #ebbf5a; }
.t-dim { color: var(--text-muted); }
.t-success { color: var(--accent); }

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.cursor {
    display: inline-block; width: 6px; height: 14px;
    background: var(--text-secondary);
    animation: blink 1s step-end infinite;
    vertical-align: middle; margin-left: 4px;
}

/* ─── Features Grid ───────────────────────────────────── */
.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 100px 24px;
    max-width: 1000px;
    margin: 0 auto;
}

/* Card wrapper: provides the rotating glow border effect */
@keyframes glow-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.f-card {
    position: relative;
    border-radius: var(--radius-card);
    overflow: hidden;
    /* 1px padding creates space for the inner to sit inside, showing glow around it */
    padding: 1px;
    background: var(--border-subtle);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.f-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.4);
}

/* Spinning conic glow - hidden until hover */
.f-card-glow {
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: conic-gradient(from 0deg, transparent 55%, var(--accent) 75%, transparent 100%);
    animation: glow-spin 3s linear infinite;
    opacity: 0;
    transition: opacity 0.4s;
    z-index: 1;
}

.f-card:hover .f-card-glow {
    opacity: 1;
}

/* Inner card content */
.f-card-inner {
    position: relative;
    z-index: 2;
    background: var(--bg-surface);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: calc(var(--radius-card) - 1px);
    padding: 32px;
    height: 100%;
}

.f-card h3 {
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.f-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.f-card .tech-label {
    display: block;
    margin-bottom: 16px;
    color: var(--accent);
    opacity: 0.7;
}

/* ─── FAQ ─────────────────────────────────────────────── */
.faq-section {
    padding: 100px 24px;
    max-width: 800px;
    margin: 0 auto;
}

.faq-section h2 {
    font-size: 2.25rem; font-weight: 400; margin-bottom: 48px; letter-spacing: -0.02em;
}

.faq-list {
    border-top: 1px solid var(--border-standard);
}

.faq-item {
    border-bottom: 1px solid var(--border-standard);
    padding: 24px 0;
}

.faq-item h4 { font-size: 1.125rem; font-weight: 400; margin-bottom: 12px; }
.faq-item p { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.6; }

/* ─── Install / CTA ───────────────────────────────────── */
.install-box {
    margin-bottom: 16px;
    padding: 16px 24px;
    background: var(--bg-base);
    border: 1px solid var(--border-standard);
    border-radius: var(--radius-sm);
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

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

/* ─── OS Selector ─────────────────────────────────────── */
.os-selector-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
}

.os-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.os-btn:hover {
    color: var(--text-secondary);
}

.os-btn.active {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border-standard);
}

/* ─── Footer ──────────────────────────────────────────── */
.footer {
    border-top: 1px solid var(--border-subtle);
    padding: 64px 24px;
    margin-top: 40px;
    background: var(--bg-base);
}

.footer-top {
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 48px;
    max-width: 1200px; margin: 0 auto;
}

.footer-brand .footer-name {
    font-family: var(--font-mono); font-weight: 500; font-size: 1.125rem;
    display: block; margin-bottom: 4px;
}

.footer-brand p { color: var(--text-muted); font-size: 0.875rem; }

.footer-links { display: flex; gap: 64px; }
.link-col { display: flex; flex-direction: column; gap: 12px; }
.link-col strong { font-size: 0.875rem; font-weight: 500; color: var(--text-primary); }
.link-col a { color: var(--text-muted); text-decoration: none; font-size: 0.875rem; transition: var(--transition); }
.link-col a:hover { color: var(--text-primary); }

/* ─── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
    .features-grid { grid-template-columns: 1fr; }
    
    .cta-grid {
        grid-template-columns: 1fr;
        gap: 32px;
        text-align: center;
    }
    .cta-grid > div {
        text-align: center !important;
        align-items: center !important;
        justify-content: center !important;
    }
    .cta-grid .install-box {
        margin: 0 auto 16px auto;
        text-align: center !important;
    }
    .cta-grid .os-selector-wrap, .cta-grid .install-box + div {
        justify-content: center !important;
    }
    
    .footer-top {
        flex-direction: column;
        gap: 40px;
    }
    .footer-links {
        flex-wrap: wrap;
        gap: 40px;
    }

    .nav-links a:not(.btn):not(.dropdown-trigger) {
        display: none;
    }
}
