/* ============================================================
   findings.css — Confirmed Findings page
   Extends the kryptosbot.com design system (style.css tokens)
   ============================================================ */

/* --- Page Structure --- */
.findings-page {
  max-width: var(--content-width);
  margin: 0 auto;
}

/* --- Hero --- */
.findings-hero {
  padding: var(--sp-12) 0 var(--sp-8);
  border-bottom: 1px solid var(--border-default);
  margin-bottom: var(--sp-12);
}

.findings-kicker {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: var(--sp-3);
}

.findings-hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: var(--sp-5);
}

.findings-hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.findings-intro {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 60ch;
}

/* --- Provenance Section --- */
.finding-provenance {
  margin-bottom: var(--sp-12);
  padding-bottom: var(--sp-8);
  border-bottom: 1px solid var(--border-default);
}

.finding-provenance h2 {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--sp-3);
}

.finding-provenance > p {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--sp-4);
}

.provenance-list {
  padding-left: var(--sp-5);
  margin-bottom: var(--sp-4);
}

.provenance-list li {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: var(--sp-3);
}

.provenance-list li strong {
  color: var(--text-primary);
}

.provenance-list li:last-child {
  color: var(--green);
  font-weight: 600;
}


/* --- Proof Paper CTA --- */
.proof-paper-btn {
  background: var(--accent) !important;
  color: #fff !important;
  border: none !important;
  font-weight: 700;
  padding: var(--sp-3) var(--sp-6);
  flex-shrink: 0;
}

.proof-paper-btn:hover {
  background: var(--accent-hover) !important;
}

.proof-paper-cta {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin-top: var(--sp-5);
  padding: var(--sp-4) var(--sp-5);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}

.proof-paper-note {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .proof-paper-cta {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* --- Ciphertext Exhibit --- */
.ct-exhibit {
  margin-bottom: var(--sp-16);
}

.ct-exhibit .section-label {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--sp-2);
}

.ct-legend-intro {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-bottom: var(--sp-4);
}

.ct-visual {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 2px;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  background: var(--code-bg);
  padding: var(--sp-5) var(--sp-6);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  margin-bottom: var(--sp-4);
  cursor: crosshair;
}

.ct-char {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5em;
  height: 1.8em;
  border-radius: 2px;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}

.ct-char:hover {
  background: var(--bg-active);
}

.ct-null {
  color: var(--amber);
  font-weight: 700;
  background: var(--amber-bg);
  border-bottom: 2px solid rgba(251, 191, 36, 0.4);
}

.ct-null:hover {
  background: rgba(251, 191, 36, 0.2);
}

.ct-crib {
  color: var(--green);
  font-weight: 700;
}

.ct-stehle {
  color: #c084fc;
  background: rgba(192, 132, 252, 0.08);
  border-bottom: 2px solid rgba(192, 132, 252, 0.4);
}

.ct-stehle:hover {
  background: rgba(192, 132, 252, 0.15);
}

.ct-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  margin-bottom: var(--sp-3);
}

.ct-legend-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

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

.ct-swatch-null { background: var(--amber); }
.ct-swatch-crib { background: var(--green); }
.ct-swatch-stehle { background: #c084fc; }
.ct-swatch-real { background: var(--text-tertiary); }

.ct-pos-readout {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  min-height: 1.5em;
}


/* --- Finding Sections --- */
.finding {
  margin-bottom: var(--sp-16);
  padding-top: var(--sp-8);
  border-top: 1px solid var(--border-default);
}

.finding-header {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}

.finding-number {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-muted);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 800;
  border: 2px solid var(--accent);
}

.finding-header h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  line-height: 1.2;
  margin: 0;
}

.finding-subtitle {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin: var(--sp-1) 0 0;
}

.finding-pvalue {
  flex-shrink: 0;
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--green);
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  align-self: center;
}


/* --- Finding Content Blocks --- */
.finding-plain {
  margin-bottom: var(--sp-8);
}

.finding-plain h3,
.finding-visual h3,
.finding-caveat h3 {
  font-size: var(--text-base);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  margin-bottom: var(--sp-3);
}

.finding-plain p {
  font-size: var(--text-base);
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: var(--sp-4);
}

.finding-plain strong {
  color: var(--text-primary);
}


/* --- Progressive Disclosure --- */
.finding-technical {
  margin-bottom: var(--sp-8);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--sp-4) var(--sp-5);
}

.finding-technical summary {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.finding-technical p {
  font-size: var(--text-sm);
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: var(--sp-3);
}


/* --- Polybius Grid --- */
.finding-visual {
  margin-bottom: var(--sp-8);
}

.finding-visual-caption {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-bottom: var(--sp-4);
  line-height: 1.6;
}

.polybius-grid {
  display: inline-block;
  margin-bottom: var(--sp-4);
}

.polybius-header,
.polybius-row {
  display: flex;
  gap: 2px;
}

.polybius-header {
  margin-bottom: 2px;
}

.polybius-col-label {
  width: 52px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-quaternary);
  padding: var(--sp-1) 0;
}

