/* ============================================================
   Arbitr Help Center — Design System v2
   Tokens derived from arbitr Identity Specification v0.2
   ============================================================ */

/* Fonts — IBM Plex Sans (UI/body), IBM Plex Mono (data), Plus Jakarta Sans (display) */
/* NOTE: CDN used for dev/test only — production must self-host from assets/fonts/ */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&family=IBM+Plex+Sans:wght@400;600&family=Plus+Jakarta+Sans:wght@600;800&display=swap');

:root {
  /* ── Brand colour ──────────────────────────────────────── */
  --color-indigo:        #3D16FA;   /* Arbitr Indigo — primary & action */
  --color-indigo-hover:  #2e0fd4;   /* darken ~10% */
  --color-indigo-tint:   #EEF0FF;   /* ~10% indigo on white */

  /* ── Tertiary accents (fills only, never status) ────────── */
  --color-cyan:          #00D4FF;
  --color-violet:        #A38DFF;   /* Soft violet — conflict-resolved */
  --color-gold:          #D4A017;

  /* ── Neutrals (cool-neutral — trace of indigo hue) ──────── */
  --color-midnight:      #0B0C1A;   /* dark ground */
  --color-charcoal:      #1C1D2E;   /* secondary dark */
  --color-ice:           #F4F5FF;   /* default page canvas */
  --color-whisper:       #ECEDF8;   /* subtle surface */
  --color-white:         #FFFFFF;   /* cards / modals / tables on Ice */

  /* ── Neutral ramp (cool-tinted, not true grey) ──────────── */
  --color-n100:          #E8E9F5;
  --color-n200:          #D1D3EC;
  --color-n300:          #A9ACCC;
  --color-n400:          #7B7FA8;
  --color-n500:          #585B82;
  --color-n600:          #3A3D60;

  /* ── Status / functional colours ───────────────────────── */
  --color-success:       #00805A;   /* corrected — was #00875F, fails AA */
  --color-warning:       #996800;   /* corrected — was #B37A00, fails AA */
  --color-critical:      #C0392B;   /* reserved for truly broken/lost */
  --color-info:          #3D16FA;   /* indigo carries info in product chrome */

  /* Tints for status chips */
  --color-success-tint:  #E6F5F0;
  --color-warning-tint:  #FDF5E0;
  --color-critical-tint: #FDE8E6;
  --color-held-tint:     #EEF0FF;   /* held = indigo tint — product working correctly */

  /* ── Surface aliases ────────────────────────────────────── */
  --color-bg:            var(--color-ice);
  --color-surface:       var(--color-white);
  --color-border:        var(--color-n200);
  --color-border-soft:   var(--color-n100);
  --color-text:          var(--color-midnight);
  --color-text-muted:    var(--color-n500);
  --color-text-light:    var(--color-n400);

  /* Code */
  --color-code-bg:       var(--color-charcoal);
  --color-code-text:     #E8E9F5;

  /* ── Typography ─────────────────────────────────────────── */
  --font-display: 'Plus Jakarta Sans', sans-serif;  /* wordmark & display only */
  --font-body:    'IBM Plex Sans', sans-serif;       /* all UI & prose */
  --font-mono:    'IBM Plex Mono', monospace;        /* IDs, timestamps, data */

  /* ── Radius — closed set, no other values ───────────────── */
  --radius:    8px;   /* containers */
  --radius-sm: 4px;   /* chips */
  /* No pill except where explicitly noted */

  /* ── Spacing (4px base) ─────────────────────────────────── */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* ── Shadows ─────────────────────────────────────────────── */
  --shadow-xs: 0 1px 2px rgba(61,22,250,.06);
  --shadow-sm: 0 1px 4px rgba(61,22,250,.08);
  --shadow:    0 4px 12px rgba(61,22,250,.10);
  --shadow-lg: 0 8px 28px rgba(61,22,250,.14);

  /* ── Layout ─────────────────────────────────────────────── */
  --sidebar-width:  272px;
  --header-height:  64px;
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

/* ── Header — solid indigo, white labels (7.80:1) ───────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: var(--color-indigo);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  gap: var(--space-4);
  z-index: 200;
  box-shadow: 0 1px 0 rgba(255,255,255,0.08), var(--shadow-sm);
}

.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo__wordmark {
  height: 32px;
  width: 120px;
  display: block;
  object-fit: contain;
  object-position: left center;
}

/* Hide the text name — wordmark SVG contains it */
.site-logo__name { display: none; }
/* Hide placeholder mark — wordmark SVG replaces it */
.site-logo__mark { display: none; }

.header-search {
  flex: 1;
  max-width: 380px;
  margin-left: auto;
  position: relative;
}

.header-search::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba(255,255,255,0.55)' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") center/contain no-repeat;
  pointer-events: none;
}

