/* =========================================================================
   Agentform — agent-native blueprint design system
   Dark ink canvas · blueprint grid · signal-amber accent
   Display: Bricolage Grotesque · UI: IBM Plex Sans · Data: IBM Plex Mono
   ========================================================================= */

:root {
  /* palette */
  --ink: #0a0d13;
  --ink-2: #0e131c;
  --surface: #121822;
  --surface-2: #18202d;
  --line: #243042;
  --line-2: #2f3e54;
  --text: #e8edf4;
  --text-dim: #9aa7ba;
  --text-faint: #61708a;

  --amber: #ffb000;
  --amber-soft: #ffc94d;
  --amber-ink: #2a1d00;
  --teal: #4fd6c1;      /* "agent / automated" signal, used sparingly */
  --red: #ff6b5e;       /* blockers / human-review */
  --green: #5fd38a;

  /* type */
  --display: "Bricolage Grotesque", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  /* metrics */
  --maxw: 1200px;
  --radius: 4px;
  --gap: clamp(1rem, 2.5vw, 2rem);
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.8);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background-color: var(--ink);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    radial-gradient(1200px 600px at 80% -10%, rgba(255, 176, 0, 0.08), transparent 60%);
  background-size: 56px 56px, 56px 56px, 100% 100%;
  background-position: -1px -1px, -1px -1px, 0 0;
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* faint grain/scanline atmosphere */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 120%, transparent 60%, rgba(0,0,0,0.5));
  z-index: 1;
  mix-blend-mode: multiply;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------- layout ---------- */
.wrap { width: min(100% - 2.4rem, var(--maxw)); margin-inline: auto; position: relative; z-index: 2; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: var(--amber);
  display: inline-block;
}

h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.05; letter-spacing: 0; margin: 0; }
h1 { font-size: clamp(2.4rem, 6.4vw, 5.2rem); }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.5rem); }

p { margin: 0 0 1rem; color: var(--text-dim); }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: var(--text); max-width: 60ch; }

/* ---------- top nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(10px);
  background: linear-gradient(180deg, rgba(10,13,19,0.92), rgba(10,13,19,0.62));
  border-bottom: 1px solid var(--line);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 0.7rem; font-family: var(--display); font-weight: 800; font-size: 1.25rem;  }
.brand__mark {
  width: 28px; height: 28px; border: 2px solid var(--amber); border-radius: 6px;
  display: grid; place-items: center; color: var(--amber); font-family: var(--mono); font-size: 0.85rem; font-weight: 700;
  box-shadow: inset 0 0 12px rgba(255,176,0,0.25);
}
.nav__links { display: flex; align-items: center; gap: 1.6rem; font-family: var(--mono); font-size: 0.82rem; }
.nav__links a { color: var(--text-dim); transition: color 0.2s var(--ease); }
.nav__links a:hover { color: var(--amber); }
.nav__toggle { display: none; background: none; border: 1px solid var(--line-2); color: var(--text); border-radius: var(--radius); padding: 0.4rem 0.6rem; font-family: var(--mono); cursor: pointer; }

@media (max-width: 760px) {
  .nav__links {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--ink-2); border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden; transition: max-height 0.3s var(--ease);
  }
  .nav__links.open { max-height: 360px; }
  .nav__links a { padding: 1rem 1.2rem; border-top: 1px solid var(--line); }
  .nav__links .btn { margin: 0.8rem 1.2rem; text-align: center; }
  .nav__toggle { display: inline-block; }
}

/* ---------- buttons ---------- */
.btn {
  --bg: var(--amber);
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--mono); font-size: 0.82rem; font-weight: 600; letter-spacing: 0.04em;
  padding: 0.85rem 1.4rem; border-radius: var(--radius); cursor: pointer;
  border: 1px solid var(--bg); background: var(--bg); color: var(--amber-ink);
  transition: transform 0.15s var(--ease), box-shadow 0.25s var(--ease), background 0.2s;
  text-transform: uppercase; white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -10px rgba(255,176,0,0.5); }
