/* AI Accounts Payable — Automation Studio */

:root {
  --bg: #070a12;
  --panel: #0e1422;
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .16);
  --ink: #eef1f7;
  --ink-2: #b9c1d3;
  --muted: #7f8aa1;
  --brand: #7c8cff;
  --cyan: #22d3ee;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #fb7185;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, Menlo, Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
.mono { font-family: var(--mono); }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.hl { color: var(--cyan); }

h1, h2, h3 { letter-spacing: -.025em; }

section { scroll-margin-top: 84px; }

/* ---------- background glow ---------- */
.glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(560px 420px at 18% 8%, rgba(99, 102, 241, .26), transparent 65%),
    radial-gradient(640px 480px at 84% 24%, rgba(34, 211, 238, .14), transparent 65%),
    radial-gradient(520px 520px at 55% 92%, rgba(168, 85, 247, .12), transparent 65%);
  filter: blur(50px);
  animation: drift 26s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to   { transform: translate3d(2%, 2%, 0) scale(1.06); }
}

/* ---------- nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 22px;
  background: rgba(7, 10, 18, .72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mark {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: conic-gradient(from 210deg, #6366f1, #a855f7, #22d3ee, #6366f1);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .18), 0 0 18px rgba(124, 140, 255, .55);
}

.brand-name {
  font-weight: 700;
  letter-spacing: -.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

/* pills */
.pill {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.pill-ghost {
  color: var(--ink-2);
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, .02);
}

.pill-ghost:hover {
  color: var(--ink);
  border-color: rgba(255, 255, 255, .3);
  transform: translateY(-1px);
}

.pill-cta {
  background: linear-gradient(135deg, #8b9bff, #22d3ee);
  color: #0b0f19;
  border: 1px solid transparent;
  box-shadow: 0 4px 22px rgba(124, 140, 255, .3);
}

.pill-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(34, 211, 238, .4);
}

/* ---------- hero ---------- */
main { max-width: 1140px; margin: 0 auto; padding: 0 20px; }

.hero {
  padding: 158px 0 54px;
  text-align: center;
}

.eyebrow {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(34px, 6vw, 62px);
  font-weight: 800;
  line-height: 1.06;
  background: linear-gradient(180deg, #ffffff, #b9c1d3);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #ffffff;
}

.sub {
  max-width: 640px;
  margin: 20px auto 0;
  color: var(--ink-2);
  font-size: clamp(15px, 2vw, 18px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
}

.trust-line {
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- console ---------- */
.demo { padding: 10px 0 30px; }

.console {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .5), 0 0 0 1px rgba(124, 140, 255, .05);
}

.chrome {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .02);
}

.dots { display: flex; gap: 6px; }
.dots i {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
}
.dots i:nth-child(1) { background: #fb7185; }
.dots i:nth-child(2) { background: #fbbf24; }
.dots i:nth-child(3) { background: #34d399; }

.chrome-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px rgba(52, 211, 153, .8);
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}

.sim-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
}

.console-grid {
  display: grid;
  grid-template-columns: minmax(220px, .95fr) minmax(250px, 1.05fr) minmax(240px, 1fr);
  gap: 0;
}

.col {
  padding: 16px;
  min-width: 0;
  border-right: 1px solid var(--line);
}

.col-right { border-right: none; display: flex; flex-direction: column; gap: 14px; }

.col-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.col-h-sub {
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-2);
  font-weight: 600;
}

/* incoming queue */
.q-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 320px;
}

.q-card {
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 0;
}

.q-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.q-vendor {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.q-amt { font-size: 13px; font-weight: 700; color: var(--ink); flex: 0 0 auto; font-family: var(--mono); }

.q-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* active invoice card */
.active-card {
  background: rgba(124, 140, 255, .07);
  border: 1px solid rgba(124, 140, 255, .28);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 14px;
  transition: border-color .3s ease, background .3s ease;
}

.ac-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.ac-vendor {
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.ac-amt { font-size: 13px; font-weight: 700; flex: 0 0 auto; }

.ac-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* stages stepper */
.stages {
  list-style: none;
  position: relative;
}

.stages::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: var(--line-2);
}

.stage { position: relative; padding: 0 0 4px 28px; }

.s-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-radius: 8px;
}

.s-dot {
  position: absolute;
  left: 0;
  top: 8px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--panel);
  border: 1.5px solid var(--line-2);
  transition: background .25s ease, border-color .25s ease, box-shadow .25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1;
  color: #06251a;
}

.s-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  transition: color .25s ease;
}

.stage.active .s-dot {
  border-color: var(--brand);
  background: rgba(124, 140, 255, .25);
  box-shadow: 0 0 12px rgba(124, 140, 255, .6);
  animation: stage-flash .5s ease;
}

.stage.active .s-name { color: var(--ink); }

.stage.done .s-dot {
  background: var(--ok);
  border-color: var(--ok);
  box-shadow: none;
}

.stage.done .s-dot::after { content: "✓"; font-weight: 800; }
.stage.done .s-name { color: var(--ink-2); }

.stage.fail .s-dot {
  background: var(--bad);
  border-color: var(--bad);
  color: #2b0710;
}

.stage.fail .s-dot::after { content: "!"; font-weight: 800; }
.stage.fail .s-name { color: var(--bad); }

@keyframes stage-flash {
  0% { box-shadow: 0 0 0 0 rgba(124, 140, 255, .7); }
  100% { box-shadow: 0 0 12px rgba(124, 140, 255, .6); }
}

.s-detail {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .35s ease;
}

.stage.open .s-detail { grid-template-rows: 1fr; }

