/* ==========================================================================
   Weavify Design System — Colors, Type, Tokens
   The connective layer between AI agents and merchants.
   Source: handoff bundle from Claude Design (2026-05-02)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Sans+Condensed:wght@500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  /* Core palette */
  --registry-black: #171411;
  --ledger-white:   #F7F3EA;
  --signal-coral:   #F05A3B;
  --machine-green:  #157A5B;
  --protocol-blue:  #2F5BFF;
  --field-grey:     #D8D1C4;
  --clay-brown:     #7A4E35;
  --warning-amber:  #D8951A;
  --error-red:      #B3261E;

  /* Tints (chips/panels only — never page bg) */
  --green-tint:  #E4EFEA;
  --blue-tint:   #E2E8FF;
  --coral-tint:  #FCE2DC;
  --amber-tint:  #F4E4C2;
  --red-tint:    #F0D7D5;

  /* Surfaces */
  --surface:         var(--ledger-white);
  --surface-raised:  #FFFFFF;
  --surface-inverse: var(--registry-black);

  /* Foreground */
  --fg-primary:   var(--registry-black);
  --fg-secondary: #4A433D;
  --fg-tertiary:  var(--clay-brown);
  --fg-on-dark:   var(--ledger-white);
  --fg-on-coral:  var(--ledger-white);

  /* Borders */
  --border-strong:  var(--registry-black);
  --border-default: #B8B0A1;
  --border-soft:    var(--field-grey);

  /* Type */
  --font-sans:  'IBM Plex Sans','Atkinson Hyperlegible','Source Sans 3',Arial,sans-serif;
  --font-label: 'IBM Plex Sans Condensed','Bahnschrift','Barlow Condensed','Arial Narrow',sans-serif;
  --font-mono:  'IBM Plex Mono','JetBrains Mono','Roboto Mono',ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;

  --fs-display-xl: 72px;
  --fs-display-l:  56px;
  --fs-h1:         44px;
  --fs-h2:         32px;
  --fs-h3:         24px;
  --fs-body-l:     20px;
  --fs-body:       16px;
  --fs-body-s:     14px;
  --fs-label:      12px;
  --fs-mono-s:     13px;
  --fs-mono-xs:    11px;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  --gutter-desktop: 24px;
  --gutter-mobile:  16px;
  --max-width: 1280px;

  /* Radius — 0–8px max. Pill (999px) is for status chips only. */
  --radius-0: 0;
  --radius-1: 2px;
  --radius-2: 4px;
  --radius-3: 6px;
  --radius-4: 8px;
  --radius-pill: 999px;

  /* Borders */
  --rule-hair:    1px solid var(--border-soft);
  --rule-default: 1px solid var(--border-default);
  --rule-strong:  1.5px solid var(--registry-black);

  /* Shadows — almost never. Functional only. */
  --shadow-1: 0 1px 0 rgba(23, 20, 17, 0.06);
  --shadow-2: 0 1px 2px rgba(23, 20, 17, 0.08);

  /* Motion */
  --dur-fast: 120ms;
  --dur-base: 180ms;
  --dur-slow: 240ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

/* ==========================================================================
   BASE
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--surface);
  color: var(--fg-primary);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */

.wv-display-xl,
.wv-display-l,
.wv-h1, .wv-h2, .wv-h3 {
  font-family: var(--font-sans);
  color: var(--fg-primary);
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0;
}

.wv-display-xl { font-size: var(--fs-display-xl); line-height: 0.95; font-weight: 700; letter-spacing: -0.02em; }
.wv-display-l  { font-size: var(--fs-display-l);  line-height: 1.0;  font-weight: 700; letter-spacing: -0.02em; }
.wv-h1         { font-size: var(--fs-h1);         line-height: 1.05; font-weight: 700; }
.wv-h2         { font-size: var(--fs-h2);         line-height: 1.15; font-weight: 700; }
.wv-h3         { font-size: var(--fs-h3);         line-height: 1.2;  font-weight: 600; }

.wv-body-l { font-size: var(--fs-body-l); line-height: 1.45; font-weight: 400; }
.wv-body   { font-size: var(--fs-body);   line-height: 1.55; font-weight: 400; }
.wv-body-s { font-size: var(--fs-body-s); line-height: 1.45; font-weight: 400; }

.wv-label {
  font-family: var(--font-label);
  font-size: var(--fs-label);
  line-height: 1.1;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-secondary);
}

.wv-mono    { font-family: var(--font-mono); font-size: var(--fs-mono-s); line-height: 1.45; }
.wv-mono-xs { font-family: var(--font-mono); font-size: var(--fs-mono-xs); line-height: 1.35; letter-spacing: 0.02em; }

@media (max-width: 720px) {
  .wv-display-xl { font-size: 44px; line-height: 1.0; }
  .wv-h1 { font-size: 36px; }
  .wv-h2 { font-size: 28px; }
  .wv-h3 { font-size: 22px; }
  .wv-body-l { font-size: 18px; }
  .wv-label { font-size: 11px; }
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.wv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  padding: 12px 18px;
  border-radius: var(--radius-3);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
}

.wv-btn--primary {
  background: var(--registry-black);
  color: var(--fg-on-dark);
  border-color: var(--registry-black);
}
.wv-btn--primary:hover { background: #2A2520; border-color: #2A2520; }

.wv-btn--coral {
  background: var(--signal-coral);
  color: var(--fg-on-coral);
  border-color: var(--signal-coral);
}
.wv-btn--coral:hover { background: #D94A2D; border-color: #D94A2D; }

.wv-btn--secondary {
  background: var(--ledger-white);
  color: var(--fg-primary);
  border-color: var(--registry-black);
}
.wv-btn--secondary:hover { background: var(--registry-black); color: var(--fg-on-dark); }

.wv-btn--small { padding: 8px 12px; font-size: 13.5px; }

.wv-btn:focus-visible {
  outline: 2px solid var(--signal-coral);
  outline-offset: 2px;
}

/* ==========================================================================
   STATUS CHIPS
   ========================================================================== */

.wv-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: var(--radius-1);
  border: 1px solid currentColor;
  white-space: nowrap;
}
.wv-chip__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.wv-chip--live    { color: var(--machine-green); background: var(--green-tint); }
.wv-chip--proto   { color: var(--protocol-blue); background: var(--blue-tint); }
.wv-chip--pending { color: var(--warning-amber); background: var(--amber-tint); }
.wv-chip--off     { color: var(--error-red); background: var(--red-tint); }
.wv-chip--neutral { color: var(--fg-primary); background: transparent; border-color: var(--border-default); }

/* ==========================================================================
   FIELDS / RULES
   ========================================================================== */

.wv-field-label {
  font-family: var(--font-label);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-tertiary);
  display: block;
  margin-bottom: 4px;
}

.wv-rule        { border: 0; border-top: 1px solid var(--border-soft); margin: 0; }
.wv-rule--strong { border-top: 1.5px solid var(--registry-black); }

*:focus-visible {
  outline: 2px solid var(--signal-coral);
  outline-offset: 2px;
}

/* ==========================================================================
   CONTAINER
   ========================================================================== */
.wv-container { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--gutter-desktop); }
@media (max-width: 720px) { .wv-container { padding: 0 var(--gutter-mobile); } }
