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

body {
    font-family: var(--font-family-base);
    background-color: var(--color-bg-body);
    color: var(--color-text-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    position: relative;
    /* For cursor glow positioning */
}

/* Cursor Glow Effect */
.cursor-glow {
    pointer-events: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 1000px;
    height: 1000px;
    background: radial-gradient(circle, rgba(255, 109, 90, 0.25) 0%, rgba(255, 109, 90, 0.05) 40%, rgba(255, 255, 255, 0) 70%);
    transform: translate(-50%, -50%);
    /* Center on cursor */
    z-index: 9999;
    opacity: 0;
    /* Hidden initially until mouse moves */
    transition: opacity 0.5s ease;
    mix-blend-mode: screen;
    /* Nice blending with dark bg */
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

ul {
    list-style: none;
}

/* Typography Overrides for n8n style */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--color-text-main);
    letter-spacing: -0.02em;
}

/* Utility Classes */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-4);
    width: 100%;
}

.text-gradient {
    color: #ff6d5a;
    background: linear-gradient(90deg, #ff8f70 0%, #ff6d5a 40%, #ff4f4f 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
    /* Force new line for the gradient part usually */
    margin-top: 0.2rem;
    position: relative;
    z-index: 2;
}

/* Glow behind text */
.hero-text {
    position: relative;
}

.hero-text::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 109, 90, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    transform: translate(-50%, -50%);
    z-index: -1;
    pointer-events: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 12px;
    /* Slightly squarer rounded corners as per image */
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    line-height: 1.5;
}

.btn-primary {
    background: var(--color-primary-gradient);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(230, 80, 50, 0.3);
    /* Subtle inner border for depth */
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(255, 77, 77, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-text-main);
}

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

.btn-outline {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
}

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

/* Header */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: rgba(11, 13, 23, 0.8);
    /* Dark semi-transparent */
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    z-index: 1000;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.03em;
}

.logo-icon {
    display: none;
    /* Hide old icon if present */
}

.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.nav-links {
    display: flex;
    gap: var(--spacing-6);
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

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

.nav-actions {
    display: flex;
    gap: var(--spacing-3);
    align-items: center;
}

.theme-toggle-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--color-border);
    color: var(--color-text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: var(--color-border-hover);
}

[data-theme="light"] .navbar {
    background-color: rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .card {
    background-color: #ffffff;
}

[data-theme="light"] .modal-content {
    background-color: #ffffff;
    color: #0f172a;
}

[data-theme="light"] .form-input {
    background: #f8fafc;
    color: #0f172a;
    border-color: #e2e8f0;
}

[data-theme="light"] .form-input:focus {
    border-color: var(--color-primary);
    background: #ffffff;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
}

.mobile-menu-btn span {
    width: 24px;
    height: 2px;
    background-color: var(--color-text-main);
}

/* Hero Section */
.hero {
    padding-top: calc(var(--header-height) + var(--spacing-16));
    padding-bottom: var(--spacing-16);
    position: relative;
    overflow: hidden;
}

/* Background grid for n8n feel */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -1;
    mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
    -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-12);
    align-items: center;
}

.hero-text {
    max-width: 600px;
    z-index: 2;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background-color: rgba(255, 109, 90, 0.1);
    border: 1px solid rgba(255, 109, 90, 0.3);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    color: #ff6d5a;
    margin-bottom: var(--spacing-6);
}

.hero h1 {
    font-size: 3.5rem;
    /* Large and bold */
    line-height: 1.2;
    margin-bottom: var(--spacing-6);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.hero-sub {
    font-size: 1.125rem;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-8);
    font-weight: 300;
}

.hero-actions {
    display: flex;
    gap: var(--spacing-4);
    margin-bottom: var(--spacing-12);
}

