/* ============================================================
   Arktera Systems — breakdown-motion.css
   Advanced ambient motion for strategic breakdown pages.
   Extends motion.css — do NOT modify motion.css.
   Load order: style.css → extended.css → motion.css → breakdown-motion.css
   ============================================================ */

/* ══════════════════════════════════════════════════════════
   KEYFRAME EXTENSIONS
══════════════════════════════════════════════════════════ */

/* Slow horizontal sweep — for connector lines */
@keyframes lineSweep {
  0% {
    transform: scaleX(0);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    transform: scaleX(1);
    opacity: 0.6;
  }
}

/* Annotation bounce — marker indicators */
@keyframes annotationBounce {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  40% {
    transform: translateY(-5px) scale(1.05);
  }
  70% {
    transform: translateY(-2px) scale(1.02);
  }
}

/* Issue indicator pulse — critical severity */
@keyframes criticalPulse {
  0%,
  100% {
    box-shadow:
      0 0 0 0 hsla(0, 72%, 60%, 0),
      0 0 8px var(--red);
    opacity: 1;
  }
  50% {
    box-shadow:
      0 0 0 8px hsla(0, 72%, 60%, 0),
      0 0 20px var(--red);
    opacity: 0.7;
  }
}

/* Warning indicator */
@keyframes warningPulse {
  0%,
  100% {
    box-shadow:
      0 0 0 0 hsla(38, 90%, 60%, 0),
      0 0 6px var(--amber);
  }
  50% {
    box-shadow:
      0 0 0 6px hsla(38, 90%, 60%, 0),
      0 0 16px var(--amber);
  }
}

/* Trust flow — moves rightward along a line */
@keyframes trustFlowRight {
  0% {
    left: -40px;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    left: 100%;
    opacity: 0;
  }
}

