/* nexscrow design system — restyled after the "agentic" reference:
   warm paper #F5F4F0, near-black ink, IBM Plex Sans light display type,
   rounded-2xl bento cards on hairline black/7% borders, pill tags,
   fade-up reveals. */

:root {
  /* palette */
  --paper: #f5f4f0;
  --paper-2: #eceae3;
  --surface: #ffffff;
  --surface-2: #fafaf8;
  --ink: #111111;
  --ink-2: #3f3f3c;
  --ink-3: #6f6f6a;
  --line: rgb(17 17 17 / 7%);
  --line-2: rgb(17 17 17 / 15%);
  --accent: oklch(52% 0.115 155);
  --accent-deep: oklch(40% 0.1 155);
  --warn: oklch(52% 0.1 70);
  --danger: oklch(50% 0.18 27);

  /* type */
  --font-display: "IBM Plex Sans", "Geist", "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", "Geist", "Segoe UI", sans-serif;
  --font-mono: "Courier Prime", ui-monospace, "SF Mono", Menlo, monospace;

  /* spacing (8pt grid) */
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 48px; --s6: 72px;

  /* radius + shadows */
  --r-s: 8px; --r: 16px;
  --shadow-1: 0 1px 2px rgb(28 27 27 / 6%);
  --shadow-2: 0 2px 10px rgb(28 27 27 / 8%);
  --shadow-3: 0 16px 40px rgb(28 27 27 / 12%);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

::selection { background: oklch(52% 0.115 155 / 22%); }

a { color: var(--accent-deep); }

h1, h2, h3 { text-wrap: pretty; }

/* ---------------------------------------------------------------- nav */

.nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--s2) var(--s5);
  background: oklch(from var(--paper) l c h / 85%);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; backdrop-filter: blur(12px);
  z-index: 50;
}
.brand {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 500; letter-spacing: -0.02em;
  color: var(--ink); text-decoration: none;
}
.brand span { color: var(--ink-3); font-weight: 300; font-style: italic; }
.nav-right { display: flex; gap: var(--s2); align-items: center; font-size: 14.5px; }
.nav-right a { color: var(--ink); text-decoration: none; font-weight: 600; }
.nav-right a:hover { color: var(--accent-deep); }

.badge {
  padding: 3px 12px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid;
}
.badge-live { color: var(--danger); border-color: oklch(50% 0.18 27 / 40%); background: oklch(50% 0.18 27 / 6%); }

.who { color: var(--ink-2); font-size: 14px; }
.who a { font-weight: 600; }

/* --------------------------------------------------------------- hero */

.hero {
  max-width: 1160px; margin: 0 auto; padding: var(--s6) var(--s4) var(--s5);
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(280px, 4fr);
  gap: var(--s6); align-items: center;
}
.kicker {
  margin: 0 0 var(--s3);
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 14px; border-radius: 999px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-3); background: rgb(17 17 17 / 4%);
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(3rem, 1.4rem + 5vw, 5.5rem);
  line-height: 1.0; font-weight: 300; letter-spacing: -0.03em;
  margin: 0 0 var(--s3);
}
.hero h1 em { font-style: italic; color: var(--accent-deep); }
.lede {
  font-size: clamp(1.05rem, 1rem + 0.3vw, 1.25rem);
  color: var(--ink-2); max-width: 34em; margin: 0 0 var(--s4);
  text-wrap: pretty;
}
.hero-ctas { display: flex; gap: var(--s2); flex-wrap: wrap; }

.tagline {
  color: var(--accent-deep); font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; font-size: 13px;
  margin: 0 0 var(--s2);
}
.sub { color: var(--ink-2); line-height: 1.65; max-width: 640px; margin: 0 0 var(--s2); }

