/* Hero-only document demo. All artwork is lightweight HTML/CSS and inline SVG. */
.hero-demo {
  --demo-accent: #c8e013;
  --demo-line: #71864c;
  --demo-muted: #a5ae9a;
  --paper: #f0f2e8;
  --paper-ink: #273123;
  min-width: 0;
  padding-top: 8px;
}

/* Soft light and a technical grid behind the floating documents. */
.hero-demo::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 30px -60px 40px;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse at 52% 35%, #c8e01317, transparent 60%),
    linear-gradient(#c8e01308 1px, transparent 1px),
    linear-gradient(90deg, #c8e01308 1px, transparent 1px);
  background-size:
    100% 100%,
    36px 36px,
    36px 36px;
  -webkit-mask-image: radial-gradient(ellipse, #000 25%, transparent 72%);
  mask-image: radial-gradient(ellipse, #000 25%, transparent 72%);
}

.hero-demo [hidden] {
  display: none !important;
}

.hero-demo .flow-topline {
  align-items: center;
  min-height: 18px;
  margin-bottom: 14px;
  font-size: 10px;
  line-height: 1.5;
  color: #adb5a3;
}

.hero-demo .flow-topline > :last-child {
  flex: none;
  font-variant-numeric: tabular-nums;
}

/* Three tactile, accessible source selectors; their miniatures are decorative. */
.hero-demo .flow-inputs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
  position: relative;
  z-index: 2;
  padding-inline: 15px;
}

.hero-demo [data-demo-source] {
  --source-rotate-y: 0deg;
  --source-rotate-z: 0deg;
  --source-lift: 0px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  height: 82px;
  padding: 8px;
  border: 1px solid #46523b;
  border-radius: 10px;
  background: linear-gradient(145deg, #2a3325, #131911 85%);
  box-shadow:
    inset 0 1px #ecffcf30,
    inset 1px 0 #ecffcf14,
    1px 2px 0 #39482c,
    3px 5px 0 #202c17,
    4px 8px 0 #10180b,
    8px 17px 22px -5px #0009;
  color: #bac4af;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  /* Keep the same tilt while selection and hover only lift the card. */
  transform: translateY(var(--source-lift)) perspective(650px)
    rotateY(var(--source-rotate-y)) rotateZ(var(--source-rotate-z));
  transition:
    transform 300ms ease,
    border-color 250ms,
    box-shadow 250ms,
    color 250ms;
}

.hero-demo [data-demo-source="email"] {
  --source-rotate-y: 9deg;
  --source-rotate-z: -3deg;
}
.hero-demo [data-demo-source="excel"] {
  --source-rotate-y: -9deg;
  --source-rotate-z: 3deg;
}

.hero-demo [data-demo-source][aria-pressed="true"] {
  --source-lift: -4px;
  border-color: #b6cc4a;
  color: #f0f5db;
  background: linear-gradient(145deg, #36432b, #1b2315 85%);
  box-shadow:
    inset 0 1px #efffb869,
    inset 1px 0 #efffb82b,
    1px 2px 0 #6b7d36,
    3px 5px 0 #3c4e23,
    4px 8px 0 #16200d,
    9px 22px 28px -6px #000b,
    0 0 28px #c8e01318;
}

.hero-demo .hero-source-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  line-height: 1.2;
}

.hero-demo .hero-source-label svg {
  width: 12px;
  height: 12px;
  flex: none;
  color: currentColor;
}

.hero-demo [data-demo-source]:focus-visible,
.hero-demo .gateway:focus-visible {
  outline: 2px solid var(--demo-accent);
  outline-offset: 5px;
}

.hero-demo .hero-source-thumb {
  position: relative;
  display: block;
  width: 62px;
  height: 40px;
  pointer-events: none;
}

.hero-demo .hero-thumb-email {
  background: #edf0e5;
  border: 1px solid #fff9;
  border-radius: 4px;
  box-shadow:
    3px 4px 0 #a6b59430,
    0 5px 8px #0005;
  transform: rotate(-5deg);
}

.hero-demo .hero-thumb-toolbar {
  display: flex;
  gap: 2px;
  height: 9px;
  align-items: center;
  padding-inline: 4px;
  border-bottom: 1px solid #74856533;
  background: #dce4cf;
  border-radius: 3px 3px 0 0;
}

.hero-demo .hero-thumb-toolbar i {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #738461;
}
.hero-demo .hero-thumb-avatar {
  position: absolute;
  left: 5px;
  top: 15px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #829869;
}
.hero-demo .hero-thumb-lines {
  display: grid;
  gap: 3px;
  position: absolute;
  left: 20px;
  right: 6px;
  top: 15px;
}
.hero-demo .hero-thumb-lines i {
  height: 2px;
  background: #9faa92;
}
.hero-demo .hero-thumb-lines i:last-child {
  width: 65%;
}

.hero-demo .hero-thumb-sheet {
  position: relative;
  display: block;
  width: 34px;
  height: 40px;
  margin: auto;
  padding: 9px 6px 4px;
  border-radius: 2px 7px 2px 2px;
  background: #eff2e7;
  box-shadow:
    3px 3px 0 #a1af9377,
    6px 6px 0 #73836333,
    0 6px 9px #0005;
  transform: rotate(6deg);
}

.hero-demo .hero-thumb-pdf .hero-thumb-sheet::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 8px;
  border-radius: 0 0 0 2px;
  background: linear-gradient(45deg, #afbea0 50%, #34402a 51%);
}

.hero-demo .hero-thumb-filetype {
  display: block;
  margin-bottom: 4px;
  color: #3b4b2e;
  font: 700 7px / 1 sans-serif;
}
.hero-demo .hero-thumb-sheet > i {
  display: block;
  height: 2px;
  margin-top: 3px;
  background: #a6b399;
}
.hero-demo .hero-thumb-sheet > i:last-child {
  width: 65%;
}

.hero-demo .hero-thumb-excel .hero-thumb-sheet {
  width: 56px;
  height: 37px;
  margin-top: 2px;
  padding: 10px 4px 4px;
  border-radius: 3px;
  background: linear-gradient(#5e7847 8px, #e4ecda 8px);
  transform: rotate(4deg);
}

.hero-demo .hero-thumb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}
.hero-demo .hero-thumb-grid i {
  height: 5px;
  border: 1px solid #91a67b80;
  background: #c7d7b34d;
}
.hero-demo .hero-thumb-grid i:nth-child(5) {
  background: #aacb71;
  border-color: #648837;
}

/* The active source becomes a small, credible document window with physical depth. */
.hero-demo .hero-input-preview {
  position: relative;
  isolation: isolate;
  height: 158px;
  margin: 28px 8px 0;
  color: var(--paper-ink);
  background: var(--paper);
  border: 1px solid #f7fae978;
  border-radius: 9px;
  box-shadow:
    inset 0 1px #fff,
    1px 2px 0 #dce6cb,
    3px 5px 0 #a6b48e,
    5px 8px 0 #687c4b,
    7px 11px 0 #2c3c1d,
    12px 27px 34px -8px #000c;
  /* Restore the light leftward tilt while preserving the layered depth. */
  transform: perspective(1100px) rotateX(3deg) rotateY(-5deg) rotateZ(-1deg);
  transform-origin: center center;
}

.hero-demo .hero-input-preview::after {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 28px 0 0;
  pointer-events: none;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(
    100deg,
    transparent 20%,
    #c8e01324 45%,
    #c8e01377 50%,
    transparent 55%
  );
  background-size: 250% 100%;
  opacity: 0;
}

.hero-demo[data-stage="reading"] .hero-input-preview::after {
  animation: hero-document-scan 1.1s ease-in-out both;
}

@keyframes hero-document-scan {
  0% {
    opacity: 0;
    background-position: 100% 0;
  }
  25%,
  65% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    background-position: 0 0;
  }
}

.hero-demo .hero-preview-panel {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  background: var(--paper);
}

.hero-demo .hero-preview-panel:not([hidden]) {
  animation: hero-document-in 400ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes hero-document-in {
  from {
    opacity: 0.4;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-demo .hero-window-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 27px;
  padding-inline: 13px;
  border-bottom: 1px solid #82916a3d;
  background: #e0e6d6;
}

.hero-demo .hero-window-dots {
  display: flex;
  flex: none;
  gap: 3px;
}
.hero-demo .hero-window-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #91a080;
}
.hero-demo .hero-preview-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #425337;
  font: 10px / 1.4 monospace;
}
.hero-demo .hero-filetype {
  margin-left: auto;
  color: #627253;
  font: 8px / 1 monospace;
  letter-spacing: 0.07em;
}

.hero-demo .hero-mail-header {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 12px 18px 0;
}
.hero-demo .hero-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border: 1px solid #9faf8555;
  border-radius: 50%;
  background: #dce7cd;
  color: #566e3d;
}
.hero-demo .hero-avatar svg {
  width: 16px;
  height: 16px;
}
.hero-demo .hero-mail-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.hero-demo .hero-mail-meta strong {
  color: #273621;
  font-size: 10px;
  font-weight: 600;
}
.hero-demo .hero-mail-meta > span {
  color: #6c7961;
  font-size: 9px;
}
.hero-demo .hero-mail-subject {
  margin: 10px 18px 5px;
  color: #26361e;
  font-size: 12px;
  font-weight: 600;
}
.hero-demo .hero-email-text {
  margin: 0 18px;
  color: #4b5742;
  font-size: 11px;
  line-height: 1.5;
}
.hero-demo .hero-mail-signature {
  margin: 5px 18px 0;
  color: #7b8672;
  font-size: 9px;
  line-height: 1.4;
}

.hero-demo [data-preview="pdf"] {
  background: #d9dfd0;
}
.hero-demo .hero-pdf-page {
  position: relative;
  width: calc(100% - 58px);
  margin: 9px auto 0;
  padding: 10px 16px 13px;
  min-height: 130px;
  background: #fcfdf8;
  box-shadow: 0 1px 6px #20301022;
}
.hero-demo .hero-paper-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 9px;
  color: #2d3b24;
}
.hero-demo .hero-paper-heading strong {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.hero-demo .hero-paper-heading > span {
  color: #7b856f;
  font: 9px monospace;
}
.hero-demo .hero-document-table {
  display: grid;
  font-size: 10px;
  line-height: 1.5;
}
.hero-demo .hero-document-table > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px 44px;
  gap: 9px;
  padding: 4px 0;
  border-bottom: 1px solid #33462a17;
}
.hero-demo .hero-document-table > div:first-child {
  padding-top: 0;
  color: #7a846e;
  font-size: 8px;
}
.hero-demo .hero-document-table strong {
  font-weight: 500;
}
.hero-demo .hero-paper-signature {
  width: 37px;
  height: 2px;
  margin-top: 8px;
  background: #b4c698;
  box-shadow: 0 4px #dce3d3;
}

