/**
 * TrafficWeapon — Home page design system
 * Loaded only on page-home (see HomeController)
 */

/* ---- Readability tokens (home) ---- */
.page-home {
    --home-text-on-dark: #f1f5f9;
    --home-text-on-dark-muted: #cbd5e1;
    --home-text-on-light-muted: #334155;
    --home-eyebrow: #c2410c;
}

/* ---- Page shell ---- */
.page-home .site-main__wrap {
    padding-top: 0;
    max-width: 1180px;
}

.page-home .breadcrumbs {
    display: none;
}

.home-page {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ---- Section headers (shared) ---- */
.home-section {
    padding: var(--space-3xl) 0;
    position: relative;
}

.home-section__head {
    text-align: center;
    max-width: 640px;
    margin: 0 auto var(--space-2xl);
}

.home-section__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 var(--space-sm);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--home-eyebrow);
}

.home-section__eyebrow::before {
    content: '';
    width: 1.5rem;
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary), transparent);
    border-radius: 1px;
}

.home-section__title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.5rem, 3.2vw, 2rem);
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin: 0 0 var(--space);
    color: var(--color-text);
}

.home-section__intro {
    margin: 0;
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--home-text-on-light-muted);
}

.home-section__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space);
    justify-content: center;
    margin-top: var(--space-2xl);
}

.home-section--band {
    margin-left: calc(-1 * var(--space-xl));
    margin-right: calc(-1 * var(--space-xl));
    padding-left: var(--space-xl);
    padding-right: var(--space-xl);
    background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-bg-alt) 100%);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.btn--lg {
    padding: 0.85rem 1.65rem;
    font-size: 1rem;
}

/* ---- Hero (home) — dark split layout ---- */
.page-home .hero--home {
    margin-bottom: var(--space-3xl);
    padding: clamp(2.5rem, 6vw, 4.5rem) var(--space-xl);
    background: linear-gradient(145deg, #060a12 0%, #0f172a 40%, #1a2744 100%);
    border-radius: 0;
    box-shadow: none;
    text-align: left;
    overflow: visible;
}

.page-home .hero--home::before {
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.18) 0%, transparent 45%);
}

.page-home .hero--home::after {
    top: auto;
    bottom: -20%;
    right: 5%;
    width: 45%;
    height: 70%;
    background: radial-gradient(ellipse at center, rgba(59, 130, 246, 0.12) 0%, transparent 65%);
}

.page-home .hero__inner {
    position: relative;
    z-index: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
}

.page-home .hero__copy {
    max-width: 36rem;
}

.page-home .hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 var(--space-lg);
    padding: 0.35rem 0.85rem 0.35rem 0.55rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--home-text-on-dark);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-full);
    backdrop-filter: blur(8px);
}

.page-home .hero__badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
    animation: home-pulse 2s ease-in-out infinite;
}

@keyframes home-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.92); }
}

.page-home .hero__channels {
    justify-content: flex-start;
    margin-bottom: var(--space-lg);
}

.page-home .hero__channel {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: var(--home-text-on-dark);
    font-weight: 600;
    font-size: 0.8125rem;
    padding: 0.4rem 0.8rem;
}

.page-home .hero__headline {
    text-align: left;
    margin-left: 0;
    margin-right: 0;
    max-width: none;
    font-size: clamp(2.1rem, 4.5vw, 3.25rem);
    line-height: 1.15;
    color: #fff;
}

.page-home .hero__highlight {
    color: #fb923c;
    background: linear-gradient(120deg, #fdba74 0%, #fb923c 50%, #f97316 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .page-home .hero__highlight {
        color: transparent;
    }
}

.page-home .hero__subheadline {
    text-align: left;
    margin-left: 0;
    margin-right: 0;
    max-width: none;
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--home-text-on-dark-muted);
}

.page-home .hero__ctas {
    justify-content: flex-start;
    margin-bottom: var(--space-xl);
}

.page-home .hero__stats {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xl);
    margin: 0;
    padding: var(--space-lg) 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.page-home .hero__stat {
    margin: 0;
}

.page-home .hero__stat-value {
    display: block;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.75rem;
    letter-spacing: -0.03em;
    color: #fff;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.page-home .hero__stat-label {
    margin: 0;
    font-size: 0.875rem;
    color: #94a3b8;
    font-weight: 500;
}