/* numbered rail (the real product flow) */
.hero-rail {
  display: flex; flex-direction: column; gap: var(--s2);
}
.rail-step {
  display: flex; gap: var(--s3); align-items: baseline;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--s3);
  transition: background-color .3s, border-color .3s;
}
.rail-step:hover { background: var(--surface-2); border-color: var(--line-2); }
.rail-step b {
  font-family: var(--font-mono); font-weight: 400;
  color: var(--ink-3); font-size: 13px; min-width: 26px; letter-spacing: 0.05em;
}
.rail-step span { color: var(--ink-2); font-size: 15px; }

/* ------------------------------------------------------------- layout */

.wrap { max-width: 1160px; margin: 0 auto var(--s5); padding: 0 var(--s4); }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); }
.step {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: var(--s3); display: flex; flex-direction: column; gap: var(--s1);
  font-size: 14.5px;
}
.step b { font-family: var(--font-display); font-weight: 600; }
.step span { color: var(--ink-2); }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--s4);
  margin-bottom: var(--s3);
  transition: border-color .3s, background-color .3s;
}
.panel:hover { border-color: rgb(17 17 17 / 12%); }
.panel.alt { background: var(--paper-2); box-shadow: none; }
.panel h2 {
  margin: 0 0 var(--s2);
  font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: -0.01em;
}
.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--s2); margin-bottom: var(--s2); flex-wrap: wrap;
}
.panel-head h2 { margin: 0; }
.hint { color: var(--ink-3); font-size: 13.5px; line-height: 1.55; margin: 0; }

/* ---------------------------------------------------------------- form */

.form { display: flex; flex-direction: column; gap: var(--s2); }
.form label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  letter-spacing: 0.02em;
}
input, textarea, select {
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: var(--r-s);
  color: var(--ink);
  padding: 11px 14px;
  font-size: 16px; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px oklch(52% 0.115 155 / 18%);
}
textarea { min-height: 96px; resize: vertical; }
.row { display: flex; gap: var(--s2); align-items: flex-end; flex-wrap: wrap; }
.row label { min-width: 150px; flex: 1; }

/* buttons — full state coverage */

.btn {
  border: 1px solid transparent; border-radius: 999px;
  padding: 12px 26px; min-height: 44px;
  font-family: inherit; font-size: 15px; font-weight: 500;
  cursor: pointer; text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center; gap: 10px;
  transition: background-color .15s, border-color .15s, color .15s, transform .06s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn.primary { background: var(--ink); color: #fff; letter-spacing: 0.01em; }
.btn.primary:hover:not(:disabled) { background: #000; transform: translateY(-1px); }

.btn.ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn.ghost:hover:not(:disabled) { border-color: var(--ink); background: var(--surface); }

.btn.danger { background: transparent; border-color: oklch(50% 0.18 27 / 45%); color: var(--danger); }
.btn.danger:hover:not(:disabled) { background: oklch(50% 0.18 27 / 8%); border-color: var(--danger); }

.btn.small { padding: 7px 14px; min-height: 36px; font-size: 13.5px; }
.btn.google { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn.google:hover { border-color: var(--ink); }
.btn.google svg { flex: none; }

.login-actions { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }

.result {
  margin-top: var(--s2);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  padding: var(--s2) var(--s3);
  font-size: 14.5px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-word;
}
.result.error { border-color: oklch(50% 0.18 27 / 50%); background: oklch(50% 0.18 27 / 5%); }
.hidden { display: none !important; }

/* chips */

.chips { align-items: center; padding-bottom: var(--s1); }
.chip {
  background: var(--paper); border: 1px solid var(--line-2); color: var(--ink-2);
  border-radius: 999px; padding: 7px 16px; min-height: 36px;
  font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent-deep); }

/* --------------------------------------------------------- dashboard */

.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s2); margin-bottom: var(--s3); }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: var(--s2) var(--s3);
}
.stat .num {
  font-family: var(--font-display); font-size: 28px; font-weight: 600;
  color: var(--ink); letter-spacing: -0.01em;
}
.stat .lbl { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; letter-spacing: 0.03em; }

