/* ============================================================
   TAB 01 // THE PROBLEM
   Editorial scrollytelling styles. Uses the existing prototype's
   CSS custom properties (--terminal-blue, --bg-panel, etc) so
   colors stay in sync with the rest of the site. Adds serif
   typography (system Georgia — zero external dependencies) for
   the editorial register.
   ============================================================ */

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

.tp-container {
  max-width: 880px;
  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-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;
}

.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-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: var(--line); stroke-width: 1; }
.tp-axis-label  { fill: var(--text-muted); font-family: var(--font-mono); font-size: 11px; }
.tp-axis-title  { font-weight: 600; fill: var(--text-secondary); }
.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-niche  { fill: var(--terminal-amber); }
.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-niche  { stroke: var(--terminal-amber); }
.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;
}

.tp-scatter-legend-panel {
  fill: var(--bg-base);
  stroke: var(--line-soft);
  stroke-width: 1;
}

.tp-scatter-legend-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  fill: var(--text-muted);
}

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

/* Architecture flow */
.tp-flow-node {
  opacity: 0;
  transition: opacity 0.6s ease-out;
}

.tp-flow-node.tp-flow-node-visible { opacity: 1; }

.tp-flow-rect {
  fill: var(--bg-base);
  stroke: var(--terminal-blue);
  stroke-width: 1.5;
}

.tp-flow-rect-cco { stroke: var(--terminal-amber); }

.tp-flow-label {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--text-primary);
  text-anchor: middle;
}

.tp-flow-sublabel {
  font-family: var(--font-mono);
  font-size: 9px;
  fill: var(--text-muted);
  text-anchor: middle;
}

.tp-flow-arrow {
  stroke: var(--text-muted);
  stroke-width: 1.5;
  fill: none;
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  transition: stroke-dashoffset 0.5s ease-out;
}

.tp-flow-arrow.tp-flow-arrow-visible { stroke-dashoffset: 0; }

.tp-flow-parallel-box {
  fill: rgba(13, 118, 128, 0.04);
  stroke: var(--terminal-blue);
  stroke-width: 1.5;
  stroke-dasharray: 5 3;
}

.tp-flow-parallel-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  fill: var(--terminal-blue);
  text-anchor: middle;
}

.tp-flow-agent-lane {
  fill: var(--bg-panel);
  stroke: var(--line);
  stroke-width: 1;
}

.tp-flow-agent-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  fill: var(--text-primary);
}

.tp-flow-agent-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  fill: var(--text-muted);
}

.tp-flow-audit {
  fill: none;
  stroke: var(--terminal-amber);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
  opacity: 0.65;
}

.tp-flow-audit-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  fill: var(--terminal-amber);
  text-transform: uppercase;
}

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

.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-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-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,
  .tp-flow-node,
  .tp-flow-arrow {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    stroke-dashoffset: 0 !important;
  }
  .tp-scroll-arrow { animation: none !important; }
}