.tech-stack-icons {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.tech-stack-icons .logos {
    display: flex;
    gap: var(--spacing-6);
    margin-top: var(--spacing-4);
    opacity: 0.7;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Hero Visual - Animated Nodes */
.hero-visual {
    position: relative;
    height: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
}

.visual-card-stack {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}

.card {
    position: absolute;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), var(--shadow-lg);
    background-color: #1a1d26;
    /* Slightly lighter than body */
    overflow: hidden;
}

.card-back {
    top: 40px;
    right: 40px;
    width: 300px;
    height: 300px;
    opacity: 0.3;
    transform: translateZ(-50px);
    z-index: 1;
    background: linear-gradient(135deg, #1a1d26, #0b0d17);
}

.card-mid {
    top: 20px;
    right: 100px;
    width: 320px;
    height: 320px;
    opacity: 0.6;
    transform: translateZ(-25px);
    z-index: 2;
    background: linear-gradient(135deg, #1f232e, #0f1115);
}

.card-front {
    top: 0;
    right: 160px;
    /* Centered visually roughly */
    width: 400px;
    display: flex;
    flex-direction: column;
    z-index: 3;
    transform: translateZ(0);
}

.code-header {
    height: 44px;
    border-bottom: 1px solid var(--color-border);
    background-color: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    padding: 0 var(--spacing-4);
    gap: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.red {
    background-color: #ff5f56;
}

.dot.yellow {
    background-color: #ffbd2e;
}

.dot.green {
    background-color: #27c93f;
}

.code-content {
    padding: var(--spacing-8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}

.node-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-4);
    width: 100%;
}

.node {
    padding: 12px 20px;
    border-radius: var(--radius-md);
    background: linear-gradient(145deg, #2a2e3b, #1f232e);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.node::after {
    content: '●';
    color: var(--color-primary);
    font-size: 10px;
    position: absolute;
    right: 15px;
}

.node.start {
    border-left: 3px solid var(--color-primary);
}

.node.process {
    border-left: 3px solid #ffbd2e;
}

.node.output {
    border-left: 3px solid #27c93f;
}

.connector {
    width: 2px;
    height: 20px;
    background-color: var(--color-border);
    position: relative;
}

/* Features */
.features {
    padding: var(--spacing-16) 0;
    background-color: var(--color-bg-surface);
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto var(--spacing-12) auto;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-4);
    color: white;
}

.section-header p {
    color: var(--color-text-muted);
    font-size: 1.1rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-6);
}

.feature-card {
    background-color: var(--color-bg-card);
    padding: var(--spacing-8);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

/* Hover glow for cards */
.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 109, 90, 0.5), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    background-color: var(--color-bg-card-hover);
    border-color: rgba(255, 109, 90, 0.3);
}

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

.icon-box {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, rgba(255, 109, 90, 0.1), rgba(255, 109, 90, 0.05));
    color: var(--color-primary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: var(--spacing-6);
    border: 1px solid rgba(255, 109, 90, 0.1);
}

.feature-card h3 {
    margin-bottom: var(--spacing-2);
    font-size: 1.25rem;
    color: white;
}

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

/* CTA Section / Contacts */
.cta-section {
    padding: var(--spacing-16) 0;
}

.cta-box {
    background: linear-gradient(180deg, #1a1d26 0%, #0b0d17 100%);
    border: 1px solid var(--color-border);
    color: white;
    padding: var(--spacing-12);
    border-radius: var(--radius-xl);
    position: relative;
}

/* Footer */
footer {
    border-top: 1px solid var(--color-border);
    padding: var(--spacing-12) 0;
    margin-top: var(--spacing-16);
    background-color: #080910;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--spacing-8);
}

.footer-col h4 {
    font-weight: 600;
    margin-bottom: var(--spacing-4);
    color: white;
}

.footer-col a {
    color: var(--color-text-muted);
    display: block;
    margin-bottom: var(--spacing-2);
    font-size: 0.9rem;
}

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

/* Responsive */
@media (max-width: 900px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-text {
        max-width: 100%;
    }

    .hero-visual {
        display: none;
        /* Hide complex visual on mobile or simplify it */
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .nav-links,
    .nav-actions {
        display: none;
    }

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

    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

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

@keyframes scanMove {
    0% {
        top: 0;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        top: 100%;
        opacity: 0;
    }
}

/* Scan reveal animation - moves down then back up */
@keyframes scanReveal {
    0% {
        top: 5%;
        opacity: 0;
    }

    5% {
        opacity: 1;
    }

    /* Move down - revealing skull */
    45% {
        top: 95%;
        opacity: 1;
    }

    50% {
        top: 95%;
        opacity: 1;
    }

    /* Move back up - hiding skull */
    95% {
        top: 5%;
        opacity: 1;
    }

    100% {
        top: 5%;
        opacity: 0;
    }
}

/* Skin overlay animation synced with scan line */
.skin-overlay>img,
.skin-overlay>div {
    animation: skinReveal 6s infinite ease-in-out;
}

@keyframes skinReveal {
    0% {
        clip-path: inset(0 0 95% 0);
    }

    /* Skin grows as line goes down (covering skull) */
    45% {
        clip-path: inset(0 0 5% 0);
    }

    50% {
        clip-path: inset(0 0 5% 0);
    }

    /* Skin shrinks as line goes up (revealing skull) */
    95% {
        clip-path: inset(0 0 95% 0);
    }

    100% {
        clip-path: inset(0 0 95% 0);
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #1a1d26;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--spacing-8);
    width: 100%;
    max-width: 450px;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
}

.modal-close:hover {
    color: white;
}

.form-group {
    margin-bottom: var(--spacing-6);
    text-align: left;
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-2);
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: white;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: rgba(255, 255, 255, 0.08);
}

/* Mobile Menu Overlay */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--color-bg-body);
    z-index: 999;
    padding: calc(var(--header-height) + 2rem) var(--spacing-6) var(--spacing-6);
    display: none;
    /* Changed from flex to none, then flex on active */
    flex-direction: column;
    gap: var(--spacing-4);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1), opacity 0.3s ease;
    opacity: 0;
}

.mobile-menu.active {
    display: flex;
    /* Activate flex here */
    transform: translateX(0);
    opacity: 1;
}

.mobile-menu .nav-links-mobile {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
    width: 100%;
}

.mobile-menu .nav-links-mobile a {
    font-size: 1.1rem;
    color: white;
    padding: var(--spacing-2) 0;
    border-bottom: 1px solid var(--color-border);
    width: 100%;
    text-decoration: none;
}

.mobile-menu .nav-actions-mobile {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
    margin-top: var(--spacing-4);
    width: 100%;
}

.mobile-menu .btn {
    width: 100%;
    justify-content: center;
    display: flex;
}

/* Hamburger Animation classes are already toggled by JS */
.mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}
/* Light Theme Visibility Fixes */
[data-theme="light"] {
    --color-bg-body: #f8fafc;
    --color-bg-surface: #ffffff;
    --color-text-main: #0f172a;
    --color-text-muted: #64748b;
    --color-border: #e2e8f0;
}