.cols { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: var(--s3); align-items: start; }
.col-side .panel { margin-bottom: var(--s3); }

.cards { display: flex; flex-direction: column; gap: var(--s2); }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--s3);
  transition: box-shadow .2s, border-color .2s, background-color .3s;
}
.card:hover { background: var(--surface-2); border-color: var(--line-2); }
.cards.muted .card { opacity: .8; }
.card .title { font-weight: 700; margin-bottom: 6px; font-size: 15.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.job-link { color: inherit; text-decoration: none; }
.job-link:hover { color: var(--accent-deep); }
.card .meta { color: var(--ink-3); font-size: 13px; line-height: 1.65; word-break: break-all; }
.card .actions { display: flex; gap: 10px; margin-top: var(--s2); flex-wrap: wrap; }

.pill {
  padding: 2px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  border: 1px solid;
}
.pill.open { color: var(--ink-2); border-color: var(--line-2); background: var(--paper-2); }
.pill.accepted { color: var(--warn); border-color: oklch(55% 0.11 70 / 45%); background: oklch(55% 0.11 70 / 8%); }
.pill.completed { color: var(--accent-deep); border-color: oklch(52% 0.115 155 / 45%); background: oklch(52% 0.115 155 / 8%); }
.pill.expired, .pill.cancelled { color: var(--ink-3); border-color: var(--line); background: var(--paper-2); }
.pill.locked { color: var(--warn); border-color: oklch(55% 0.11 70 / 45%); background: oklch(55% 0.11 70 / 8%); }
.pill.released { color: var(--accent-deep); border-color: oklch(52% 0.115 155 / 45%); background: oklch(52% 0.115 155 / 8%); }
.pill.refunded, .pill.pending { color: var(--ink-3); border-color: var(--line); background: var(--paper-2); }

details summary {
  cursor: pointer; color: var(--accent-deep); font-size: 13.5px; font-weight: 600;
  margin-top: var(--s1); user-select: none;
}
details summary:hover { text-decoration: underline; }
details pre {
  white-space: pre-wrap; font-size: 12.5px; line-height: 1.6;
  color: var(--ink); background: var(--paper-2);
  padding: var(--s2) var(--s3); border-radius: var(--r-s);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
}

.ledger-list { display: flex; flex-direction: column; gap: 6px; max-height: 460px; overflow-y: auto; }
.event {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-s);
  padding: 8px 12px; font-size: 12.5px;
}
.event .etype { color: var(--accent-deep); font-weight: 700; letter-spacing: 0.02em; }
.event .ets { color: var(--ink-3); font-size: 11px; }
.event .edetail { color: var(--ink-2); margin-top: 2px; line-height: 1.5; }

.kv { display: grid; grid-template-columns: 1fr; gap: 10px; font-size: 13.5px; }
.kv div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.kv div:last-child { border-bottom: none; padding-bottom: 0; }
.kv .k { color: var(--ink-3); font-weight: 600; }
.kv .v { text-align: right; word-break: break-all; color: var(--ink); }

.bid-tag {
  display: inline-block; background: var(--paper-2); border: 1px solid var(--line-2);
  border-radius: var(--r-s); padding: 4px 12px; font-size: 12.5px;
  color: var(--ink-2); font-weight: 600;
}

/* ----------------------------------------------------------- timeline */

.tl { display: flex; flex-direction: column; margin-top: var(--s1); }
.tl-item { display: flex; position: relative; padding: 0 0 var(--s3) 30px; }
.tl-item::before {
  content: ""; position: absolute; left: 6px; top: 16px; bottom: -4px;
  width: 1px; background: var(--line-2);
}
.tl-item:last-child::before { display: none; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: 0; top: 5px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px oklch(52% 0.115 155 / 15%);
}
.tl-body b { display: block; font-size: 14.5px; letter-spacing: 0.01em; }
.tl-body span { display: block; color: var(--ink-2); font-size: 13.5px; line-height: 1.55; word-break: break-word; }
.tl-ts { color: var(--ink-3); font-size: 11.5px !important; letter-spacing: 0.04em; }

