/* ============================================================
   BlendScope Screen Deep-Dive Pages: patch.css
   Add to the bottom of your existing styles.css
   ============================================================ */

/* ── Shared variables (extend your existing palette) ──────── */
:root {
  --screen-accent: #2e6be6;
  --screen-accent-dim: rgba(46, 107, 230, 0.12);
  --screen-gold: #c9a84c;
  --screen-gold-dim: rgba(201, 168, 76, 0.12);
  --screen-teal: #1fa89a;
  --screen-teal-dim: rgba(31, 168, 154, 0.12);
  --screen-red-dim: rgba(220, 60, 60, 0.08);
  --code-bg: rgba(0, 0, 0, 0.06);
}

/* ── Text-only decision blocks (no matching screenshot yet) ── */
.decision-block-grid.text-only {
  grid-template-columns: 1fr;
  max-width: 1100px;
}

.decision-block-grid.text-only .decision-body .col-text {
  column-count: 2;
  column-gap: 3rem;
}

.decision-block-grid.text-only .decision-body .col-text p {
  margin-block-start: 0;
  margin-block-end: 1em;
}

.decision-block-grid.text-only .decision-body .col-text p:last-child {
  margin-block-end: 0;
}

@media (max-width: 860px) {
  .decision-block-grid.text-only .decision-body .col-text {
    column-count: 1;
  }
}

/* ── Media lightbox (fullscreen viewer for video/img) ──────── */
.media-wrap {
  position: relative;
}

.media-expand-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 5;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
  transition: background 150ms ease;
}

.media-expand-btn:hover,
.media-expand-btn:focus-visible {
  background: rgba(0, 0, 0, 0.78);
}

.media-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
  padding: 2rem;
}

.media-lightbox.is-open {
  display: flex;
}

.media-lightbox-content img,
.media-lightbox-content video {
  display: block;
  max-width: 92vw;
  max-height: 92vh;
  width: auto;
  height: auto;
  border-radius: 8px;
}

.media-lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.media-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

body.media-lightbox-locked {
  overflow: hidden;
}

/* ── Implementation notes (secondary, collapsed technical detail) ── */
.impl-notes {
  margin-top: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--code-bg);
}

.impl-notes summary {
  cursor: pointer;
  list-style: none;
  padding: 0.7rem 1rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #888);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.impl-notes summary::-webkit-details-marker { display: none; }

.impl-notes summary::before {
  content: "+";
  font-size: 0.95rem;
  line-height: 1;
  color: var(--screen-accent);
}

.impl-notes[open] summary::before { content: "\2212"; }

.impl-notes summary:hover { color: var(--body, #3a3530); }

.impl-notes-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
}

.impl-notes-body p {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--body, #3a3530);
  margin-bottom: 0.75rem;
}

.impl-notes-body p:last-child { margin-bottom: 0; }

/* ── Inline code ──────────────────────────────────────────── */
.project-page code {
  font-family: "DM Mono", "Fira Code", "Courier New", monospace;
  font-size: 0.82em;
  background: var(--code-bg);
  border-radius: 4px;
  padding: 0.15em 0.4em;
  color: inherit;
}

/* ── FPO placeholder block ────────────────────────────────── */
.fpo-block {
  background: rgba(0, 0, 0, 0.04);
  border: 2px dashed rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  color: rgba(0, 0, 0, 0.35);
  font-size: 0.82rem;
  line-height: 1.5;
  text-align: center;
  min-height: 240px;
  width: 100%;
}

.fpo-block svg {
  opacity: 0.3;
  flex-shrink: 0;
}

/* ── Deep-dive screen recordings ──────────────────────────── */
.project-hero-image video {
  display: block;
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  background: #eef3f5;
}

.decision-media video {
  display: block;
  width: 100%;
  max-height: 480px;
  object-fit: contain;
  background: #eef3f5;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.project-media-grid video {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 760px;
  object-fit: contain;
  background: #eef3f5;
}

/* ── Core hypothesis pull-quote ───────────────────────────── */
.screen-hypothesis {
  background: #0f1923;
  padding: 5rem var(--page-margin, 2rem);
  text-align: center;
}

.screen-hypothesis .eyebrow {
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 1.5rem;
}

.screen-hypothesis blockquote {
  font-size: clamp(1.3rem, 2.5vw, 2rem);
  font-weight: 500;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  max-width: 820px;
  margin: 0 auto;
  font-style: normal;
  border: none;
  padding: 0;
}

.screen-hypothesis blockquote span,
.screen-hypothesis blockquote code {
  color: #7eb8f7;
  font-style: normal;
}

.screen-hypothesis blockquote code {
  background: rgba(126, 184, 247, 0.12);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
}

/* ── Decision blocks ──────────────────────────────────────── */
.decision-block {
  padding: 5rem var(--page-margin, 2rem);
  border-top: 1px solid var(--line);
}

.decision-block-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
}

.decision-block-grid.reverse {
  direction: rtl;
}

.decision-block-grid.reverse > * {
  direction: ltr;
}

@media (max-width: 860px) {
  .decision-block-grid,
  .decision-block-grid.reverse {
    grid-template-columns: 1fr;
    direction: ltr;
    gap: 2.5rem;
  }
}

.decision-label {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.decision-num {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--screen-accent);
  opacity: 0.7;
  flex-shrink: 0;
  padding-top: 0.2em;
}

.decision-label h3 {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}

.decision-body p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--body, #3a3530);
  margin-bottom: 1rem;
}

