/* ============================================================================
   BattXR -- Battery Category Heroes  v2.0.0
   Single editorial hero. Code-as-typography signature + optional pulse.
   No per-category styling -- everything is editor-driven.
   ============================================================================ */

:root {
  --bch-paper:      #f4ede0;
  --bch-paper-warm: #ebe1cc;
  --bch-ink:        #15110d;
  --bch-muted:      rgba(21, 17, 13, 0.6);
  --bch-accent:     #70dee3;
  --bch-line:       rgba(255, 255, 255, 0.18);
  --bch-line-soft:  rgba(255, 255, 255, 0.10);

  --bch-display: "Fraunces", Georgia, serif;
  --bch-body:    "Inter", system-ui, sans-serif;
  --bch-mono:    "JetBrains Mono", ui-monospace, monospace;
}

/* ----------------------------------------------------------------------------
   Section shell
   ---------------------------------------------------------------------------- */
.bch-hero {
  position: relative;
  overflow: hidden;
  width: 100%;
  background: #0a0908;
}

/* Height presets */
.bch-hero--h-full    { min-height: 92vh; }
.bch-hero--h-large   { min-height: 75vh; }
.bch-hero--h-medium  { min-height: 60vh; }
.bch-hero--h-content { min-height: 0; }
/* .bch-hero--h-custom: min-height set inline per instance */

.bch-hero-content {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  width: 100%;
  height: 100%;
  min-height: inherit;
  padding: 48px 48px 64px;
  box-sizing: border-box;
}

.bch-hero-inner {
  max-width: 1280px;
  margin-inline: auto;
  width: 100%;
}

/* ----------------------------------------------------------------------------
   Background media + Ken Burns
   ---------------------------------------------------------------------------- */
.bch-hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.bch-hero-media img,
.bch-hero-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}
.bch-hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bch-ink);
  opacity: 0.55;
  z-index: 1;
  pointer-events: none;
}
.bch-hero-media-kb-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  .bch-hero-media--kb .bch-hero-media-kb-wrap {
    --bch-kb-max: 1.10;
    animation: bch-hero-kb 24s ease-out infinite alternate;
    transform-origin: center center;
    will-change: transform;
  }
}
@keyframes bch-hero-kb {
  from { transform: scale(1.02); }
  to   { transform: scale(var(--bch-kb-max, 1.10)); }
}

/* Desktop / mobile image swap */
.bch-hero-img-mobile { display: none; }
@media (max-width: 767px) {
  .bch-hero-img-desktop { display: none; }
  .bch-hero-img-mobile  { display: block; }
}

/* ----------------------------------------------------------------------------
   Code typography (signature)
   ---------------------------------------------------------------------------- */
.bch-hero-bigtype {
  position: absolute;
  z-index: 1;
  font-family: var(--bch-display);
  font-weight: 400;
  font-size: 360px;
  line-height: 0.78;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  color: rgba(244, 237, 224, 0.16);
  -webkit-text-stroke: 1px rgba(244, 237, 224, 0.16);
  -webkit-text-fill-color: transparent;
          text-fill-color: transparent;
  user-select: none;
  pointer-events: none;
  white-space: nowrap;
}

/* Outline vs filled */
.bch-hero--bigtype-outline .bch-hero-bigtype {
  -webkit-text-fill-color: transparent;
          text-fill-color: transparent;
}
.bch-hero--bigtype-filled .bch-hero-bigtype {
  -webkit-text-stroke-width: 0;
  -webkit-text-fill-color: currentColor;
          text-fill-color: currentColor;
}

/* Position variants -- offsets pulled from per-instance CSS vars */
.bch-hero--code-right-bottom .bch-hero-bigtype { right: var(--bch-bigtype-x, -28px); bottom: var(--bch-bigtype-y, -56px); }
.bch-hero--code-right-top    .bch-hero-bigtype { right: var(--bch-bigtype-x, -28px); top:    var(--bch-bigtype-y, -56px); }
.bch-hero--code-left-bottom  .bch-hero-bigtype { left:  var(--bch-bigtype-x, -28px); bottom: var(--bch-bigtype-y, -56px); }
.bch-hero--code-left-top     .bch-hero-bigtype { left:  var(--bch-bigtype-x, -28px); top:    var(--bch-bigtype-y, -56px); }
.bch-hero--code-center       .bch-hero-bigtype {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) translate(var(--bch-bigtype-x, 0), var(--bch-bigtype-y, 0));
}