.hero-demo [data-preview="excel"] .hero-window-bar {
  background: #d9e5cd;
}
.hero-demo .hero-preview-count {
  flex: none;
  margin-left: auto;
  color: #506537;
  font: 9px / 1.4 monospace;
}
.hero-demo .hero-sheet-formula {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 22px;
  padding-inline: 11px;
  color: #6c7a5d;
  background: #f6f8f0;
  border-bottom: 1px solid #b4c2a4;
  font: 9px monospace;
}
.hero-demo .hero-sheet-formula > :first-child {
  font-style: italic;
  font-family: serif;
  font-size: 12px;
  padding-right: 9px;
  border-right: 1px solid #bdcbaa;
}
.hero-demo .hero-spreadsheet {
  font-size: 10px;
  line-height: 1.4;
}
.hero-demo .hero-spreadsheet > div {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 74px 72px;
}
.hero-demo .hero-spreadsheet > div > * {
  position: relative;
  min-width: 0;
  padding: 6px 9px;
  border-right: 1px solid #bac9a8;
  border-bottom: 1px solid #bac9a8;
}
.hero-demo .hero-spreadsheet > div:first-child > * {
  padding-block: 2px;
  background: #e3ebda;
  text-align: center;
  font: 9px / 1.4 monospace;
  color: #71805f;
}
.hero-demo .hero-spreadsheet > div > :first-child {
  padding-inline: 2px;
  text-align: center;
  background: #e3ebda;
  font: 9px / 1.6 monospace;
  color: #71805f;
}
.hero-demo .hero-spreadsheet > div:nth-child(2) {
  font-weight: 600;
  color: #455638;
}
.hero-demo .hero-spreadsheet > div:nth-child(3) > :nth-child(3) {
  color: #354b24;
  background: #d8e9bf;
  box-shadow: inset 0 0 0 1.5px #77934c;
}
.hero-demo .hero-spreadsheet > div:nth-child(3) > :nth-child(3)::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  right: -1px;
  bottom: -1px;
  background: #77934c;
}

