/* ── Page-specific overrides ─────────────────────────────────────── */
#runway { height: 300vh; }
#header-panel { padding: 24px 48px 16px; }

#title-overlay {
  display: block;
  margin: 0 auto;
  font-family: 'Major Mono Display', monospace;
  font-size: clamp(28px, 5vw, 52px);
  color: #0cc;
  letter-spacing: 0.12em;
  line-height: 1.2;
}
#subtitle {
  font-size: clamp(16px, 2vw, 22px);
  color: rgba(255, 255, 255, 0.3);
  margin-top: 4px;
  letter-spacing: 0.12em;
}
#narrative-panel {
  position: fixed;
  left: 30%;
  top: 42%;
  transform: translateX(-50%);
  z-index: 10;
  pointer-events: none;
  width: min(500px, 50vw);
  transition: opacity 0.4s ease;
}
.narrative-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: clamp(18px, 2.5vw, 28px);
  pointer-events: none;
  opacity: 0;
  line-height: 1.4;
  will-change: transform, opacity;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.8);
}
.narrative-line:nth-child(1) { color: rgba(255, 180, 100, 0.85); }
.narrative-line:nth-child(2) { color: rgba(255, 200, 140, 0.85); }
.narrative-line:nth-child(3) { color: rgba(200, 220, 200, 0.85); }
.narrative-line:nth-child(4) { color: rgba(100, 220, 220, 0.85); }
.narrative-line:nth-child(5) { color: rgba(50, 230, 160, 0.85); }

#pipeline {
  position: fixed;
  right: 5%;
  top: 30%;
  width: 36vw;
  max-width: 550px;
  z-index: 10;
  opacity: 0;
  will-change: opacity;
  transition: opacity 0.4s ease;
}
#pipeline-bars {
  position: relative;
}
.pipeline-header {
  color: rgba(255, 255, 255, 0.4);
  font-size: clamp(13px, 1.2vw, 17px);
  margin-bottom: 10px;
}
.pipeline-bar {
  position: absolute;
  left: 0;
  right: 0;
  height: clamp(28px, 4.5vh, 42px);
  transition: top 0.4s ease;
  cursor: default;
}
.pipeline-bar:focus {
  outline: 2px solid #0cc;
  outline-offset: 2px;
}
.pipeline-track {
  position: absolute;
  inset: 0;
  background: var(--bar-color);
  opacity: 0.12;
  border-radius: 2px;
}
.pipeline-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 0;
  background: var(--bar-color);
  opacity: 0.65;
  border-radius: 2px;
  transition: width 0.4s ease;
}
.pipeline-label {
  position: absolute;
  top: 0; left: 6px; bottom: 0;
  display: flex;
  align-items: center;
  color: #000;
  font-size: clamp(14px, 1.5vw, 20px);
  font-weight: bold;
}
.flow-selector {
  margin-top: 16px;
  pointer-events: auto;
}
.flow-title {
  color: rgba(255, 255, 255, 0.4);
  font-size: clamp(13px, 1.2vw, 17px);
  margin-bottom: 8px;
}
.flow-options {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
}