.btn:active { transform: translateY(0); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn--ghost:hover { border-color: var(--amber); color: var(--amber); box-shadow: none; }
.btn--lg { padding: 1.05rem 1.8rem; font-size: 0.9rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
@media (max-width: 480px) {
  .btn--lg { width: 100%; justify-content: center; }
}

/* ---------- cards / panels ---------- */
.panel {
  background: linear-gradient(180deg, var(--surface), var(--ink-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  position: relative;
}
.panel--pad { padding: clamp(1.2rem, 2.5vw, 2rem); }
.panel__tag {
  position: absolute; top: -1px; left: 1.4rem; transform: translateY(-50%);
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-faint); background: var(--ink); padding: 0 0.5rem;
}

.panel.featured {
  border-color: var(--amber);
  box-shadow: 0 0 0 1px var(--amber), 0 24px 60px -30px rgba(255,176,0,0.5);
}

/* corner ticks for blueprint feel */
.ticked::before, .ticked::after {
  content: ""; position: absolute; width: 10px; height: 10px; border: 1px solid var(--amber); opacity: 0.6;
}
.ticked::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.ticked::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.25rem 0.6rem; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-dim);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--ok { color: var(--green); border-color: rgba(95,211,138,0.4); }
.badge--warn { color: var(--amber-soft); border-color: rgba(255,201,77,0.4); }
.badge--block { color: var(--red); border-color: rgba(255,107,94,0.4); }
.badge--agent { color: var(--teal); border-color: rgba(79,214,193,0.4); }

/* ---------- forms ---------- */
label.field { display: block; margin-bottom: 1.1rem; }
.field__label { display: block; font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 0.5rem; }
input[type=text], input[type=email], input[type=number], select, textarea {
  width: 100%; font-family: var(--sans); font-size: 1rem; color: var(--text);
  background: var(--ink); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 0.8rem 0.9rem; transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(255,176,0,0.15);
}
textarea { resize: vertical; min-height: 90px; font-family: var(--mono); font-size: 0.9rem; }
.checkrow { display: flex; align-items: flex-start; gap: 0.7rem; font-size: 0.95rem; color: var(--text); }
.checkrow input { width: auto; margin-top: 0.2rem; accent-color: var(--amber); }

.choices { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.choice {
  border: 1px solid var(--line-2); border-radius: var(--radius); padding: 0.9rem;
  cursor: pointer; transition: border-color 0.2s, background 0.2s; font-family: var(--mono); font-size: 0.85rem;
}
.choice:hover { border-color: var(--amber); }
.choice input { display: none; }
.choice.selected { border-color: var(--amber); background: rgba(255,176,0,0.08); color: var(--amber-soft); }

/* ---------- data table ---------- */
.dtable { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 0.85rem; }
.dtable th, .dtable td { text-align: left; padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--line); }
.dtable th { color: var(--text-faint); font-weight: 600; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; }
.dtable tr:hover td { background: rgba(255,255,255,0.02); }
.score { color: var(--amber); font-weight: 700; }

/* ---------- utilities ---------- */
.muted { color: var(--text-faint); }
.mono { font-family: var(--mono); }
.center { text-align: center; }
.grid { display: grid; gap: var(--gap); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .cols-3, .cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; } }
.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.stack > * + * { margin-top: 1rem; }
.hidden { display: none !important; }

/* ---------- reveal-on-load / scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); }
.reveal.in { opacity: 1; transform: none; transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.in { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- wizard ---------- */
.wizard-steps li {
  flex: 1; text-align: center; padding: 0.55rem 0.3rem; border: 1px solid var(--line);
  color: var(--text-faint); border-radius: var(--radius); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wizard-steps li.active { color: var(--amber); border-color: var(--amber); background: rgba(255,176,0,0.07); }
.wizard-steps li.done { color: var(--green); border-color: rgba(95,211,138,0.4); }
@media (max-width: 560px) { .wizard-steps { flex-wrap: wrap; } .wizard-steps li { flex: 1 1 45%; } }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); margin-top: 4rem; padding-block: 2.4rem; }
.footer__grid { display: flex; flex-wrap: wrap; gap: 1.4rem 2.4rem; justify-content: space-between; align-items: center; }
.footer a { color: var(--text-dim); font-family: var(--mono); font-size: 0.8rem; }
.footer a:hover { color: var(--amber); }

/* ---------- toast / inline status ---------- */
.note { border-left: 3px solid var(--amber); background: rgba(255,176,0,0.06); padding: 0.9rem 1.1rem; border-radius: var(--radius); font-size: 0.92rem; color: var(--text); }
.note--block { border-color: var(--red); background: rgba(255,107,94,0.07); }
.note--agent { border-color: var(--teal); background: rgba(79,214,193,0.06); }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.25); border-top-color: var(--amber); border-radius: 50%; display: inline-block; animation: spin 0.7s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