.stepper { display: flex; gap: 6px; flex-wrap: wrap; margin-top: var(--s2); }
.step-pill {
  padding: 5px 13px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink-3);
  font-size: 12px; font-weight: 600; letter-spacing: 0.03em;
}
.step-pill.on { color: var(--accent-deep); border-color: oklch(52% 0.115 155 / 55%); background: oklch(52% 0.115 155 / 7%); }

/* deliverable (rendered markdown report) */

.md h1 { font-family: var(--font-display); font-size: 26px; margin: 6px 0 12px; font-weight: 600; letter-spacing: -0.01em; }
.md h2 { font-family: var(--font-display); font-size: 19px; margin: var(--s3) 0 var(--s1); color: var(--ink); font-weight: 600; }
.md h3, .md h4 { font-size: 16px; margin: var(--s2) 0 6px; }
.md p { line-height: 1.7; margin: var(--s1) 0; color: var(--ink-2); }
.md ul { padding-left: 22px; margin: var(--s1) 0; }
.md li { line-height: 1.65; margin: 6px 0; color: var(--ink-2); }
.md b { color: var(--ink); }
.md code { background: var(--paper-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 4px; font-size: 13px; font-family: var(--font-mono); color: var(--ink); }

.mono { font-family: var(--font-mono); font-size: 11.5px; word-break: break-all; }
.footer {
  color: var(--ink-3); font-size: 13.5px; padding: var(--s4);
  border-top: 1px solid var(--line); margin-top: var(--s4);
}
.footer a { color: var(--ink-2); }
.footer a:hover { color: var(--accent-deep); }
.empty { color: var(--ink-3); font-size: 13.5px; font-style: italic; }

/* ------------------------------------------------- agent marketplace */

.page-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.1rem + 3vw, 3.2rem);
  line-height: 1.12; font-weight: 700; letter-spacing: -0.02em;
  margin: 0 0 var(--s2);
}
.page-title em { font-style: normal; color: var(--accent-deep); }
.nav-on { color: var(--accent-deep); }

.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--s3);
}
.agent-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--s3);
  min-height: 320px;
  display: flex; flex-direction: column; gap: var(--s2);
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.agent-card:hover {
  box-shadow: var(--shadow-3);
  border-color: var(--line-2);
  transform: translateY(-2px);
}
.agent-head { display: flex; align-items: center; gap: var(--s2); }
.agent-head h3 {
  margin: 0; font-family: var(--font-display);
  font-size: 20px; font-weight: 700; letter-spacing: -0.01em;
}
.agent-head > div { flex: 1; min-width: 0; }
.agent-avatar {
  width: 48px; height: 48px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 14px; font-family: var(--font-display);
  font-size: 22px; font-weight: 700;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--accent-deep);
}
.agent-tagline { margin: 2px 0 0; color: var(--ink-3); font-size: 13px; font-weight: 600; }
.agent-rank {
  font-family: var(--font-display); font-size: 15px; font-weight: 700;
  color: var(--accent-deep);
  background: oklch(52% 0.115 155 / 8%);
  border: 1px solid oklch(52% 0.115 155 / 45%);
  border-radius: 999px; padding: 4px 12px; flex: none;
}
.agent-desc { color: var(--ink-2); font-size: 14px; line-height: 1.6; margin: 0; }
.agent-caps {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.agent-caps li {
  font-size: 12px; font-weight: 600; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 11px;
}
.agent-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s1);
  margin-top: auto; padding-top: var(--s2);
  border-top: 1px solid var(--line);
}
.agent-stats div { display: flex; flex-direction: column; }
.agent-stats b { font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.agent-stats span { font-size: 11.5px; color: var(--ink-3); letter-spacing: .02em; }
.agent-actions { display: flex; gap: var(--s1); flex-wrap: wrap; }

@media (max-width: 620px) {
  .agent-grid { grid-template-columns: 1fr; }
}

/* marketplace v2 */

.discover-bar { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s3); align-items: center; }
.discover-bar input[type="search"] { max-width: 420px; flex: 1; min-width: 240px; }
.cat-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip.cat.on { border-color: var(--accent); color: var(--accent-deep); background: oklch(52% 0.115 155 / 7%); }

