/**
 * Homepage-specific styles
 * Requires: /css/ds4a.css (base styles)
 */

/* Noise texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    z-index: 1000;
}

body {
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    height: 40px;
    width: auto;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.4rem 0.75rem;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.header-badge svg {
    width: 18px;
    height: 11px;
    border-radius: 2px;
}

.header-badge.victron {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 2rem;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 2.5rem;
}

.hero-logo {
    height: 70px;
    width: auto;
    margin-bottom: 1rem;
}

.tagline {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2rem;
    letter-spacing: 0.1em;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.tagline .highlight {
    display: inline-block;
    width: 1.4em;
    height: 1.4em;
    vertical-align: middle;
    margin: 0 0.05em;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Section Labels */
.section-label {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    max-width: 1100px;
}

.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* Navigation Grid */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
    max-width: 1100px;
    width: 100%;
    margin-bottom: 2.5rem;
}

.nav-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    min-height: 180px;
}

.nav-card:hover {
    border-color: var(--accent-orange);
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(255, 107, 44, 0.1);
}

.nav-card-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    overflow: hidden;
}

.nav-card-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

.nav-card:hover .nav-card-icon {
    transform: scale(1.05);
}

.nav-card-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.4rem;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}

.nav-card-description {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
    flex-grow: 1;
}

.nav-card-arrow {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    font-size: 1.25rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
    opacity: 0;
}

.nav-card:hover .nav-card-arrow {
    color: var(--accent-orange);
    transform: translateX(4px);
    opacity: 1;
}

/* Card Tags */
.nav-card-tag {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.nav-card-tag.coming-soon {
    background: var(--text-muted);
    color: var(--bg-primary);
}

.nav-card-tag.new {
    background: var(--accent-green);
    color: var(--bg-primary);
}

.nav-card-tag.victron {
    background: var(--accent-blue);
    color: white;
}

.nav-card-tag.emergency {
    background: var(--accent-red);
    color: white;
}

.nav-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-card.disabled:hover {
    border-color: var(--border-color);
    transform: none;
    box-shadow: none;
}

.nav-card.disabled:hover .nav-card-icon {
    transform: none;
}

/* Support Card - Wider */
.nav-card.support-card {
    grid-column: span 2;
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
    min-height: auto;
    padding: 1.5rem 2rem;
}

.nav-card.support-card .nav-card-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 0;
    flex-shrink: 0;
}

.nav-card.support-card .nav-card-content {
    flex: 1;
}

.nav-card.support-card .nav-card-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.feature-tag {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-grid {
        grid-template-columns: 1fr;
    }

    .nav-card.support-card {
        grid-column: span 1;
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-card.support-card .nav-card-icon {
        margin-bottom: 1rem;
    }

    .tagline {
        font-size: 1.5rem;
    }

    .hero-logo {
        height: 50px;
    }

    header {
        flex-direction: column;
        gap: 1rem;
    }

    .header-right {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 540px) {
    .nav-card {
        min-height: 160px;
    }
}
