/* ============================================
   IRONLEAF DEV — Design System & Styles
   ============================================ */

/* CSS Custom Properties */
:root {
    /* Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-card: #16161f;
    --bg-card-hover: #1c1c28;
    --bg-glass: rgba(22, 22, 31, 0.7);

    --text-primary: #f0f0f5;
    --text-secondary: #8888a0;
    --text-muted: #55556a;

    --accent-1: #2dd4a8;
    --accent-2: #0ea5e9;
    --accent-3: #6366f1;
    --accent-glow: rgba(45, 212, 168, 0.15);

    --gradient-main: linear-gradient(135deg, #2dd4a8, #0ea5e9, #6366f1);
    --gradient-card: linear-gradient(135deg, rgba(45, 212, 168, 0.08), rgba(14, 165, 233, 0.04));
    --gradient-border: linear-gradient(135deg, rgba(45, 212, 168, 0.3), rgba(99, 102, 241, 0.1));

    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);

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

    /* Spacing */
    --section-padding: clamp(80px, 10vw, 140px);
    --container-max: 1200px;

    /* Animation */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Light Theme Variables */
:root[data-theme="light"] {
    --bg-primary: #fafafc;
    --bg-secondary: #f0f0f5;
    --bg-card: #ffffff;
    --bg-card-hover: #f8f9fa;
    --bg-glass: rgba(255, 255, 255, 0.85);

    --text-primary: #0a0a0f;
    --text-secondary: #4a4a5e;
    --text-muted: #8888a0;

    --border: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.16);
    
    --gradient-card: linear-gradient(135deg, rgba(45, 212, 168, 0.05), rgba(14, 165, 233, 0.05));
    --accent-glow: rgba(45, 212, 168, 0.25);
}

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

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

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.4s var(--ease-out), color 0.4s var(--ease-out);
}

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

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   NAVIGATION
   ============================================ */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 20px 0;
    transition: all 0.4s var(--ease-out);
}

.navbar.scrolled {
    padding: 12px 0;
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border-bottom: 1px solid var(--border);
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.nav-logo-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.accent {
    color: var(--accent-1);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 36px;
    list-style: none;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.3s;
    position: relative;
    cursor: pointer;
}

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

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--accent-1);
    transition: width 0.3s var(--ease-out);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-cta {
    background: var(--accent-1) !important;
    color: var(--bg-primary) !important;
    padding: 8px 20px !important;
    border-radius: 8px;
    font-weight: 600 !important;
    transition: transform 0.3s var(--ease-spring), box-shadow 0.3s !important;
}

.nav-cta::after {
    display: none !important;
}

.nav-cta:hover {
    filter: brightness(1.1);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s;
}

/* ============================================
   HERO
   ============================================ */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 24px 80px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 70%);
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
    animation: float 8s ease-in-out infinite;
}

.glow-1 {
    width: 500px;
    height: 500px;
    background: rgba(45, 212, 168, 0.12);
    top: 10%;
    left: 20%;
    animation-delay: 0s;
}

.glow-2 {
    width: 400px;
    height: 400px;
    background: rgba(14, 165, 233, 0.1);
    top: 30%;
    right: 15%;
    animation-delay: -3s;
}

.glow-3 {
    width: 350px;
    height: 350px;
    background: rgba(99, 102, 241, 0.08);
    bottom: 20%;
    left: 40%;
    animation-delay: -5s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.05); }
    66% { transform: translate(-20px, 15px) scale(0.95); }
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 32px;
    animation: fadeInUp 0.8s var(--ease-out) 0.1s both;
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-1);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(45, 212, 168, 0.4); }
    50% { opacity: 0.8; box-shadow: 0 0 0 8px rgba(45, 212, 168, 0); }
}

.hero-title {
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.04em;
    margin-bottom: 24px;
    animation: fadeInUp 0.8s var(--ease-out) 0.2s both;
}

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

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 560px;
    margin: 0 auto 40px;
    animation: fadeInUp 0.8s var(--ease-out) 0.3s both;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 64px;
    animation: fadeInUp 0.8s var(--ease-out) 0.4s both;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    border: none;
    transition: all 0.3s var(--ease-spring);
}

.btn-primary {
    background: var(--accent-1);
    color: var(--bg-primary);
}