.verified {
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--accent-deep); background: oklch(52% 0.115 155 / 9%);
  border: 1px solid oklch(52% 0.115 155 / 45%);
  border-radius: 999px; padding: 2px 9px; vertical-align: 3px; margin-left: 6px;
}
.unverified {
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--ink-3); background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 9px; vertical-align: 3px; margin-left: 6px;
}

.match-row {
  display: flex; align-items: baseline; gap: var(--s1); flex-wrap: wrap;
  background: oklch(52% 0.115 155 / 6%);
  border: 1px solid oklch(52% 0.115 155 / 35%);
  border-radius: var(--r-s); padding: 8px 12px;
}
.match-score { font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--accent-deep); flex: none; }
.why-rec { font-size: 12.5px; color: var(--ink-2); }

.agent-policy { border-top: 1px dashed var(--line); padding-top: 10px; }

.release-options { border: 1px solid var(--line); border-radius: var(--r-s); padding: var(--s2) var(--s3); margin: 0; }
.release-options legend { font-size: 13px; font-weight: 700; color: var(--ink-2); padding: 0 8px; }
.radio-row { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; color: var(--ink-2); margin-top: 8px; }
.radio-row input { width: auto; margin-top: 3px; }

.escrow-summary {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-s); padding: var(--s2) var(--s3);
  display: flex; flex-direction: column; gap: 6px;
}
.escrow-summary div { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); }
.escrow-summary b { color: var(--ink); font-family: var(--font-display); }

.lb-row {
  display: grid; grid-template-columns: 36px 1.2fr 1fr auto auto auto; gap: var(--s2);
  align-items: center; padding: 10px var(--s2);
  border-bottom: 1px solid var(--line); font-size: 14px;
}
.lb-row:last-child { border-bottom: none; }
.lb-pos { font-family: var(--font-display); font-weight: 700; color: var(--ink-3); }
.lb-name { font-weight: 700; }
.lb-spec { color: var(--ink-2); }
.lb-stat { color: var(--ink-3); font-size: 13px; text-align: right; }

.why-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); margin-top: 0; }
.why {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: var(--s2) var(--s3); display: flex; flex-direction: column; gap: 4px;
}
.why b { font-size: 14.5px; }
.why span { color: var(--ink-3); font-size: 13px; }

.pill.delivered { color: var(--warn); border-color: oklch(55% 0.11 70 / 45%); background: oklch(55% 0.11 70 / 8%); }

@media (max-width: 760px) {
  .why-grid { grid-template-columns: repeat(2, 1fr); }
  .lb-row { grid-template-columns: 28px 1fr auto; }
  .lb-spec, .lb-stat:nth-child(n+3) { display: none; }
}

/* ---------------------------------------------------------- motion */

@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: word-reveal 1.1s cubic-bezier(0.16, 1, 0.3, 1) backwards; }
  .hero-copy > *:nth-child(2) { animation-delay: .08s; }
  .hero-copy > *:nth-child(3) { animation-delay: .16s; }
  .hero-copy > *:nth-child(4) { animation-delay: .24s; }
  .hero-rail { animation: fade-up .8s .15s ease backwards; }
  .rail-step { animation: fade-up .7s ease backwards; }
  .rail-step:nth-child(2) { animation-delay: .12s; }
  .rail-step:nth-child(3) { animation-delay: .22s; }
  .rail-step:nth-child(4) { animation-delay: .32s; }
  .panel { animation: fade-up .6s ease backwards; }
  @keyframes word-reveal {
    0% { opacity: 0; filter: blur(16px); transform: translateY(20px); }
    100% { opacity: 1; filter: blur(0); transform: translateY(0); }
  }
  @keyframes fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
}