/* Clarity typewriter effect — CSS only */
@keyframes caretBlink {
  0%,
  100% {
    opacity: 1;
  }
  49% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* Messaging rewrite fade — before/after swap */
@keyframes rewriteFadeOut {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-8px);
  }
}
@keyframes rewriteFadeIn {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Analytical scan — horizontal scan line */
@keyframes analysisScan {
  0% {
    top: 0%;
    opacity: 0;
  }
  5% {
    opacity: 0.5;
  }
  95% {
    opacity: 0.5;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

/* Slow layer reveal — for framework layers */
@keyframes layerReveal {
  0% {
    transform: scaleX(0);
    opacity: 0;
  }
  100% {
    transform: scaleX(1);
    opacity: 1;
  }
}

/* Floating annotation drift — gentle X+Y */
@keyframes annotationDrift {
  0% {
    transform: translate(0px, 0px) rotate(-0.5deg);
  }
  33% {
    transform: translate(4px, -8px) rotate(0.3deg);
  }
  66% {
    transform: translate(-3px, -4px) rotate(-0.2deg);
  }
  100% {
    transform: translate(0px, 0px) rotate(-0.5deg);
  }
}
@keyframes annotationDriftB {
  0% {
    transform: translate(0px, -6px) rotate(0.4deg);
  }
  40% {
    transform: translate(-5px, 0px) rotate(-0.3deg);
  }
  80% {
    transform: translate(3px, -10px) rotate(0.2deg);
  }
  100% {
    transform: translate(0px, -6px) rotate(0.4deg);
  }
}

/* Browser mockup float */
@keyframes browserFloat {
  0% {
    transform: translateY(0px) rotate(-0.4deg);
  }
  50% {
    transform: translateY(-10px) rotate(0.3deg);
  }
  100% {
    transform: translateY(0px) rotate(-0.4deg);
  }
}

/* Marker connectors draw */
@keyframes connectorDraw {
  0% {
    stroke-dashoffset: 200;
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 0.6;
  }
}

/* Comparison slide */
@keyframes slideLeft {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}
@keyframes slideRight {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Score fill */
@keyframes scoreFill {
  from {
    width: 0%;
  }
  to {
    width: var(--score-width, 80%);
  }
}

/* Glow pulse on issue number */
@keyframes issueBadgeGlow {
  0%,
  100% {
    box-shadow: 0 0 0 0 var(--issue-color, var(--red));
  }
  50% {
    box-shadow: 0 0 16px 4px var(--issue-color, var(--red));
  }
}

/* Trust layer cascade */
@keyframes trustLayerIn {
  0% {
    opacity: 0;
    transform: translateX(-16px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Subtle node orbit for messaging system */
@keyframes nodeOrbit {
  0% {
    transform: rotate(0deg) translateX(48px) rotate(0deg);
  }
  100% {
    transform: rotate(360deg) translateX(48px) rotate(-360deg);
  }
}
@keyframes nodeOrbitReverse {
  0% {
    transform: rotate(0deg) translateX(36px) rotate(0deg);
  }
  100% {
    transform: rotate(-360deg) translateX(36px) rotate(360deg);
  }
}

/* ══════════════════════════════════════════════════════════
   BROWSER MOCKUP SYSTEM
══════════════════════════════════════════════════════════ */

.browser-mockup {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 24px 80px hsla(199, 69%, 3%, 0.6),
    0 0 0 1px var(--border);
  animation: browserFloat 10s ease-in-out infinite;
  position: relative;
  will-change: transform;
}
.browser-bar {
  background: var(--bg-tertiary);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.browser-dots {
  display: flex;
  gap: 5px;
}
.browser-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-hover);
  flex-shrink: 0;
}
.browser-dot:nth-child(1) {
  background: var(--red);
  opacity: 0.7;
}
.browser-dot:nth-child(2) {
  background: var(--amber);
  opacity: 0.7;
}
.browser-dot:nth-child(3) {
  background: var(--green);
  opacity: 0.7;
}
.browser-url {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.75rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.browser-content {
  position: relative;
  min-height: 280px;
  background: var(--bg-primary);
  overflow: hidden;
}

/* ── ISSUE MARKER ── */
.issue-marker {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.65rem;
  font-weight: 600;
  color: #fff;
  z-index: 10;
  cursor: default;
  will-change: transform;
}
.issue-marker--critical {
  background: var(--red);
  animation:
    criticalPulse 2.5s ease-in-out infinite,
    annotationBounce 6s ease-in-out infinite;
}
.issue-marker--warning {
  background: var(--amber);
  animation:
    warningPulse 3s ease-in-out infinite 1s,
    annotationBounce 8s ease-in-out infinite 2s;
}
.issue-marker--info {
  background: var(--accent);
  animation: annotationBounce 10s ease-in-out infinite 1s;
  box-shadow: 0 0 12px var(--accent);
}

/* ── CONNECTOR LINE SVG ── */
.connector-svg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}
.connector-line {
  stroke: var(--border-hover);
  stroke-width: 1;
  stroke-dasharray: 4 3;
  fill: none;
  animation: connectorDraw 3s ease-out forwards;
}
.connector-line--accent {
  stroke: var(--accent);
  stroke-dasharray: 5 3;
}
.connector-line--red {
  stroke: var(--red);
  stroke-dasharray: 4 4;
}

/* ── ANALYSIS SCAN OVERLAY ── */
.analysis-scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  pointer-events: none;
  z-index: 8;
  animation: analysisScan 6s ease-in-out infinite 1s;
}

/* ══════════════════════════════════════════════════════════
   DIAGNOSTIC DASHBOARD
══════════════════════════════════════════════════════════ */

.diagnostic-dashboard {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  position: relative;
  overflow: hidden;
}
.diagnostic-dashboard::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, hsla(255, 255%, 255%, 0.02) 0%, transparent 60%);
  pointer-events: none;
}

.diag-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.diag-title {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.diag-live {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}
.diag-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: dataTick 2s ease-in-out infinite;
}

.diag-row {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr 48px;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid hsla(191, 9%, 63%, 0.06);
}

.diag-row > .diag-bar-track {
  min-width: 0;
}

.diag-row:last-child {
  border-bottom: none;
}
.diag-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.diag-bar-track {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.diag-bar-fill {
  height: 100%;
  border-radius: 3px;
  width: 0;
  transform-origin: left;
  transition: width 1.8s cubic-bezier(0.23, 1, 0.32, 1);
}
.diag-bar-fill--red {
  background: var(--red);
}
.diag-bar-fill--amber {
  background: var(--amber);
}
.diag-bar-fill--green {
  background: var(--green);
}
.diag-bar-fill--accent {
  background: var(--accent);
}
.diag-score {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  text-align: right;
  font-weight: 600;
}
.diag-score--red {
  color: var(--red);
}
.diag-score--amber {
  color: var(--amber);
}
.diag-score--green {
  color: var(--green);
}

/* ══════════════════════════════════════════════════════════
   ISSUE SECTION SYSTEM
══════════════════════════════════════════════════════════ */

.issue-section {
  padding: 5rem 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.issue-section:last-of-type {
  border-bottom: none;
}

.issue-header {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.issue-badge {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  font-weight: 600;
  flex-shrink: 0;
  letter-spacing: 0.08em;
}
.issue-badge--critical {
  background: var(--red-dim);
  border: 1px solid var(--red);
  color: var(--red);
  --issue-color: var(--red);
  animation: issueBadgeGlow 3s ease-in-out infinite;
}
.issue-badge--warning {
  background: var(--amber-dim);
  border: 1px solid var(--amber);
  color: var(--amber);
  --issue-color: var(--amber);
  animation: issueBadgeGlow 4s ease-in-out infinite 1s;
}
.issue-badge--info {
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  color: var(--accent);
  --issue-color: var(--accent);
}

.issue-meta {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}
.issue-title {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
}

.issue-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.issue-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition:
    border-color 0.3s,
    transform 0.3s;
}
.issue-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
}
.issue-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  transition: opacity 0.3s;
}
.issue-card--problem::before {
  background: linear-gradient(90deg, transparent, var(--red), transparent);
}
.issue-card--fix::before {
  background: linear-gradient(90deg, transparent, var(--green), transparent);
}
.issue-card--impact::before {
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.issue-card--why::before {
  background: linear-gradient(90deg, transparent, var(--amber), transparent);
}
.issue-card:hover::before {
  opacity: 1;
}

.issue-card-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.issue-card-label--problem {
  color: var(--red);
}
.issue-card-label--fix {
  color: var(--green);
}
.issue-card-label--impact {
  color: var(--accent);
}
.issue-card-label--why {
  color: var(--amber);
}

.issue-card h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.issue-card p {
  font-size: 0.8375rem;
  color: var(--text-secondary);
  line-height: 1.68;
}

/* Floating annotation beside issue */
.issue-annotation {
  position: absolute;
  right: -180px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.875rem 1rem;
  min-width: 168px;
  backdrop-filter: blur(12px);
  animation: annotationDrift 14s ease-in-out infinite;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 2;
}
.issue-annotation-title {
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

/* ══════════════════════════════════════════════════════════
   BEFORE / AFTER COMPARISON SYSTEM
══════════════════════════════════════════════════════════ */

.comparison-system {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  position: relative;
}
.comparison-system::after {
  content: "VS";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.2em;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.comparison-card {
  border-radius: 14px;
  padding: 2rem;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: transform 0.35s;
}
.comparison-card:hover {
  transform: translateY(-4px);
}

.comparison-card--before {
  background: var(--bg-secondary);
  border-color: var(--red);
}
.comparison-card--before::before {
  content: "BEFORE";
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  color: var(--red);
  background: var(--red-dim);
  border: 1px solid var(--red);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
}

.comparison-card--after {
  background: var(--bg-glass);
  border-color: var(--green);
  backdrop-filter: blur(12px);
}
.comparison-card--after::before {
  content: "AFTER";
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  color: var(--green);
  background: var(--green-dim);
  border: 1px solid var(--green);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
}

.comparison-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}
.comparison-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.comparison-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.8375rem;
  color: var(--text-secondary);
  line-height: 1.55;
}
.comparison-item-icon {
  flex-shrink: 0;
  margin-top: 0.1rem;
  font-size: 0.7rem;
}
.comparison-item--bad .comparison-item-icon {
  color: var(--red);
}
.comparison-item--good .comparison-item-icon {
  color: var(--green);
}

/* Trust flow line */
.trust-flow {
  position: relative;
  margin: 2rem 0;
  height: 40px;
  overflow: hidden;
}
.trust-flow-track {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
  transform: translateY(-50%);
}
.trust-flow-particle {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-50%);
  animation: trustFlowRight 3s ease-in-out infinite;
  box-shadow: 0 0 10px var(--accent);
}
.trust-flow-particle:nth-child(2) {
  animation-delay: 1s;
}
.trust-flow-particle:nth-child(3) {
  animation-delay: 2s;
}

/* ══════════════════════════════════════════════════════════
   MESSAGING COMPARISON SYSTEM
══════════════════════════════════════════════════════════ */

.msg-comparison {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition:
    border-color 0.3s,
    transform 0.35s;
}
.msg-comparison:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.msg-comparison-header {
  background: var(--bg-tertiary);
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.msg-tag {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}
.msg-tag--weak {
  color: var(--red);
  background: var(--red-dim);
  border: 1px solid var(--red);
}
.msg-tag--strong {
  color: var(--green);
  background: var(--green-dim);
  border: 1px solid var(--green);
}

.msg-body {
  padding: 1.25rem 1.5rem;
}
.msg-text-weak {
  font-size: 0.9375rem;
  color: var(--text-muted);
  font-style: italic;
  text-decoration: line-through;
  text-decoration-color: var(--red);
  line-height: 1.6;
  margin-bottom: 1rem;
}
.msg-text-strong {
  font-size: 0.9375rem;
  color: var(--text-primary);
  font-weight: 500;
  line-height: 1.6;
}
.msg-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  color: var(--accent);
  font-size: 0.9rem;
}

/* ══════════════════════════════════════════════════════════
   TRUST FRAMEWORK VISUALIZATION
══════════════════════════════════════════════════════════ */

.trust-framework {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
}
.trust-layer {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 0.75rem;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateX(-16px);
  transition:
    border-color 0.3s,
    transform 0.3s;
}
.trust-layer.animated {
  animation: trustLayerIn 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}
.trust-layer:nth-child(1).animated {
  animation-delay: 0.1s;
}
.trust-layer:nth-child(2).animated {
  animation-delay: 0.25s;
}
.trust-layer:nth-child(3).animated {
  animation-delay: 0.4s;
}
.trust-layer:nth-child(4).animated {
  animation-delay: 0.55s;
}
.trust-layer:nth-child(5).animated {
  animation-delay: 0.7s;
}
.trust-layer:hover {
  border-color: var(--accent);
  transform: translateX(4px);
}

.trust-layer-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 2px 0 0 2px;
}
.trust-layer-bar--1 {
  background: var(--accent);
}
.trust-layer-bar--2 {
  background: hsl(185, 70%, 45%);
}
.trust-layer-bar--3 {
  background: hsl(185, 60%, 55%);
}
.trust-layer-bar--4 {
  background: var(--green);
}
.trust-layer-bar--5 {
  background: hsl(158, 50%, 60%);
}

.trust-layer-num {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  flex-shrink: 0;
  min-width: 20px;
}
.trust-layer-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.trust-layer-icon svg {
  width: 18px;
  height: 18px;
}
.trust-layer-body h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}
.trust-layer-body p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.58;
}

