/* ============================================================
   Battery analysis page — Zamily vs competitors
   ============================================================ */

.battery-page {
    position: relative;
    overflow: hidden;
}

.battery-page__bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 10% 10%, rgba(13, 148, 136, 0.06), transparent 40%),
        radial-gradient(circle at 90% 20%, rgba(239, 68, 68, 0.04), transparent 40%);
}

.battery-shell {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    padding: clamp(3rem, 6vw, 5rem) 1.5rem;
    display: grid;
    gap: clamp(3rem, 6vw, 5rem);
}

/* ---------- Hero ---------- */
.battery-hero {
    text-align: center;
}

.battery-hero h1 {
    font-size: clamp(2rem, 5vw, 3.25rem);
    line-height: 1.1;
    margin: 0.75rem 0 1rem;
    font-weight: 700;
}

.battery-hero__lead {
    max-width: 680px;
    margin: 0 auto;
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
}

.battery-hero__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 780px;
    margin: 2.5rem auto 0;
}

@media (max-width: 640px) {
    .battery-hero__stats {
        grid-template-columns: 1fr;
    }
}

.battery-stat {
    background: var(--bg-surface2);
    border: 1px solid var(--border, rgba(120, 120, 120, 0.18));
    border-radius: 16px;
    padding: 1.4rem 1.2rem;
    text-align: center;
}

