/* === AUDIT ASSEMBLY ============================================ */
/* Flat horizontal conveyor with central scanner. Documents travel
   left -> right, get scanned, emerge tagged AUDITED + PLAN. */

.audit-stage {
  margin: 56px auto 0;
  max-width: 1180px;
  padding: 0 32px;
  position: relative;
  z-index: 1;
}

.audit-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 14px;
}
.audit-eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--rust);
}

.audit-scene {
  position: relative;
  height: 240px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    repeating-linear-gradient(135deg, rgba(168,77,46,0.04) 0 1px, transparent 1px 14px),
    var(--paper-2);
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.5) inset,
    0 30px 60px -40px rgba(80,40,20,0.25);
  transform: none;
}

/* ambient cubes drifting */
.audit-cube {
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 4px;
  opacity: 0.55;
  pointer-events: none;
  animation: cubeDrift 9s ease-in-out infinite;
}
.audit-cube.c1 { top: 18px;  left: 8%;   background: var(--rust);  animation-delay: -1s; }
.audit-cube.c2 { top: 22px;  right: 12%; background: var(--sage);  width: 14px; height: 14px; animation-delay: -3s; }
.audit-cube.c3 { bottom: 22px; left: 16%; background: var(--clay); width: 12px; height: 12px; animation-delay: -5s; }
.audit-cube.c4 { bottom: 18px; right: 8%; background: var(--rust-soft); animation-delay: -7s; }
@keyframes cubeDrift {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-8px) rotate(8deg); }
}

/* the belt itself: a flat horizontal track with vertical stripe pattern */
.audit-belt {
  position: absolute;
  left: 6%; right: 6%;
  top: 50%;
  transform: translateY(-50%);
  height: 56px;
  border-radius: 10px;
  background:
    repeating-linear-gradient(90deg,
      rgba(42,31,23,0.18) 0 2px,
      transparent 2px 22px),
    linear-gradient(180deg, #ddc9b0, #c9b39a);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.5),
    inset 0 -1px 0 rgba(42,31,23,0.18),
    0 6px 18px -10px rgba(80,40,20,0.45);
  border: 1px solid rgba(42,31,23,0.18);
}

/* scanner sits centered, straddling the belt */
.audit-scanner {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 168px;
  height: 140px;
  pointer-events: none;
  z-index: 3;
}

.scanner-base {
  position: absolute;
  inset: auto 0 0 0;
  height: 24px;
  background: linear-gradient(180deg, #2a1f17, #1a130d);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  box-shadow:
    0 4px 10px -4px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.08);
}
.scanner-base .label {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--clay);
  text-transform: uppercase;
}
.scanner-base .label.r { color: var(--sage); }

.scanner-arch {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 168px;
  height: 116px;
  border: 2px solid var(--rust);
  border-bottom: none;
  border-top-left-radius: 84px 60px;
  border-top-right-radius: 84px 60px;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(168,77,46,0.18), transparent 60%);
  box-shadow:
    0 0 0 1px rgba(168,77,46,0.18),
    0 12px 28px -16px rgba(168,77,46,0.6);
}

/* reticle: glowing pulse at the centre of the scanner */
.reticle {
  position: absolute;
  left: 50%; top: 56%;
  transform: translate(-50%, -50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1px dashed rgba(168,77,46,0.7);
  background: radial-gradient(circle, rgba(168,77,46,0.35), transparent 65%);
  animation: reticlePulse 1.6s ease-in-out infinite;
}
.reticle::before,
.reticle::after {
  content: "";
  position: absolute;
  background: var(--rust);
}
.reticle::before { left: 50%; top: 8%;  width: 1px; height: 84%; transform: translateX(-50%); }
.reticle::after  { top: 50%; left: 8%;  height: 1px; width: 84%; transform: translateY(-50%); }
@keyframes reticlePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(168,77,46,0.45); transform: translate(-50%, -50%) scale(1); }
  50%      { box-shadow: 0 0 0 12px rgba(168,77,46,0); transform: translate(-50%, -50%) scale(1.05); }
}

/* horizontal scan beam sweeping across the scanner archway */
.scan-beam {
  position: absolute;
  left: calc(50% - 84px);
  top: 50%;
  transform: translateY(-50%);
  width: 168px;
  height: 56px;
  pointer-events: none;
  overflow: hidden;
  border-radius: 6px;
  z-index: 2;
}
.scan-beam::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg,
    transparent,
    rgba(168,77,46,0.85),
    rgba(168,77,46,0.4),
    transparent);
  box-shadow: 0 0 12px 2px rgba(168,77,46,0.55);
  animation: scanSweep 2.4s linear infinite;
}
@keyframes scanSweep {
  0%   { left: -4px; }
  100% { left: 100%; }
}

