/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@700&family=Inter:wght@400;600;700&display=swap');

:root {
    --primary-blue: #0e2a47;
    --secondary-blue: #1f4b7a;
    --accent-red: #e84c3d;
    --success-green: #10b981;
    --warning-yellow: #f59e0b;
    --danger-red: #ef4444;

    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #102030;
    --text-muted: #64748b;

    --shadow-soft: 0 10px 30px -5px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 20px 40px -5px rgba(0, 0, 0, 0.12);

    --radius-lg: 16px;
    --radius-md: 10px;

    --transition-fast: 0.2s ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: 'Merriweather', serif;
    margin-top: 0;
    line-height: 1.3;
}

h1 {
    font-size: 38px;
    color: #ffffff;
    margin-bottom: 12px;
}

.hero-sub {
    font-size: 20px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.section-icon {
    width: 32px;
    height: 32px;
    fill: var(--accent-red);
}

h2 {
    font-size: 26px;
    color: var(--primary-blue);
    margin-bottom: 0;
    /* Handled by section-header */
    position: relative;
}

p {
    margin-bottom: 16px;
}

/* Section Animation */
section {
    padding: 50px 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    padding: 60px 0 80px;
    text-align: center;
    color: #fff;
    border-radius: 0 0 24px 24px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.hero-bg-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: auto;
    opacity: 0.05;
    pointer-events: none;
    fill: #fff;
}

/* Snapshot Grid */
.snapshot {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.snap-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
}

.snap-bg-icon {
    position: absolute;
    right: -10px;
    bottom: -10px;
    width: 80px;
    height: 80px;
    fill: var(--primary-blue);
    opacity: 0.05;
    transform: rotate(-15deg);
}

.snap-value {
    display: block;
    font-size: 42px;
    font-weight: 700;
    color: var(--primary-blue);
    font-family: 'Merriweather', serif;
    position: relative;
    z-index: 1;
}

.snap-label {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

.snap-compare {
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-muted);
    padding-top: 12px;
    border-top: 1px solid #edf2f7;
    position: relative;
    z-index: 1;
}

/* Full Chart Section */
.chart-container {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.bar-row:last-child {
    margin-bottom: 0;
}

.rank {
    width: 24px;
    font-weight: 700;
    color: var(--text-muted);
    text-align: center;
}

.brand-name {
    width: 90px;
    font-weight: 600;
    color: var(--primary-blue);
}

.bar-area {
    flex: 1;
    height: 24px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--secondary-blue);
    width: 0%;
    transition: width 1s cubic-bezier(0.2, 1, 0.3, 1);
    border-radius: 4px;
}

/* Top 3 colors */
.bar-row:nth-child(1) .bar-fill {
    background: var(--primary-blue);
}

.bar-row:nth-child(2) .bar-fill {
    background: var(--secondary-blue);
}

.bar-row:nth-child(3) .bar-fill {
    background: #3b82f6;
}

.bar-val {
    width: 60px;
    text-align: right;
    font-weight: 700;
    font-size: 14px;
}

/* Contrast Block (Growth vs Decline) */
.contrast-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.contrast-col {
    background: #fff;
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.contrast-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    opacity: 0.1;
}

.contrast-col h3 {
    font-size: 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.growth h3 {
    color: var(--success-green);
}

.decline h3 {
    color: var(--danger-red);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
    z-index: 1;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-name {
    font-weight: 600;
    color: var(--text-main);
}

.stat-val {
    font-weight: 700;
}

.growth .stat-val {
    color: var(--success-green);
}

.decline .stat-val {
    color: var(--danger-red);
}

/* Insight Groups */
.insight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.group-card {
    background: #fff;
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border-top: 4px solid transparent;
    position: relative;
    overflow: hidden;
}

.group-bg-icon {
    position: absolute;
    bottom: -10px;
    right: -10px;
    width: 60px;
    height: 60px;
    opacity: 0.08;
    fill: currentColor;
    transform: rotate(10deg);
}

.group-card.healthy {
    border-color: var(--success-green);
    color: var(--success-green);
}

.group-card.breakout {
    border-color: var(--warning-yellow);
    color: var(--warning-yellow);
}

.group-card.holding {
    border-color: #f97316;
    color: #f97316;
}

.group-card.risk {
    border-color: var(--danger-red);
    color: var(--danger-red);
}

.group-title {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 14px;
    margin-bottom: 12px;
    color: inherit;
    position: relative;
    z-index: 1;
}

.group-brands {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 8px;
    font-family: 'Merriweather', serif;
    position: relative;
    z-index: 1;
}

.group-desc ul {
    margin: 0;
    padding-left: 20px;
    font-size: 14px;
    color: var(--text-muted);
    position: relative;
    z-index: 1;
}

.group-desc li {
    margin-bottom: 4px;
}

/* Case Studies */
.case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.case-card {
    background: #fff;
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.case-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: var(--primary-blue);
}

.case-bg-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    fill: var(--primary-blue);
    opacity: 0.04;
}

.case-card h4 {
    font-size: 20px;
    color: var(--primary-blue);
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.case-tag {
    font-size: 10px;
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 4px;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-weight: normal;
    text-transform: uppercase;
    height: fit-content;
}

.case-row {
    font-size: 14px;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.case-row strong {
    color: var(--text-main);
}

.case-row span {
    color: var(--text-muted);
}

/* Funnel */
.funnel-container {
    background: #fff;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    text-align: center;
}

.funnel-svg {
    max-width: 400px;
    margin: 0 auto 24px;
    display: block;
}

.funnel-poly {
    fill: var(--secondary-blue);
    opacity: 0.6;
    transition: 0.5s;
}

.funnel-poly.active {
    opacity: 1;
    fill: var(--primary-blue);
}

.funnel-info p {
    margin-bottom: 8px;
    font-weight: 500;
}

.funnel-conditions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.cond-tag {
    background: #ecf3f9;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--primary-blue);
    font-weight: 600;
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 40px;
    border-top: 1px solid #e2e8f0;
}

/* Responsive */
@media (max-width: 768px) {
    .contrast-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 40px 0 60px;
    }

    h1 {
        font-size: 28px;
    }

    h2 {
        font-size: 22px;
    }

    .bar-row {
        gap: 8px;
    }

    .rank {
        width: 20px;
        font-size: 12px;
    }

    .brand-name {
        width: 70px;
        font-size: 13px;
    }


    .bar-val {
        width: 45px;
        font-size: 12px;
    }
}

/* Stagger Animation */
.stagger-item {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.2, 1, 0.3, 1);
}

.stagger-item.active {
    opacity: 1;
    transform: translateY(0);
}