.polybius-row {
  margin-bottom: 2px;
}

.polybius-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.polybius-null {
  color: var(--amber);
  background: var(--amber-bg);
  border-color: var(--amber-border);
  font-weight: 800;
}

.polybius-target-col {
  border-color: var(--border-strong);
}


/* --- Delta Display (Stehle) --- */
.delta-display {
  overflow-x: auto;
  margin-bottom: var(--sp-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

.delta-row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
}

.delta-row:last-child {
  border-bottom: none;
}

.delta-label {
  flex-shrink: 0;
  width: 120px;
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--bg-elevated);
}

.delta-cell {
  flex: 1;
  min-width: 44px;
  text-align: center;
  padding: var(--sp-2) var(--sp-1);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.delta-cell-empty {
  color: transparent;
}

.delta-null {
  color: var(--amber);
  background: var(--amber-bg);
}

.delta-cell-diff {
  color: #c084fc;
  font-weight: 700;
  background: rgba(192, 132, 252, 0.08);
}

.delta-row-char .delta-cell {
  font-size: var(--text-base);
  font-weight: 700;
}


/* --- KRYPTOS x SEVEN Grid --- */
.ks-grid {
  display: inline-block;
  margin-bottom: var(--sp-4);
}

.ks-header,
.ks-row {
  display: flex;
  gap: 2px;
}

.ks-header {
  margin-bottom: 2px;
}

.ks-corner {
  width: 60px;
}

.ks-col-label,
.ks-row-label {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--accent);
}

.ks-col-label {
  width: 56px;
  text-align: center;
  padding: var(--sp-1) 0;
}

.ks-col-label small,
.ks-row-label small {
  font-weight: 400;
  color: var(--text-quaternary);
  font-size: var(--text-xs);
}

.ks-row {
  margin-bottom: 2px;
}

.ks-row-label {
  width: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
}

.ks-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 44px;
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-tertiary);
}

.ks-null {
  color: var(--amber);
  background: var(--amber-bg);
  border-color: var(--amber-border);
}

.ks-real {
  color: var(--green);
  background: var(--green-bg);
  border-color: var(--green-border);
}

.ks-mixed {
  color: var(--accent);
  background: var(--accent-faint);
  border-color: var(--border-focus);
}

.ks-empty {
  background: var(--bg-root);
  border-color: var(--border-subtle);
  color: var(--text-quaternary);
}


/* --- Stat Pills --- */
.finding-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-bottom: var(--sp-8);
}

.stat-pill {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  min-width: 140px;
}

.stat-pill-label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-pill-value {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
}

.stat-pill-accent {
  border-color: var(--accent-muted);
  background: var(--accent-faint);
}

.stat-pill-accent .stat-pill-value {
  color: var(--accent);
}


/* --- Caveat Block --- */
.finding-caveat {
  padding: var(--sp-4) var(--sp-5);
  border-left: 3px solid var(--text-quaternary);
  background: var(--bg-surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.finding-caveat p {
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--text-secondary);
}


/* --- Conclusion --- */
.findings-conclusion {
  padding-top: var(--sp-8);
  border-top: 1px solid var(--border-default);
  margin-bottom: var(--sp-8);
}

.findings-conclusion h2 {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--sp-6);
}

.conclusion-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.conclusion-card {
  padding: var(--sp-5);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
}

.conclusion-card h3 {
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--sp-3);
}

.conclusion-card ul {
  padding-left: var(--sp-5);
  margin: 0;
}

.conclusion-card li {
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: var(--sp-2);
}

.conclusion-solved {
  border-color: var(--green-border);
  background: var(--green-bg);
}

.conclusion-solved h3 {
  color: var(--green);
}

.conclusion-open {
  border-color: var(--amber-border);
  background: var(--amber-bg);
}

.conclusion-open h3 {
  color: var(--amber);
}

.conclusion-footer {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  text-align: center;
}


/* --- Responsive --- */
@media (max-width: 768px) {
  .finding-header {
    flex-wrap: wrap;
  }

  .finding-pvalue {
    margin-left: 0;
  }

  .conclusion-grid {
    grid-template-columns: 1fr;
  }

  .polybius-cell {
    width: 40px;
    height: 40px;
    font-size: var(--text-base);
  }

  .ks-cell {
    width: 44px;
    height: 36px;
    font-size: var(--text-sm);
  }

  .delta-label {
    width: 80px;
    font-size: 0.65rem;
  }

  .findings-hero h1 {
    font-size: var(--text-2xl);
  }
}
