/* =============================================
   Swiss Solar Battery Simulator – Landing Page
   Design System (matching Simulator app)
   ============================================= */

/* ---- CSS Custom Properties (Light Mode) ---- */
:root {
    /* Primary – Swiss Red */
    --color-swiss-red: #D52B1E;
    --color-swiss-red-light: #FF6B6B;
    --color-swiss-red-dark: #A61B12;

    /* Secondary – Energy Teal */
    --color-energy-teal: #007A7C;
    --color-energy-teal-light: #5BBFB3;
    --color-energy-teal-dark: #005F60;

    /* Backgrounds */
    --color-bg-primary: #FFFFFF;
    --color-bg-secondary: #F4F6F8;
    --color-bg-tertiary: #E9ECEF;
    --color-bg-card: #FFFFFF;

    /* Borders */
    --color-border: #DEE2E6;
    --color-border-light: #E9ECEF;

    /* Text */
    --color-text-primary: #1A1A1A;
    --color-text-secondary: #4A5568;
    --color-text-muted: #718096;
    --color-text-inverse: #FFFFFF;

    /* Chart accent colors */
    --color-chart-production: #F59E0B;
    --color-chart-consumption: #D52B1E;
    --color-chart-soc: #007A7C;
    --color-chart-grid-import: #3B82F6;
    --color-chart-grid-export: #10B981;

    /* Shadows */
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.05), 0 1px 1px rgba(0, 0, 0, 0.03);
    --shadow-card-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-elevated: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* Hero gradient */
    --hero-gradient: linear-gradient(135deg, #F4F6F8 0%, #E9ECEF 50%, #dfe6ed 100%);
    --hero-accent-gradient: linear-gradient(135deg, var(--color-swiss-red), var(--color-chart-production));
}

/* ---- Dark Mode (automatic via media query) ---- */
@media (prefers-color-scheme: dark) {
    :root {
        --color-swiss-red: #FF6B6B;
        --color-swiss-red-light: #FF8787;
        --color-swiss-red-dark: #D52B1E;

        --color-energy-teal: #2A9D8F;
        --color-energy-teal-light: #64FFDA;
        --color-energy-teal-dark: #1D7569;

        --color-bg-primary: #0F172A;
        --color-bg-secondary: #020617;
        --color-bg-tertiary: #1E293B;
        --color-bg-card: #1E293B;

        --color-border: #334155;
        --color-border-light: #1E293B;

        --color-text-primary: #F8FAFC;
        --color-text-secondary: #CBD5E1;
        --color-text-muted: #94A3B8;
        --color-text-inverse: #0F172A;

        --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3);
        --shadow-card-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
        --shadow-elevated: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);

        --hero-gradient: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #0F172A 100%);
        --hero-accent-gradient: linear-gradient(135deg, #FF6B6B, #F59E0B);
    }
}

/* =============================================
   Reset & Base
   ============================================= */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--color-bg-secondary);
    color: var(--color-text-primary);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--color-energy-teal);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--color-energy-teal-light);
}

img,
svg {
    max-width: 100%;
    height: auto;
}

/* =============================================
   Layout Utilities
   ============================================= */

.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 5rem 0;
}

.section-alt {
    background-color: var(--color-bg-primary);
}

.section-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.section-header p {
    color: var(--color-text-secondary);
    font-size: 1.125rem;
    max-width: 640px;
    margin: 0 auto;
}

/* =============================================
   Navigation
   ============================================= */

.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--color-bg-primary);
    border-bottom: 1px solid var(--color-border-light);
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.85);
}

@media (prefers-color-scheme: dark) {
    .navbar {
        background: rgba(15, 23, 42, 0.85);
    }
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 3.75rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--color-text-primary);
}

.navbar-brand svg {
    width: 32px;
    height: 32px;
}

.navbar-nav {
    display: flex;
    list-style: none;
    gap: 0.25rem;
}

.navbar-nav a {
    display: block;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    border-radius: var(--radius-md);
    transition: background 0.15s, color 0.15s;
}

.navbar-nav a:hover {
    background: var(--color-bg-tertiary);
    color: var(--color-text-primary);
}

.navbar-nav .btn-primary {
    color: white;
    background-color: var(--color-swiss-red);
}

.navbar-nav .btn-primary:hover {
    background-color: var(--color-swiss-red-dark);
    box-shadow: 0 4px 14px rgba(213, 43, 30, 0.3);
    transform: translateY(-1px);
    color: white;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-text-primary);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}

/* =============================================
   Hero
   ============================================= */

.hero {
    background: var(--hero-gradient);
    padding: 6rem 0 5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 122, 124, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -15%;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(213, 43, 30, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 1rem;
}

.hero h1 .accent {
    background: var(--hero-accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.2rem;
    color: var(--color-text-secondary);
    max-width: 560px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* =============================================
   Buttons
   ============================================= */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--color-swiss-red);
    color: white;
}

.btn-primary:hover {
    background-color: var(--color-swiss-red-dark);
    box-shadow: 0 4px 14px rgba(213, 43, 30, 0.3);
    transform: translateY(-1px);
    color: white;
}

.btn-secondary {
    background-color: var(--color-bg-card);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background-color: var(--color-bg-tertiary);
    transform: translateY(-1px);
    color: var(--color-text-primary);
}

/* =============================================
   Cards
   ============================================= */

.card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    padding: 2rem;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    font-size: 1.5rem;
}