@media (max-width: 768px) {
  .trust-layer {
    gap: 0.75rem;
    padding: 1rem;
  }

  .trust-layer-num {
    display: none;
  }

  .trust-layer-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    align-self: flex-start;
  }

  .trust-layer-icon svg {
    width: 16px;
    height: 16px;
  }
}

/* ══════════════════════════════════════════════════════════
   MESSAGING ORBIT SYSTEM (hero visual for page 2)
══════════════════════════════════════════════════════════ */

.msg-orbit-system {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto;
}
.msg-orbit-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.6rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-align: center;
  animation: glowBreathe 5s ease-in-out infinite;
  z-index: 2;
}
.msg-orbit-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  border: 1px solid var(--border);
}
.msg-orbit-ring--1 {
  width: 160px;
  height: 160px;
  margin: -80px 0 0 -80px;
  animation: orbitCCW 20s linear infinite;
  opacity: 1;
}
.msg-orbit-ring--2 {
  width: 240px;
  height: 240px;
  margin: -120px 0 0 -120px;
  animation: orbitCW 30s linear infinite;
  opacity: 15;
}
.msg-orbit-node {
  position: absolute;
  top: 0;
  left: 50%;
  margin-left: -10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--red-dim);
  border: 1px solid var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
}
.msg-orbit-node--good {
  background: var(--green-dim);
  border-color: var(--green);
}