/* track holding the documents */
.audit-track {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.audit-doc {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translate(-100%, -50%);
  width: 88px;
  height: 92px;
  animation: docTravel 9s linear infinite;
}
.audit-doc:nth-child(1) { animation-delay: 0s; }
.audit-doc:nth-child(2) { animation-delay: -3s; }
.audit-doc:nth-child(3) { animation-delay: -6s; }

@keyframes docTravel {
  0%   { left: 4%;  transform: translate(-100%, -50%); }
  100% { left: 96%; transform: translate(0, -50%); }
}

.doc-card {
  position: absolute;
  inset: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 8px;
  box-shadow:
    0 6px 14px -8px rgba(80,40,20,0.45),
    0 1px 0 rgba(255,255,255,0.6) inset;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.doc-h {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 8px;
  letter-spacing: 0.16em;
  color: var(--ink-mute);
  margin-bottom: 2px;
}
.doc-bar {
  height: 4px;
  background: rgba(42,31,23,0.16);
  border-radius: 2px;
}
.doc-bar.mid   { width: 80%; }
.doc-bar.short { width: 55%; }

/* stamp + plan tag start invisible, fade in after the doc passes the scanner */
.doc-stamp {
  position: absolute;
  top: 6px; right: 6px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--rust);
  color: var(--paper);
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.5);
  animation: stampIn 9s linear infinite;
  box-shadow: 0 4px 10px -4px rgba(168,77,46,0.6);
}
.audit-doc:nth-child(1) .doc-stamp { animation-delay: 0s; }
.audit-doc:nth-child(2) .doc-stamp { animation-delay: -3s; }
.audit-doc:nth-child(3) .doc-stamp { animation-delay: -6s; }

@keyframes stampIn {
  0%, 50%   { opacity: 0; transform: scale(0.5) rotate(-12deg); }
  55%       { opacity: 1; transform: scale(1.2) rotate(-12deg); }
  60%, 100% { opacity: 1; transform: scale(1) rotate(-12deg); }
}

.doc-plan {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 8px;
  letter-spacing: 0.18em;
  color: var(--rust);
  white-space: nowrap;
  opacity: 0;
  animation: planIn 9s linear infinite;
}
.audit-doc:nth-child(1) .doc-plan { animation-delay: 0s; }
.audit-doc:nth-child(2) .doc-plan { animation-delay: -3s; }
.audit-doc:nth-child(3) .doc-plan { animation-delay: -6s; }

@keyframes planIn {
  0%, 55%   { opacity: 0; transform: translate(-50%, 4px); }
  62%, 100% { opacity: 1; transform: translate(-50%, 0); }
}

/* mask: hide the doc card while it's mid-scanner so the beam reads "scanning" */
.audit-doc::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background: rgba(168,77,46,0.18);
  opacity: 0;
  animation: docFlash 9s linear infinite;
  pointer-events: none;
}
.audit-doc:nth-child(1)::before { animation-delay: 0s; }
.audit-doc:nth-child(2)::before { animation-delay: -3s; }
.audit-doc:nth-child(3)::before { animation-delay: -6s; }
@keyframes docFlash {
  0%, 42%   { opacity: 0; }
  46%, 54%  { opacity: 0.65; }
  58%, 100% { opacity: 0; }
}

/* legend below */
.audit-legend {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 22px;
}
.audit-step {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  background: var(--paper);
  display: grid;
  grid-template-columns: 38px 1fr;
  grid-template-rows: auto auto;
  column-gap: 14px;
  row-gap: 2px;
  align-items: center;
  transition: border-color .25s ease, background .25s ease;
}
.audit-step.active {
  border-color: var(--rust-soft);
  background: #fbf6ec;
}
.audit-step-dot {
  grid-row: span 2;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--paper-3);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--rust);
}
.audit-step.active .audit-step-dot {
  background: var(--rust);
  color: var(--paper);
  border-color: var(--rust-deep);
}
.audit-step-k {
  font-family: "Newsreader", Georgia, serif;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.audit-step-v {
  font-size: 12.5px;
  color: var(--ink-soft);
}

@media (max-width: 900px) {
  .audit-scene { height: 200px; }
  .audit-scanner { width: 132px; height: 110px; }
  .scanner-arch { width: 132px; height: 92px; border-top-left-radius: 66px 50px; border-top-right-radius: 66px 50px; }
  .scan-beam { left: calc(50% - 66px); width: 132px; }
  .audit-doc { width: 72px; height: 78px; }
  .audit-legend { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .audit-stage {
    margin-top: 42px;
    padding: 0 18px;
  }
  .audit-eyebrow {
    font-size: 10px;
    letter-spacing: 0.14em;
    margin-bottom: 12px;
  }
  .audit-scene {
    height: 174px;
    border-radius: 14px;
  }
  .audit-belt {
    left: 4%;
    right: 4%;
    height: 46px;
  }
  .audit-scanner {
    width: 108px;
    height: 96px;
  }
  .scanner-arch {
    width: 108px;
    height: 78px;
    border-top-left-radius: 54px 42px;
    border-top-right-radius: 54px 42px;
  }
  .scanner-base {
    height: 22px;
    padding: 0 7px;
  }
  .scanner-base .label {
    font-size: 7px;
    letter-spacing: 0.12em;
  }
  .reticle {
    width: 36px;
    height: 36px;
  }
  .scan-beam {
    left: calc(50% - 54px);
    width: 108px;
    height: 46px;
  }
  .audit-doc {
    width: 58px;
    height: 64px;
  }
  .doc-card {
    padding: 8px 6px;
    gap: 4px;
  }
  .doc-h,
  .doc-plan {
    font-size: 6px;
    letter-spacing: 0.12em;
  }
  .doc-stamp {
    width: 18px;
    height: 18px;
    font-size: 11px;
  }
  .audit-legend {
    gap: 10px;
    margin-top: 16px;
  }
  .audit-step {
    padding: 14px;
  }
}
