/* =========================================================================
   Blog — Index. The directory above the editorial articles.
   Inherits tokens, typography, .nav, .footer, and surface system from
   ../styles.css. Component prefix: .bi- (blog index) and .bi-row for
   the per-article list rows.
   Three sections: hero (drench) · index list (light) · cta (drench).
   ========================================================================= */

/* Section grid overlay — same chrome as the rest of the site. */
.s__grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    repeating-linear-gradient(to right,
      var(--grid-line-drench) 0 1px,
      transparent 1px calc(100% / 12));
}
.s[data-surface="light"] .s__grid,
.s[data-surface="white"] .s__grid {
  background-image:
    repeating-linear-gradient(to right,
      var(--grid-line-light) 0 1px,
      transparent 1px calc(100% / 12));
}

/* ============================================================
   HERO — Drench. Directory header, not a destination hero.
   ============================================================ */
.bi-hero {
  min-height: 78vh;
  padding-top: calc(var(--section-y) + 60px);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.bi-hero__inner {
  position: relative;
  z-index: 3;
  width: 100%;
  display: grid;
  gap: clamp(20px, 3vw, 36px);
  align-content: end;
}

.bi-hero__ticker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  opacity: 0.85;
  margin: 0;
  flex-wrap: wrap;
}
.bi-hero__dot {
  width: 8px;
  height: 8px;
  background: var(--white);
  display: inline-block;
  animation: bi-pulse 2.4s var(--ease-out-quart) infinite;
}
.bi-hero__sep { opacity: 0.5; }

.bi-hero__display {
  font-size: clamp(2.5rem, 7vw, 6rem);
  line-height: 0.88;
  letter-spacing: -0.045em;
  max-width: 20ch;
}
.bi-hero__lede {
  max-width: 60ch;
  font-size: clamp(1.0625rem, 1.4vw, 1.375rem);
  line-height: 1.5;
  opacity: 0.92;
}

@keyframes bi-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.85); }
}

/* ============================================================
   INDEX — Light. Stacked editorial list. Each row is a single
   <a> wrapping the entire preview.
   ============================================================ */
.bi-index__inner {
  position: relative;
  z-index: 2;
  display: grid;
  gap: clamp(40px, 5vw, 72px);
}

.bi-index__head {
  display: grid;
  gap: 14px;
  max-width: 36ch;
}
.bi-index__eyebrow { color: var(--rocket-blue); margin: 0; }
.bi-index__title {
  color: var(--ink);
  font-size: clamp(1.75rem, 3.6vw, 3rem);
  line-height: 1.0;
}

.bi-index__rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  border-top: 1px solid rgba(10, 10, 10, 0.18);
}
.bi-index__row {
  border-bottom: 1px solid rgba(10, 10, 10, 0.18);
  display: block;
}

.bi-index__more {
  margin: 0;
  color: var(--graphite);
  opacity: 0.85;
  max-width: 60ch;
}
.bi-index__more a {
  color: var(--graphite);
  border-bottom: 1px solid rgba(10, 10, 10, 0.32);
  padding-bottom: 2px;
  margin-left: 6px;
  transition: color 180ms var(--ease-out-quart),
              border-color 180ms var(--ease-out-quart);
}
.bi-index__more a:hover {
  color: var(--rocket-blue);
  border-bottom-color: var(--rocket-blue);
}

/* ============================================================
   ROW — A single article preview. Two-column layout: hero card
   (left), main content (right). Stacks on mobile.
   ============================================================ */
.bi-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  column-gap: clamp(28px, 4vw, 64px);
  row-gap: clamp(20px, 3vw, 28px);
  align-items: start;
  padding: clamp(36px, 5vw, 64px) 0 clamp(32px, 4vw, 52px);
  color: var(--ink);
  position: relative;
  transition: padding-left 320ms var(--ease-out-quart);
}

/* HERO CARD — drench panel with inline SVG. */
.bi-row__hero {
  display: block;
  aspect-ratio: 600 / 380;
  overflow: hidden;
  background: var(--rocket-blue);
  position: relative;
}
.bi-row__hero-svg {
  display: block;
  width: 100%;
  height: 100%;
  transition: transform 480ms var(--ease-out-quart);
}
.bi-row:hover .bi-row__hero-svg,
.bi-row:focus-visible .bi-row__hero-svg {
  transform: scale(1.03);
}

/* MAIN — content column. */
.bi-row__main {
  display: grid;
  gap: clamp(14px, 2vw, 22px);
  align-content: start;
}