.battery-stat__label {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.battery-stat__value {
    display: block;
    font-size: clamp(2rem, 5vw, 2.6rem);
    line-height: 1;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.battery-stat--us .battery-stat__value { color: #0d9488; }
.battery-stat--them .battery-stat__value { color: #ef4444; }
.battery-stat--diff .battery-stat__value {
    background: linear-gradient(135deg, #0d9488, #14b8a6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.battery-stat__meta {
    display: block;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ---------- Honesty callout under hero stats ---------- */
.battery-honesty {
    max-width: 780px;
    margin: 2rem auto 0;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: rgba(234, 179, 8, 0.06);
    border: 1px solid rgba(234, 179, 8, 0.25);
    border-radius: 14px;
    padding: 1.25rem 1.4rem;
    text-align: left;
    font-size: 0.93rem;
    line-height: 1.65;
    color: var(--text-secondary);
}

.battery-honesty__icon {
    flex: 0 0 auto;
    color: #ca8a04;
    margin-top: 1px;
}

.battery-honesty__body strong { color: var(--text-primary); }
.battery-honesty__body code {
    background: rgba(120, 120, 120, 0.12);
    padding: 0.1em 0.35em;
    border-radius: 4px;
    font-size: 0.88em;
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
}

/* ---------- Background-only section ---------- */
.battery-background__header {
    text-align: center;
    margin-bottom: 2rem;
}

.battery-background__lede {
    max-width: 720px;
    margin: 0.75rem auto 0;
    color: var(--text-secondary);
    line-height: 1.7;
}

.battery-background__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

@media (max-width: 720px) {
    .battery-background__grid { grid-template-columns: 1fr; }
}

.battery-background-card {
    background: var(--bg-surface2);
    border: 1px solid var(--border, rgba(120, 120, 120, 0.18));
    border-radius: 16px;
    padding: 1.5rem 1.75rem;
}

.battery-background-card--us { border-top: 4px solid #0d9488; }
.battery-background-card--them { border-top: 4px solid #ef4444; }

.battery-background-card__topline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.battery-background-card__name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.battery-background-card__badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    padding: 0.25em 0.6em;
    border-radius: 999px;
    background: rgba(120, 120, 120, 0.15);
    color: var(--text-muted);
}

.battery-background-card__value {
    font-size: clamp(2rem, 5vw, 2.6rem);
    font-weight: 700;
    line-height: 1;
    margin: 0.25rem 0 0.5rem;
}

.battery-background-card--us .battery-background-card__value { color: #0d9488; }
.battery-background-card--them .battery-background-card__value { color: #ef4444; }

.battery-background-card__meta {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin: 0 0 1.1rem;
}

.battery-background-card__breakdown {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.5rem;
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.battery-background-card__breakdown li {
    position: relative;
    padding-left: 1rem;
}

.battery-background-card__breakdown li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.65em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.5;
}

.battery-background-card--us .battery-background-card__breakdown li::before { background: #0d9488; opacity: 0.7; }
.battery-background-card--them .battery-background-card__breakdown li::before { background: #ef4444; opacity: 0.7; }

.battery-background-card__breakdown strong { color: var(--text-primary); }

.battery-background__note {
    margin-top: 1.5rem;
    max-width: 780px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.battery-background__note strong { color: var(--text-primary); }

/* ---------- Chart section ---------- */
.battery-chart-section__header {
    text-align: center;
    margin-bottom: 2rem;
}

.battery-chart-section__lede {
    max-width: 720px;
    margin: 0.75rem auto 0;
    color: var(--text-secondary);
    font-size: 0.98rem;
    line-height: 1.65;
}

.battery-chart {
    background: var(--bg-surface2);
    border: 1px solid var(--border, rgba(120, 120, 120, 0.18));
    border-radius: 20px;
    padding: 2rem 1.5rem 1.5rem;
    box-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.2);
    margin: 0 0 1.25rem;
}

.battery-chart__svg {
    width: 100%;
    height: auto;
    display: block;
    color: var(--text-primary);
}

.battery-chart__caption {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    text-align: center;
}

.battery-chart__legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem 2rem;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.battery-chart__legend li {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.battery-chart__legend-swatch {
    display: inline-block;
    width: 24px;
    height: 3px;
    border-radius: 2px;
}

.battery-chart__legend-swatch--us          { background: #0d9488; }
.battery-chart__legend-swatch--us-range    {
    /* Band swatch: shows the filled-range aesthetic from the chart */
    background: rgba(13, 148, 136, 0.25);
    border-top: 2px dashed #0d9488;
    border-bottom: 2px solid #0d9488;
    width: 28px;
    height: 10px;
    border-radius: 2px;
}
.battery-chart__legend-swatch--them        { background: #ef4444; }
.battery-chart__legend-swatch--them-worst  {
    background: repeating-linear-gradient(to right, #ef4444 0 3px, transparent 3px 7px);
    opacity: 0.7;
}
.battery-chart__legend-swatch--idle        {
    background: repeating-linear-gradient(to right, #9ca3af 0 4px, transparent 4px 8px);
}

/* ---------- Why three cards ---------- */
.battery-why__header {
    text-align: center;
    margin-bottom: 2rem;
}

.battery-why__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

@media (max-width: 900px) {
    .battery-why__grid {
        grid-template-columns: 1fr;
    }
}

.battery-why-card {
    background: var(--bg-surface2);
    border: 1px solid var(--border, rgba(120, 120, 120, 0.18));
    border-radius: 16px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
}

.battery-why-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(13, 148, 136, 0.12);
    color: #0d9488;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.battery-why-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 0.6rem;
}

.battery-why-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.65;
    margin: 0 0 0.8rem;
}

.battery-why-card__delta {
    margin-top: auto !important;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border, rgba(120, 120, 120, 0.2));
    font-size: 0.85rem;
    color: var(--text-primary) !important;
}

.battery-why-card__delta strong {
    color: #0d9488;
}

/* ---------- Methodology ---------- */
.battery-method__header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.battery-method__lede {
    max-width: 680px;
    margin: 0.75rem auto 0;
    color: var(--text-secondary);
    line-height: 1.7;
}

.battery-method__content {
    background: var(--bg-surface2);
    border: 1px solid var(--border, rgba(120, 120, 120, 0.18));
    border-radius: 16px;
    padding: clamp(1.5rem, 3vw, 2.25rem);
    max-width: 820px;
    margin: 0 auto;
}

.battery-method__content h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 1.5rem 0 0.5rem;
    color: var(--text-primary);
}

.battery-method__content h3:first-child {
    margin-top: 0;
}

.battery-method__content p,
.battery-method__content li {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
}

.battery-method__content ul {
    padding-left: 1.25rem;
    margin: 0.5rem 0;
}

.battery-method__content li {
    margin-bottom: 0.35rem;
}

.battery-method__content code {
    background: rgba(120, 120, 120, 0.12);
    padding: 0.12em 0.4em;
    border-radius: 4px;
    font-size: 0.88em;
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
}

/* ---------- Sources ---------- */
.battery-sources {
    text-align: center;
    max-width: 820px;
    margin: 0 auto;
}

.battery-sources__title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 1rem;
}

.battery-sources__list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    display: grid;
    gap: 0.6rem;
    font-size: 0.95rem;
}

.battery-sources__list a {
    color: #0d9488;
    text-decoration: underline;
}

.battery-sources__note {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.65;
    font-style: italic;
}

/* ---------- CTA ---------- */
.battery-cta {
    display: flex;
    justify-content: center;
}

.battery-cta__inner {
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.08), rgba(20, 184, 166, 0.04));
    border: 1px solid rgba(13, 148, 136, 0.2);
    border-radius: 20px;
    padding: clamp(2rem, 4vw, 3rem);
    max-width: 820px;
    text-align: center;
}

.battery-cta__inner h2 {
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    font-weight: 700;
    margin: 0 0 0.75rem;
}

.battery-cta__inner p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 1.5rem;
}

.battery-cta__inner a.button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* ---------- Interactive chart tooltip + scan line ---------- */
.battery-chart__svg {
    cursor: crosshair;
    touch-action: pan-y;
}

.battery-tooltip {
    position: absolute;
    pointer-events: none;
    background: var(--bg-surface, #1a1a1a);
    border: 1px solid var(--border, rgba(120, 120, 120, 0.25));
    border-radius: 10px;
    padding: 0.6rem 0.8rem 0.7rem;
    font-size: 0.82rem;
    line-height: 1.35;
    box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.3), 0 2px 6px rgba(0, 0, 0, 0.15);
    min-width: 195px;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.12s ease-out, transform 0.12s ease-out;
    z-index: 3;
    color: var(--text-secondary, #cbd5e1);
}

.battery-tooltip.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.battery-tooltip__time {
    font-weight: 700;
    font-size: 0.88rem;
    padding-bottom: 0.4rem;
    margin-bottom: 0.4rem;
    border-bottom: 1px solid var(--border, rgba(120, 120, 120, 0.18));
    color: var(--text-primary, #fff);
    text-align: center;
}

.battery-tooltip__row {
    display: grid;
    grid-template-columns: 14px 1fr auto;
    align-items: center;
    gap: 0.5rem;
    padding: 0.15rem 0;
}

.battery-tooltip__dot {
    width: 12px;
    height: 3px;
    border-radius: 1px;
    display: inline-block;
}

.battery-tooltip__dot--phone      {
    height: 0;
    border-top: 2px dashed #9ca3af;
}
.battery-tooltip__dot--us-best    {
    height: 0;
    border-top: 2px dashed #0d9488;
    opacity: 0.85;
}
.battery-tooltip__dot--us-worst   { background: #0d9488; }
.battery-tooltip__dot--them       { background: #ef4444; }
.battery-tooltip__dot--them-worst {
    height: 0;
    border-top: 2px dashed #ef4444;
    opacity: 0.75;
}

.battery-tooltip__label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.battery-tooltip__value {
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    font-size: 0.88rem;
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .battery-page,
    .battery-chart__svg,
    .battery-stat,
    .battery-why-card,
    .battery-tooltip {
        transition: none !important;
        animation: none !important;
    }
}

/* ---------- Mobile chart polish ---------- */
@media (max-width: 640px) {
    /* End-of-line labels sit at x=797 in a 940-wide viewBox; they shrink
       to ~4px on phones and become illegible. The legend below the chart
       already names each line, so hide the end labels on narrow screens. */
    .battery-chart__end-labels { display: none; }

    .battery-chart {
        padding: 1.25rem 0.75rem 1rem;
        border-radius: 14px;
    }
    .battery-chart__caption {
        font-size: 0.8rem;
    }
    .battery-chart__legend {
        gap: 0.75rem 1.25rem;
        font-size: 0.85rem;
    }
    .battery-chart-section__lede {
        font-size: 0.92rem;
    }
}

