/* ============================================
   MR VERO — WEB COMPONENT LIBRARY
   Drop-in CSS for buttons, cards, inputs, etc.
   Depends on tokens.css
   ============================================ */

/* ---------- BUTTONS ---------- */
.vero-btn {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: 10px 16px;
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all var(--t-base) var(--e-out);
  white-space: nowrap;
  cursor: pointer;
}
.vero-btn--primary {
  background: var(--gold-500);
  color: var(--ink-000);
  font-weight: 600;
}
.vero-btn--primary:hover {
  background: var(--gold-300);
  box-shadow: 0 0 24px -4px var(--gold-glow);
}
.vero-btn--secondary {
  background: var(--ink-900);
  color: var(--ink-000);
}
.vero-btn--secondary:hover { background: var(--ink-950); }
.vero-btn--ghost {
  color: var(--ink-900);
  border-color: var(--line-strong);
}
.vero-btn--ghost:hover {
  border-color: var(--ink-500);
  background: var(--ink-200);
}
.vero-btn--sm { padding: 6px 10px; font-size: var(--fs-xs); }
.vero-btn--lg { padding: 14px 22px; font-size: var(--fs-md); }
.vero-btn:disabled { opacity: 0.4; pointer-events: none; }
.vero-btn:active { transform: translateY(0.5px); opacity: 0.85; transition-duration: var(--t-fast); }

/* ---------- CARD ---------- */
.vero-card {
  background: var(--ink-150);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s-6);
  transition: border-color var(--t-base) var(--e-out);
}
.vero-card--hover:hover { border-color: var(--line-strong); }
.vero-card--elev { box-shadow: var(--shadow-2); }

/* ---------- INPUT ---------- */
.vero-field {
  display: flex; flex-direction: column; gap: var(--s-2);
}
.vero-label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--fg-faint);
}
.vero-input, .vero-textarea, .vero-select {
  width: 100%;
  background: var(--ink-100);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  transition: border-color var(--t-base) var(--e-out), background var(--t-base) var(--e-out), box-shadow var(--t-fast) var(--e-out);
}
.vero-input:focus, .vero-textarea:focus, .vero-select:focus {
  outline: none;
  border-color: var(--gold-500);
  background: var(--ink-150);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--gold-500) 20%, transparent);
}
.vero-input::placeholder { color: var(--fg-faint); }

/* ---------- BADGE ---------- */
.vero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px;
  border-radius: var(--r-xs);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  border: 1px solid var(--line);
  background: var(--ink-100);
  color: var(--fg-muted);
}
.vero-badge--ok   { color: var(--ok);   border-color: color-mix(in oklch, var(--ok) 30%, transparent); }
.vero-badge--warn { color: var(--warn); border-color: color-mix(in oklch, var(--warn) 30%, transparent); }
.vero-badge--err  { color: var(--err);  border-color: color-mix(in oklch, var(--err) 30%, transparent); }
.vero-badge--info { color: var(--info); border-color: color-mix(in oklch, var(--info) 30%, transparent); }
.vero-badge--accent { color: var(--gold-500); border-color: color-mix(in oklch, var(--gold-500) 40%, transparent); }

.vero-badge__dot {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  box-shadow: 0 0 6px currentColor;
}

/* ---------- TABLE ---------- */
.vero-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-md);
}
.vero-table th {
  text-align: left;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--fg-faint);
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}
.vero-table td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--line-faint);
  color: var(--fg-muted);
}
.vero-table td { transition: background var(--t-fast) var(--e-out), box-shadow var(--t-base) var(--e-out); }
.vero-table tr:hover td { background: color-mix(in oklch, var(--ink-300) 60%, transparent); }
.vero-table tr:hover td:first-child { box-shadow: inset 2px 0 0 var(--gold-500); }

/* ---------- AVATAR ---------- */
.vero-avatar {
  width: 32px; height: 32px;
  border-radius: var(--r-pill);
  background: var(--ink-300);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--fg-muted);
  overflow: hidden;
  border: 1px solid var(--line);
}
.vero-avatar--lg { width: 48px; height: 48px; font-size: var(--fs-md); }
.vero-avatar--sm { width: 22px; height: 22px; font-size: 9px; }

