:root {
    /* Core Palette - Defined as variables to enable smooth switching */
    --font-heading: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Light Theme (Default) */
    --bg-body: #f8fafc;        /* Off-white (Slate 50) */
    --bg-surface: #ffffff;     /* Pure white */
    --bg-surface-2: #f1f5f9;   /* Slate 100 */
    
    --text-primary: #0f172a;   /* Slate 900 */
    --text-secondary: #475569; /* Slate 600 */
    --text-tertiary: #94a3b8;  /* Slate 400 */

    --border-color: #e2e8f0;   /* Slate 200 */
    --border-hover: #cbd5e1;   /* Slate 300 */
    
    --primary: #2563eb;        /* Blue 600 */
    --primary-hover: #1d4ed8;  /* Blue 700 */
    --primary-fg: #ffffff;
    
    --accent: #8b5cf6;         /* Violet 500 */

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
    --shadow-glow: 0 0 0 0 transparent; /* No glow in light mode usually */
    
    --hero-overlay: linear-gradient(180deg, rgba(255,255,255,0) 0%, #f8fafc 100%);
    --nav-bg: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] {
    /* Dark Theme */
    --bg-body: #0c0e11;        /* Deep, almost black grey */
    --bg-surface: #15171b;     /* Slightly lighter grey */
    --bg-surface-2: #1e2126;   /* Component background */
    
    --text-primary: #f8fafc;   /* Slate 50 */
    --text-secondary: #94a3b8; /* Slate 400 */
    --text-tertiary: #64748b;  /* Slate 500 */

    --border-color: #2d333b;   /* Dark border */
    --border-hover: #454c59;   
    
    --primary: #3b82f6;        /* Blue 500 (Brighter for dark mode) */
    --primary-hover: #60a5fa;  /* Blue 400 */
    
    --accent: #a78bfa;         /* Violet 400 */

    --shadow-sm: 0 1px 0 0 rgba(255,255,255,0.05);
    --shadow-md: 0 4px 20px -5px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 15px rgba(59, 130, 246, 0.15); /* Subtle cyber glow */
    
    --hero-overlay: linear-gradient(180deg, rgba(12,14,17,0) 0%, #0c0e11 100%);
    --nav-bg: rgba(21, 23, 27, 0.8);
}

/* Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

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

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header & Nav */
header {
    background-color: var(--nav-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 72px;
    display: flex;
    align-items: center;
}

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

.logo {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: -0.01em;
}

.logo img {
    height: 36px;
    width: auto;
}

.logo-light { display: block; }
.logo-dark { display: none; }

[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: block; }

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

nav a {
    color: var(--text-secondary);
    font-size: 0.95rem;
    transition: color 0.2s;
}

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

.theme-toggle-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 1rem;
}

.theme-toggle-btn:hover {
    background-color: var(--bg-surface-2);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

/* Hero Section */
.hero {
    padding: 8rem 0 6rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    /* Subtle background pattern */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background-image: 
        radial-gradient(var(--border-color) 1px, transparent 1px);
    background-size: 32px 32px;
    opacity: 0.3;
    z-index: -1;
    mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
}

.hero h1 {
    font-size: 3.75rem;
    margin-bottom: 1.5rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto 2.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.75rem;
    background-color: var(--primary);
    color: var(--primary-fg);
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    border: 1px solid transparent;
    font-size: 1rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    color: var(--primary-fg);
}

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

.btn-outline:hover {
    background-color: var(--bg-surface-2);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

/* Cards */
.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    height: auto;
    display: flex;
    flex-direction: column;
}

.card.h-full {
    height: 100%;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border-color: var(--primary);
}

.tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 999px;
    background-color: var(--bg-surface-2);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    font-weight: 500;
}

/* Utilities */
.grid {
    display: grid;
    gap: 2rem;
}
.grid-cols-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.text-center { text-align: center; }
.mb-sm { margin-bottom: 0.5rem; }
.mb-md { margin-bottom: 1rem; }
.mb-lg { margin-bottom: 2rem; }
.mb-xl { margin-bottom: 4rem; }

/* Dedicated Software Grid */
.software-layout {
    display: grid;
    grid-template-columns: 1fr; /* Mobile first: stack */
    gap: 2rem;
}

@media (min-width: 900px) {
    .software-layout {
        grid-template-columns: 2fr 1fr;
        gap: 4rem;
    }
}

/* Footer */
footer {
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: 4rem 0;
    margin-top: auto;
    width: 100%;
    position: relative;
    clear: both;
    z-index: 10;
}

footer p {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

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

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

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

/* Responsive */
@media (max-width: 768px) {
    .grid-cols-2 { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2.5rem; }
    .hero { padding: 4rem 0; }
    header .container { padding: 0 1rem; }
    nav ul { gap: 1rem; }
    nav a { font-size: 0.85rem; }
}