/* ----------------------------------------------------------------------------
   Pulse overlay
   ---------------------------------------------------------------------------- */
.bch-hero-pulse {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  height: 96px;
  pointer-events: none;
  opacity: 0.85;
}
.bch-hero-pulse svg {
  width: 100%;
  height: 100%;
  display: block;
}
.bch-hero-pulse path {
  stroke: #4dd5ff;
  stroke-width: 1.4;
  fill: none;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: bch-hero-sweep 5s ease-in-out infinite;
}

.bch-hero--pulse-top    .bch-hero-pulse { top: 22%;    transform: translateY(-50%); }
.bch-hero--pulse-middle .bch-hero-pulse { top: 50%;    transform: translateY(-50%); }
.bch-hero--pulse-bottom .bch-hero-pulse { top: 78%;    transform: translateY(-50%); }

@keyframes bch-hero-sweep {
  0%   { stroke-dashoffset: 1400; opacity: 0.9; }
  55%  { stroke-dashoffset: 0;    opacity: 0.9; }
  100% { stroke-dashoffset: -1400; opacity: 0.9; }
}

@media (prefers-reduced-motion: reduce) {
  .bch-hero-pulse path { animation: none; stroke-dashoffset: 0; }
}

/* ----------------------------------------------------------------------------
   Position counter
   ---------------------------------------------------------------------------- */
