/* ============================================
   GO CONCURRENCY — BOOK FRONT PAGE (index.html)
   Page-scoped styles. Tokens come from styles.css; every class here is
   prefixed bi- so nothing collides with the chapter components. Generated
   by tools/build_index.py.
   ============================================ */

.bi {
  position: relative;
  z-index: 2;
  max-width: 1120px;
  margin: 0 auto;
  padding: 56px var(--space-lg) var(--space-3xl);
}
@media (min-width: 1024px) {
  .bi { padding: 72px var(--space-xl) var(--space-3xl); }
}
.bi section + section { border-top: 1px solid rgba(148, 163, 184, 0.12); padding-top: 72px; }
.bi-hero { padding-bottom: 56px; }
.bi section { padding-bottom: 72px; }

.bi-eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.bi-eyebrow-v { color: var(--accent-purple-text); }

.bi-title {
  font-size: clamp(2.75rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.02;
  color: var(--text-heading);
  margin: 0;
  text-wrap: balance;
}
.bi-title small {
  display: block;
  font-size: clamp(1.5rem, 2.6vw, 1.875rem);
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-heading);
  margin-top: 10px;
}
.bi-lede {
  font-size: 1.1875rem;
  color: var(--text-primary);
  max-width: 66ch;
  margin: 22px 0 0;
}
.bi-btns { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 0; }
.bi-btns-close { margin-bottom: 0; }
.bi-btn {
  /* Same dress as .site-cta in the header, one step larger for a hero. */
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #67e8f9;
  text-decoration: none;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.25);
  transition: all 0.4s ease;
  white-space: nowrap;
}
.bi-btn:hover {
  background: rgba(6, 182, 212, 0.18);
  border-color: rgba(6, 182, 212, 0.4);
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.15);
  text-decoration: none;
}
.bi-btn svg { width: 16px; height: 16px; }
.bi-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* --- The soak trace --- */
.bi-trace-fig {
  margin: 0;
  background: var(--diagram-bg);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: var(--radius-lg);
  padding: 14px 10px 10px;
  position: relative;
}
.bi-trace { width: 100%; height: auto; display: block; font-family: var(--font-mono); }
.bi-trace-m { display: none; }
.bi-trace .base { stroke: rgba(148, 163, 184, 0.22); stroke-width: 1; }
.bi-trace .grid { stroke: rgba(148, 163, 184, 0.08); stroke-width: 1; }
.bi-trace .lbl { fill: var(--diagram-text); font-size: 12px; font-family: var(--font-mono); }
.bi-trace .lbl.dim { fill: var(--text-muted); font-size: 11px; }
.bi-trace .ser { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linejoin: round; }
.bi-trace .end { fill: var(--accent); stroke: var(--diagram-bg); stroke-width: 2; }
.bi-trace .stall { fill: rgba(248, 81, 73, 0.06); }
.bi-trace .mark { stroke: var(--accent-red); stroke-width: 1; stroke-dasharray: 3 3; }
.bi-trace .mark-t { fill: var(--accent-red); font-size: 11.5px; }
.bi-trace .xh { stroke: var(--text-heading); stroke-width: 1; opacity: 0.5; }
.bi-trace-m .lbl { font-size: 17px; }
.bi-trace-m .lbl.dim { font-size: 15px; }
.bi-trace-m .mark-t { font-size: 16px; }
.bi-trace-m .ser { stroke-width: 2.2; }
.bi-trace-m .end { r: 4.5; }
.bi-tip {
  position: absolute;
  pointer-events: none;
  background: var(--bg-tertiary);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 5;
  white-space: nowrap;
}
.bi-tip b { color: var(--text-heading); font-weight: 500; }

/* --- Terminals on this page: columns must not wrap, so they scroll --- */
.bi .output-block { margin: 0; }
.bi .output-block .terminal-body { overflow-x: auto; }
.bi .output-block .terminal-line { white-space: nowrap; }

/* --- Section heads --- */
.bi-sec-head { max-width: 720px; margin-bottom: 34px; }
.bi-sec-head h2 {
  font-size: clamp(1.625rem, 3.2vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-heading);
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  text-wrap: balance;
}
.bi-sec-head p { color: var(--text-secondary); font-size: 1.0625rem; margin: 0; }
.bi-sec-head p code { font-size: 0.9em; }

/* --- Syllabus trace --- */
.bi-trace-wrap {
  background: var(--diagram-bg);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: var(--radius-lg);
  padding: 18px;
  position: relative;
}
.bi-ruler {
  position: relative;
  height: 22px;
  margin-left: 190px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}