.header-search input {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.875rem;
  outline: none;
  transition: background 0.15s, border-color 0.15s;
}
.header-search input::placeholder { color: rgba(255,255,255,0.5); }
.header-search input:focus {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.4);
}

.lang-switch {
  color: rgba(255,255,255,0.8);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.25);
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.12s;
}
.lang-switch:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* ── Layout ──────────────────────────────────────────────────── */
.layout {
  display: flex;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-4) 0 var(--space-8);
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

/* Platform accordion */
.sidebar-platform { border-bottom: 1px solid var(--color-border-soft); }
.sidebar-platform summary { list-style: none; cursor: pointer; }
.sidebar-platform summary::-webkit-details-marker { display: none; }

.sidebar-platform__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem var(--space-4);
}

.sidebar-platform__title a {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-midnight);
  text-decoration: none;
  flex: 1;
  transition: color 0.12s;
}

.sidebar-platform__title a:hover { color: var(--color-indigo); }
.sidebar-platform[open] .sidebar-platform__title a { color: var(--color-indigo); }

.sidebar-chevron {
  color: var(--color-text-light);
  font-size: 1rem;
  transition: transform 0.2s;
  flex-shrink: 0;
  pointer-events: none;
}
.sidebar-platform[open] .sidebar-chevron { transform: rotate(90deg); }

.sidebar-platform__body { padding-bottom: var(--space-2); }

.sidebar-section-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-light);
  padding: var(--space-3) var(--space-5) var(--space-1);
}

.sidebar-links { list-style: none; padding: 0; margin-bottom: var(--space-1); }

.sidebar-links li a {
  display: block;
  padding: 0.45rem var(--space-6);
  font-size: 0.855rem;
  color: var(--color-text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.1s, border-color 0.1s, background 0.1s;
  line-height: 1.4;
}

.sidebar-links li a:hover {
  color: var(--color-indigo);
  background: var(--color-indigo-tint);
}

.sidebar-links li a.active {
  color: var(--color-indigo);
  border-left-color: var(--color-indigo);
  background: var(--color-indigo-tint);
  font-weight: 600;
}

/* Homepage sidebar */
.home-nav { padding: var(--space-3) 0; }
.home-nav li { list-style: none; }
.home-nav li a {
  display: block;
  padding: 0.65rem var(--space-4);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.1s, border-color 0.1s;
}
.home-nav li a:hover {
  color: var(--color-indigo);
  border-left-color: var(--color-indigo);
}

/* ── Platform landing page ──────────────────────── */
.platform-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-3);
}

.platform-desc {
  font-size: 1rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
  max-width: 60ch;
  line-height: 1.6;
}

.platform-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-5) 0;
}

.platform-section-heading {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: var(--space-4);
  color: var(--color-text);
}

.platform-article-list {
  list-style: none;
  padding: 0;
  margin-bottom: var(--space-2);
}

.platform-article-list li {
  border-bottom: 1px solid var(--color-border-soft);
}

.platform-article-list li a {
  display: block;
  padding: 0.6rem 0;
  color: var(--color-indigo);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.12s;
}

.platform-article-list li a:hover {
  color: var(--color-indigo-hover);
  text-decoration: underline;
}

/* ── Main content ────────────────────────────────────────────── */
.main-content {
  flex: 1;
  padding: var(--space-10) var(--space-12);
  max-width: 900px;
  min-width: 0;
}

/* ── Homepage hero — solid indigo, flat ──────────────────────── */
.home-hero {
  background: var(--color-indigo);
  border-radius: var(--radius);
  padding: var(--space-12) var(--space-10);
  text-align: center;
  margin-bottom: var(--space-8);
}

.home-hero h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: var(--space-2);
  letter-spacing: -0.03em;
}

.home-hero p {
  color: rgba(255,255,255,0.72);
  font-size: 1rem;
  margin-bottom: var(--space-6);
}

.home-search {
  display: flex;
  max-width: 480px;
  margin: 0 auto;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}

.home-search input {
  flex: 1;
  padding: 0.85rem var(--space-5);
  border: none;
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  color: var(--color-text);
  background: var(--color-white);
}

.home-search button {
  padding: 0.85rem var(--space-6);
  background: var(--color-midnight);
  color: #fff;
  border: none;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.home-search button:hover { background: var(--color-charcoal); }

/* ── Product cards ───────────────────────────────────────────── */
.ja-product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.ja-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-8) var(--space-5) var(--space-6);
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.12s;
  min-width: 0;
  overflow: hidden;
}

.ja-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--color-indigo);
  transform: translateY(-2px);
}

.ja-card__logo {
  width: 100%;
  height: 56px;
  max-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
  overflow: hidden;
  flex-shrink: 0;
}

.ja-card__logo img {
  display: block;
  width: auto !important;
  height: auto !important;
  max-height: 48px !important;
  max-width: 140px !important;
  object-fit: contain;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
}