.bch-hero-counter {
  position: absolute;
  top: 40px;
  right: 48px;
  z-index: 4;
  font-family: var(--bch-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  font-variant-numeric: tabular-nums;
}

/* ----------------------------------------------------------------------------
   Kicker
   ---------------------------------------------------------------------------- */
.bch-hero-kicker {
  font-family: var(--bch-mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--bch-accent);
  margin: 0 0 32px;
  display: inline-block;
  font-weight: 400;
}
.bch-hero-kicker::before { content: "\2014\00a0\00a0"; }
.bch-hero-kicker::after  { content: "\00a0\00a0\2014"; }

/* ----------------------------------------------------------------------------
   Title
   ---------------------------------------------------------------------------- */
.bch-hero-title {
  font-family: var(--bch-display);
  font-variation-settings: "opsz" 144;
  font-weight: 300;
  font-size: clamp(3.5rem, 11vw, 9rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: #ffffff;
  margin: 0 0 28px;
}
.bch-hero-title em,
.bch-hero-title i,
.bch-hero-title .bch-hero-accent {
  font-style: italic;
  font-weight: 400;
  color: var(--bch-accent);
}

/* ----------------------------------------------------------------------------
   Hairline rule
   ---------------------------------------------------------------------------- */
.bch-hero-rule {
  width: 80px;
  height: 1px;
  background: rgba(255, 255, 255, 0.25);
  margin: 28px 0 24px;
  border: 0;
}

/* ----------------------------------------------------------------------------
   Lede
   ---------------------------------------------------------------------------- */
.bch-hero-lede {
  font-family: var(--bch-body);
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.55;
  color: #ffffff;
  max-width: 56ch;
  font-weight: 300;
  margin: 0;
}
.bch-hero-lede em,
.bch-hero-lede i {
  font-style: italic;
  color: var(--bch-accent);
}
.bch-hero-lede p { margin: 0 0 0.9em; }
.bch-hero-lede p:last-child { margin-bottom: 0; }

/* ----------------------------------------------------------------------------
   CTAs
   ---------------------------------------------------------------------------- */
.bch-hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}
.bch-hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 22px;
  font-family: var(--bch-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 0;
  cursor: pointer;
  transition: opacity 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.bch-hero-cta--primary {
  background: var(--bch-accent);
  color: #0a0908;
}
.bch-hero-cta--primary:hover {
  opacity: 0.9;
}
.bch-hero-cta--ghost {
  background: transparent;
  color: #f4ede0;
  border-color: rgba(244, 237, 224, 0.28);
}
.bch-hero-cta--ghost:hover {
  border-color: rgba(244, 237, 224, 0.6);
}

/* ----------------------------------------------------------------------------
   Stats strip -- with overflow safety triple-lock
   ---------------------------------------------------------------------------- */
.bch-hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
  gap: 32px;
  max-width: 900px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 24px;
  margin-top: 32px;
}
.bch-hero-stat {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bch-hero-stat-label {
  font-family: var(--bch-mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 400;
}
.bch-hero-stat-val {
  font-family: var(--bch-display);
  font-variation-settings: "opsz" 36;
  font-weight: 400;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  line-height: 1.1;
  color: #ffffff;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
}
.bch-hero-stats--shrink .bch-hero-stat-val {
  font-size: clamp(0.95rem, 1.5vw, 1.4rem);
}

/* ----------------------------------------------------------------------------
   Mobile
   ---------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .bch-hero-content { padding: 32px 24px 48px; }
  .bch-hero-counter { top: 24px; right: 24px; }
}

@media (max-width: 768px) {
  .bch-hide-mobile { display: none !important; }
}

@media (max-width: 640px) {
  .bch-hero-title {
    font-size: clamp(2.8rem, 14vw, 5rem);
  }
  .bch-hero-stats {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding-top: 16px;
    margin-top: 24px;
  }
  .bch-hero-stat-val {
    font-size: 1.2rem;
  }
  .bch-hero-ctas {
    width: 100%;
  }
  .bch-hero-cta {
    flex: 1 1 auto;
    padding: 13px 18px;
  }
}

/* ----------------------------------------------------------------------------
   Link styles -- 9 treatments applied via .bch-links--<style> on the section
   Targeted at .bch-hero-lede a so they only affect lede links.
   ---------------------------------------------------------------------------- */
.bch-hero-lede a {
  color: var(--bch-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.2s ease, text-decoration-thickness 0.2s ease, opacity 0.2s ease;
}

.bch-links--underline .bch-hero-lede a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}
.bch-links--underline .bch-hero-lede a:hover {
  text-decoration-thickness: 2px;
}

.bch-links--subtle .bch-hero-lede a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.bch-links--subtle .bch-hero-lede a:hover {
  border-bottom-color: currentColor;
}

.bch-links--thick .bch-hero-lede a {
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 0.18em;
}
.bch-links--thick .bch-hero-lede a:hover {
  opacity: 0.85;
}

.bch-links--dotted .bch-hero-lede a {
  text-decoration: underline dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}
.bch-links--dotted .bch-hero-lede a:hover {
  text-decoration-style: solid;
}

.bch-links--animated .bch-hero-lede a {
  text-decoration: none;
  background-image: linear-gradient(to right, currentColor, currentColor);
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  padding-bottom: 2px;
  transition: background-size 0.35s ease;
}
.bch-links--animated .bch-hero-lede a:hover {
  background-size: 100% 1px;
}

.bch-links--highlight .bch-hero-lede a {
  text-decoration: none;
  background: rgba(223, 103, 55, 0.18);
  padding: 0 0.2em;
  transition: background 0.2s ease;
}
.bch-links--highlight .bch-hero-lede a:hover {
  background: rgba(223, 103, 55, 0.32);
}

.bch-links--bracket .bch-hero-lede a {
  text-decoration: none;
}
.bch-links--bracket .bch-hero-lede a::before { content: "[\00a0"; opacity: 0.6; }
.bch-links--bracket .bch-hero-lede a::after  { content: "\00a0]"; opacity: 0.6; }
.bch-links--bracket .bch-hero-lede a:hover::before,
.bch-links--bracket .bch-hero-lede a:hover::after { opacity: 1; }

.bch-links--bold .bch-hero-lede a {
  text-decoration: none;
  font-weight: 600;
}
.bch-links--bold .bch-hero-lede a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.bch-links--bold-clean .bch-hero-lede a {
  text-decoration: none;
  font-weight: 600;
}
.bch-links--bold-clean .bch-hero-lede a:hover {
  opacity: 0.7;
}
