/* ==========================================================================
   Vendor Scout — foundation
   Design tokens, primitives, and the marketing site.
   Command-center styles live in app.css.
   ========================================================================== */

:root {
  /* Brand */
  --navy: #001f45;
  --lime: #b9f45f;

  /* Ink + text */
  --ink: #0a1520;
  --muted: #5b6a7c;
  --faint: #8a97a7;

  /* Surfaces */
  --paper: #fbfcfe;
  --surface: #fff;
  --surface-2: #f6f8fb;
  --surface-3: #eff3f8;

  /* Lines */
  --line: #e4eaf1;
  --line-strong: #d2dce8;

  /* Status */
  --blue: #2878ff;
  --blue-soft: #eef4ff;
  --green: #1f9d5c;
  --green-soft: #e9f7ef;
  --red: #d8453a;
  --red-soft: #fdf1f0;
  --amber: #b97d09;
  --amber-soft: #fdf6e6;

  /* Type */
  --sans: "Avenir Next", Avenir, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  --fs-display: clamp(38px, 4.4vw, 60px);
  --fs-hero: clamp(30px, 3.2vw, 44px);
  --fs-h1: 26px;
  --fs-h2: 19px;
  --fs-h3: 15px;
  --fs-body: 14px;
  --fs-sm: 13px;
  --fs-xs: 12px;
  --fs-label: 11px;

  /* Radius + elevation */
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --shadow-sm: 0 1px 2px rgba(16, 40, 66, .05);
  --shadow: 0 6px 20px rgba(20, 45, 72, .07);
  --shadow-lg: 0 24px 60px rgba(20, 45, 72, .12);

  /* Layout */
  --rail-w: 224px;
  --content-max: 1360px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.015em; line-height: 1.25; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p { margin: 0; }
a { color: inherit; }
button, a, input { font: inherit; }
button { cursor: pointer; }
strong, b { font-weight: 600; }

/* --------------------------------------------------------------------------
   Primitives
   -------------------------------------------------------------------------- */

/* Numeric / data values use tabular mono so columns align */
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

.muted { color: var(--muted); }
.faint { color: var(--faint); }

/* A single small caps label. Used sparingly — never stacked above a heading
   that repeats it. */
.label {
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--faint);
}

/* Buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: none;
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  color: var(--ink);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn-sm { height: 30px; padding: 0 11px; font-size: var(--fs-xs); }
.btn-lg { height: 44px; padding: 0 20px; font-size: var(--fs-body); }
.btn-block { width: 100%; }

.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover { background: #17293a; }

.btn-accent { background: var(--lime); color: var(--navy); border-color: #a8e646; }
.btn-accent:hover { background: #adee4d; }

.btn-ghost { background: var(--surface); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: #b9c8d8; background: var(--surface-2); }

.btn-quiet { color: var(--muted); }
.btn-quiet:hover { color: var(--ink); background: var(--surface-2); }

.btn-danger { background: var(--surface); border-color: #eec4c0; color: #b23a30; }
.btn-danger:hover { background: var(--red-soft); border-color: #e3a9a3; }

.btn:disabled { opacity: .45; cursor: not-allowed; }

/* Chips / pills ---------------------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: var(--fs-label);
  font-weight: 600;
  white-space: nowrap;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-live { color: var(--green); border-color: #bfe6cf; background: var(--green-soft); }
.chip-warn { color: var(--amber); border-color: #ecd9a6; background: var(--amber-soft); }
.chip-crit { color: var(--red); border-color: #f0c3bd; background: var(--red-soft); }
.chip-info { color: #1f5fd0; border-color: #c8dcff; background: var(--blue-soft); }
.chip-plain { color: var(--muted); }

/* Tags for requirements, regions, etc. */
.tag {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: var(--fs-xs);
  color: #35485c;
}

/* Panels ---------------------------------------------------------------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.panel-pad { padding: 20px; }

/* A panel header: one heading, optional trailing control. No eyebrow. */
.panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}
.panel-top h2, .panel-top h3 { font-size: var(--fs-h3); }

/* Section heading between panels: one line, nothing stacked. */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 28px 0 12px;
}
.section-head h2 { font-size: var(--fs-h2); }
.section-head > span { color: var(--muted); font-size: var(--fs-xs); }