.decision-body p:last-child {
  margin-bottom: 0;
}

.decision-media figcaption {
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--muted, #888);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

/* ── Before / After comparison ────────────────────────────── */
.before-after-section {
  padding: 5rem var(--page-margin, 2rem);
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.before-after-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2.5rem;
}

@media (max-width: 700px) {
  .before-after-grid {
    grid-template-columns: 1fr;
  }
}

.before-after-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.before-after-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
  display: inline-block;
  width: fit-content;
}

.before-after-label.before {
  background: rgba(180, 60, 60, 0.1);
  color: #b43c3c;
}

.before-after-label.after {
  background: rgba(46, 107, 230, 0.1);
  color: var(--screen-accent);
}

.before-after-card p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--body, #3a3530);
  margin: 0;
}

/* ── UX Principles grid ───────────────────────────────────── */
.principles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
}

@media (max-width: 900px) {
  .principles-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .principles-grid {
    grid-template-columns: 1fr;
  }
}

.principle-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.principle-card strong {
  font-size: 1rem;
  font-weight: 700;
  color: var(--coral, #7B5EA7);
  line-height: 1.3;
}

.principle-card p {
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--body, #3a3530);
  margin: 0;
}

/* ── Talking points section ───────────────────────────────── */
.talking-points-section {
  background: #0f1923;
  padding: 5rem var(--page-margin, 2rem);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.talking-points-section .project-section-heading {
  margin-bottom: 3rem;
}

.talking-points-section .eyebrow {
  color: rgba(255, 255, 255, 0.4);
}

.talking-points-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 900px;
}

.talking-point {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 1.5rem;
  align-items: start;
  padding: 2rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.talking-point:first-child {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.tp-num {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.25);
  padding-top: 0.2em;
}

.talking-point p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
}

.talking-point p strong {
  color: rgba(255, 255, 255, 0.95);
  display: block;
  margin-bottom: 0.4rem;
  font-size: 1rem;
}

.talking-point p code {
  background: rgba(126, 184, 247, 0.12);
  color: #7eb8f7;
  border-radius: 3px;
  padding: 0.1em 0.35em;
  font-size: 0.85em;
}

/* ── Screen navigation ────────────────────────────────────── */
.screen-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem var(--page-margin, 2rem);
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.screen-nav a {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--screen-accent);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: opacity 0.15s ease;
}

.screen-nav a:hover {
  opacity: 0.7;
}

.screen-nav-group {
  display: flex;
  gap: 1.5rem;
}

.screen-nav a.back {
  color: var(--muted, #888);
}

/* ── Gaps grid (All Alerts honest gaps section) ───────────── */
.gaps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
}

@media (max-width: 900px) {
  .gaps-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .gaps-grid {
    grid-template-columns: 1fr;
  }
}

.gap-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.5rem;
}

.gap-header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.gap-status {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #b43c3c;
  background: rgba(180, 60, 60, 0.08);
  border-radius: 4px;
  padding: 0.2em 0.5em;
  width: fit-content;
}

.gap-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
  color: var(--heading, #1a1510);
}

.gap-card p {
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--body, #3a3530);
  margin: 0;
}

/* ── Gravity Well: sequence steps ─────────────────────────── */
.sequence-steps {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2rem;
}

.sequence-step {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 1rem;
  align-items: start;
}

.step-num {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--screen-accent-dim);
  color: var(--screen-accent);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sequence-step p {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--body, #3a3530);
  margin: 0;
  padding-top: 0.4rem;
}

/* ── Live Map: topology comparison table ─────────────────── */
.topology-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}

@media (max-width: 640px) {
  .topology-compare {
    grid-template-columns: 1fr;
  }
}

.topology-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.5rem;
  background: #fff;
}

.topology-card.rejected {
  opacity: 0.65;
  border-style: dashed;
}

.topology-card h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--heading, #1a1510);
}

.topology-card p {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--body, #3a3530);
  margin: 0;
}

.topology-verdict {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  display: block;
}

.topology-verdict.chosen {
  color: var(--screen-accent);
}

.topology-verdict.rejected {
  color: #b43c3c;
}

/* ── Timeline: swimlane legend ────────────────────────────── */
.swimlane-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.swimlane-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  border: 1px solid currentColor;
}

.swimlane-chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

/* ── Overview: metric card strip ─────────────────────────── */
.metric-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

@media (max-width: 900px) {
  .metric-strip {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 560px) {
  .metric-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

.metric-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem 1rem;
  text-align: center;
}

.metric-card .metric-value {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
  color: var(--heading, #1a1510);
  margin-bottom: 0.3rem;
}

.metric-card .metric-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #888);
}

/* ── Responsive page margin ───────────────────────────────── */
@media (max-width: 640px) {
  .decision-block {
    padding: 3rem 1.25rem;
  }

  .screen-hypothesis {
    padding: 3.5rem 1.25rem;
  }

  .talking-points-section {
    padding: 3.5rem 1.25rem;
  }

  .screen-nav {
    padding: 1.5rem 1.25rem;
  }
}

.screen-dive-row {
  display: flex;
  padding: 0.5rem 0 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  margin-bottom: 0.5rem;
}

.screen-dive-link {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--screen-accent, #2e6be6);
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.screen-dive-link:hover {
  opacity: 0.65;
}