/* ---------- SECTION HEADER ---------- */
.vero-section-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--s-6);
  align-items: baseline;
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--s-8);
}
.vero-section-head h2 {
  font-size: var(--fs-2xl);
  font-weight: 500;
  letter-spacing: -0.02em;
}

/* ---------- KBD ---------- */
.vero-kbd {
  display: inline-block;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--fg-muted);
  background: var(--ink-200);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xs);
}

/* ---------- TOGGLE / SWITCH ---------- */
.vero-switch {
  position: relative;
  width: 32px; height: 18px;
  background: var(--ink-300);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background var(--t-base) var(--e-out);
}
.vero-switch::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 12px; height: 12px;
  background: var(--fg);
  border-radius: 50%;
  transition: transform var(--t-base) var(--e-out), background var(--t-base) var(--e-out);
}
.vero-switch[aria-checked="true"] { background: var(--gold-500); }
.vero-switch[aria-checked="true"]::after { transform: translateX(14px); background: var(--ink-000); }

/* ---------- PROGRESS ---------- */
.vero-progress {
  height: 4px;
  background: var(--ink-200);
  border-radius: var(--r-pill);
  overflow: hidden;
  position: relative;
}
.vero-progress__bar {
  height: 100%;
  background: var(--gold-500);
  box-shadow: 0 0 8px -1px var(--gold-glow);
}

/* ============================================
   MOTION DETAILS
   Subtle, ≤500ms, all opt-out via reduced-motion.
   ============================================ */