.card-icon-red {
    background: rgba(213, 43, 30, 0.1);
    color: var(--color-swiss-red);
}

.card-icon-teal {
    background: rgba(0, 122, 124, 0.1);
    color: var(--color-energy-teal);
}

.card-icon-amber {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-chart-production);
}

.card-icon-blue {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-chart-grid-import);
}

.card-icon-green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-chart-grid-export);
}

.card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card p {
    color: var(--color-text-secondary);
    font-size: 0.9375rem;
    line-height: 1.65;
}

/* =============================================
   Grid Layouts
   ============================================= */

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* =============================================
   Intro Section (Solar & Batterie)
   ============================================= */

.intro-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: start;
}

.intro-text h3 {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.intro-text p {
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
    font-size: 0.9375rem;
}

.intro-text p:last-child {
    margin-bottom: 0;
}

.highlight-box {
    background: linear-gradient(135deg, rgba(0, 122, 124, 0.06), rgba(0, 122, 124, 0.02));
    border: 1px solid rgba(0, 122, 124, 0.15);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
}

@media (prefers-color-scheme: dark) {
    .highlight-box {
        background: linear-gradient(135deg, rgba(42, 157, 143, 0.08), rgba(42, 157, 143, 0.02));
        border-color: rgba(42, 157, 143, 0.2);
    }
}

.highlight-box h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--color-energy-teal);
}

.highlight-box ul {
    list-style: none;
    padding: 0;
}

.highlight-box li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--color-text-secondary);
    font-size: 0.9375rem;
}

.highlight-box li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--color-energy-teal);
    font-weight: 700;
}

/* =============================================
   Steps / Benutzeranleitung
   ============================================= */

.steps {
    counter-reset: step-counter;
}

.step {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    position: relative;
}

.step:last-child {
    margin-bottom: 0;
}

.step-number {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-swiss-red);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.step:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 23px;
    top: 56px;
    bottom: -8px;
    width: 2px;
    background: var(--color-border);
}

.step-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
}

.step-content p {
    color: var(--color-text-secondary);
    font-size: 0.9375rem;
    line-height: 1.65;
}

.step-content ul {
    margin-top: 0.5rem;
    padding-left: 1.25rem;
    color: var(--color-text-secondary);
    font-size: 0.9375rem;
}

.step-content li {
    margin-bottom: 0.375rem;
}

/* =============================================
   Badge
   ============================================= */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
    background: var(--color-energy-teal);
    color: white;
    letter-spacing: 0.02em;
}

.badge-amber {
    background: var(--color-chart-production);
    color: #1A1A1A;
}

/* =============================================
   Feature Highlight (alternating image+text)
   ============================================= */

.feature-row {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 3rem;
}

.feature-row:last-child {
    margin-bottom: 0;
}

.feature-visual {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-xl);
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    font-size: 4rem;
}

.feature-text h3 {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.feature-text p {
    color: var(--color-text-secondary);
    font-size: 0.9375rem;
    line-height: 1.65;
    margin-bottom: 0.75rem;
}

/* =============================================
   Results / KPI Preview
   ============================================= */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.kpi-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    box-shadow: var(--shadow-card);
    text-align: center;
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-energy-teal);
    margin-bottom: 0.25rem;
}

.kpi-label {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

/* =============================================
   Footer
   ============================================= */

.footer {
    background: var(--color-bg-primary);
    border-top: 1px solid var(--color-border-light);
    padding: 2.5rem 0;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--color-text-primary);
}

.footer-brand svg {
    width: 24px;
    height: 24px;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.footer-links a {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.footer-links a:hover {
    color: var(--color-energy-teal);
}

.footer-copy {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

/* =============================================
   Scroll Reveal Animations
   ============================================= */

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* stagger children */
.reveal-delay-1 {
    transition-delay: 0.1s;
}

.reveal-delay-2 {
    transition-delay: 0.2s;
}

.reveal-delay-3 {
    transition-delay: 0.3s;
}

.reveal-delay-4 {
    transition-delay: 0.4s;
}

.reveal-delay-5 {
    transition-delay: 0.5s;
}

/* =============================================
   Responsive
   ============================================= */

@media (min-width: 640px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .kpi-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 768px) {
    .intro-grid {
        grid-template-columns: 1fr 1fr;
    }

    .feature-row {
        flex-direction: row;
        align-items: center;
    }

    .feature-row.reverse {
        flex-direction: row-reverse;
    }

    .feature-visual,
    .feature-text {
        flex: 1;
    }

    .section {
        padding: 6rem 0;
    }
}

@media (min-width: 1024px) {
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .hero h1 {
        font-size: 3.5rem;
    }

    .section-header h2 {
        font-size: 2.25rem;
    }
}

/* Mobile nav */
@media (max-width: 767px) {
    .navbar-nav {
        display: none;
        position: absolute;
        top: 3.75rem;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--color-bg-primary);
        border-bottom: 1px solid var(--color-border);
        padding: 0.5rem;
        box-shadow: var(--shadow-elevated);
    }

    @media (prefers-color-scheme: dark) {
        .navbar-nav {
            background: var(--color-bg-primary);
        }
    }

    .navbar-nav.open {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }

    .hero h1 {
        font-size: 2.25rem;
    }

    .hero p {
        font-size: 1.05rem;
    }

    .hero-icon {
        width: 64px;
        height: 64px;
    }

    .step {
        gap: 1rem;
    }

    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .step:not(:last-child)::before {
        left: 19px;
        top: 48px;
    }
}