[data-theme="light"] .navbar {
    background-color: rgba(255, 255, 255, 0.8);
    border-bottom-color: #e2e8f0;
}

[data-theme="light"] .hero h1 {
    color: #0f172a;
}

[data-theme="light"] .btn-outline {
    background-color: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

[data-theme="light"] .btn-outline:hover {
    background-color: #f1f5f9;
    border-color: #94a3b8;
}

[data-theme="light"] .section-header h2 {
    color: #0f172a;
}

[data-theme="light"] .feature-card {
    background-color: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .feature-card h3 {
    color: #0f172a;
}

[data-theme="light"] .cta-box {
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
    color: #0f172a;
    border-color: #cbd5e1;
}

[data-theme="light"] .cta-box h2 {
    color: #0f172a;
}

[data-theme="light"] .cta-box div[style*="filter: invert(90%)"] {
    filter: none !important;
    border: 1px solid #e2e8f0 !important;
}

[data-theme="light"] footer {
    background-color: #f1f5f9;
    border-top-color: #e2e8f0;
}

[data-theme="light"] footer .logo {
    color: #0f172a;
}

[data-theme="light"] footer p, 
[data-theme="light"] footer .footer-col h4 {
    color: #0f172a;
}

[data-theme="light"] footer .footer-col a {
    color: #64748b;
}

[data-theme="light"] footer .footer-col a:hover {
    color: var(--color-primary);
}

[data-theme="light"] .mobile-menu {
    background-color: #ffffff;
}

[data-theme="light"] .mobile-menu .nav-links-mobile a {
    color: #0f172a;
    border-bottom-color: #f1f5f9;
}

[data-theme="light"] .mobile-menu-btn span {
    background-color: #0f172a;
}

/* Cost Page Light Theme Adjustments */
[data-theme="light"] .price-section-title {
    color: #0f172a;
}

[data-theme="light"] .price-hero h1 {
    color: #0f172a;
}

[data-theme="light"] .nav-chip {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #64748b;
}

[data-theme="light"] .nav-chip:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

[data-theme="light"] .price-table th {
    background-color: #f1f5f9;
}

[data-theme="light"] .price-info-badge {
    background-color: #ffffff;
    border-color: #e2e8f0;
}

/* Modal Light Theme Adjustments */
.modal-content h2 {
    margin-bottom: 0.5rem;
    color: white; /* Default for dark */
}

.modal-content p {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 2rem;
    line-height: 1;
}

[data-theme="light"] .modal-content h2 {
    color: #0f172a;
}

[data-theme="light"] .modal-close {
    color: #64748b;
}

[data-theme="light"] .modal-close:hover {
    color: #0f172a;
}

[data-theme="light"] .form-label {
    color: #64748b;
}

/* Light Theme Grid Visibility */
[data-theme="light"] .hero::before {
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
}