/* ------------------------------------------------------ responsive */

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding-top: var(--s5); gap: var(--s4); }
  .steps, .stats { grid-template-columns: repeat(2, 1fr); }
  .cols { grid-template-columns: 1fr; }
  .nav { padding: var(--s2) var(--s3); }
}
@media (max-width: 620px) {
  .steps, .stats { grid-template-columns: 1fr; }
  .wrap { padding: 0 var(--s3); }
  .hero { padding: var(--s4) var(--s3) var(--s4); }
}

/* ================================================= landing page v2
   Full-page hero video, bento grids, marquee — ported from the
   "agentic" reference template. */

.tag-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 14px; border-radius: 999px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-3); background: rgb(17 17 17 / 4%);
}

/* hero — full-viewport video + progressive blur */

.hero-full {
  position: relative; height: 92vh; min-height: 560px;
  overflow: hidden; margin-top: -64px; padding-top: 64px;
}
.hero-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0;
  transform: scale(0.85);
}
@media (prefers-reduced-motion: no-preference) {
  .hero-video { animation: hero-zoom 2s cubic-bezier(0.16, 1, 0.3, 1) .3s forwards; }
  @keyframes hero-zoom { to { transform: scale(1.05); } }
}
.hero-gradient {
  position: absolute; inset-inline: 0; bottom: 0; height: 65%; z-index: 1;
  background: linear-gradient(to top, var(--paper) 0%, var(--paper) 18%, rgb(245 244 240 / 85%) 35%, rgb(245 244 240 / 50%) 55%, rgb(245 244 240 / 15%) 75%, transparent);
}
.hero-blur {
  position: absolute; inset-inline: 0; bottom: 0; z-index: 1; pointer-events: none;
  mask-image: linear-gradient(to top, black 0%, transparent 100%);
  -webkit-mask-image: linear-gradient(to top, black 0%, transparent 100%);
}
.hero-blur-1 { height: 20%; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.hero-blur-2 { height: 38%; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.hero-blur-3 { height: 55%; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }

.hero-content {
  position: absolute; inset-inline: 0; bottom: 0; z-index: 3;
  padding: 0 var(--s5) var(--s5);
  max-width: 900px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 1.2rem + 5.2vw, 5.5rem);
  font-weight: 300; line-height: 1.0; letter-spacing: -0.03em;
  color: var(--ink); margin: var(--s3) 0 var(--s4);
}
.hero-title em { font-style: italic; color: var(--accent-deep); }
.hero-metrics {
  display: flex; gap: var(--s5); flex-wrap: wrap;
  margin-bottom: var(--s4);
}
.hm-num {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 1.4rem + 1.4vw, 2.4rem);
  font-weight: 300; letter-spacing: -0.02em; color: var(--ink);
}
.hm-lbl {
  font-size: 11px; color: var(--ink-3);
  letter-spacing: 0.14em; text-transform: uppercase; margin-top: 4px;
}
@media (prefers-reduced-motion: no-preference) {
  .hero-content > * { animation: word-reveal 1.1s cubic-bezier(0.16, 1, 0.3, 1) backwards; }
  .hero-content > *:nth-child(2) { animation-delay: .1s; }
  .hero-content > *:nth-child(3) { animation-delay: .25s; }
  .hero-content > *:nth-child(4) { animation-delay: .4s; }
}

/* sections */

