/* ============================================================
   statisticker.com — problem-page styles (from TAB 01)
   Architecture-flow rules are unused on this surface on purpose.
   ============================================================ */

/* ---------- Layout container ---------- */

.tp-container {
  width: 100%;
  max-width: 880px;
  min-width: 0;
  margin: 0 auto;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text-primary);
}

.tp-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--terminal-blue);
  margin-bottom: 28px;
  text-transform: uppercase;
}

/* ---------- Hero ---------- */

.tp-hero {
  padding: 80px 0 100px 0;
  border-bottom: 1px solid var(--line-soft);
}

.tp-hero-title {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: clamp(38px, 5.6vw, 64px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0 0 32px 0;
}

.tp-hero-em {
  color: var(--terminal-amber);
  font-style: italic;
}

.tp-hero-deck {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0;
}

.tp-hero-deck em {
  font-style: italic;
  color: var(--text-primary);
}

.tp-hero-cta {
  margin-top: 36px;
}

.tp-scroll-hint {
  margin-top: 60px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 12px;
}

.tp-scroll-arrow {
  font-size: 16px;
  animation: tp-bounce 2s ease-in-out infinite;
}

@keyframes tp-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(6px); }
}

/* ---------- Sections ---------- */

.tp-section {
  padding: 90px 0;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
}

.tp-section-num {
  position: absolute;
  top: 90px;
  left: -68px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 48px;
  font-weight: 400;
  font-style: italic;
  color: var(--terminal-amber);
  opacity: 0.55;
  line-height: 1;
}

@media (max-width: 1100px) {
  .tp-section-num {
    position: static;
    margin-bottom: 16px;
    font-size: 36px;
  }
}

.tp-section-title {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.18;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin: 0 0 32px 0;
  max-width: 740px;
}

.tp-section-body {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.62;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 0 48px 0;
}

.tp-section-body em {
  font-style: italic;
  color: var(--text-primary);
}

.tp-section-footnote {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 40px 0 0 0;
  padding: 20px 24px;
  background: var(--bg-panel);
  border-left: 3px solid var(--terminal-amber);
}

.tp-section-footnote strong {
  color: var(--text-secondary);
  font-weight: 600;
}

/* ---------- Pullquotes ---------- */

.tp-pullquote {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.32;
  color: var(--terminal-blue);
  margin: 56px 0 0 0;
  padding: 32px 0 32px 32px;
  border-left: 3px solid var(--terminal-blue);
  max-width: 680px;
}

/* ---------- Figures ---------- */

.tp-figure {
  margin: 24px 0 0 0;
  padding: 32px 0;
  max-width: 100%;
  min-width: 0;
}

.tp-figure-caption {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.55;
  color: var(--text-muted);
  margin-bottom: 18px;
  max-width: 760px;
}

.tp-caption-tag {
  display: inline-block;
  padding: 1px 6px;
  margin-right: 8px;
  background: var(--terminal-amber);
  color: var(--bg-base);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.tp-figure-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

.tp-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tp-legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.tp-figure-video {
  margin-top: 0;
  width: 100%;
  max-width: min(100%, calc((100vh - 12rem) * 16 / 9));
  max-width: min(100%, calc((100dvh - 12rem) * 16 / 9));
  min-width: 0;
  overflow: hidden;
  contain: inline-size;
}

/* 16:9 box from the figure's width, not the file's 1920×1080.
   Padding-% is relative to this figure, so the frame must stay 100% wide. */
.tp-video-frame {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 0;
  padding-bottom: 56.25%;
  background: #111111;
  border: 1px solid var(--line);
  overflow: hidden;
  transform: translateZ(0);
}

.tp-video {
  position: absolute;
  inset: 0;
  display: block;
  box-sizing: border-box;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  object-position: center;
  background: #111111;
}

.tp-video-fallback {
  display: none;
  margin: 0;
  padding: 28px 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: #f3e8db;
  text-align: center;
}

.tp-video-frame.tp-video-failed .tp-video {
  display: none;
}

.tp-video-frame.tp-video-failed .tp-video-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 0;
}