/* Definition grid — replaces rows of tiny metric cards */
.facts { display: grid; gap: 1px; background: var(--line); border-radius: var(--r); overflow: hidden; }
.facts > div { background: var(--surface); padding: 12px 14px; min-width: 0; }
.facts dt { margin: 0 0 5px; color: var(--muted); font-size: var(--fs-label); font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.facts dd { margin: 0; font-size: var(--fs-sm); font-weight: 600; overflow-wrap: anywhere; }
.facts dd small { display: block; margin-top: 3px; color: var(--faint); font-size: var(--fs-label); font-weight: 400; }
.facts-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.facts-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.facts-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

/* Tables ---------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
}
table.data td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-sm);
  vertical-align: middle;
}
table.data tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
table.data th.num { font-family: var(--sans); }
table.data .cell-name { font-weight: 600; }
table.data .cell-sub { display: block; margin-top: 3px; color: var(--faint); font-size: var(--fs-label); font-weight: 400; }
/* Proper nouns as column headers read badly in caps. */
table.data th.entity {
  color: var(--ink);
  font-size: var(--fs-sm);
  letter-spacing: 0;
  text-transform: none;
}
table.data th.entity .cell-sub { text-transform: none; letter-spacing: 0; }
table.data tr.row-muted td:first-child { box-shadow: inset 2px 0 var(--line-strong); }

/* Empty / error --------------------------------------------------------- */
.empty {
  padding: 28px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--muted);
  font-size: var(--fs-sm);
  text-align: center;
}
.error-state {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #f0c3bd;
  border-radius: var(--r);
  background: var(--red-soft);
  color: #b23a30;
  font-size: var(--fs-sm);
}
.error-state[hidden] { display: none; }

/* Brand ----------------------------------------------------------------- */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { display: block; width: 28px; height: 28px; border-radius: 8px; }
.brand b { font-size: var(--fs-sm); font-weight: 600; letter-spacing: -.01em; }

/* Screen-reader only */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ==========================================================================
   Marketing site
   ========================================================================== */

#landing[hidden] { display: none; }
.landing-main { overflow: hidden; }

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
  padding: 0 clamp(20px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(251, 252, 254, .88);
  backdrop-filter: blur(14px);
}
.site-links { display: flex; align-items: center; gap: 26px; margin-left: 12px; }
.site-links a { color: #35485c; font-size: var(--fs-sm); text-decoration: none; }
.site-links a:hover { color: var(--blue); }
.site-nav .nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.mobile-menu { display: none; }
.mobile-links { display: none; }

/* Hero ------------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 560px);
  gap: 56px;
  align-items: center;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 76px clamp(20px, 4vw, 56px) 72px;
}
.hero h1 {
  margin: 0 0 20px;
  font-size: var(--fs-display);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -.035em;
  /* Wide enough that each of the three sentences gets its own line. */
  max-width: 18ch;
}
.hero-deck { max-width: 46ch; color: #38495c; font-size: 16px; line-height: 1.65; }
.hero-actions { display: flex; gap: 10px; margin: 28px 0 26px; }

/* Live counters read from mission state */
.hero-stats { display: flex; flex-wrap: wrap; gap: 0 26px; }
.hero-stats > div { padding-right: 26px; border-right: 1px solid var(--line); }
.hero-stats > div:last-child { border-right: 0; padding-right: 0; }
.hero-stats b { display: block; font-size: var(--fs-h3); font-weight: 600; }
.hero-stats span { color: var(--muted); font-size: var(--fs-label); }

/* The landing page's visual story: current supplier → agent → approval */
.flow-card { padding: 22px; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-lg); }
.flow-card > .label { display: block; margin-bottom: 16px; }

.flow-step { display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: 14px; }
.flow-step > .flow-mark { display: grid; place-items: center; position: relative; }
.flow-step > .flow-mark i {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--line-strong);
  z-index: 1;
}
/* connector */
.flow-step:not(:last-child) > .flow-mark:after {
  content: ""; position: absolute; top: 11px; bottom: -11px; width: 2px; background: var(--line);
}
.flow-step-body { padding-bottom: 20px; }
.flow-step:last-child .flow-step-body { padding-bottom: 0; }
.flow-step-body b { display: block; font-size: var(--fs-sm); }
.flow-step-body span { display: block; margin-top: 2px; color: var(--muted); font-size: var(--fs-xs); }
.flow-step-body .flow-figure { margin-top: 8px; font-family: var(--mono); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }

