/* ========= SCROLL STORY CONTAINER ========= */
.scroll-story { position: relative; }
.scroll-story-viewport {
  width: 100%; height: 100vh; height: 100dvh;
  position: relative; overflow: hidden; background: var(--bg);
}

/* ========= HERO TEXT (inside pinned section) ========= */
.scroll-hero {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -55%);
  text-align: center; z-index: 60;
  width: 90%; max-width: 600px;
}
.scroll-hero h1 { margin-bottom: 16px; }
.scroll-hero p { font-size: 1rem; color: var(--text-3); }

/* ========= DOCUMENT ELEMENTS ========= */
.doc {
  position: absolute; left: 0; top: 0;
  width: 130px; height: 170px;
  opacity: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  will-change: transform, opacity;
  pointer-events: none;
}
.doc-bar { height: 7px; width: 100%; }
.doc-bar--income { background: var(--accent); }
.doc-bar--identity { background: var(--blue); }
.doc-bar--criminal { background: var(--amber); }
.doc-bar--eviction { background: var(--red); }
.doc-body { padding: 10px 12px; }
.doc-icon { width: 18px; height: 18px; margin-bottom: 6px; color: var(--text-3); }
.doc-label { font-size: .58rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); margin-bottom: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-line { height: 3px; border-radius: 2px; background: var(--bg-alt); margin-bottom: 5px; }
.doc-line--w90 { width: 90%; }
.doc-line--w75 { width: 75%; }
.doc-line--w60 { width: 60%; }
.doc-line--w45 { width: 45%; }
.doc-line--w30 { width: 30%; }
.doc-line--num { width: 40%; background: var(--accent-bg); height: 4px; margin-top: 2px; }

/* ID-shaped doc (landscape) */
.doc--landscape { width: 170px; height: 110px; }
/* Small card */
.doc--small { width: 130px; height: 90px; }

/* ========= LANE HEADERS ========= */
.lane-header {
  position: absolute; top: 84px;
  font-family: var(--font); font-size: .68rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-3);
  will-change: transform, opacity;
  transform: translateX(-50%);
}
.lane-header--income { color: var(--accent); }
.lane-header--identity { color: var(--blue); }
.lane-header--criminal { color: var(--amber); }
.lane-header--eviction { color: var(--red); }

/* ========= ATTESTATION CARDS ========= */
.attestation-card {
  position: absolute; top: 30%;
  width: 190px;
  opacity: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  will-change: transform, opacity;
  pointer-events: none;
  transform: translateX(-50%);
}
.att-lane-indicator { width: 100%; height: 3px; border-radius: 2px; margin-bottom: 14px; }
.att-lane-indicator--income { background: var(--accent); }
.att-lane-indicator--identity { background: var(--blue); }
.att-lane-indicator--criminal { background: var(--amber); }
.att-lane-indicator--eviction { background: var(--red); }
.att-title { font-family: var(--font); font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }
.att-result { font-size: .82rem; color: var(--text); font-weight: 500; margin-bottom: 12px; }
.verified-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; background: var(--green-bg); color: var(--green);
  border-radius: 20px; font-size: .65rem; font-weight: 600;
  will-change: transform;
}
.verified-badge svg { width: 12px; height: 12px; }
.zk-icon {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 8px; background: var(--accent-bg); color: var(--accent);
  border-radius: 20px; font-size: .6rem; font-weight: 600;
  margin-left: 4px;
  will-change: transform, opacity;
}
.zk-icon svg { width: 11px; height: 11px; }

/* ========= DECISION CARD ========= */
.decision-card {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  opacity: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--green);
  border-radius: var(--radius);
  padding: 36px;
  text-align: center;
  will-change: transform, opacity;
  pointer-events: none;
  box-shadow: var(--shadow-md);
}
.decision-approved {
  font-family: var(--serif); font-size: 2.2rem; color: var(--green);
  letter-spacing: .02em; margin-bottom: 16px;
}
.decision-meta { display: flex; flex-direction: column; gap: 8px; }
.decision-hash {
  font-family: var(--mono); font-size: .68rem; color: var(--text-3);
  letter-spacing: .02em; word-break: break-all;
}
.decision-timestamp { font-size: .72rem; color: var(--text-3); }
.decision-badges { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 4px; }
.decision-badges span {
  padding: 3px 10px; border-radius: 3px; font-size: .6rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
  background: var(--accent-bg); color: var(--accent);
}