.page-home .hero__cta--secondary {
    border: 2px solid rgba(255, 255, 255, 0.45);
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.page-home .hero__cta--secondary:hover {
    border-color: rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* Panel preview mockup */
.page-home .hero__preview {
    perspective: 1200px;
}

.page-home .hero-preview {
    transform: rotateY(-6deg) rotateX(4deg);
    transform-style: preserve-3d;
    border-radius: var(--radius-xl);
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.2),
        0 24px 48px -12px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    overflow: hidden;
    transition: transform 0.4s ease;
}

.page-home .hero-preview:hover {
    transform: rotateY(-2deg) rotateX(2deg) translateY(-4px);
}

.page-home .hero-preview__chrome {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1rem;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.page-home .hero-preview__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
}

.page-home .hero-preview__dot:nth-child(1) { background: #ef4444; }
.page-home .hero-preview__dot:nth-child(2) { background: #eab308; }
.page-home .hero-preview__dot:nth-child(3) { background: #22c55e; }

.page-home .hero-preview__url {
    margin-left: auto;
    font-size: 0.6875rem;
    color: rgba(148, 163, 184, 0.8);
    font-family: ui-monospace, monospace;
}

.page-home .hero-preview__body {
    display: flex;
    min-height: 220px;
}

.page-home .hero-preview__nav {
    width: 52px;
    padding: 1rem 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.page-home .hero-preview__nav-item {
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
}

.page-home .hero-preview__nav-item.is-active {
    background: linear-gradient(90deg, var(--color-primary), #fb923c);
    box-shadow: 0 0 12px rgba(234, 88, 12, 0.4);
}

.page-home .hero-preview__main {
    flex: 1;
    padding: 1rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.page-home .hero-preview__kpis {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.page-home .hero-preview__kpi {
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
}

.page-home .hero-preview__kpi--accent {
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.35), rgba(234, 88, 12, 0.1));
    border: 1px solid rgba(234, 88, 12, 0.25);
}

.page-home .hero-preview__chart {
    flex: 1;
    min-height: 72px;
    border-radius: 10px;
    background:
        linear-gradient(180deg, rgba(234, 88, 12, 0.15) 0%, transparent 100%),
        repeating-linear-gradient(90deg, rgba(255,255,255,0.04) 0, rgba(255,255,255,0.04) 1px, transparent 1px, transparent 24px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    overflow: hidden;
}

.page-home .hero-preview__chart::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 55%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 60' preserveAspectRatio='none'%3E%3Cpath fill='%23ea580c' fill-opacity='0.35' d='M0 60 L0 45 L30 38 L55 42 L80 28 L110 32 L140 18 L170 24 L200 12 L200 60 Z'/%3E%3Cpath fill='none' stroke='%23fb923c' stroke-width='2' d='M0 45 L30 38 L55 42 L80 28 L110 32 L140 18 L170 24 L200 12'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat;
}

.page-home .hero-preview__rows {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.page-home .hero-preview__rows span {
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
}

.page-home .hero-preview__rows span:nth-child(1) { width: 92%; }
.page-home .hero-preview__rows span:nth-child(2) { width: 78%; }
.page-home .hero-preview__rows span:nth-child(3) { width: 65%; }

/* Non-home heroes: neutralize inner wrapper */
.hero:not(.hero--home) .hero__inner {
    display: block;
}

.hero:not(.hero--home) .hero__preview {
    display: none;
}

/* ---- Platform bento grid ---- */
.page-home .platform-modules--home {
    padding-top: 0;
}

.page-home .platform-modules__grid--bento {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: minmax(140px, auto);
    gap: var(--space);
}

.page-home .platform-module {
    position: relative;
    padding: var(--space-xl);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.page-home .platform-module::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), transparent);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.page-home .platform-module:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), 0 12px 32px rgba(15, 23, 42, 0.08);
    border-color: rgba(234, 88, 12, 0.2);
}

.page-home .platform-module:hover::before {
    opacity: 1;
}

.page-home .platform-module--featured {
    grid-column: span 3;
}

.page-home .platform-module:not(.platform-module--featured) {
    grid-column: span 2;
}

.page-home .platform-module__index {
    position: absolute;
    top: var(--space);
    right: var(--space);
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--color-text-subtle);
}

.page-home .platform-module__desc {
    color: var(--home-text-on-light-muted);
    line-height: 1.65;
}

.page-home .platform-module__title {
    color: var(--color-text);
}

.page-home .platform-module--featured .platform-module__desc {
    max-width: 28em;
}

/* ---- Channels band ---- */
.page-home .value-props--channels {
    padding: var(--space-2xl) var(--space-xl);
}

.page-home .value-props--channels .value-props__grid {
    gap: var(--space);
}

.page-home .value-props__card {
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.page-home .value-props__card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* ---- Timeline steps ---- */
.page-home .how-it-works--timeline {
    background: linear-gradient(180deg, transparent 0%, var(--color-accent-soft) 50%, transparent 100%);
    border-radius: var(--radius-2xl);
    padding: var(--space-3xl) var(--space-lg);
    margin: var(--space-2xl) 0;
}

.page-home .how-it-works--timeline .how-it-works__grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space);
    max-width: none;
    position: relative;
}

.page-home .how-it-works--timeline .how-it-works__grid::before {
    content: '';
    position: absolute;
    top: 2rem;
    left: 12%;
    right: 12%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
    opacity: 0.25;
    pointer-events: none;
}

.page-home .how-it-works--timeline .how-it-works__step {
    text-align: left;
    padding: var(--space-xl);
    background: var(--color-surface);
    position: relative;
    z-index: 1;
}

.page-home .how-it-works--timeline .how-it-works__num {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
}

.page-home .how-it-works--timeline .how-it-works__step-title {
    color: var(--color-text);
}

.page-home .how-it-works--timeline .how-it-works__step-desc {
    color: var(--home-text-on-light-muted);
    line-height: 1.65;
}

.page-home .value-props--channels .value-props__card p {
    color: var(--home-text-on-light-muted);
}

.page-home .value-props--channels .value-props__link {
    color: var(--home-eyebrow);
}

.page-home .tools-teaser--home .home-section__intro,
.page-home .tools-teaser__intro {
    color: var(--home-text-on-light-muted);
}

.page-home .tools-teaser__card-label {
    color: var(--color-text);
    font-weight: 600;
}

.page-home .testimonial-card__content {
    color: var(--home-text-on-light-muted);
    font-style: normal;
}

/* Softer background texture on home for cleaner reading */
body.page-home::before {
    opacity: 0.45;
}

/* ---- Tools ---- */
.page-home .tools-teaser--home {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-2xl);
    padding: var(--space-2xl) var(--space-xl);
    margin: 0;
    box-shadow: var(--shadow);
}

.page-home .tools-teaser__card {
    background: var(--color-bg);
}

.page-home .tools-teaser__card:hover .tools-teaser__card-icon {
    transform: scale(1.05);
}

.page-home .tools-teaser__card-icon {
    transition: transform 0.2s ease;
}

/* ---- CTA + testimonials ---- */
.page-home .cta-section {
    border-radius: var(--radius-2xl);
    margin-top: var(--space-3xl);
}

.page-home .testimonials-section--home .testimonials-section__grid {
    gap: var(--space-lg);
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .page-home .hero__inner {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .page-home .hero__copy {
        max-width: none;
    }

    .page-home .hero__channels,
    .page-home .hero__ctas {
        justify-content: center;
    }

    .page-home .hero__headline,
    .page-home .hero__subheadline {
        text-align: center;
    }

    .page-home .hero__stats {
        justify-content: center;
    }

    .page-home .hero__preview {
        max-width: 420px;
        margin: 0 auto;
    }

    .page-home .hero-preview {
        transform: none;
    }

    .page-home .platform-modules__grid--bento {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-home .platform-module--featured,
    .page-home .platform-module:not(.platform-module--featured) {
        grid-column: span 1;
    }

    .page-home .how-it-works--timeline .how-it-works__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-home .how-it-works--timeline .how-it-works__grid::before {
        display: none;
    }
}

@media (max-width: 640px) {
    .page-home .hero--home {
        padding: var(--space-2xl) var(--space);
    }

    .page-home .hero__stats {
        gap: var(--space-lg);
    }

    .page-home .platform-modules__grid--bento {
        grid-template-columns: 1fr;
    }

    .page-home .how-it-works--timeline .how-it-works__grid {
        grid-template-columns: 1fr;
    }

    .home-section--band {
        margin-left: calc(-1 * var(--space));
        margin-right: calc(-1 * var(--space));
        padding-left: var(--space);
        padding-right: var(--space);
        border-radius: var(--radius-xl);
    }

    .page-home .site-main__wrap {
        padding-left: var(--space);
        padding-right: var(--space);
    }
}

@media (prefers-reduced-motion: reduce) {
    .page-home .hero__badge-dot {
        animation: none;
    }

    .page-home .hero-preview:hover,
    .page-home .platform-module:hover,
    .page-home .value-props__card:hover {
        transform: none;
    }
}