.bi-ruler span { position: absolute; top: 0; transform: translateX(-50%); }
.bi-ruler span::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 17px;
  width: 1px;
  height: 6px;
  background: rgba(148, 163, 184, 0.22);
}
.bi-lanes { display: grid; grid-template-columns: 190px 1fr; }
.bi-lane-labels { display: flex; flex-direction: column; }
.bi-lane {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.12);
  padding-left: 6px;
  font-family: var(--font-mono);
}
.bi-lane-p { font-size: 12px; color: var(--c); width: 26px; }
.bi-lane-name { font-size: 11.5px; color: var(--text-muted); line-height: 1.2; }
.bi-track {
  height: 308px;
  position: relative;
  border-left: 1px solid rgba(148, 163, 184, 0.22);
  background: repeating-linear-gradient(to bottom, transparent 0 43px, rgba(148, 163, 184, 0.12) 43px 44px);
}
.bi-span {
  position: absolute;
  top: calc(var(--lane) * 44px + 8px);
  height: 28px;
  border-radius: var(--radius-sm);
  background: color-mix(in oklab, var(--c) 22%, transparent);
  border: 1px solid var(--c);
  color: var(--text-heading);
  font-family: var(--font-mono);
  font-size: 11.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-width: 14px;
  text-decoration: none;
  transition: filter var(--transition-fast), transform var(--transition-fast);
}
/* The light-up runs once, when the trace scrolls into view (index.js adds
   .is-lit). Without script, or under reduced motion, spans are simply lit. */
.bi-track.is-lit .bi-span {
  opacity: 0.28;
  animation: bi-lit 0.45s ease forwards;
  animation-delay: calc(var(--i) * 90ms + 100ms);
}
.bi-span span { pointer-events: none; color: var(--text-heading); letter-spacing: 0.02em; }
.bi-span:hover {
  filter: brightness(1.35);
  transform: translateY(-1px);
  z-index: 2;
  text-decoration: none;
  box-shadow: 0 0 0 2px var(--diagram-bg), 0 0 0 3px var(--c);
}
@keyframes bi-lit { to { opacity: 1; } }

.bi-card {
  margin-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  padding-top: 14px;
  min-height: 92px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px 18px;
  align-items: start;
  font-size: 14.5px;
}
.bi-card-n {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  align-self: center;
}
.bi-card h4 { margin: 0; color: var(--text-heading); font-size: 17px; font-weight: 600; line-height: 1.3; }
.bi-card h4 a { color: inherit; text-decoration: none; }
.bi-card h4 a:hover { color: var(--accent); }
.bi-card p { margin: 4px 0 0; color: var(--text-secondary); font-size: 14px; line-height: 1.5; max-width: 78ch; }
.bi-card-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
  line-height: 1.7;
  white-space: nowrap;
}
.bi-card-meta b { color: var(--text-primary); font-weight: 500; display: block; }
.bi-card-meta a { color: var(--accent-green); text-decoration: none; display: block; }
.bi-card-meta a:hover { text-decoration: underline; }

/* --- The plain list --- */
.bi-parts { margin-top: 40px; display: grid; grid-template-columns: 1fr 1fr; gap: 28px 40px; }
.bi-part h3 {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c);
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin: 0 0 10px;
  padding: 0 0 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}
.bi-part-p, .bi-part-h { font-family: var(--font-mono); }
.bi-part-h { margin-left: auto; font-weight: 400; color: var(--text-muted); text-transform: none; letter-spacing: 0; }
.bi-part ol { list-style: none; margin: 0; padding: 0; }
.bi-part li { margin: 0; padding: 0; }
.bi-part li a {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 12px;
  padding: 10px 6px;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-decoration: none;
  align-items: start;
}
.bi-part li a:hover { background: var(--code-bg); }
.bi-ln { font-family: var(--font-mono); color: var(--c); font-size: 13px; padding-top: 2px; }
.bi-lt b { display: block; font-weight: 600; color: var(--text-heading); font-size: 15.5px; line-height: 1.35; }
.bi-lt em {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-style: normal;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: 3px;
}
.bi-lh { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); padding-top: 3px; font-variant-numeric: tabular-nums; }

/* --- Responsive --- */
@media (max-width: 980px) {
  .bi-parts { grid-template-columns: 1fr; }
  .bi-card { grid-template-columns: 1fr; }
  .bi-card-meta { text-align: left; white-space: normal; }
}
@media (max-width: 720px) {
  /* The lane trace has no honest form at this width; the list is the syllabus. */
  .bi-trace-wrap { display: none; }
  .bi-trace-d { display: none; }
  .bi-trace-m { display: block; }
  .bi section + section { padding-top: 52px; }
  .bi section { padding-bottom: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  .bi-track.is-lit .bi-span { opacity: 1; animation: none; }
  .bi-span { transition: none; }
}