.lp-section { padding: 110px var(--s5); max-width: 1240px; margin: 0 auto; }
.lp-border { border-top: 1px solid rgb(17 17 17 / 6%); }
.lp-head { margin-bottom: var(--s5); }
.lp-head-split {
  display: flex; flex-direction: column; gap: var(--s3);
}
@media (min-width: 800px) {
  .lp-head-split { flex-direction: row; align-items: flex-end; justify-content: space-between; }
}
.lp-title {
  margin: var(--s2) 0 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 1rem + 3.4vw, 3.6rem);
  font-weight: 300; letter-spacing: -0.025em; line-height: 1.05;
}
.lp-aside { font-size: 14px; color: var(--ink-3); line-height: 1.7; max-width: 300px; margin: 0; }
.lp-cta-row { margin-top: var(--s4); }

/* bento grid */

.bento-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; }
.bento-4 { grid-template-columns: repeat(4, 1fr); }
.bento-4 > .bento { grid-column: span 1; }
.bento {
  position: relative; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--s4);
  min-height: 190px;
  transition: border-color .3s, background-color .3s;
}
.bento:hover { background: var(--surface-2); border-color: var(--line-2); }
.bento h3 { margin: 0 0 8px; font-weight: 400; font-size: 19px; letter-spacing: -0.01em; }
.bento p { margin: 0; font-size: 13.5px; color: var(--ink-3); line-height: 1.65; }
.bento-sub { margin-top: 2px !important; font-size: 12px !important; }
.span-12 { grid-column: span 12; }
.span-4 { grid-column: span 4; }

.bento-arc {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 70%;
}
.bento-blur {
  position: absolute; inset: 0;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  mask-image: linear-gradient(to bottom, transparent 45%, black 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 45%, black 100%);
}
.bento-fade {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 35%, rgb(245 244 240 / 30%) 50%, rgb(245 244 240 / 75%) 65%, rgb(245 244 240 / 95%) 80%, var(--paper) 100%);
}
.bento-body { position: relative; z-index: 1; }

.bento-icon {
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid rgb(17 17 17 / 10%);
  background: rgb(255 255 255 / 60%); backdrop-filter: blur(8px);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: var(--s3); color: var(--ink-2);
}

.step-num {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-3); letter-spacing: 0.15em; display: block;
}
.bento-step-body { margin-top: auto; padding-top: var(--s6); }

.agent-letter {
  width: 44px; height: 44px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 20px; font-weight: 500;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--accent-deep); margin-bottom: var(--s3);
}
.cap-list {
  list-style: none; margin: var(--s2) 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.cap-list li {
  font-size: 12.5px; color: var(--ink-2);
  padding-left: 14px; position: relative;
}
.cap-list li::before {
  content: ""; position: absolute; left: 0; top: 7px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--ink-3); opacity: .5;
}
.cap-note { margin-top: var(--s3) !important; font-size: 11.5px !important; color: var(--ink-3) !important; letter-spacing: .03em; }

/* marquee */

.marquee-wrap { overflow: hidden; padding: 0; user-select: none; }
.marquee { display: flex; border-bottom: 1px solid rgb(17 17 17 / 6%); }
.marquee-row {
  display: flex; flex-shrink: 0;
  animation: marquee-left 28s linear infinite;
}
.marquee-right .marquee-row { animation-name: marquee-right; animation-duration: 22s; }
.marquee-row span {
  display: flex; align-items: center; gap: 24px;
  padding: 18px 36px; border-right: 1px solid rgb(17 17 17 / 6%);
  font-size: 13.5px; color: var(--ink-3); white-space: nowrap; letter-spacing: .04em;
}
.marquee-row span::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: rgb(17 17 17 / 20%); flex-shrink: 0;
}
.marquee-row.dim span { color: rgb(17 17 17 / 30%); }
@keyframes marquee-left { to { transform: translateX(-100%); } }
@keyframes marquee-right { from { transform: translateX(-100%); } to { transform: translateX(0); } }

/* security list + audit card */