.hero-demo .flow-lines {
  height: 48px;
  margin-top: 0;
  color: var(--demo-line);
}

.hero-demo .flow-pulse {
  opacity: 0;
  animation: none;
  stroke: #c8e013;
  stroke-dasharray: 17 83;
}

/* A selected source sends one quiet stream; the three lanes never flash together. */
.hero-demo:is(
    [data-stage="intake"],
    [data-stage="reading"],
    [data-stage="matching"]
  )[data-source="email"]
  .flow-pulse-email,
.hero-demo:is(
    [data-stage="intake"],
    [data-stage="reading"],
    [data-stage="matching"]
  )[data-source="pdf"]
  .flow-pulse-pdf,
.hero-demo:is(
    [data-stage="intake"],
    [data-stage="reading"],
    [data-stage="matching"]
  )[data-source="excel"]
  .flow-pulse-excel {
  opacity: 0.85;
  animation: hero-demo-stream 1.45s linear infinite;
}

@keyframes hero-demo-stream {
  from {
    stroke-dashoffset: 20;
  }
  to {
    stroke-dashoffset: -80;
  }
}

.hero-demo .gateway {
  position: relative;
  height: 76px;
  margin-inline: 25px;
  padding: 12px 16px;
  gap: 13px;
  border-color: #819346;
  border-radius: 11px;
  background: linear-gradient(130deg, #344229, #1b2315 48%, #13190f);
  box-shadow:
    inset 0 1px #e6ff9755,
    inset 1px 0 #e6ff971a,
    1px 2px 0 #596e35,
    3px 5px 0 #354622,
    5px 9px 0 #15200d,
    10px 24px 30px -10px #000d;
  transition:
    border-color 250ms,
    box-shadow 250ms;
}

.hero-demo:is(
    [data-stage="reading"],
    [data-stage="matching"],
    [data-stage="validating"]
  )
  .gateway {
  border-color: #a6b942;
  box-shadow:
    inset 0 1px #e6ff9777,
    inset 1px 0 #e6ff9733,
    1px 2px 0 #849c43,
    3px 5px 0 #4c642c,
    5px 9px 0 #1d2d10,
    10px 24px 30px -10px #000d,
    0 0 34px #c8e0131c;
}

.hero-demo .gateway::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid #c8e01309;
  border-radius: 7px;
  pointer-events: none;
}