.tp-svg-chart,
.tp-svg-scatter,
.tp-svg-flow {
  width: 100%;
  height: auto;
  display: block;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  padding: 24px;
  box-sizing: border-box;
}

.tp-svg-scatter {
  min-height: 520px;
}

.tp-svg-flow {
  min-height: 280px;
}

/* ---------- SVG primitives (used by tab01-problem.js) ---------- */

.tp-axis-line   { stroke: rgba(17, 17, 17, 0.28); stroke-width: 1; }
.tp-axis-label  { fill: var(--text-muted); font-family: var(--font-mono); font-size: 11px; }
.tp-axis-arrowhead { fill: rgba(17, 17, 17, 0.28); }
.tp-axis-title {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  fill: var(--text-muted);
}
.tp-axis-tick   { stroke: var(--line-soft); stroke-width: 1; }
.tp-quadrant-divider { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; opacity: 0.7; }

.tp-data-line   { fill: none; stroke-width: 2.5; }
.tp-data-line.tp-rules { stroke: var(--terminal-amber); }
.tp-data-line.tp-reviewers { stroke: var(--terminal-blue); }

.tp-line-anim {
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  transition: stroke-dashoffset 1.8s ease-out;
}

.tp-section.revealed .tp-line-anim {
  stroke-dashoffset: 0;
}

/* Scatter zones */
.tp-zone {
  opacity: 0;
  transition: opacity 1.0s ease-out;
}

.tp-section.revealed .tp-zone { opacity: 1; }

.tp-zone-ai-unlock    { fill: var(--terminal-green); fill-opacity: 0.06; stroke: var(--terminal-green); stroke-opacity: 0.35; stroke-dasharray: 4 4; stroke-width: 1; }
.tp-zone-rules-engine { fill: var(--text-muted);     fill-opacity: 0.04; stroke: var(--text-muted);     stroke-opacity: 0.25; stroke-dasharray: 4 4; stroke-width: 1; }

.tp-zone-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  fill: var(--text-muted);
}

.tp-zone-label.tp-zone-label-ai    { fill: var(--terminal-green); }

/* Scatter points */
.tp-point {
  opacity: 0;
  transform-origin: center;
  transform-box: fill-box;
  transition:
    opacity 0.6s ease-out,
    transform 0.6s cubic-bezier(0.22, 1.6, 0.36, 1);
}

.tp-point.tp-point-visible {
  opacity: 1;
  transform: scale(1);
}

.tp-point.tp-point-hidden { transform: scale(0.2); }

.tp-point-circle-unlock { fill: var(--terminal-green); }
.tp-point-circle-wedge  { fill: var(--bb-red); }
.tp-point-circle-solved { fill: var(--text-muted); }

.tp-point-ring {
  fill: none;
  stroke-width: 1.5;
  opacity: 0.45;
}

.tp-point-ring-unlock { stroke: var(--terminal-green); }
.tp-point-ring-wedge  { stroke: var(--bb-red); }
.tp-point-ring-solved { stroke: var(--text-muted); }

.tp-point-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  fill: var(--bg-panel);
  pointer-events: none;
}

.tp-point-num-legend {
  font-size: 9px;
}

/* Legend strip — horizontal, under a hairline, outside the plot area.
   Shared by Fig. B and Fig. D. Replaces the old floating .tp-scatter-legend-panel. */
.tp-legend-rule {
  stroke: var(--line);
  stroke-width: 0.8;
}

.tp-legend-label {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  fill: var(--text-muted);
}

.tp-legend-entry {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--text-secondary);
}

.tp-legend-entry-muted { fill: var(--text-muted); }

/* ---------- Competitive context table (Section C) ---------- */

.tp-comp-wrap {
  width: 100%;
  overflow-x: auto;
  background: var(--bg-panel);
  border: 1px solid var(--line);
}