@media (prefers-reduced-motion: no-preference) {

  /* (1) Agent dot — ambient breathing glow. Apply with .vero-pulse-gold. */
  @keyframes vero-pulse-gold {
    0%, 100% { box-shadow: 0 0 6px 0 color-mix(in oklch, var(--gold-500) 60%, transparent); }
    50%      { box-shadow: 0 0 12px 1px color-mix(in oklch, var(--gold-500) 90%, transparent); }
  }
  .vero-pulse-gold { animation: vero-pulse-gold 2400ms var(--e-in-out) infinite; }

  /* (2) Progress — moving sheen across the gold fill while indeterminate. */
  @keyframes vero-sheen {
    0%   { transform: translateX(-40%); }
    100% { transform: translateX(140%); }
  }
  .vero-progress__bar.is-active { position: relative; overflow: hidden; }
  .vero-progress__bar.is-active::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.18) 50%, transparent 100%);
    animation: vero-sheen 1500ms var(--e-out) infinite;
  }

  /* (3) Badge dot — first-paint warm-up. Plays once on mount. */
  @keyframes vero-dot-in {
    from { transform: scale(0.6); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
  }
  .vero-badge__dot { animation: vero-dot-in 320ms var(--e-out) both; }

  /* (7) Modal entrance — scrim fades, panel rises. Apply scrim + .vero-modal. */
  @keyframes vero-scrim-in { from { opacity: 0; } to { opacity: 1; } }
  @keyframes vero-modal-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
  .vero-scrim { animation: vero-scrim-in var(--t-base) var(--e-out) both; }
  .vero-modal { animation: vero-modal-in var(--t-base) var(--e-out) both; animation-delay: 60ms; }

  /* (8) Caret — blinking underscore for live agent text. */
  @keyframes vero-caret { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
  .vero-caret::after { content: "_"; margin-left: 2px; color: var(--gold-500); animation: vero-caret 1100ms steps(1, end) infinite; }

  /* (9) Editorial reveal — eyebrows + headlines fade up on scroll-in.
     Pair with IntersectionObserver toggling .is-in. */
  .vero-reveal { opacity: 0; transform: translateY(4px); transition: opacity var(--t-slow) var(--e-out), transform var(--t-slow) var(--e-out); }
  .vero-reveal.is-in { opacity: 1; transform: translateY(0); }
}

/* ============================================
   PROCESSING / BUSY VOCABULARY
   12 components for "the agent is doing something."
   Gold = primary signal. All ≤2.4s loops, all opt-out via reduced-motion.
   ============================================ */

@media (prefers-reduced-motion: no-preference) {

  /* (1) Spinner — 1px gold arc, 16/20/32px. Inline next to mono labels. */
  @keyframes vero-spin { to { transform: rotate(360deg); } }
  .vero-spinner {
    display: inline-block; width: 16px; height: 16px;
    border-radius: 50%;
    border: 1px solid color-mix(in oklch, var(--gold-500) 18%, transparent);
    border-top-color: var(--gold-500);
    border-right-color: var(--gold-500);
    animation: vero-spin 900ms linear infinite;
    vertical-align: -3px;
  }
  .vero-spinner--sm { width: 12px; height: 12px; vertical-align: -1px; }
  .vero-spinner--lg { width: 32px; height: 32px; border-width: 1.5px; }

  /* (2) Indeterminate progress — 30% gold slug travels with glow trail. */
  @keyframes vero-prog-indet {
    0%   { left: -35%; }
    100% { left: 100%; }
  }
  .vero-progress--indeterminate { position: relative; overflow: hidden; }
  .vero-progress--indeterminate .vero-progress__bar { display: none; }
  .vero-progress--indeterminate::after {
    content: ""; position: absolute; top: 0; left: -35%;
    width: 35%; height: 100%; background: var(--gold-500);
    box-shadow: 0 0 8px -1px var(--gold-glow);
    border-radius: var(--r-pill);
    animation: vero-prog-indet 1400ms var(--e-out) infinite;
  }

  /* (3) Pulse dot — already shipped as .vero-pulse-gold. */

  /* (4) Bar wave — five 2px bars, processing/typing indicator. */
  @keyframes vero-bar { 0%, 60%, 100% { opacity: 0.25; transform: scaleY(0.5); } 30% { opacity: 1; transform: scaleY(1); } }
  .vero-bars { display: inline-flex; align-items: center; gap: 2px; height: 12px; transform-origin: center; }
  .vero-bars > i { display: inline-block; width: 2px; height: 100%; background: var(--gold-500); transform-origin: center; animation: vero-bar 900ms var(--e-in-out) infinite; }
  .vero-bars > i:nth-child(1) { animation-delay: 0ms; }
  .vero-bars > i:nth-child(2) { animation-delay: 60ms; }
  .vero-bars > i:nth-child(3) { animation-delay: 120ms; }
  .vero-bars > i:nth-child(4) { animation-delay: 180ms; }
  .vero-bars > i:nth-child(5) { animation-delay: 240ms; }

  /* (5) Skeleton — gold-tinted shimmer over ink-200 block. Set width/height inline. */
  @keyframes vero-skel { from { background-position: -200% 0; } to { background-position: 200% 0; } }
  .vero-skel {
    display: block; min-height: 8px; border-radius: 3px;
    background: linear-gradient(90deg, var(--ink-200) 0%, color-mix(in oklch, var(--gold-500) 8%, var(--ink-300)) 50%, var(--ink-200) 100%);
    background-size: 200% 100%;
    animation: vero-skel 1800ms var(--e-in-out) infinite;
  }

  /* (6) Live timer — mono numerals + blinking caret. JS feeds the text. */
  .vero-timer {
    display: inline-flex; align-items: center; gap: 4px;
    font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--fg-muted);
    font-feature-settings: "ss01", "tnum";
  }
  .vero-timer::after { content: "_"; color: var(--gold-500); animation: vero-caret 1100ms steps(1, end) infinite; }

  /* (7) Step progress — multi-stage dots. Mark with .is-done / .is-current. */
  .vero-steps { display: inline-flex; align-items: center; gap: 6px; }
  .vero-steps > i {
    display: inline-block; width: 6px; height: 6px; border-radius: 50%;
    background: var(--ink-400);
    transition: background var(--t-base) var(--e-out), box-shadow var(--t-base) var(--e-out);
  }
  .vero-steps > i.is-done { background: var(--gold-500); }
  .vero-steps > i.is-current { background: var(--gold-500); animation: vero-pulse-gold 1800ms var(--e-in-out) infinite; }

  /* (8) Busy badge — variant of vero-badge. Use with class="vero-badge vero-badge--busy". */
  .vero-badge--busy {
    color: var(--gold-500);
    border-color: color-mix(in oklch, var(--gold-500) 40%, transparent);
    background: color-mix(in oklch, var(--gold-500) 6%, var(--ink-150));
  }
  .vero-badge--busy .vero-badge__dot { animation: vero-pulse-gold 1800ms var(--e-in-out) infinite, vero-dot-in 320ms var(--e-out) both; }

  /* (9) Stream cursor — already shipped as .vero-caret. */

  /* (10) Top-loader — 2px gold bar across viewport top. */
  @keyframes vero-toploader {
    0%   { width: 0; }
    50%  { width: 60%; }
    100% { width: 90%; }
  }
  .vero-toploader {
    position: fixed; top: 0; left: 0; height: 2px;
    background: var(--gold-500); box-shadow: 0 0 8px var(--gold-glow);
    animation: vero-toploader 800ms var(--e-out) forwards;
    z-index: 100;
  }

  /* (11) Thinking — leading chat slot before tokens stream. Pulse dot + 3 mono dots. */
  @keyframes vero-think { 0%, 60%, 100% { opacity: 0.25; } 30% { opacity: 1; } }
  .vero-thinking {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--fg-muted);
    letter-spacing: var(--tracking-wide); text-transform: uppercase;
  }
  .vero-thinking::before {
    content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gold-500);
    box-shadow: 0 0 6px var(--gold-500);
    animation: vero-pulse-gold 1800ms var(--e-in-out) infinite;
  }
  .vero-thinking-dots { display: inline-flex; gap: 2px; }
  .vero-thinking-dots > i { width: 3px; height: 3px; border-radius: 50%; background: var(--gold-500); animation: vero-think 1200ms var(--e-in-out) infinite; }
  .vero-thinking-dots > i:nth-child(2) { animation-delay: 200ms; }
  .vero-thinking-dots > i:nth-child(3) { animation-delay: 400ms; }

  /* (12) Tool-call strip — `▸ tool.name(args)` with animated underline + status. */
  @keyframes vero-tool-fill { from { width: 0; } to { width: 100%; } }
  .vero-tool {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--fg-muted);
    padding: 4px 0; position: relative;
  }
  .vero-tool__glyph { color: var(--gold-500); }
  .vero-tool__name  { color: var(--ink-900); }
  .vero-tool__args  { color: var(--fg-faint); }
  .vero-tool__line {
    position: absolute; left: 0; bottom: 0; height: 1px;
    background: var(--gold-500); box-shadow: 0 0 6px var(--gold-glow);
    width: 0;
  }
  .vero-tool.is-running .vero-tool__line { animation: vero-tool-fill 1600ms var(--e-out) infinite; }
  .vero-tool.is-done    .vero-tool__line { width: 100%; animation: none; box-shadow: none; }
  .vero-tool.is-done    .vero-tool__glyph { color: var(--ok); }
  .vero-tool.is-error   .vero-tool__line { width: 100%; background: var(--err); animation: none; box-shadow: none; }
  .vero-tool.is-error   .vero-tool__glyph { color: var(--err); }
}