.row-title-hero {
  font-family: 'Major Mono Display', monospace;
  font-size: clamp(22px, 3vw, 36px);
  color: #0cc;
  margin-bottom: 12px;
  letter-spacing: 0.1em;
}
.arch-label-sm {
  fill: #0cc;
  font-family: 'Share Tech Mono', monospace;
  font-size: 14px;
  text-anchor: middle;
  dominant-baseline: central;
}
.cache-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 100%;
  max-width: 320px;
}
.cache-layer {
  width: 100%;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
}
.cache-layer.cache-fast {
  border-color: rgba(0, 234, 170, 0.4);
  box-shadow: 0 0 15px rgba(0, 234, 170, 0.08);
}
.cache-layer.cache-persist {
  border-color: rgba(0, 170, 255, 0.4);
  box-shadow: 0 0 15px rgba(0, 170, 255, 0.08);
}
.cache-layer.cache-mint {
  border-color: rgba(255, 150, 50, 0.4);
  box-shadow: 0 0 15px rgba(255, 150, 50, 0.08);
}
.cache-label {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.cache-fast .cache-label { color: rgba(0, 234, 170, 0.7); }
.cache-persist .cache-label { color: rgba(0, 170, 255, 0.7); }
.cache-mint .cache-label { color: rgba(255, 150, 50, 0.7); }
.cache-detail {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
}
.cache-arrow {
  color: rgba(0, 204, 204, 0.3);
  font-size: 20px;
  padding: 4px 0;
  animation: pulse-arrow 2s ease-in-out infinite;
}
/* -- Security & resilience flow SVG ------------------------------------ */
.flow-svg {
  width: 100%;
  max-width: 440px;
  height: auto;
}
.flow-node {
  fill: rgba(0, 204, 204, 0.08);
  stroke: rgba(0, 204, 204, 0.4);
  stroke-width: 1.5;
}
.flow-fork-node {
  stroke: rgba(0, 204, 204, 0.6);
}
.flow-fork-glow {
  animation: fork-glow 2s ease-in-out infinite;
}
.flow-label {
  fill: #0cc;
  font-family: 'Share Tech Mono', monospace;
  font-size: 16px;
  text-anchor: middle;
  dominant-baseline: central;
}
.flow-sublabel {
  fill: rgba(255, 255, 255, 0.4);
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  text-anchor: middle;
  dominant-baseline: central;
}
.flow-path {
  stroke: rgba(0, 204, 204, 0.45);
  stroke-width: 2;
  stroke-dasharray: 6 5;
  animation: flow-dash 1.5s linear infinite;
  fill: none;
}
.flow-branch-ok {
  stroke: rgba(255, 180, 50, 0.6);
}
.flow-branch-retry {
  stroke: rgba(0, 204, 204, 0.6);
}
.flow-branch-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  dominant-baseline: central;
}
.flow-branch-label-ok {
  fill: rgba(255, 180, 50, 0.7);
}
.flow-branch-label-retry {
  fill: rgba(0, 204, 204, 0.7);
}
@keyframes flow-dash {
  to { stroke-dashoffset: -11; }
}
@keyframes fork-glow {
  0%, 100% { opacity: 0.25; }
  50%      { opacity: 1; }
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  #header-panel {
    left: 50%;
    transform: translateX(-50%);
    transition: opacity 0.4s ease;
  }
  #narrative-panel {
    left: 50%;
    top: 55%;
    width: min(500px, 90vw);
  }
  #pipeline {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(500px, 90vw);
    max-width: none;
  }
  .flow-selector {
    margin-top: 2em;
  }
}
@media (max-width: 600px) {
  #header-panel {
    padding: 16px 20px 12px;
    max-width: 94vw;
  }
  #title-overlay {
    font-size: clamp(22px, 8vw, 36px);
  }
  #narrative-panel {
    left: 50%;
    top: auto;
    bottom: 80px;
    width: 88vw;
    min-height: 3em;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(0, 204, 204, 0.15);
    border-radius: 8px;
    padding: 10px 16px;
  }
  .narrative-line {
    font-size: clamp(18px, 4.5vw, 24px);
  }
  #pipeline {
    left: 5%;
    right: 5%;
    transform: none;
    top: auto;
    bottom: 8%;
    width: auto;
    max-width: none;
  }
  .pipeline-bar {
    height: 20px;
  }
  .pipeline-track {
    opacity: 0.06;
  }
  .pipeline-header {
    font-size: 12px;
    margin-bottom: 6px;
  }
  .pipeline-label {
    font-size: 13px;
  }
  .flow-options {
    flex-direction: column;
    gap: 6px;
  }
  .flow-btn {
    font-size: 13px;
    padding: 10px 12px;
    min-height: 44px;
  }
  #tooltip {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cache-arrow { animation: none; opacity: 0.6; }
  .flow-path { animation: none; }
  .flow-fork-glow { animation: none; opacity: 0.5; }
}
