:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary: #0f172a;
    --accent: #06b6d4;
    --accent-2: #8b5cf6;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --radius: 12px;
    --radius-xl: 16px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.06);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,.08), 0 8px 10px -6px rgba(0,0,0,.04);
    --shadow-xl: 0 25px 50px -12px rgba(0,0,0,.25);
    --gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
}

[data-theme="dark"] {
    --gray-50: #0f172a;
    --gray-100: #1e293b;
    --gray-200: #334155;
    --gray-300: #475569;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #e2e8f0;
    --gray-900: #f8fafc;
    --shadow: 0 1px 3px rgba(0,0,0,.4);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.5);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,.5);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    color: var(--gray-800);
    line-height: 1.6;
    background: var(--gray-50);
    transition: background .4s ease, color .4s ease;
}

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

/* --- Scroll Reveal --- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: .08s; }
.reveal-delay-2 { transition-delay: .16s; }
.reveal-delay-3 { transition-delay: .24s; }

/* --- Navbar --- */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: rgba(255,255,255,.75);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--gray-200);
    transition: background .3s, box-shadow .3s, border-color .3s;
}
[data-theme="dark"] .navbar { background: rgba(15,23,42,.72); border-color: var(--gray-700); }
.navbar.scrolled { box-shadow: var(--shadow-md); }
.nav-container {
    display: flex; align-items: center; justify-content: space-between;
    height: 72px;
}
.logo {
    font-size: 1.5rem; font-weight: 800; color: var(--primary); text-decoration: none;
    letter-spacing: -.6px;
}
.logo span { color: var(--accent); }
.nav-links { display: flex; list-style: none; gap: 28px; }
.nav-links a {
    text-decoration: none; color: var(--gray-700); font-weight: 500; font-size: .95rem;
    position: relative; padding: 6px 0;
    transition: color .25s;
}
[data-theme="dark"] .nav-links a { color: var(--gray-200); }
.nav-links a::after {
    content: ""; position: absolute; left: 0; bottom: 0;
    width: 0; height: 2px; background: var(--primary); border-radius: 2px;
    transition: width .3s;
}
.nav-links a:hover { color: var(--primary); }
.nav-links a:hover::after { width: 100%; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--gray-700); border-radius: 2px; transition: .3s; }
[data-theme="dark"] .nav-toggle span { background: var(--gray-200); }
.nav-toggle .dark-toggle {
    width: 22px; height: 22px; margin-top: 6px;
    background: transparent; border: 1.5px solid var(--gray-300); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 12px;
}
[data-theme="dark"] .nav-toggle .dark-toggle { border-color: var(--gray-400); }