/* ══════════════════════════════════════════════════════════
   IMPACT CARD SYSTEM
══════════════════════════════════════════════════════════ */

.impact-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-rest);
  transition:
    border-color 0.35s,
    transform 0.35s,
    box-shadow 0.35s;
}
.impact-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.35s;
}
.impact-card:hover {
  border-color: var(--accent);
  transform: translateY(-5px);
  box-shadow: 0 16px 48px hsla(199, 69%, 3%, 0.45);
}
.impact-card:hover::before {
  opacity: 1;
}
.impact-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 1.25rem;
  transition: background 0.3s;
}
.impact-card:hover .impact-card-icon {
  background: var(--accent);
  color: hsl(199, 69%, 5%);
}
[data-theme="light"] .impact-card:hover .impact-card-icon {
  color: hsl(209, 44%, 8%);
}
.impact-card-icon svg {
  width: 20px;
  height: 20px;
}
.impact-card-num {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
}
.impact-card h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.impact-card p {
  font-size: 0.8375rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ══════════════════════════════════════════════════════════
   FLOATING ANNOTATION SYSTEM (breakdown-specific)
══════════════════════════════════════════════════════════ */

.bd-float {
  position: absolute;
  pointer-events: none;
  will-change: transform;
  z-index: 4;
}
.bd-float--a {
  animation: annotationDrift 16s ease-in-out infinite;
}
.bd-float--b {
  animation: annotationDriftB 20s ease-in-out infinite;
}
.bd-float--c {
  animation: ambientDrift 24s ease-in-out infinite;
}
.bd-float--d {
  animation: dangle 11s ease-in-out infinite;
  transform-origin: top center;
}

/* ══════════════════════════════════════════════════════════
   OUTCOME METRIC STRIP
══════════════════════════════════════════════════════════ */

.outcome-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-top: 2rem;
}
.outcome-strip-item {
  background: var(--bg-secondary);
  padding: 1.5rem;
  text-align: center;
  transition: background 0.2s;
}
.outcome-strip-item:hover {
  background: var(--bg-glass);
}
.outcome-strip-num {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 0.35rem;
}
.outcome-strip-num .accent {
  color: var(--accent);
}
.outcome-strip-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ══════════════════════════════════════════════════════════
   HERO PANEL LAYOUT
