/* Layout and visual composition */
body {
  margin: 0;
  padding: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.interactive-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.story-header {
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
  text-align: left;
}

.meta-tag {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}

.story-title {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  line-height: 1.15;
  color: var(--color-text);
  margin: 0 0 1rem;
}

@media (max-width: 768px) {
  .story-header {
    padding: 2rem 1.25rem 1.25rem;
  }
  .story-title {
    font-size: 1.85rem;
  }
}

.story-lede {
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--color-text-muted);
  margin: 0 0 1.25rem;
}

@media (max-width: 768px) {
  .story-lede {
    font-size: 1.05rem;
  }
}

.story-byline {
  font-size: 0.875rem;
  color: var(--color-text-light);
  border-top: 1px solid var(--color-border);
  padding-top: 0.75rem;
}

/* Scrollytelling stage and narrative layout */
.story-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* Desktop stage: full viewport sticky background */
@media (min-width: 769px) {
  .stage-wrapper {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
    background: var(--color-stage-bg);
  }

  .prose-column {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 620px;
    margin: -100vh 0 4rem;
    margin-left: 4%;
    margin-right: auto;
    padding: 0 1.25rem;
    box-sizing: border-box;
  }

  .scene-card {
    margin: 0 0 85vh;
  }

  .scene-card:last-child {
    margin-bottom: 25vh;
  }
}

/* Mobile stage: top sticky graphic header (36vh high), cards scroll in view below */
@media (max-width: 768px) {
  .stage-wrapper {
    position: sticky;
    top: 0;
    width: 100%;
    height: 38vh;
    z-index: 10;
    pointer-events: none;
    overflow: hidden;
    background: var(--color-stage-bg);
    border-bottom: 2px solid var(--color-border-strong);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  }

  .prose-column {
    position: relative;
    z-index: 2;
    width: 100%;
    margin: 1rem auto 4rem;
    padding: 0 1rem;
    box-sizing: border-box;
  }

  .scene-card {
    margin: 0 0 50vh;
    padding: 1.5rem 1.15rem;
  }

  .scene-card:first-child {
    margin-top: 1rem;
  }

  .scene-card:last-child {
    margin-bottom: 20vh;
  }
}

.vis-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vis-stage svg {
  width: 100%;
  height: 100%;
  display: block;
}

.scene-card {
  background: var(--color-surface-translucent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--color-card-shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.6rem;
  background: var(--color-border);
  color: var(--color-text);
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.scene-card h2 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  line-height: 1.25;
  margin: 0 0 1rem;
  color: var(--color-text);
}

@media (max-width: 768px) {
  .scene-card h2 {
    font-size: 1.35rem;
  }
}

.scene-card p {
  font-size: 1rem;
  color: var(--color-text);
  margin: 0 0 1rem;
}

.editorial-media {
  margin: 1.25rem 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.media-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  max-height: 280px;
}

figcaption {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  padding: 0.5rem 0.75rem;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.summary-box {
  background: rgba(30, 58, 138, 0.05);
  border-left: 4px solid var(--color-primary);
  padding: 1rem 1.25rem;
  border-radius: 0 8px 8px 0;
  margin-top: 1rem;
}

.summary-box h3 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
  color: var(--color-primary);
}

.action-list {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.925rem;
}

.action-list li {
  margin-bottom: 0.4rem;
}

.callout-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}

.callout-card h4 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  color: var(--color-primary);
}

.callout-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.policy-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.policy-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.policy-item.banned {
  background: rgba(185, 28, 28, 0.06);
  border-left: 4px solid var(--color-danger);
}

.policy-item.protected {
  background: rgba(21, 128, 61, 0.06);
  border-left: 4px solid var(--color-success);
}

.policy-icon {
  font-size: 1.1rem;
  font-weight: bold;
}

.policy-item.banned .policy-icon { color: var(--color-danger); }
.policy-item.protected .policy-icon { color: var(--color-success); }

.stat-highlight-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1.25rem 0;
}

@media (max-width: 480px) {
  .stat-highlight-box {
    grid-template-columns: 1fr;
  }
}

.stat-block {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 1rem;
  border-radius: 8px;
}

.stat-val {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
}

.stat-desc {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 0.35rem;
  line-height: 1.4;
}

/* Regional pipeline data display */
.data-display-container {
  margin: 1rem 0;
}

.data-table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
}

.pipeline-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.825rem;
  text-align: left;
}

.pipeline-table th, .pipeline-table td {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--color-border);
}

.pipeline-table th {
  background: var(--color-border);
  font-weight: 600;
}

.status-badge {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 700;
}

.status-A { background: #dcfce7; color: #166534; }
.status-C { background: #e0f2fe; color: #0369a1; }
.status-U { background: #fef9c3; color: #854d0e; }

.data-attribution-note {
  font-size: 0.75rem;
  color: var(--color-text-light);
  line-height: 1.4;
  margin-top: 0.75rem;
  border-top: 1px solid var(--color-border);
  padding-top: 0.5rem;
}

.citation-list {
  padding-left: 1.25rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.citation-list li {
  margin-bottom: 0.75rem;
}

.citation-list code {
  font-family: var(--font-mono);
  background: var(--color-border);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
}

/* Footer */
.story-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 2.5rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  position: relative;
  z-index: 2;
}

/* Vis Stage SVG styling */
.stage-title {
  fill: #f8fafc;
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 700;
}

.stage-subtitle {
  fill: #94a3b8;
  font-family: var(--font-sans);
  font-size: 13px;
}

.stage-node-box {
  rx: 8;
  ry: 8;
  stroke-width: 1.5;
  transition: all 0.3s ease;
}

.stage-node-text {
  fill: #f8fafc;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
}

.stage-node-subtext {
  fill: #94a3b8;
  font-family: var(--font-sans);
  font-size: 11px;
}

/* Reduced motion */
html[data-pique-reduced-motion="reduce"] .scene-card,
html[data-pique-reduced-motion="reduce"] .stage-node-box {
  transition: none !important;
}