.ja-card__title {
  font-weight: 600;
  font-size: 0.925rem;
  margin-bottom: var(--space-2);
  color: var(--color-text);
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.ja-card__desc {
  font-size: 0.825rem;
  color: var(--color-text-muted);
  line-height: 1.65;
}

@media (max-width: 860px) { .ja-product-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 520px) { .ja-product-grid { grid-template-columns: 1fr; } }

/* ── Neutralise HubSpot layout classes inside articles ────────── */
.article .row-fluid-wrapper,
.article .dnd-section,
.article .dnd-row,
.article .dnd-module,
.article .widget-span,
.article .container-fluid,
.article .article-wrapper,
.article .hs_cos_wrapper {
  display: block;
  width: 100% !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.article .row-fluid {
  display: block;
  width: 100% !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.article .row-fluid::after { content: ''; display: table; clear: both; }

.article [class*="span"] {
  display: block;
  width: 100% !important;
  float: none !important;
  margin: 0 !important;
  padding: 0.25rem 0 !important;
}

/* ── Lists ───────────────────────────────────────────────────── */
.article ul,
.article ol {
  padding-left: 1.5rem;
  margin: 0.5rem 0 1.25rem;
}

.article ul { list-style: disc; }
.article ol { list-style: decimal; }

.article li { margin-bottom: 0.4rem; line-height: 1.6; }

.article ul ul,
.article ol ol,
.article ul ol,
.article ol ul { margin: 0.25rem 0; }

/* ── Article typography ──────────────────────────────────────── */
.article h1 {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 800;
  margin-bottom: var(--space-5);
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--color-text);
}

.article h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: var(--space-10) 0 var(--space-4);
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-border);
}

.article h3 {
  font-size: 1.025rem;
  font-weight: 600;
  margin: var(--space-6) 0 var(--space-3);
}

.article h4 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  margin: var(--space-5) 0 var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--color-text-muted);
}

.article p { margin-bottom: 1.05rem; }

.article a { color: var(--color-indigo); text-decoration: none; font-weight: 500; }
.article a:hover { text-decoration: underline; }

.article code {
  font-family: var(--font-mono);
  background: var(--color-n100);
  border: 1px solid var(--color-border);
  padding: 0.15em 0.45em;
  border-radius: var(--radius-sm);
  font-size: 0.85em;
  color: var(--color-indigo);
}

.article pre {
  background: var(--color-code-bg) !important;
  border-radius: var(--radius);
  padding: var(--space-5) var(--space-6);
  overflow-x: auto;
  margin: var(--space-5) 0;
  box-shadow: var(--shadow-sm);
}

.article pre,
.article pre * {
  color: var(--color-code-text) !important;
  background: none;
}

.article pre code {
  background: none !important;
  border: none;
  padding: 0;
  font-size: 0.875rem;
  color: var(--color-code-text) !important;
  font-family: var(--font-mono);
}

.article img {
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  margin: var(--space-5) 0;
  box-shadow: var(--shadow-xs);
}

.article table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-5) 0;
  font-size: 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.article th {
  background: var(--color-ice);
  padding: 0.65rem var(--space-4);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--color-text-muted);
  text-align: left;
  border-bottom: 2px solid var(--color-border);
}

.article td {
  padding: 0.7rem var(--space-4);
  border-bottom: 1px solid var(--color-border-soft);
}

.article tr:last-child td { border-bottom: none; }
.article tr:hover td { background: var(--color-ice); }

/* ── Video placeholder ──────────────────────────────── */
.video-placeholder {
  background: var(--color-ice);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  margin: var(--space-5) 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* ── Breadcrumb ──────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--color-text-light);
  margin-bottom: var(--space-6);
}
.breadcrumb a { color: var(--color-text-light); text-decoration: none; transition: color 0.12s; }
.breadcrumb a:hover { color: var(--color-indigo); }
.breadcrumb span { color: var(--color-text-muted); }

/* ── 404 ─────────────────────────────────────────────────────── */
.error-page { text-align: center; padding: 5rem 1rem; }
.error-page h1 {
  font-family: var(--font-display);
  font-size: 6rem;
  font-weight: 800;
  color: var(--color-border);
  letter-spacing: -0.05em;
}
.error-page p { color: var(--color-text-muted); margin: var(--space-3) 0 var(--space-8); font-size: 1rem; }

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.7rem var(--space-6);
  background: var(--color-indigo);
  color: #fff;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.12s;
  box-shadow: 0 2px 8px rgba(61,22,250,.25);
}
.btn:hover { background: var(--color-indigo-hover); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) { .main-content { padding: var(--space-6) var(--space-5); } }
@media (max-width: 700px) {
  .sidebar { display: none; }
  .main-content { padding: var(--space-5) var(--space-4); }
  .home-hero { padding: var(--space-10) var(--space-5); }
  .home-hero h1 { font-size: 1.6rem; }
}