══════════════════════════════════════════════════════════ */

.bd-hero-visual {
  position: relative;
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .issue-grid {
    grid-template-columns: 1fr;
  }
  .comparison-system {
    grid-template-columns: 1fr;
  }
  .comparison-system::after {
    display: none;
  }
  .issue-annotation {
    display: none;
  }
  .diag-row {
    grid-template-columns: 140px 1fr 48px;
    gap: 1.5rem;
  }

  .diag-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .diag-bar-track {
    min-width: 0;
    overflow: hidden;
  }

  .diag-bar-fill {
    max-width: 100%;
  }

  .diag-score {
    white-space: nowrap;
    text-align: right;
  }
}
@media (max-width: 600px) {
  .browser-mockup {
    font-size: 0.8rem;
  }
  .diag-row {
    grid-template-columns: 1fr;
    row-gap: 0.35rem;
    align-items: start;
  }

  .diag-bar-track {
    width: 100%;
  }

  .diag-score {
    justify-self: start;
    text-align: left;
    font-size: 0.7rem;
    opacity: 0.8;
  }
}

/* ══════════════════════════════════════════════════════════
   REDUCED MOTION
══════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .browser-mockup,
  .issue-marker,
  .issue-marker--critical,
  .issue-marker--warning,
  .issue-badge--critical,
  .issue-badge--warning,
  .trust-flow-particle,
  .analysis-scan,
  .bd-float--a,
  .bd-float--b,
  .bd-float--c,
  .bd-float--d,
  .msg-orbit-ring--1,
  .msg-orbit-ring--2,
  .trust-layer {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .trust-layer {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ══════════════════════════════════════════════════════════
   MOCK IMAGE SYSTEM
   SVG-based annotated website screenshots.
   Clickable → lightbox overlay.
══════════════════════════════════════════════════════════ */

