:root {
    /* Calliope Light Mode Defaults */
    --primary: #4F46E5;
    --primary-light: #6366F1;
    --secondary: #06B6D4;
    --accent-glow: rgba(79, 70, 229, 0.4);
    --bg-dark: #F9FAFB;
    --bg-card: rgba(255, 255, 255, 0.85);
    --text-main: #111827;
    --text-muted: #4B5563;
    --border: rgba(0, 0, 0, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.3);

    /* Map Platform Variables for Login Page */
    --bg-surface: var(--bg-card);
    --text-primary: var(--text-main);
    --text-secondary: var(--text-muted);
    --border-subtle: var(--border);
    --brand-primary: var(--primary);
    --colour-text: var(--text-main);
    --surface-dark: var(--bg-card);
    --border-dark: var(--border);

    /* Gradients and Headings */
    --bg-gradient-1: rgba(79, 70, 229, 0.08);
    --bg-gradient-2: rgba(249, 250, 251, 1);
    --bg-gradient-3: rgba(6, 182, 212, 0.08);
    --text-heading: #111827;
}

:root[data-theme="dark"], .dark {
    /* Calliope Premium Dark Mode */
    --primary: #6366F1;
    --primary-light: #818CF8;
    --secondary: #22D3EE;
    --accent-glow: rgba(99, 102, 241, 0.5);
    --bg-dark: #060913;
    --bg-card: rgba(15, 20, 35, 0.65);
    --text-main: #F9FAFB;
    --text-muted: #9CA3AF;
    --border: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(10, 15, 30, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);

    /* Map Platform Variables */
    --bg-surface: var(--bg-card);
    --text-primary: var(--text-main);
    --text-secondary: var(--text-muted);
    --border-subtle: var(--border);
    --brand-primary: var(--primary);
    --colour-text: var(--text-main);
    --surface-dark: var(--bg-card);
    --border-dark: var(--border);

    /* Gradients and Headings */
    --bg-gradient-1: rgba(79, 70, 229, 0.2);
    --bg-gradient-2: rgba(6, 9, 19, 1);
    --bg-gradient-3: rgba(34, 211, 238, 0.15);
    --text-heading: #FFFFFF;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Dynamic Animated Background Gradients */
.bg-gradient {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, var(--bg-gradient-1) 0%, var(--bg-gradient-2) 50%),
                radial-gradient(circle at 80% 20%, var(--bg-gradient-3) 0%, transparent 40%);
    z-index: -1;
    pointer-events: none;
    animation: slowDrift 20s ease-in-out infinite alternate;
}

@keyframes slowDrift {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.05) translate(-2%, 2%); }
}

a {
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.3s;
}

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

/* Premium Navbar */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 5%;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, var(--text-heading) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-brand img {
    height: 32px;
    width: 32px;
}

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

.nav-links a {
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

/* Buttons with Glow FX */
.btn {
    padding: 0.8rem 1.75rem;
    border-radius: 9999px; /* Pill shape */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    text-align: center;
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white !important;
    border: none;
    box-shadow: 0 4px 15px var(--accent-glow);
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

.btn-primary:hover::after {
    opacity: 1;
}

.btn-outline {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    backdrop-filter: blur(10px);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

/* Revitalized Hero Section */
.hero {
    padding: 9rem 5% 7rem;
    text-align: center;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
}

.hero h1 {
    font-size: clamp(3rem, 6vw, 5.5rem);
    font-weight: 800;
    line-height: 1.05;
    margin-bottom: 1.5rem;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, var(--text-heading) 30%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Dashboard Showcase */
.showcase {
    padding: 0 5% 6rem;
    text-align: center;
    position: relative;
    z-index: 10;
}

.mockup-container {
    max-width: 1100px;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0,0,0,0.4), 0 0 0 1px var(--glass-border);
    position: relative;
    transform: perspective(1000px) rotateX(2deg);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.mockup-container:hover {
    transform: perspective(1000px) rotateX(0deg) translateY(-10px);
}

.mockup-container img {
    width: 100%;
    display: block;
}

/* Bento Box Feature Grid */
.features {
    padding: 6rem 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-heading);
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.2rem;
    margin-bottom: 4rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(250px, auto);
    gap: 1.5rem;
}

/* Responsive Bento Rules */
@media (max-width: 1024px) {
    .bento-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .bento-grid { grid-template-columns: 1fr; }
}

.bento-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
    overflow: hidden;
}

.bento-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.03) 100%);
    z-index: 0;
}

.bento-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-light);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), inset 0 0 0 1px rgba(255,255,255,0.05);
}

/* Specific Bento Spans */
.bento-card.span-2 {
    grid-column: span 2;
}
@media (max-width: 768px) {
    .bento-card.span-2 { grid-column: span 1; }
}

.bento-icon {
    width: 48px;
    height: 48px;
    margin-bottom: auto; /* Pushes text to bottom */
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 1;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.bento-icon svg {
    width: 24px;
    height: 24px;
}

.bento-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    z-index: 1;
}

.bento-card p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
    z-index: 1;
}

/* Footer */
footer {
    border-top: 1px solid var(--glass-border);
    padding: 5rem 5% 2rem;
    margin-top: 5rem;
    background: rgba(0,0,0,0.1);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 3rem;
}

.footer-brand p {
    color: var(--text-muted);
    margin-top: 1rem;
    max-width: 300px;
}

.footer-links {
    display: flex;
    gap: 5rem;
    flex-wrap: wrap;
}

.footer-column h4 {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--text-heading);
    font-weight: 700;
}

.footer-column ul {
    list-style: none;
}

.footer-column li {
    margin-bottom: 0.8rem;
}

.footer-column a {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}

.footer-column a:hover {
    color: var(--primary-light);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 4rem;
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

.animate-fade-in {
    opacity: 0;
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }

/* Forms */
.form-container {
    max-width: 500px;
    margin: 4rem auto;
    background: var(--bg-card);
    padding: 3rem;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

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

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

.form-control {
    width: 100%;
    padding: 0.85rem 1rem;
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-main);
    font-family: inherit;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background: rgba(0, 0, 0, 0.2);
}

/* Sub-page Layout Classes (ported from legacy structure) */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 5%; }
.section { padding: 4rem 0; }
.section.soft { background: rgba(0, 0, 0, 0.2); border-top: 1px solid var(--glass-border); border-bottom: 1px solid var(--glass-border); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 3rem; }
.card, .panel {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2.5rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
.card h3, .panel h2, .panel h3 { color: var(--text-heading); margin-bottom: 1rem; font-weight: 700; letter-spacing: -0.02em; }
.card p, .panel p { color: var(--text-muted); margin-bottom: 1rem; }
.card ul, .panel ul { color: var(--text-muted); margin-left: 1.5rem; margin-bottom: 1rem; }
.card li, .panel li { margin-bottom: 0.5rem; }
.page-hero { padding: 6rem 5% 3rem; text-align: center; }
.page-hero h1 { font-size: 3rem; font-weight: 800; margin-bottom: 1.5rem; color: var(--text-heading); letter-spacing: -0.03em; }
.page-hero p { font-size: 1.25rem; color: var(--text-muted); max-width: 800px; margin: 0 auto; }
.page-hero .eyebrow { color: var(--primary-light); font-weight: 700; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 1rem; }
