/* Base Styles & CSS Variables */
:root {
    /* Light Theme (Default) */
    --bg-main: #f8fafc;
    --bg-alt: #f1f5f9;
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-invert: #ffffff;
    
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #0ea5e9;
    
    --border-color: rgba(15, 23, 42, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.5);
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    
    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --gradient-1: linear-gradient(135deg, #2563eb, #0ea5e9);
}

[data-theme="dark"] {
    /* Dark Theme */
    --bg-main: #0f172a;
    --bg-alt: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --text-invert: #0f172a;
    
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --secondary: #38bdf8;
    
    --border-color: rgba(248, 250, 252, 0.1);
    --glass-bg: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(248, 250, 252, 0.1);
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -1px rgba(0,0,0,0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5), 0 4px 6px -2px rgba(0,0,0,0.3);
    
    --gradient-1: linear-gradient(135deg, #3b82f6, #38bdf8);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Offset for sticky nav */
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

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

ul {
    list-style: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.01em; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
}

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

.text-red { color: var(--danger); }
.text-yellow { color: var(--warning); }
.text-green { color: var(--success); }

/* Layout Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.bg-alternate {
    background-color: var(--bg-alt);
}

.w-100 { width: 100%; }
.w-75 { width: 75%; }
.w-60 { width: 60%; }
.w-50 { width: 50%; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: 'Outfit', sans-serif;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff; /* Always white text on primary btn */
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-secondary:hover {
    background: var(--bg-alt);
    transform: translateY(-2px);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-block {
    width: 100%;
}

/* Glassmorphism Components */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.05em;
}

.logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s;
}

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

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.25rem;
    cursor: pointer;
    transition: transform 0.3s ease, color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.theme-toggle:hover {
    background: var(--bg-alt);
    transform: rotate(15deg);
}

/* Hero Section */
.hero {
    padding: 160px 0 100px;
    position: relative;
    overflow: hidden;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 2;
}

.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

[data-theme="dark"] .badge {
    background: rgba(59, 130, 246, 0.15);
}

.hero-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.hero-visual {
    position: relative;
}

.main-panel {
    padding: 2rem;
    min-height: 350px;
}

.panel-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.dot.red { background: #ef4444; }
.dot.yellow { background: #f59e0b; }
.dot.green { background: #10b981; }

.code-line {
    height: 12px;
    background: var(--border-color);
    border-radius: 6px;
    margin-bottom: 1rem;
}

.chart-container {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    height: 150px;
    margin-top: 3rem;
    border-bottom: 2px solid var(--border-color);
}

.bar {
    flex: 1;
    background: var(--gradient-1);
    border-radius: 4px 4px 0 0;
    animation: growUp 1.5s ease-out forwards;
    transform-origin: bottom;
}

.floating-panel {
    position: absolute;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: float 6s ease-in-out infinite;
}

.floating-panel.panel-1 {
    top: -20px;
    right: -20px;
    animation-delay: 0s;
}

.floating-panel.panel-2 {
    bottom: -30px;
    left: -30px;
    animation-delay: -3s;
}

.floating-panel i {
    font-size: 1.5rem;
    color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
    padding: 0.75rem;
    border-radius: 12px;
}

.floating-panel h4 {
    margin: 0;
    font-size: 1rem;
}

.floating-panel span {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 600;
}

.hero-bg-glow {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translate(30%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(37,99,235,0.15) 0%, rgba(15,23,42,0) 70%);
    border-radius: 50%;
    z-index: 1;
    pointer-events: none;
}

/* Services */
.services {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 4rem;
}

.services-stack {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.service-group {
    background: var(--bg-alt);
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.service-group:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.service-group-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

.service-group-header h3 {
    margin-bottom: 0;
    font-size: 1.75rem;
}

.service-icon {
    width: 60px;
    height: 60px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border-radius: 16px;
    transition: background 0.3s ease;
}

.service-group:hover .service-icon {
    background: var(--primary);
    color: #ffffff;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.category-box {
    background: var(--bg-main);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    font-weight: 600;
    text-align: center;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.category-box:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

/* Case Studies */
.case-studies {
    padding: 100px 0;
}

.studies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.study-card {
    background: var(--bg-main);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.study-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.study-img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-bottom: 1px solid var(--border-color);
}

.study-content {
    padding: 2.5rem;
}

.industry-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-alt);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    margin-bottom: 1rem;
}

.study-content h3 {
    margin-bottom: 2rem;
}

.psr-block {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    border-left: 2px solid var(--border-color);
    position: relative;
}

.psr-block i {
    position: absolute;
    left: -11px;
    top: 3px;
    background: var(--bg-main);
    border-radius: 50%;
}

.psr-block h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.psr-block p {
    font-size: 0.95rem;
    margin-bottom: 0;
}

.psr-block.result {
    border-left-color: var(--success);
}
.psr-block.result p {
    color: var(--text-main);
}

/* Process / Lifecycle Diagram */
.process {
    padding: 100px 0;
    position: relative;
}

.lifecycle-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.phase-card {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.phase-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.phase-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--border-color);
    line-height: 1;
}

.phase-icon {
    font-size: 2.5rem;
    color: var(--primary);
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.process-bg-glow {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translate(-30%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(14,165,233,0.1) 0%, rgba(15,23,42,0) 70%);
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
}

/* Contact Section */
.contact {
    padding: 100px 0;
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.contact-info p {
    font-size: 1.25rem;
    margin-bottom: 3rem;
}

.contact-form-wrapper {
    padding: 3rem;
    width: 100%;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

input, textarea, select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-main);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.custom-select {
    position: relative;
}

.custom-select::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
}

select {
    appearance: none;
    -webkit-appearance: none;
}

/* Footer */
footer {
    background: #0f172a;
    color: #f8fafc;
    padding-top: 80px;
}

.footer-container {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-brand p {
    color: #94a3b8;
    margin-top: 1rem;
    max-width: 300px;
}

.footer-links h4 {
    color: #ffffff;
    margin-bottom: 1.5rem;
}

.footer-links a {
    display: block;
    color: #94a3b8;
    margin-bottom: 0.75rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #38bdf8;
}

.footer-bottom {
    background: #020617;
    padding: 1.5rem 0;
    text-align: center;
}

.footer-bottom p {
    margin: 0;
    color: #64748b;
    font-size: 0.875rem;
}

/* Animations & Utilities */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes growUp {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}

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

/* Responsive */
@media (max-width: 992px) {
    .hero-container, .contact-container {
        grid-template-columns: 1fr;
    }
    .hero {
        padding-top: 120px;
    }
    .hero-visual {
        margin-top: 3rem;
    }
    .lifecycle-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .lifecycle-grid {
        grid-template-columns: 1fr;
    }
    .nav-links, .nav-cta {
        display: none;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .footer-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}