/* ── MOCK IMAGE WRAPPER ── */
.mock-img-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: zoom-in;
  transition:
    border-color 0.3s,
    box-shadow 0.3s,
    transform 0.3s;
  background: var(--bg-primary);
  group: mock;
}
.mock-img-wrap:hover {
  border-color: var(--accent);
  box-shadow:
    0 8px 40px hsla(199, 69%, 3%, 0.5),
    0 0 0 1px var(--accent-glow);
  transform: translateY(-3px);
}

/* Zoom hint overlay */
.mock-img-wrap::after {
  content: "⊕  View Full";
  position: absolute;
  bottom: 0.875rem;
  right: 0.875rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--bg-glass);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 0.25s,
    transform 0.25s;
  pointer-events: none;
}
.mock-img-wrap:hover::after {
  opacity: 1;
  transform: translateY(0);
}

/* The SVG itself */
.mock-img-wrap svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Caption below mock */
.mock-caption {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}
.mock-caption-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.mock-caption-dot--red {
  background: var(--red);
  box-shadow: 0 0 5px var(--red);
}
.mock-caption-dot--amber {
  background: var(--amber);
  box-shadow: 0 0 5px var(--amber);
}
.mock-caption-dot--accent {
  background: var(--accent);
  box-shadow: 0 0 5px var(--accent);
}

/* ── LIGHTBOX ── */
.lx-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: hsla(199, 69%, 3%, 0.92);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.23, 1, 0.32, 1);
}
.lx-overlay.open {
  opacity: 1;
  pointer-events: all;
}
[data-theme="light"] .lx-overlay {
  background: hsla(210, 20%, 97%, 0.92);
}

.lx-inner {
  position: relative;
  max-width: 1100px;
  width: 100%;
  transform: scale(0.94) translateY(16px);
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}
.lx-overlay.open .lx-inner {
  transform: scale(1) translateY(0);
}

.lx-frame {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 32px 80px hsla(199, 69%, 3%, 0.7);
}
.lx-frame svg {
  display: block;
  width: 100%;
  height: auto;
}

.lx-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
}
.lx-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.lx-close {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    border-color 0.2s,
    color 0.2s,
    background 0.2s;
  font-family: inherit;
}
.lx-close:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.lx-footer {
  padding: 0.875rem 1.5rem;
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.07em;
}

.lx-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  justify-content: space-between;
  pointer-events: none;
  padding: 0 0.5rem;
}
.lx-nav-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: all;
  transition:
    border-color 0.2s,
    background 0.2s;
  backdrop-filter: blur(12px);
  font-family: inherit;
}
.lx-nav-btn:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}
.lx-nav-btn[disabled] {
  opacity: 0.3;
  pointer-events: none;
}

/* Press Escape hint */
.lx-esc {
  position: absolute;
  bottom: -2.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  white-space: nowrap;
}

/* Layout helpers for mock + text side-by-side */
.issue-with-mock {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
  margin-top: 1.5rem;
}
@media (max-width: 860px) {
  .issue-with-mock {
    grid-template-columns: 1fr;
  }
}