@media (max-width: 880px) {
  .bi-row {
    grid-template-columns: 1fr;
  }
  .bi-row__hero {
    /* Slightly wider on mobile for visual punch. */
    aspect-ratio: 16 / 9;
  }
}

.bi-row__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.bi-row__meta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  opacity: 0.78;
}
.bi-row__angle  { color: var(--rocket-blue); }
.bi-row__date   { color: var(--graphite); }
.bi-row__read   { color: var(--graphite); }
.bi-row__sep {
  opacity: 0.45;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.bi-row__display {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.75rem, 4vw, 3.25rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: var(--ink);
  text-wrap: balance;
  max-width: 22ch;
  transition: transform 320ms var(--ease-out-quart),
              color 220ms var(--ease-out-quart);
}

.bi-row__body {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.15vw, 1.125rem);
  line-height: 1.55;
  color: var(--graphite);
  max-width: 64ch;
  text-wrap: pretty;
}

.bi-row__tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 0;
}
.bi-row__tags li {
  color: var(--graphite);
  display: inline-flex;
  align-items: center;
}
.bi-row__tags li + li::before {
  content: "·";
  margin: 0 14px;
  color: var(--rocket-blue);
  opacity: 0.8;
}

.bi-row__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--rocket-blue);
  margin-top: clamp(4px, 1vw, 12px);
}
.bi-row__arrow {
  display: inline-block;
  transition: transform 240ms var(--ease-out-quart);
}

/* Hover — entire row is the affordance. Mirrors the case-studies row. */
.bi-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 0;
  height: 2px;
  background: var(--rocket-blue);
  transform: translateY(-50%);
  transition: width 280ms var(--ease-out-quart);
  pointer-events: none;
}
.bi-row:hover,
.bi-row:focus-visible {
  outline: none;
  padding-left: 24px;
}
.bi-row:hover::before,
.bi-row:focus-visible::before {
  width: 14px;
}
.bi-row:hover .bi-row__display,
.bi-row:focus-visible .bi-row__display {
  color: var(--rocket-blue);
}
.bi-row:hover .bi-row__arrow,
.bi-row:focus-visible .bi-row__arrow {
  transform: translateX(6px);
}
.bi-row:focus-visible {
  outline: 2px solid var(--rocket-blue);
  outline-offset: 4px;
}

@media (max-width: 720px) {
  .bi-row:hover,
  .bi-row:focus-visible {
    padding-left: 16px;
  }
  .bi-row:hover::before,
  .bi-row:focus-visible::before {
    width: 10px;
  }
}

/* ============================================================
   CTA — Drench. Talk to Andrey. Same pattern as the studies.
   ============================================================ */
.bi-cta {
  min-height: 60vh;
  display: flex;
  align-items: center;
}
.bi-cta__inner {
  position: relative;
  z-index: 2;
  display: grid;
  gap: clamp(18px, 2.5vw, 32px);
  max-width: 30ch;
}
.bi-cta__eyebrow { opacity: 0.7; margin: 0; }
.bi-cta__display {
  font-size: clamp(3rem, 10vw, 7.5rem);
  line-height: 0.86;
  letter-spacing: -0.045em;
}
.bi-cta__lede { max-width: 40ch; }
.bi-cta__actions {
  margin-top: clamp(8px, 2vw, 24px);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.bi-cta__btn {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 14px 22px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: background-color 180ms var(--ease-out-quart),
              color 180ms var(--ease-out-quart),
              transform 240ms var(--ease-out-quart);
}
.bi-cta__btn--primary {
  background: var(--white);
  color: var(--rocket-blue);
  border: 1px solid var(--white);
}
.bi-cta__btn--primary:hover {
  background: transparent;
  color: var(--white);
  transform: translateY(-1px);
}
.bi-cta__btn--ghost {
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.5);
}
.bi-cta__btn--ghost:hover {
  border-color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}
.bi-cta__btn:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 3px;
}

/* Entrance choreography — same one-shot pattern. */
.reveal { opacity: 1; transform: none; }
html.has-js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 720ms var(--ease-out-quint),
    transform 720ms var(--ease-out-quint);
  transition-delay: calc(var(--i, 0) * 80ms);
  will-change: opacity, transform;
}
html.has-js .reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .bi-hero__dot { animation: none; }
  .bi-cta__btn,
  .bi-row,
  .bi-row__display,
  .bi-row__arrow,
  .bi-row::before { transition: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