/* --- Hero --- */
.hero {
    position: relative; overflow: hidden;
    padding: 180px 0 120px;
    background: var(--gradient-hero);
    color: #fff;
    isolation: isolate;
}
.hero::before, .hero::after {
    content: "";
    position: absolute; border-radius: 50%; filter: blur(120px); opacity: .35;
    pointer-events: none; z-index: 0;
}
.hero::before { width: 520px; height: 520px; background: radial-gradient(circle, #2563eb 0%, transparent 70%); top: -120px; right: -80px; }
.hero::after { width: 420px; height: 420px; background: radial-gradient(circle, #06b6d4 0%, transparent 70%); bottom: -80px; left: -60px; }
.hero h1 {
    font-size: clamp(2.4rem, 5vw, 3.8rem); font-weight: 800; color: #fff; line-height: 1.12;
    letter-spacing: -.8px; margin-bottom: 20px;
}
.hero h1 span { color: #fbbf24; }
.hero .container { position: relative; z-index: 1; text-align: center; }
.hero-lead { color: #e2e8f0; font-size: 1.2rem; font-weight: 600; margin-bottom: 12px; }
.hero-desc { color: #94a3b8; max-width: 720px; margin: 0 auto 16px; font-size: 1.1rem; line-height: 1.7; }

.hero .container p { margin-left: auto; margin-right: auto; }

.hero-buttons { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 36px; }

/* --- Buttons --- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 14px 28px; border-radius: 999px; font-weight: 600; font-size: 1rem;
    text-decoration: none; transition: all .25s; cursor: pointer; border: none;
}
.btn-primary {
    background: var(--primary); color: #fff;
    box-shadow: 0 1px 2px rgba(37,99,235,.35);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 8px 18px rgba(37,99,235,.35); }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }
.btn-lg { padding: 15px 34px; font-size: 1.05rem; }

/* --- Sections --- */
.section { padding: 100px 0; }
.section-alt { background: var(--gray-50); }
[data-theme="dark"] .section-alt { background: #131c31; }
.section-title {
    text-align: center; font-size: 2.4rem; font-weight: 800; color: var(--secondary); margin-bottom: 16px;
    letter-spacing: -.6px;
}
[data-theme="dark"] .section-title { color: #e2e8f0; }
.section-subtitle {
    text-align: center; color: var(--gray-500); font-size: 1.1rem; max-width: 640px;
    margin: 0 auto 56px; line-height: 1.7;
}

/* --- Bento Services Card (Home) --- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(130px, auto);
    gap: 18px;
}
.bento-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 28px; position: relative; overflow: hidden;
    transition: transform .3s, box-shadow .3s, border-color .3s;
    grid-column: span 2;
}
[data-theme="dark"] .bento-card { background: var(--gray-100); border-color: var(--gray-200); }
.bento-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}
.bento-card .service-icon {
    width: 48px; height: 48px; background: var(--primary-light); color: var(--primary);
    border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
}
[data-theme="dark"] .bento-card .service-icon { color: #fbbf24; }
.bento-card h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; color: var(--secondary); }
.bento-card p { color: var(--gray-500); font-size: .95rem; line-height: 1.7; }
.bento-card.featured { grid-column: span 2; grid-row: span 2; background: var(--secondary); color: #fff; border-color: transparent; }
.bento-card.featured p, .bento-card.featured h3 { color: #fff; }
.bento-card.wide { grid-column: span 2; }
.bento-card.tall { grid-row: span 2; }

@media (max-width: 900px) {
    .bento-grid { grid-template-columns: repeat(2, 1fr); }
    .bento-card, .bento-card.featured, .bento-card.wide { grid-column: span 1; }
    .bento-card.tall, .bento-card.featured { grid-row: span 1; }
}
@media (max-width: 520px) {
    .bento-grid { grid-template-columns: 1fr; }
    .bento-card, .bento-card.featured, .bento-card.wide { grid-column: span 1; grid-row: span 1; }
}

/* --- Services Grid fallback --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}
.service-card {
    background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-xl);
    padding: 32px; transition: all .3s;
}
[data-theme="dark"] .service-card { background: var(--gray-100); border-color: var(--gray-200); }
.service-card:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.service-icon {
    width: 56px; height: 56px; background: var(--primary-light); border-radius: 14px;
    display: flex; align-items: center; justify-content: center; margin-bottom: 24px; color: var(--primary);
}
.service-card h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 10px; color: var(--secondary); }
.service-card p { color: var(--gray-500); font-size: .95rem; line-height: 1.7; }

/* --- About --- */
.about-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center;
}
.about-content h2 { font-size: 2rem; font-weight: 800; color: var(--secondary); margin-bottom: 20px; }
.about-content p { color: var(--gray-500); margin-bottom: 16px; font-size: 1.05rem; line-height: 1.8; }
.about-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 24px; }
.stat { text-align: center; padding: 28px 16px; background: #fff; border-radius: var(--radius-xl); border: 1px solid var(--gray-200); }
[data-theme="dark"] .stat { background: var(--gray-100); }
.stat-number { font-size: 2.4rem; font-weight: 800; color: var(--primary); display: block; line-height: 1; }
.stat-label { color: var(--gray-500); font-size: .85rem; margin-top: 6px; }

/* --- Portfolio / Media Grid --- */
.media-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px;
}
.media-grid > div { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-xl); overflow: hidden; transition: all .3s; }
[data-theme="dark"] .media-grid > div { background: var(--gray-100); border-color: var(--gray-200); }
.media-grid > div:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.media-grid img, .media-grid video { width: 100%; height: 200px; object-fit: cover; display: block; }
.media-grid h3 { padding: 20px 24px 0; font-size: 1.1rem; }
.media-grid p { padding: 6px 24px; color: var(--gray-500); font-size: .92rem; }
.media-grid p:last-child { padding-bottom: 20px; }

/* --- Contact --- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.contact-info h2 { font-size: 2rem; font-weight: 800; color: var(--secondary); margin-bottom: 20px; }
.contact-info > p { color: var(--gray-500); margin-bottom: 28px; font-size: 1.05rem; line-height: 1.7; }
.contact-details { display: flex; flex-direction: column; gap: 20px; }
.contact-item { display: flex; align-items: flex-start; gap: 14px; }
.contact-item-icon {
    width: 48px; height: 48px; background: var(--primary-light); border-radius: 12px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--primary);
}
.contact-item h4 { font-weight: 600; margin-bottom: 4px; color: var(--secondary); font-size: .95rem; }
.contact-item p { color: var(--gray-500); font-size: .95rem; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 8px; color: var(--gray-700); font-size: .9rem; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 12px 14px; border: 1.5px solid var(--gray-200); border-radius: var(--radius);
    font-family: inherit; font-size: 1rem; transition: border-color .25s, box-shadow .25s; background: #fff;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light);
}
.form-group textarea { min-height: 140px; resize: vertical; }

/* --- Page Header --- */
.page-header {
    padding: 160px 0 80px; background: var(--gradient-hero);
    text-align: center; position: relative; overflow: hidden; color: #fff; isolation: isolate;
}
.page-header::before { content: ""; position: absolute; width: 500px; height: 500px; border-radius: 50%; filter: blur(120px); opacity: .35; background: radial-gradient(circle, #2563eb, transparent 70%); top: -100px; left: 50%; transform: translateX(-50%); pointer-events: none; z-index: 0; }
.page-header h1 { font-size: 3.2rem; font-weight: 800; color: #fff; letter-spacing: -.8px; position: relative; z-index: 1; }
.page-header p { color: #cbd5e1; font-size: 1.15rem; margin-top: 12px; max-width: 640px; margin-left: auto; margin-right: auto; position: relative; z-index: 1; }
.page-header .container { position: relative; z-index: 1; }

/* --- CTA --- */
.cta-section {
    background: var(--gradient-hero); padding: 100px 0; text-align: center; color: #fff;
    position: relative; overflow: hidden;
}
.cta-section::before { content: ""; position: absolute; width: 500px; height: 500px; border-radius: 50%; filter: blur(140px); opacity: .35; background: radial-gradient(circle, #8b5cf6 0%, transparent 70%); bottom: -120px; right: -80px; pointer-events: none; }
.cta-section h2 { font-size: 2.2rem; font-weight: 800; margin-bottom: 16px; position: relative; z-index: 1; }
.cta-section p { opacity: .9; margin-bottom: 32px; font-size: 1.1rem; position: relative; z-index: 1; }
.cta-section .btn-outline { border-color: #fff; color: #fff; position: relative; z-index: 1; }
.cta-section .btn-outline:hover { background: #fff; color: var(--primary); }
.cta-section .container { position: relative; z-index: 1; }

/* --- Footer --- */
.footer { background: var(--secondary); color: #cbd5e1; padding: 80px 0 0; transition: background .4s; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 60px; }
.footer h3 { font-size: 1.4rem; font-weight: 800; margin-bottom: 10px; color: #fff; }
.footer h4 { font-weight: 600; margin-bottom: 14px; color: #94a3b8; }
.footer p { color: #94a3b8; font-size: .92rem; line-height: 1.7; }
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 10px; }
.footer a { color: #94a3b8; text-decoration: none; transition: color .2s; font-size: .92rem; }
.footer a:hover { color: #fff; }
.social-links { display: flex; gap: 10px; margin-top: 16px; }
.social-links a {
    width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.08);
    display: flex; align-items: center; justify-content: center; color: #fff;
    transition: all .25s;
}
.social-links a:hover { background: var(--primary); transform: translateY(-2px); }
.footer-bottom { border-top: 1px solid #1f2d42; padding: 22px 0; text-align: center; }
[data-theme="dark"] .footer-bottom { border-color: #1f2d42; }
.footer-bottom p { font-size: .85rem; color: #64748b; }

/* --- Tech Tags --- */
.tech-tag {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; background: var(--gray-100); color: var(--gray-700);
    border-radius: 999px; font-size: .88rem; font-weight: 500; border: 1px solid var(--gray-200);
    transition: all .2s;
}
[data-theme="dark"] .tech-tag { background: var(--gray-900); color: var(--gray-200); border-color: var(--gray-300); }
.tech-tag:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
[data-theme="dark"] .tech-tag:hover { background: #1e293b; color: #60a5fa; }

/* --- Video Section --- */
.video-section { position: relative; overflow: hidden; border-radius: var(--radius-xl); }
.video-section video { width: 100%; height: auto; display: block; border-radius: var(--radius-xl); }
[data-theme="dark"] .video-section { filter: brightness(.85); }

/* --- Dark mode toggle --- */
.theme-toggle {
    position: fixed; bottom: 20px; right: 20px; z-index: 999;
    width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--gray-300);
    background: #fff; color: var(--gray-700); cursor: pointer; font-size: 18px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-md); backdrop-filter: blur(8px);
    transition: all .25s;
}
[data-theme="dark"] .theme-toggle { background: var(--gray-800); color: #fbbf24; border-color: var(--gray-500); }
.theme-toggle:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* --- Process Steps --- */
.process-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; counter-reset: step; }
.process-step { text-align: center; padding: 36px 20px; }
.process-step::before {
    counter-increment: step; content: counter(step);
    display: inline-flex; width: 56px; height: 56px; align-items: center; justify-content: center;
    background: var(--primary); color: #fff; border-radius: 50%;
    font-weight: 800; font-size: 1.3rem; margin-bottom: 16px;
    box-shadow: 0 12px 20px -6px rgba(37,99,235,.4);
}
.process-step h4 { font-weight: 700; color: var(--secondary); margin-bottom: 8px; }
.process-step p { color: var(--gray-500); font-size: .92rem; line-height: 1.6; }

/* --- Service detail --- */
.service-detail { padding: 40px 0; }
.service-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; margin-bottom: 40px; }
.service-detail-grid.reverse { direction: rtl; }
.service-detail-grid.reverse > * { direction: ltr; }
.service-detail-text h2 { font-size: 1.9rem; font-weight: 800; color: var(--secondary); margin-bottom: 16px; }
.service-detail-text p { color: var(--gray-500); line-height: 1.8; margin-bottom: 14px; }
.service-detail-text ul { list-style: none; padding: 0; }
.service-detail-text ul li { padding: 8px 0; padding-left: 26px; position: relative; color: var(--gray-600); font-size: .98rem; }
.service-detail-text ul li::before { content: "→"; position: absolute; left: 0; color: var(--primary); font-weight: 700; }

/* --- Alert --- */
.alert { padding: 16px 20px; border-radius: var(--radius); margin-bottom: 20px; font-weight: 500; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* --- Blob divider --- */
.blob-divider {
    width: 100%; height: 80px; overflow: hidden; pointer-events: none; position: relative;
}
.blob-divider svg { position: absolute; bottom: 0; width: 100%; height: 100%; display: block; }

/* --- Responsive --- */
@media (max-width: 900px) {
    .service-detail-grid { grid-template-columns: 1fr; gap: 32px; }
    .service-detail-grid.reverse { direction: ltr; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
    .about-grid { grid-template-columns: 1fr; gap: 32px; }
    .contact-grid { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 768px) {
    .section { padding: 60px 0; }
    .section-title { font-size: 1.7rem; }
    .hero { padding: 130px 0 80px; }
    .page-header { padding: 120px 0 48px; }
    .page-header h1 { font-size: 2rem; }
    .nav-links { display: none; position: absolute; top: 72px; left: 0; right: 0; background: #fff; flex-direction: column; padding: 16px 24px; border-bottom: 1px solid var(--gray-200); box-shadow: var(--shadow-lg); gap: 12px; }
    .nav-links.active { display: flex; }
    .nav-toggle { display: flex; }
    .footer-grid { grid-template-columns: 1fr; }
    .about-stats { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .stat-number { font-size: 1.6rem; }
}
@media (max-width: 480px) {
    .hero-buttons { flex-direction: column; align-items: center; }
    .hero-buttons .btn { width: 100%; justify-content: center; }
}