.btn-primary:hover {
    filter: brightness(1.15);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-hover);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-muted);
}

.btn-large {
    padding: 18px 36px;
    font-size: 1.1rem;
    border-radius: 14px;
}

.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    animation: fadeInUp 0.8s var(--ease-out) 0.5s both;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

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

.scroll-indicator {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    animation: fadeInUp 0.8s var(--ease-out) 0.7s both;
}

.scroll-line {
    width: 1px;
    height: 48px;
    background: linear-gradient(to bottom, var(--accent-1), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 1; height: 48px; }
    50% { opacity: 0.3; height: 32px; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   SECTIONS (shared)
   ============================================ */

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

.section-tag {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-1);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
    line-height: 1.15;
}

.section-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0 auto;
}

/* ============================================
   SERVICES
   ============================================ */

.services {
    padding: var(--section-padding) 0;
    background: var(--bg-secondary);
    position: relative;
}

.services::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.service-card {
    padding: 36px;
    border-radius: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all 0.4s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-main);
    opacity: 0;
    transition: opacity 0.4s;
}

.service-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

:root[data-theme="light"] .service-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

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

.service-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--gradient-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--accent-1);
}

.service-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}

.service-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.service-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.service-tags span {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 6px;
    background: rgba(45, 212, 168, 0.08);
    color: var(--accent-1);
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
}

/* ============================================
   ABOUT
   ============================================ */

.about {
    padding: var(--section-padding) 0;
}

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

.about-content .section-title {
    text-align: left;
}

.about-content p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 16px;
}

.about-values {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.value {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: border-color 0.3s;
}

.value:hover {
    border-color: var(--border-hover);
}

.value-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.value strong {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.value span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Code Window */
.code-window {
    border-radius: 16px;
    overflow: hidden;
    background: #0d0d14;
    border: 1px solid var(--border);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}

.code-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border);
}

.code-dots {
    display: flex;
    gap: 6px;
}

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

.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }

.code-filename {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.code-body {
    padding: 24px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.8;
    overflow-x: auto;
}

.code-body code {
    font-family: inherit;
}

.code-keyword { color: #c792ea; }
.code-var { color: #82aaff; }
.code-key { color: #f0f0f5; }
.code-string { color: #c3e88d; }
.code-bool { color: #ffcb6b; }

/* ============================================
   PROCESS
   ============================================ */

.process {
    padding: var(--section-padding) 0;
    background: var(--bg-secondary);
    position: relative;
}

.process::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.process-steps {
    display: flex;
    align-items: flex-start;
    gap: 0;
}

.step {
    flex: 1;
    text-align: center;
    padding: 0 20px;
}

.step-number {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 16px;
}

.step h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.step p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.step-connector {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
    margin-top: 28px;
    flex-shrink: 0;
    opacity: 0.3;
}

/* ============================================
   CONTACT
   ============================================ */

.contact {
    padding: var(--section-padding) 0;
}

.contact-card {
    border-radius: 24px;
    padding: 80px 48px;
    text-align: center;
    background: var(--gradient-card);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.contact-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 100%, rgba(45, 212, 168, 0.06), transparent 50%);
    pointer-events: none;
}

.contact-content {
    position: relative;
    z-index: 1;
}

.contact-content .section-title {
    margin-bottom: 16px;
}

.contact-content p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 32px;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    padding: 32px 0;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.1rem;
}

.footer-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.footer-copy {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.7s var(--ease-out);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 900px) {
    .nav-links {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-primary);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 32px;
        z-index: 999;
    }

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

    .nav-links a {
        font-size: 1.2rem;
    }

    .nav-toggle {
        display: flex;
        z-index: 1001;
    }

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

    .about-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .process-steps {
        flex-direction: column;
        align-items: center;
        gap: 32px;
    }

    .step-connector {
        width: 2px;
        height: 32px;
        background: linear-gradient(180deg, var(--accent-1), var(--accent-2));
        margin-top: 0;
    }

    .hero-stats {
        flex-direction: column;
        gap: 16px;
    }

    .stat-divider {
        width: 40px;
        height: 1px;
    }

    .footer-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .contact-card {
        padding: 48px 24px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        justify-content: center;
        max-width: 300px;
    }
}