/* ============================================================
   Page sections (shared across multiple pages)
   ============================================================ */

.page-hero {
    padding: clamp(36px, 5vw, 72px) 0 clamp(48px, 6vw, 80px);
    border-bottom: 1px solid var(--line);
    position: relative;
  }

  .closing-cta {
    padding: clamp(56px, 7vw, 80px) 0;
    border-top: 1px solid var(--line);
  }
  .closing-cta__grid {
    display: grid; gap: 32px; grid-template-columns: 1fr;
  }
  @media (min-width: 880px) {
    .closing-cta__grid {
      grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
      gap: 56px;
      align-items: end;
    }
  }
  .closing-cta h2 { font-size: clamp(36px, 5vw, 64px); letter-spacing: -0.035em; line-height: 1.05; font-weight: 500; color: var(--ink-950); margin: 0; max-width: 14ch; }
  .closing-cta p { font-size: clamp(15px, 1.4vw, 17px); line-height: 1.65; color: var(--ink-800); max-width: 50ch; margin: 0 0 28px 0; }

  /* FAQ card grid */
  .faq-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
    margin-top: 32px;
  }
  @media (min-width: 720px) {
    .faq-grid { grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 40px; }
    .faq-grid > .faq-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  }
  @media (min-width: 1024px) {
    .faq-grid { gap: 24px; }
  }

  .faq-card {
    background: var(--ink-100);
    border: 1px solid var(--line);
    border-left: 2px solid var(--gold-500);
    border-radius: 5px;
    padding: 24px;
    transition: border-color var(--t-base) var(--e-out), background var(--t-base) var(--e-out);
  }
  @media (min-width: 720px) { .faq-card { padding: 28px; } }
  @media (min-width: 960px) { .faq-card { padding: 32px; } }

  .faq-card:hover {
    background: color-mix(in oklch, var(--gold-500) 3%, var(--ink-100));
    border-color: color-mix(in oklch, var(--gold-500) 28%, var(--line));
  }

  .faq-card__tag {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold-500);
    font-weight: 500;
    margin-bottom: 12px;
  }
  @media (min-width: 720px) { .faq-card__tag { font-size: 11px; margin-bottom: 14px; } }

  .faq-card__q {
    font-family: var(--font-sans);
    font-size: 18px;
    line-height: 1.25;
    letter-spacing: -0.012em;
    font-weight: 500;
    color: var(--ink-950);
    margin: 0 0 12px;
    text-wrap: balance;
  }
  @media (min-width: 720px) { .faq-card__q { font-size: 19px; margin-bottom: 14px; } }
  @media (min-width: 1024px) { .faq-card__q { font-size: 21px; letter-spacing: -0.015em; } }

  .faq-card__a {
    font-size: 14px;
    line-height: 1.6;
    color: var(--ink-800);
    margin: 0;
    text-wrap: pretty;
  }
  @media (min-width: 720px) { .faq-card__a { font-size: 15px; } }
  @media (min-width: 1024px) { .faq-card__a { font-size: 16px; line-height: 1.7; } }
  .faq-card__a strong { color: var(--ink-950); font-weight: 500; }
  .faq-card__a a { color: var(--ink-950); text-decoration: underline; text-underline-offset: 2px; }
  .faq-card__a a:hover { color: var(--gold-500); }

  /* Legal pages: privacy, terms, data-security */
  .legal-meta {
    font-family: var(--font-mono); font-size: 11px;
    letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--gold-500); margin-bottom: 18px; display: block;
  }
  .legal-layout {
    display: grid; gap: clamp(32px, 4vw, 56px);
    grid-template-columns: 1fr; align-items: start;
  }
  @media (min-width: 960px) {
    .legal-layout { grid-template-columns: minmax(220px, 260px) minmax(0, 1fr); }
  }
  .legal-sidebar { min-width: 0; }
  @media (min-width: 960px) {
    .legal-sidebar { position: sticky; top: 108px; max-height: calc(100vh - 124px); overflow-y: auto; }
  }
  .legal-prose { max-width: 70ch; min-width: 0; }
  .legal-prose .lede { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.55; color: var(--ink-900); margin: 0 0 28px 0; max-width: 56ch; }
  .legal-prose h2 {
    font-size: clamp(22px, 2.2vw, 28px); letter-spacing: -0.015em; line-height: 1.2;
    font-weight: 500; color: var(--ink-950);
    margin: 56px 0 16px 0;
    scroll-margin-top: 108px;
  }
  .legal-prose h2:first-of-type { margin-top: 0; }
  .legal-prose h3 {
    font-size: clamp(15px, 1.4vw, 17px); font-weight: 600;
    color: var(--ink-950); margin: 24px 0 8px 0;
  }
  .legal-prose p, .legal-prose li {
    font-size: clamp(15px, 1.4vw, 17px); line-height: 1.65;
    color: var(--ink-800); margin: 0 0 14px 0;
  }
  .legal-prose ul { padding-left: 22px; margin: 0 0 18px 0; }
  .legal-prose li { margin-bottom: 6px; }
  .legal-prose strong { color: var(--ink-950); font-weight: 600; }
  .legal-prose hr { border: none; border-top: 1px solid var(--line); margin: 40px 0; }
  .legal-prose a { color: var(--ink-950); text-decoration: underline; text-underline-offset: 2px; }
  .legal-prose a:hover { color: var(--gold-500); }
  .legal-toc {
    background: var(--ink-150);
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: clamp(20px, 3vw, 28px);
    margin: 0;
  }
  .legal-toc h2 { font-size: 13px; font-family: var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-700); margin: 0 0 14px 0; font-weight: 500; }
  .legal-toc ol { padding-left: 22px; margin: 0; columns: 1; }
  @media (min-width: 600px) and (max-width: 959px) {
    .legal-toc ol { columns: 2; column-gap: 32px; }
  }
  .legal-toc li { font-size: 14px; line-height: 1.5; margin-bottom: 6px; color: var(--ink-800); }
  .legal-toc a { color: var(--ink-900); text-decoration: none; }
.legal-toc a:hover { color: var(--gold-500); text-decoration: underline; }
