:root {
    /* Base Default (Light) */
    --bg-color: #f8f9fa;
    --text-color: #1a1a1a;
    --card-bg: #ffffff;
    --card-border: #e1e4e8;
    --primary: #2563eb;
    --accent: #3b82f6;
    --shadow: 0 10px 30px -10px rgba(0,0,0,0.1);
    --hero-gradient: linear-gradient(135deg, #e0e7ff 0%, #f3f4f6 100%);
    --nav-bg: rgba(255, 255, 255, 0.8);
}

/* THEME DEFINITIONS */
.dark-mode {
    --bg-color: #0f172a;
    --text-color: #f1f5f9;
    --card-bg: #1e293b;
    --card-border: #334155;
    --primary: #38bdf8;
    --accent: #0ea5e9;
    --shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
    --hero-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --nav-bg: rgba(15, 23, 42, 0.8);
}

.natural-mode {
    --bg-color: #f1f8e9;
    --text-color: #1b5e20;
    --card-bg: #ffffff;
    --card-border: #c5e1a5;
    --primary: #558b2f;
    --accent: #7cb342;
    --hero-gradient: linear-gradient(135deg, #dcedc8 0%, #f1f8e9 100%);
    --nav-bg: rgba(241, 248, 233, 0.8);
}

.ocean-mode {
    --bg-color: #e0f7fa;
    --text-color: #006064;
    --card-bg: #ffffff;
    --card-border: #b2ebf2;
    --primary: #00acc1;
    --accent: #26c6da;
    --hero-gradient: linear-gradient(135deg, #b2ebf2 0%, #e0f7fa 100%);
}

.sunset-mode {
    --bg-color: #fff3e0;
    --text-color: #bf360c;
    --card-bg: #ffffff;
    --card-border: #ffcc80;
    --primary: #ff5722;
    --accent: #ff8a65;
    --hero-gradient: linear-gradient(135deg, #ffe0b2 0%, #fff3e0 100%);
}

/* GLOBAL RESET & TYPOGRAPHY */
* { box-sizing: border-box; transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease; }
body {
    margin: 0;
    font-family: 'Open Sans', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
}

h1, h2, h3 { font-family: 'Roboto Slab', serif; }
a { text-decoration: none; color: inherit; }

/* HEADER */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-border);
}

.logo { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }

/* HERO SECTION */
.hero-container {
    padding: 8rem 1rem 4rem;
    text-align: center;
    background: var(--hero-gradient);
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.2;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.8;
    max-width: 700px;
    margin-bottom: 2rem;
}

/* GRID LAYOUT FOR AI AGENTS */
.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 2rem 5%;
    max-width: 1400px;
    margin: -50px auto 0; /* Pull up into hero */
    position: relative;
    z-index: 10;
}

/* CARD DESIGN */
.agent-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    height: 100%;
    min-height: 280px;
}

.agent-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.15);
    border-color: var(--primary);
}

.agent-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(128,128,128, 0.1);
    color: var(--primary);
}

.agent-card h3 { font-size: 1.5rem; margin: 0.5rem 0; }
.agent-card p { opacity: 0.7; font-size: 0.95rem; line-height: 1.6; flex-grow: 1; }

.card-link {
    margin-top: 1.5rem;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-link i { transition: transform 0.2s ease; }
.agent-card:hover .card-link i { transform: translateX(5px); }

/* SPECIFIC ACCENT COLORS PER CARD */
/* Note: You can add specific colors for Law, Health etc here if you want them to differ from the theme primary */
.agent-card[data-type="law"] .agent-icon { color: #e11d48; background: rgba(225, 29, 72, 0.1); }
.agent-card[data-type="health"] .agent-icon { color: #059669; background: rgba(5, 150, 105, 0.1); }
.agent-card[data-type="code"] .agent-icon { color: #7c3aed; background: rgba(124, 58, 237, 0.1); }
.agent-card[data-type="diy"] .agent-icon { color: #d97706; background: rgba(217, 119, 6, 0.1); }

/* BUTTONS */
.theme-toggle, .user-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-color);
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.2s;
}
.theme-toggle:hover { background: rgba(0,0,0,0.05); }

/* FOOTER */
footer {
    text-align: center;
    padding: 4rem 1rem;
    margin-top: 4rem;
    border-top: 1px solid var(--card-border);
    opacity: 0.6;
}