.flow-step.is-current > .flow-mark i { background: var(--lime); border-color: var(--navy); }
.flow-step.is-agent > .flow-mark i { background: var(--navy); border-color: var(--navy); }
.flow-step.is-human > .flow-mark i { background: var(--surface); border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.flow-step.is-problem > .flow-mark i { border-color: #e6a49d; background: var(--red-soft); }
.flow-step.is-problem .flow-figure { color: #b23a30; }
.flow-step.is-human .flow-figure { color: #1f5fd0; }

/* Landing sections ------------------------------------------------------- */
.lp-section {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 72px clamp(20px, 4vw, 56px);
}
.lp-section + .lp-section { border-top: 1px solid var(--line); }
.lp-section h2 { max-width: 24ch; font-size: var(--fs-hero); font-weight: 600; line-height: 1.1; letter-spacing: -.03em; }
.lp-lead { max-width: 62ch; margin-top: 14px; color: var(--muted); font-size: 15px; line-height: 1.7; }

.lp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 36px; }
.lp-grid article { padding: 22px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.lp-grid h3 { margin-bottom: 8px; font-size: var(--fs-h3); }
.lp-grid p { color: var(--muted); font-size: var(--fs-sm); line-height: 1.6; }
.lp-grid .lp-num { display: block; margin-bottom: 14px; color: var(--blue); font-family: var(--mono); font-size: var(--fs-xs); }

/* Stage strip used on the landing page to show the agent pipeline */
.lp-stages { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; margin-top: 36px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.lp-stages > div { padding: 18px 16px; border-right: 1px solid var(--line); }
.lp-stages > div:last-child { border-right: 0; }
.lp-stages b { display: block; font-size: var(--fs-sm); }
.lp-stages span { display: block; margin-top: 4px; color: var(--muted); font-size: var(--fs-xs); }
.lp-stages i { display: block; width: 18px; height: 2px; margin-bottom: 12px; border-radius: 2px; background: var(--navy); }
.lp-stages > div:last-child i { background: var(--blue); }

/* Approval band */
.lp-band { background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.lp-band-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: 56px; align-items: center; max-width: var(--content-max); margin: 0 auto; padding: 72px clamp(20px, 4vw, 56px); }

.packet-card { border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.packet-card header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.packet-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.packet-row b { display: block; font-size: var(--fs-sm); }
.packet-row span { display: block; margin-top: 2px; color: var(--muted); font-size: var(--fs-xs); }
.packet-row .packet-value { text-align: right; font-family: var(--mono); font-size: var(--fs-h3); font-variant-numeric: tabular-nums; }
.packet-row .packet-value small { display: block; margin-top: 3px; color: var(--muted); font-family: var(--sans); font-size: var(--fs-label); }
.packet-card footer { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 18px; }

/* Closing */
.lp-close { background: #08171f; color: #fff; }
.lp-close-inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; max-width: var(--content-max); margin: 0 auto; padding: 68px clamp(20px, 4vw, 56px); }
.lp-close h2 { max-width: 20ch; font-size: var(--fs-hero); }
.lp-close p { margin-top: 12px; color: #9fb0ab; font-size: 15px; }

.site-footer {
  display: grid;
  grid-template-columns: 1.6fr repeat(2, .8fr) 1fr;
  gap: 32px;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 48px clamp(20px, 4vw, 56px);
  border-top: 1px solid var(--line);
}
.site-footer p { margin-top: 12px; max-width: 34ch; color: var(--muted); font-size: var(--fs-xs); line-height: 1.6; }
.site-footer > div { display: grid; align-content: start; gap: 9px; }
.site-footer .label { margin-bottom: 3px; }
.site-footer a, .site-footer button { padding: 0; border: 0; background: none; color: var(--muted); font-size: var(--fs-xs); text-align: left; text-decoration: none; }
.site-footer a:hover, .site-footer button:hover { color: var(--ink); }
.site-footer small { color: var(--faint); font-size: var(--fs-label); }

/* Landing responsive ---------------------------------------------------- */
@media (max-width: 1040px) {
  .site-links, .site-nav .nav-right .btn { display: none; }
  .mobile-menu { display: inline-flex; margin-left: auto; }
  .mobile-links { position: absolute; top: 58px; right: clamp(20px, 4vw, 56px); display: none; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-lg); }
  .mobile-links.open { display: grid; }
  .mobile-links a { padding: 8px; color: var(--ink); font-size: var(--fs-sm); text-decoration: none; }
  .hero, .lp-band-inner { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hero { padding-top: 52px; padding-bottom: 56px; }
  .lp-grid { grid-template-columns: 1fr; }
  .lp-stages { grid-auto-flow: row; grid-auto-columns: auto; }
  .lp-stages > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .lp-stages > div:last-child { border-bottom: 0; }
  .site-footer { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .lp-section, .lp-band-inner, .lp-close-inner { padding-top: 52px; padding-bottom: 52px; }
  .hero-actions { display: grid; }
  .hero-stats { gap: 14px 0; }
  .hero-stats > div { flex: 1 0 45%; border-right: 0; padding-right: 0; }
  .lp-close-inner { flex-direction: column; align-items: flex-start; }
  .site-footer { grid-template-columns: 1fr; gap: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