/* ========= PHASE NARRATIVES ========= */
.phase-narrative {
  position: absolute; bottom: 72px; left: 48px;
  max-width: 340px;
  will-change: transform, opacity;
  z-index: 40;
}
.phase-narrative h3 {
  font-family: var(--serif); font-size: 1.3rem;
  margin-bottom: 8px; color: var(--text);
}
.phase-narrative p {
  font-size: .85rem; color: var(--text-2); line-height: 1.65;
}

/* ========= SCROLL HINT ========= */
.scroll-hint {
  margin-top: 24px;
  color: var(--text-3);
  cursor: pointer;
  animation: scroll-hint-bounce 2s ease-in-out infinite;
}
@keyframes scroll-hint-bounce {
  0%, 100% { transform: translateY(0); opacity: .6; }
  50% { transform: translateY(8px); opacity: 1; }
}

/* ========= PROGRESS INDICATOR ========= */
.scroll-progress {
  position: absolute; right: 28px; top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex; flex-direction: column; gap: 0;
}
.scroll-progress-track {
  position: absolute; left: 6px; top: 8px; bottom: 8px;
  width: 2px; background: var(--border); border-radius: 1px;
}
.scroll-progress-step {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px 10px 0; position: relative;
  cursor: pointer; border-radius: 6px;
  transition: background var(--transition-fast);
}
.scroll-progress-step:hover {
  background: var(--accent-bg);
}
.scroll-progress-step:hover .scroll-progress-dot {
  background: var(--accent); transform: scale(1.15);
}
.scroll-progress-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--border);
  transition: all var(--transition-base) var(--ease-default);
  flex-shrink: 0; position: relative; z-index: 1;
}
.scroll-progress-step.active .scroll-progress-dot {
  background: var(--accent); transform: scale(1.2);
  box-shadow: 0 0 0 4px var(--accent-bg);
}
.scroll-progress-label {
  font-size: .72rem; font-weight: 600; color: var(--text-3);
  opacity: .5; transition: all var(--transition-fast);
  white-space: nowrap;
}
.scroll-progress-step:hover .scroll-progress-label {
  opacity: .85; color: var(--text-2);
}
.scroll-progress-step.active .scroll-progress-label {
  opacity: 1; color: var(--accent);
}

/* ========= REDUCED MOTION ========= */
@media (prefers-reduced-motion: reduce) {
  .scroll-story-viewport { height: auto; min-height: 100vh; }
  .scroll-story.static-mode .scroll-story-viewport {
    display: flex; flex-direction: column; align-items: center;
    padding: 120px 24px 80px; gap: 64px; height: auto;
  }
  .scroll-story.static-mode .doc,
  .scroll-story.static-mode .lane-header,
  .scroll-story.static-mode .attestation-card,
  .scroll-story.static-mode .decision-card,
  .scroll-story.static-mode .phase-narrative {
    position: relative; opacity: 1; transform: none; visibility: visible;
  }
  .scroll-story.static-mode .scroll-hero { position: relative; transform: none; }
  .scroll-story.static-mode .scroll-progress { display: none; }
}

/* ========= MOBILE ========= */
@media (max-width: 768px) {
  .doc { width: 95px; height: 125px; }
  .doc--landscape { width: 125px; height: 82px; }
  .doc--small { width: 95px; height: 68px; }
  .doc-label { font-size: .5rem; }
  .doc-body { padding: 7px 8px; }
  .doc-icon { width: 14px; height: 14px; margin-bottom: 4px; }

  .scroll-progress {
    display: flex; flex-direction: row; gap: 0;
    right: auto; top: auto; bottom: 16px;
    left: 50%; transform: translateX(-50%);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 24px; padding: 8px 12px;
    box-shadow: var(--shadow);
  }
  .scroll-progress-track { display: none; }
  .scroll-progress-step { padding: 8px 10px; gap: 5px; flex-direction: column; border-radius: 16px; }
  .scroll-progress-dot { width: 10px; height: 10px; }
  .scroll-progress-label { font-size: .6rem; opacity: .5; }
  .scroll-progress-step.active .scroll-progress-label { opacity: 1; }
  .scroll-progress-step.active .scroll-progress-dot { transform: scale(1.3); }

  .phase-narrative { left: 20px; bottom: 76px; max-width: 260px; }
  .phase-narrative h3 { font-size: 1.1rem; }
  .phase-narrative p { font-size: .78rem; }

  .scroll-hero h1 { font-size: 2rem; }

  .attestation-card { width: 150px; padding: 14px; }
  .att-title { font-size: .62rem; }
  .att-result { font-size: .74rem; }

  .decision-card { width: 260px; padding: 28px; }
  .decision-approved { font-size: 1.8rem; }
}