.hero-demo .gateway > .pylaios-mark {
  width: 56px;
  height: 56px;
  margin: -7px;
}

.hero-demo .gateway > div:not(.hero-engine-labels) {
  flex: 1;
  min-width: 0;
}

.hero-demo .gateway strong {
  font-size: 22px;
  line-height: 1.3;
}

.hero-demo [data-demo-status] {
  display: block;
  min-height: 18px;
  margin-top: 2px;
  color: #bfcbaa;
  font-size: 11px;
  line-height: 1.5;
}

.hero-demo .gateway-spark {
  flex: none;
  display: flex;
  align-items: center;
  color: #c8d68e;
  opacity: 0.75;
}

.hero-demo .gateway-spark svg {
  width: 23px;
  height: 23px;
}

.hero-demo .hero-engine-labels {
  position: absolute;
  z-index: 2;
  inset-inline: 12px;
  bottom: -10px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-3px);
  transition:
    opacity 180ms,
    transform 180ms;
}

.hero-demo .hero-engine-labels > * {
  padding: 3px 7px;
  border: 1px solid #526437;
  border-radius: 4px;
  background: #172013;
  color: #c1d294;
  font: 9px / 1.3 monospace;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.hero-demo .gateway:focus-within .hero-engine-labels {
  opacity: 1;
  transform: none;
}

@media (hover: hover) and (pointer: fine) {
  .hero-demo [data-demo-source]:hover {
    --source-lift: -6px;
    border-color: #bdd35a;
    color: #f1f7e3;
    box-shadow:
      inset 0 1px #edff9755,
      inset 1px 0 #edff9722,
      1px 2px 0 #6b7d36,
      3px 5px 0 #3c4e23,
      4px 8px 0 #16200d,
      9px 24px 30px -5px #000b;
  }
  .hero-demo .gateway:hover .hero-engine-labels {
    opacity: 1;
    transform: none;
  }
}

.hero-demo .output-line {
  position: relative;
  height: 36px;
  background: #819451;
}

.hero-demo .output-line::after {
  content: "";
  position: absolute;
  width: 3px;
  height: 7px;
  left: -1px;
  top: 0;
  background: var(--demo-accent);
  opacity: 0;
}

.hero-demo[data-stage="fields"] .output-line::after,
.hero-demo[data-stage="validated"] .output-line::after {
  animation: hero-demo-output 800ms ease-in-out infinite;
}

@keyframes hero-demo-output {
  0% {
    opacity: 0;
    transform: translateY(0);
  }
  30%,
  75% {
    opacity: 0.65;
  }
  100% {
    opacity: 0;
    transform: translateY(27px);
  }
}

.hero-demo .order-card {
  margin-inline: 32px;
  padding: 10px 16px;
  border-color: #4c5a3d;
  border-radius: 10px;
  background: linear-gradient(140deg, #20291a, #12180f);
  box-shadow:
    inset 0 1px #ecffd12b,
    inset 1px 0 #ecffd110,
    1px 2px 0 #3f502d,
    3px 5px 0 #26351a,
    5px 8px 0 #0f180a,
    10px 23px 32px -10px #000c;
  transition: border-color 250ms;
}

.hero-demo[data-stage="ready"] .order-card {
  border-color: #697942;
}

.hero-demo .order-card-head {
  height: 37px;
  gap: 8px;
  padding-bottom: 4px;
  flex-wrap: nowrap;
  align-items: flex-start;
}

.hero-demo .order-card-head > span:first-child {
  min-width: 0;
  min-height: 17px;
  color: #b9c69c;
  font-size: 11px;
  line-height: 1.5;
}

.hero-demo .order-card-head svg {
  flex: none;
}

.hero-demo .order-card-head .mono {
  flex: none;
  padding-top: 2px;
  font-size: 10px;
  line-height: 1.5;
  white-space: nowrap;
}

.hero-demo .order-row {
  grid-template-columns: minmax(0, 1fr) 58px 50px;
  gap: 7px;
  padding-top: 6px;
  font-size: 11px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.hero-demo .order-row:nth-child(2) {
  color: #97a38a;
  font-size: 10px;
}

.hero-demo [data-order-field] {
  min-width: 0;
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 250ms ease,
    transform 250ms ease;
}

.hero-demo[data-fields="0"] [data-order-field],
.hero-demo[data-fields="1"] [data-order-field="2"],
.hero-demo[data-fields="1"] [data-order-field="3"],
.hero-demo[data-fields="2"] [data-order-field="3"] {
  opacity: 0;
  transform: translateY(4px);
}

/* Reserve the review line even in a standard cycle to avoid shifting the card. */
.hero-demo .hero-review-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 41px;
  padding-top: 5px;
  color: #bfc5a6;
  font-size: 10px;
  line-height: 1.4;
}

.hero-demo .hero-review-line > * {
  opacity: 0;
  transition: opacity 250ms;
}

.hero-demo .hero-review-confidence {
  flex: 1;
  min-width: 0;
}

.hero-demo [data-demo-review-status] {
  flex: 1;
  min-width: 0;
  padding: 2px 5px;
  border: 1px solid #7783485c;
  border-radius: 3px;
  color: #d5dbb8;
  background: #c8e01308;
}

.hero-demo[data-scenario="review"]:is(
    [data-stage="review"],
    [data-stage="validated"],
    [data-stage="ready"]
  )
  .hero-review-line
  > * {
  opacity: 1;
}

.hero-demo:is([data-stage="validated"], [data-stage="ready"])
  [data-demo-review-status] {
  color: #cfe49d;
  border-color: #809c515c;
}

.hero-demo .order-bottom {
  margin-top: 4px;
  padding-top: 8px;
  min-height: 26px;
  font-size: 11px;
  line-height: 1.5;
  color: #a8b497;
}

.hero-demo .order-bottom svg,
.hero-demo .order-card-head svg {
  opacity: 0.25;
  transition: opacity 250ms;
}

.hero-demo[data-stage="ready"] .order-bottom svg,
.hero-demo[data-stage="ready"] .order-card-head svg {
  opacity: 1;
  color: #c8e013;
}

.hero-demo .flow-caption {
  margin-top: 12px;
  font-size: 11px;
  line-height: 1.5;
  color: #a5ae9a;
}

.hero-demo .flow-controls {
  margin-top: 1px;
}

.hero-demo:not(.hero-demo-enhanced) .flow-controls {
  visibility: hidden;
}

/* The button reflects the visitor's pause choice, including during hover pause. */
.hero-demo .flow-toggle[aria-pressed="false"] .pause-symbol,
.hero-demo .flow-toggle[aria-pressed="true"] .play-symbol {
  display: block;
}

.hero-demo .flow-toggle[aria-pressed="false"] .play-symbol,
.hero-demo .flow-toggle[aria-pressed="true"] .pause-symbol {
  display: none;
}

.hero-demo .flow-toggle {
  min-height: 44px;
  font-size: 11px;
  touch-action: manipulation;
}

.hero-demo .hero-demo-announcement {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Override even the more specific source/stage animation shorthands, including
   pseudo-elements. JavaScript also freezes any transitions already in progress. */
.hero-demo.animation-paused,
.hero-demo.animation-paused::before,
.hero-demo.animation-paused::after,
.hero-demo.animation-paused *,
.hero-demo.animation-paused *::before,
.hero-demo.animation-paused *::after {
  animation-play-state: paused !important;
}

/* The explanation is an immediate interaction, not part of the demo timeline. */
.hero-demo.animation-paused .hero-engine-labels {
  transition: none;
}

/* Older browsers settle a transition immediately when precise frame-pause is
   unavailable; the demo timer and all keyframe animations still stay paused. */
.hero-demo.hero-motion-fallback.animation-paused,
.hero-demo.hero-motion-fallback.animation-paused *,
.hero-demo.hero-motion-fallback.animation-paused *::before,
.hero-demo.hero-motion-fallback.animation-paused *::after {
  transition: none !important;
}

/* Selecting another document while paused still gives a fully readable preview. */
.hero-demo.hero-static-preview .hero-preview-panel {
  animation: none !important;
  opacity: 1;
  transform: none;
}

/* Tablet: narrow the spatial lanes, preserving readable fields and tap targets. */
@media (min-width: 601px) and (max-width: 1050px) {
  .hero-demo .flow-topline {
    font-size: 9px;
  }
  .hero-demo .flow-inputs {
    gap: 8px;
    padding-inline: 4px;
  }
  .hero-demo .hero-input-preview {
    height: 175px;
    margin-inline: 2px;
    transform: perspective(1100px) rotateX(2deg) rotateZ(-1deg);
  }
  .hero-demo .hero-pdf-page {
    width: calc(100% - 30px);
    padding-inline: 11px;
  }
  .hero-demo .hero-window-bar {
    padding-inline: 10px;
    gap: 7px;
  }
  .hero-demo .hero-preview-count {
    font-size: 8px;
  }
  .hero-demo .hero-spreadsheet > div {
    grid-template-columns: 23px minmax(0, 1fr) 62px 58px;
  }
  .hero-demo .hero-spreadsheet > div > * {
    padding-inline: 6px;
  }
  .hero-demo .flow-lines {
    height: 44px;
  }
  .hero-demo .gateway {
    margin-inline: 9px;
    height: 88px;
    padding-inline: 13px;
    gap: 10px;
  }
  .hero-demo .gateway-spark {
    display: none;
  }
  .hero-demo .order-card {
    margin-inline: 9px;
    padding-inline: 12px;
  }
  .hero-demo .order-card-head {
    height: 43px;
  }
  .hero-demo .order-row {
    grid-template-columns: minmax(0, 1fr) 49px 43px;
    gap: 5px;
  }
  .hero-demo .hero-review-line {
    height: 59px;
  }
  .hero-demo .flow-caption {
    padding-inline: 8px;
  }
}

/* Mobile: one compact vertical card; all sources feed the single centre lane. */
@media (max-width: 600px) {
  .hero-demo {
    max-width: 470px;
    margin-inline: auto;
    padding: 17px 14px 6px;
    border: 1px solid #2f3928;
    border-radius: 13px;
    background: linear-gradient(160deg, #141b1080, #0b0d0b 58%);
  }
  .hero-demo::before {
    inset: 0;
    border-radius: inherit;
  }
  .hero-demo .flow-topline {
    margin-bottom: 13px;
    font-size: 9px;
  }
  .hero-demo .flow-inputs {
    gap: 7px;
    padding-inline: 0;
  }
  .hero-demo [data-demo-source] {
    height: 78px;
    padding-inline: 5px;
    gap: 7px;
  }
  .hero-demo .hero-source-label {
    font-size: 10px;
  }
  .hero-demo .hero-input-preview {
    height: 178px;
    margin: 25px 0 0;
    transform: none;
  }
  .hero-demo .hero-window-bar {
    padding-inline: 9px;
    gap: 7px;
  }
  .hero-demo .hero-preview-label {
    font-size: 9px;
  }
  .hero-demo .hero-preview-count {
    font-size: 8px;
  }
  .hero-demo .hero-mail-header {
    margin-inline: 13px;
  }
  .hero-demo .hero-mail-subject {
    margin-inline: 13px;
  }
  .hero-demo .hero-email-text {
    margin-inline: 13px;
    font-size: 11px;
    line-height: 1.55;
  }
  .hero-demo .hero-mail-signature {
    margin-inline: 13px;
  }
  .hero-demo .hero-pdf-page {
    width: calc(100% - 24px);
    padding-inline: 11px;
    min-height: 144px;
  }
  .hero-demo .hero-document-table > div {
    grid-template-columns: minmax(0, 1fr) 40px 37px;
    gap: 6px;
  }
  .hero-demo .hero-spreadsheet > div {
    grid-template-columns: 22px minmax(0, 1fr) 55px 49px;
  }
  .hero-demo .hero-spreadsheet > div > * {
    padding-inline: 5px;
    padding-block: 8px;
  }
  .hero-demo .flow-lines {
    height: 40px;
    background: linear-gradient(#71864c, #71864c) center / 1px 100% no-repeat;
  }
  .hero-demo .flow-lines > path:first-child,
  .hero-demo .flow-pulse-email,
  .hero-demo .flow-pulse-excel {
    display: none;
  }
  .hero-demo:is(
      [data-stage="intake"],
      [data-stage="reading"],
      [data-stage="matching"]
    )
    .flow-pulse-pdf {
    opacity: 0.85;
    animation: hero-demo-stream 1.45s linear infinite;
  }
  .hero-demo .gateway {
    margin-inline: 0;
    height: 88px;
    padding: 12px;
    gap: 10px;
  }
  .hero-demo .gateway > .pylaios-mark {
    width: 50px;
    height: 50px;
    margin: -6px;
  }
  .hero-demo .gateway strong {
    font-size: 21px;
  }
  .hero-demo .gateway-spark {
    display: flex;
  }
  .hero-demo .gateway-spark svg {
    width: 19px;
    height: 19px;
  }
  .hero-demo .output-line {
    height: 34px;
  }
  .hero-demo .order-card {
    margin-inline: 0;
    padding: 12px;
  }
  .hero-demo .order-card-head {
    height: 40px;
  }
  .hero-demo .order-card-head > span:first-child {
    font-size: 10px;
    line-height: 1.5;
  }
  .hero-demo .order-card-head .mono {
    font-size: 9px;
  }
  .hero-demo .order-row {
    grid-template-columns: minmax(0, 1fr) 47px 42px;
    gap: 5px;
  }
  .hero-demo .hero-review-line {
    height: 55px;
    font-size: 9px;
    gap: 5px;
  }
  .hero-demo .order-bottom {
    font-size: 10px;
  }
  .hero-demo .flow-caption {
    max-width: 32em;
    margin: 11px auto 0;
    font-size: 10px;
  }
}

/* A legible finished order remains available without animation. */
@media (prefers-reduced-motion: reduce) {
  .hero-demo *,
  .hero-demo *::before,
  .hero-demo *::after {
    animation: none !important;
    transition: none !important;
  }
  .hero-demo .flow-pulse,
  .hero-demo .output-line::after,
  .hero-demo .hero-input-preview::after {
    opacity: 0 !important;
  }
  .hero-demo [data-order-field] {
    opacity: 1 !important;
    transform: none !important;
  }
  .hero-demo .order-bottom svg,
  .hero-demo .order-card-head svg {
    opacity: 1;
  }
}