.tp-comp-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.tp-comp-table thead th {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: left;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-elev);
}

.tp-comp-table th:first-child,
.tp-comp-table td:first-child {
  width: 28%;
}

.tp-comp-table th:nth-child(3),
.tp-comp-table td:nth-child(3) {
  width: 40%;
}

.tp-comp-table tbody td {
  padding: 16px 18px;
  vertical-align: top;
  border-bottom: 1px solid var(--line-soft);
}

.tp-comp-table tbody tr:last-child td {
  border-bottom: none;
}

.tp-comp-table tbody td:last-child {
  color: var(--text-primary);
}

.tp-comp-name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.tp-comp-cat {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.tp-comp-footnote {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 16px 0 0 0;
  max-width: 760px;
}

@media (max-width: 720px) {
  .tp-comp-table {
    min-width: 0;
  }

  .tp-comp-table thead {
    display: none;
  }

  .tp-comp-table,
  .tp-comp-table tbody,
  .tp-comp-table tr,
  .tp-comp-table td {
    display: block;
    width: 100%;
  }

  .tp-comp-table tbody tr {
    padding: 16px 18px 18px;
    border-bottom: 1px solid var(--line);
  }

  .tp-comp-table tbody tr:last-child {
    border-bottom: none;
  }

  .tp-comp-table tbody td {
    padding: 8px 0;
    border-bottom: none;
  }

  .tp-comp-table tbody td::before {
    display: block;
    content: attr(data-label);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 4px;
  }

  .tp-comp-table tbody td:first-child::before {
    display: none;
  }
}

/* ---------- Wedge cards (Section E) ---------- */

.tp-wedge-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
  margin: 32px 0 0 0;
}

@media (max-width: 880px) {
  .tp-wedge-grid {
    grid-template-columns: 1fr;
  }
}

.tp-wedge-card {
  padding: 22px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-top-width: 3px;
}

.tp-wedge-lead  { border-top-color: var(--terminal-green); }
.tp-wedge-niche { border-top-color: var(--terminal-amber); }
.tp-wedge-current { border-top-color: var(--terminal-amber); }
.tp-wedge-roadmap { border-top-color: var(--terminal-blue); }

.tp-wedge-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.tp-wedge-lead  .tp-wedge-tag { color: var(--terminal-green); }
.tp-wedge-niche .tp-wedge-tag { color: var(--terminal-amber); }
.tp-wedge-current .tp-wedge-tag { color: var(--terminal-amber); }
.tp-wedge-roadmap .tp-wedge-tag { color: var(--terminal-blue); }

.tp-wedge-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 400;
  margin: 0 0 14px 0;
  color: var(--text-primary);
  line-height: 1.18;
}

.tp-wedge-body {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0 0 14px 0;
}

.tp-wedge-body em {
  font-style: italic;
  color: var(--text-primary);
}

.tp-wedge-named {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.55;
  color: var(--text-muted);
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

/* ---------- CTA ---------- */

.tp-cta {
  display: inline-flex;
  align-items: baseline;
  gap: 14px;
  margin: 56px 0 0 0;
  padding: 18px 28px;
  background: var(--terminal-blue);
  color: var(--bg-base);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.tp-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.tp-cta-arrow {
  font-size: 18px;
}

.tp-cta-target {
  margin-left: 8px;
  padding: 2px 8px;
  background: rgba(0, 0, 0, 0.18);
  font-size: 11px;
  letter-spacing: 0.08em;
}

/* ---------- Colophon ---------- */

.tp-colophon {
  padding: 36px 0 24px 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* ---------- Reveal animation (IntersectionObserver-driven) ---------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.9s ease-out,
    transform 0.9s ease-out;
}

[data-reveal].tp-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Reduced-motion override ---------- */

@media (prefers-reduced-motion: reduce) {
  [data-reveal],
  .tp-line-anim,
  .tp-zone,
  .tp-point {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    stroke-dashoffset: 0 !important;
  }
  .tp-scroll-arrow { animation: none !important; }
}