/* Scan line on mock images */
.mock-img-wrap .mock-scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  pointer-events: none;
  z-index: 5;
  animation: analysisScan 7s ease-in-out infinite 3s;
}

/* ============================================================
   breakdown-motion.css — Responsive Audit Patch
   Append to the end of breakdown-motion.css
   ============================================================ */

/* ── BD-HERO-VISUAL — overflow + floating panel hide ── */
.bd-hero-visual {
  overflow: hidden;
}

@media (max-width: 600px) {
  .bd-float {
    display: none;
  }
}

/* ── IMPACT GRID — was undefined; now defined ── */
.impact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

@media (max-width: 900px) {
  .impact-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .impact-grid {
    grid-template-columns: 1fr;
  }
}

/* ── BROWSER MOCKUP — clamp height, ensure no h-scroll ── */
@media (max-width: 480px) {
  .browser-mockup {
    border-radius: 10px;
  }
  .browser-bar {
    padding: 0.5rem 0.75rem;
  }
  .browser-url {
    font-size: 0.62rem;
    padding: 0.25rem 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .browser-content {
    min-height: 220px;
  }
}

/* ── ISSUE SECTION — padding collapse on mobile ── */
@media (max-width: 600px) {
  .issue-section {
    padding: 3rem 0;
  }
  .issue-title {
    font-size: 1.125rem;
  }
  .issue-header {
    gap: 0.875rem;
    margin-bottom: 1.5rem;
  }
  .issue-badge {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
  }
}

/* ── ISSUE CARDS — padding on very small screens ── */
@media (max-width: 480px) {
  .issue-card {
    padding: 1.25rem;
  }
  .issue-card h4 {
    font-size: 0.875rem;
  }
}

/* ── DIAGNOSTIC DASHBOARD (breakdown version) ── */
/* Already handled at 900px and 600px in the file;
   add 380px floor for ultra-narrow */
@media (max-width: 380px) {
  .diagnostic-dashboard {
    padding: 1.25rem 1rem;
  }
  .diag-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding-bottom: 0.875rem;
    margin-bottom: 1.25rem;
  }
  .diag-title {
    font-size: 0.62rem;
  }
}

/* ── COMPARISON SYSTEM (breakdown version) ── */
/* Already collapses at 900px; add padding tightening */
@media (max-width: 600px) {
  .comparison-card {
    padding: 1.5rem 1.25rem;
  }
  .comparison-card h3 {
    font-size: 1rem;
  }
}

/* ── MOCK IMAGE WRAPPER — ensure SVGs never overflow ── */
.mock-img-wrap svg {
  max-width: 100%;
  height: auto;
}

@media (max-width: 480px) {
  .mock-img-wrap {
    border-radius: 8px;
  }
  .mock-caption {
    font-size: 0.6rem;
    padding: 0.5rem 0.75rem;
  }
}

/* ── LIGHTBOX — full-screen on mobile ── */
@media (max-width: 600px) {
  .lx-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .lx-inner {
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
  }
  .lx-frame {
    border-radius: 0;
  }
  .lx-nav {
    padding: 0 0.25rem;
  }
  .lx-nav-btn {
    width: 36px;
    height: 36px;
  }
  .lx-esc {
    display: none;
  }
}

/* ── OUTCOME STRIP — collapse to 2-col on mobile ── */
@media (max-width: 480px) {
  .outcome-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .outcome-strip-item {
    padding: 1.25rem;
  }
  .outcome-strip-num {
    font-size: 1.375rem;
  }
}

/* ── TRUST FLOW — hide on tiny screens ── */
@media (max-width: 480px) {
  .trust-flow {
    display: none;
  }
}

/* ── IMPACT CARD (breakdown version) — padding tighten ── */
@media (max-width: 480px) {
  .impact-card {
    padding: 1.5rem 1.25rem;
  }
}

/* ── ISSUE WITH MOCK — already 1-col at 860px;
   tighten gap on mobile ── */
@media (max-width: 600px) {
  .issue-with-mock {
    gap: 1.25rem;
  }
}