.s-detail-inner {
  overflow: hidden;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-2);
}

.d-line {
  padding: 1.5px 0 1.5px 2px;
  animation: line-in .3s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.d-kv { display: flex; gap: 10px; }
.d-k { color: var(--muted); flex: 0 0 74px; }
.d-v { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@keyframes line-in {
  from { opacity: 0; transform: translateY(3px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* right column panels */
.panel-sub {
  background: rgba(255, 255, 255, .015);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  min-width: 0;
}

.panel-ex { min-height: 200px; position: relative; }

.ex-list { display: flex; flex-direction: column; gap: 8px; }

.ex-empty {
  font-size: 12.5px;
  color: var(--muted);
  padding: 8px 2px;
}

.ex-card {
  background: rgba(251, 191, 36, .05);
  border: 1px solid rgba(251, 191, 36, .28);
  border-radius: 12px;
  padding: 10px 12px;
  transition: border-color .3s ease, background .3s ease, opacity .3s ease;
}

.ex-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.ex-reason {
  font-size: 12px;
  color: var(--warn);
  margin-top: 5px;
}

.ex-actions { display: flex; gap: 8px; margin-top: 9px; }

.ex-actions button {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, opacity .15s ease;
}

.ex-actions button:disabled { cursor: default; opacity: .55; }

.btn-approve {
  background: rgba(52, 211, 153, .14);
  border: 1px solid rgba(52, 211, 153, .5);
  color: var(--ok);
}

.btn-approve:hover:not(:disabled) { background: rgba(52, 211, 153, .26); transform: translateY(-1px); }

.btn-reject {
  background: rgba(251, 113, 133, .1);
  border: 1px solid rgba(251, 113, 133, .4);
  color: var(--bad);
}

.btn-reject:hover:not(:disabled) { background: rgba(251, 113, 133, .2); transform: translateY(-1px); }

.ex-card.flash-ok { border-color: var(--ok); background: rgba(52, 211, 153, .1); }
.ex-card.flash-bad { border-color: var(--bad); background: rgba(251, 113, 133, .1); }

/* ledger */
.led-list { display: flex; flex-direction: column; }

.led-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  min-width: 0;
}

.led-row:last-child { border-bottom: none; }

.led-check { flex: 0 0 auto; font-weight: 800; font-size: 12px; }

.led-main {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink-2);
}

.led-amt { flex: 0 0 auto; font-size: 12px; color: var(--ink); }

/* audit strip */
.audit {
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, .28);
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.75;
  min-height: 130px;
  overflow: hidden;
}

.a-line {
  display: flex;
  gap: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: line-in .3s ease;
}

.a-time { color: var(--muted); flex: 0 0 auto; }
.a-text { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }

/* generic card entrance / exit */
.card-in { animation: card-in .4s ease; }

@keyframes card-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-out {
  opacity: 0 !important;
  transform: translateY(-5px);
  transition: opacity .32s ease, transform .32s ease;
}

/* ---------- how it works ---------- */
.how { padding: 70px 0 20px; text-align: center; }

.how h2, .cta h2 {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
}

.section-sub {
  color: var(--muted);
  margin-top: 10px;
  font-size: 15px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 34px;
  text-align: left;
}

.step-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  transition: border-color .25s ease, transform .25s ease;
}

.step-card:hover { border-color: var(--line-2); transform: translateY(-2px); }

.step-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: .1em;
}

.step-card h3 { font-size: 16.5px; margin: 8px 0 6px; }

.step-card p { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }

/* ---------- metrics ---------- */
.metrics-wrap { padding: 60px 0 10px; text-align: center; }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 30px 20px;
}

.metric { display: flex; flex-direction: column; gap: 4px; }

.metric-num {
  font-size: clamp(30px, 4.6vw, 46px);
  font-weight: 800;
  letter-spacing: -.03em;
  background: linear-gradient(135deg, #8b9bff, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

.metric-label { font-size: 13px; color: var(--muted); }

.metrics-note { margin-top: 12px; font-size: 12.5px; color: var(--muted); }

/* ---------- trust ---------- */
.trust { padding: 56px 0 10px; }

.trust-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.trust-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  transition: border-color .25s ease, transform .25s ease;
}

.trust-card:hover { border-color: var(--line-2); transform: translateY(-2px); }

.trust-card h3 { font-size: 17px; margin-bottom: 8px; }

.trust-card p { font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }

/* ---------- cta ---------- */
.cta { padding: 90px 0 70px; text-align: center; }

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
}

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 26px 20px 34px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.footer a { color: var(--ink-2); border-bottom: 1px solid var(--line-2); transition: color .2s ease; }
.footer a:hover { color: var(--ink); }

/* ---------- scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s ease var(--d, 0s), transform .6s ease var(--d, 0s);
}

.reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .console-grid { grid-template-columns: 1fr; }
  .col { border-right: none; border-bottom: 1px solid var(--line); }
  .col-right { border-bottom: none; }
  .q-list { min-height: 0; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .metrics { grid-template-columns: repeat(2, 1fr); gap: 26px 14px; }
  .trust-cards { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .nav .pill-ghost { display: none; }
  .hero { padding-top: 128px; }
  .steps { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .nav { padding: 10px 14px; }
  .brand-name { font-size: 14.5px; }
  .pill { padding: 8px 14px; font-size: 13px; }
  main { padding: 0 14px; }
  .col { padding: 13px; }
  .metrics { grid-template-columns: 1fr; }
  .audit { min-height: 0; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .glow { animation: none; }
  .reveal { opacity: 1; transform: none; }
}