.bento-2col {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4);
}
.sec-list { display: flex; flex-direction: column; gap: var(--s3); }
.sec-item {
  display: flex; gap: var(--s2);
}
.sec-item h3 { margin: 0 0 4px; font-weight: 400; font-size: 15px; }
.sec-item p { margin: 0; font-size: 12.5px; color: var(--ink-3); }
.sec-item::before {
  content: ""; width: 4px; flex-shrink: 0; border-radius: 999px;
  background: rgb(17 17 17 / 10%);
}
.audit-head {
  font-size: 11px; color: rgb(17 17 17 / 30%);
  letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: var(--s2);
}
.audit-rows { display: flex; flex-direction: column; gap: 8px; }
.audit-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  background: rgb(17 17 17 / 2%); border: 1px solid rgb(17 17 17 / 4%);
  transition: background-color .2s;
}
.audit-row:hover { background: rgb(17 17 17 / 4%); }
.a-ts {
  font-family: var(--font-mono); font-size: 10px; color: rgb(17 17 17 / 25%);
  min-width: 56px;
}
.a-act { font-size: 12px; color: var(--ink-2); flex: 1; }
.audit-row i {
  width: 6px; height: 6px; border-radius: 50%;
  background: oklch(60% 0.15 145 / 60%);
}

/* reveal on scroll */

@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
  .reveal.in { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
  .bento-grid { grid-template-columns: 1fr; }
  .span-4, .span-12 { grid-column: span 1; }
  .bento-4 { grid-template-columns: repeat(2, 1fr); }
  .bento-2col { grid-template-columns: 1fr; }
  .lp-section { padding: var(--s5) var(--s3); }
  .hero-content { padding: 0 var(--s3) var(--s4); }
}
@media (max-width: 620px) {
  .bento-4 { grid-template-columns: 1fr; }
  .hero-metrics { gap: var(--s3); }
}

/* ── Portal gate (sign-in before entering) ────────────────── */
body.gated { overflow: hidden; }
.gate {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgb(245 244 240 / 55%);
  backdrop-filter: blur(22px) saturate(1.15);
  -webkit-backdrop-filter: blur(22px) saturate(1.15);
}
.gate-card {
  background: rgb(255 255 255 / 80%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgb(255 255 255 / 70%);
  border-radius: 24px;
  box-shadow: 0 24px 80px rgb(17 17 17 / 14%);
  padding: 44px 40px 32px;
  max-width: 420px; width: 100%;
  text-align: center;
}
.gate-brand { justify-content: center; font-size: 26px; }
.gate-tag {
  margin: 14px 0 26px !important;
  font-size: 14.5px; color: var(--ink-3); line-height: 1.6;
}
.gate-actions { display: flex; flex-direction: column; gap: 10px; }
.gate-actions .btn { width: 100%; justify-content: center; }
.gate-note {
  margin: 22px 0 0 !important;
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-4);
}
.gate .result { margin-top: 14px; text-align: left; }

/* ── Cards with masked image tops (glass fade into card) ──── */
.bento-media { display: flex; flex-direction: column; min-height: 320px; }
.bento-img-top {
  position: absolute; top: 0; left: 0; right: 0;
  height: 52%; pointer-events: none;
}
.bento-img-top img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 28%;
  opacity: 0.9;
  mask-image: linear-gradient(to bottom, black 0%, black 18%, transparent 92%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 18%, transparent 92%);
}
.bento-media .bento-step-body {
  position: relative; z-index: 1;
  margin-top: auto;
  padding-top: 150px;
}
.bento-media .step-num {
  position: relative; z-index: 1;
}

/* Network badge: shown on every app page while only NEAR Testnet is enabled. */
.testnet-badge{display:inline-flex;align-items:center;margin-left:10px;padding:3px 8px;border-radius:999px;background:#fff4d6;border:1px solid #e8c56a;color:#7a5200;font-size:10px;font-weight:700;letter-spacing:.12em;line-height:1.4;white-space:nowrap}
