/* ═══════════════════════════════════════════════════════════════
   AskQuorum AI — main.css
   Premium-minimal system: dark warm near-black, one accent,
   hairline borders, light-weight type. No gradients, no glass,
   no shadows, no particles.
   ═══════════════════════════════════════════════════════════════ */

/* Font stylesheet is linked directly in each page's <head> (not @import'd
   here) so the browser can fetch it in parallel with this file instead of
   discovering it only after main.css finishes downloading and parsing. */

/* ── Tokens ─────────────────────────────────────────────────── */
:root {
  --bg:        #0e0f12;
  --bg-raise:  #131418;

  --ink:   rgba(245, 246, 248, 0.96);
  --ink-2: rgba(245, 246, 248, 0.64);
  --ink-3: rgba(245, 246, 248, 0.42);

  --hair:        rgba(255, 255, 255, 0.08);
  --hair-strong: rgba(255, 255, 255, 0.16);
  --surface:     rgba(255, 255, 255, 0.025);
  --surface-hi:  rgba(255, 255, 255, 0.055);

  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.24);

  --nav-bg: rgba(14, 15, 18, 0.86);

  /* Logo mark */
  --logo-deep: var(--ink);
  --logo-mid:  #3b82f6;
  --logo-dot:  var(--bg);

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;

  --gutter: clamp(24px, 6vw, 72px);
  --container: 1120px;

  --dur: 0.25s;
  --ease: cubic-bezier(0.25, 0.6, 0.3, 1);
}

/* ── Light theme ────────────────────────────────────────────── */
[data-theme="light"] {
  --bg:       #ffffff;
  --bg-raise: #f5f6f8;

  --ink:   rgba(14, 16, 20, 0.94);
  --ink-2: rgba(14, 16, 20, 0.64);
  --ink-3: rgba(14, 16, 20, 0.46);

  --hair:        rgba(14, 16, 20, 0.11);
  --hair-strong: rgba(14, 16, 20, 0.20);
  --surface:     rgba(14, 16, 20, 0.022);
  --surface-hi:  rgba(14, 16, 20, 0.05);

  --accent: #1d4ed8;
  --accent-soft: rgba(29, 78, 216, 0.18);

  --nav-bg: rgba(255, 255, 255, 0.88);

  --logo-deep: #1e3a8a;
  --logo-mid:  #3b82f6;
}

/* Theme transition (skipped on first paint via .no-transition) */
body, .nav, .cell, .card, .grid, .footer { transition: background-color var(--dur), border-color var(--dur), color var(--dur); }
.no-transition, .no-transition * { transition: none !important; }

/* ── Reset / base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
html:focus-within { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--accent-soft); color: var(--ink); }

img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input, textarea, select { font: inherit; color: inherit; }

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute; left: -9999px; top: 12px; z-index: 200;
  background: var(--bg-raise); color: var(--ink); padding: 10px 18px;
  border: 1px solid var(--hair-strong); border-radius: 6px; font-size: 13px;
}
.skip-link:focus { left: 12px; }

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4 {
  color: var(--ink);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.display {
  font-size: clamp(1.7rem, 3.6vw, 2.7rem);
  font-weight: 300;
  letter-spacing: -0.028em;
  line-height: 1.08;
}
/* Two-tone headline: each span is its own line, second line muted */
.display-split span { display: block; }
.display .dim { color: var(--ink-2); }

.h-lg { font-size: clamp(1.2rem, 2.1vw, 1.6rem); font-weight: 400; }
.h-md { font-size: clamp(1.02rem, 1.55vw, 1.2rem); font-weight: 400; }
h3    { font-size: 0.9rem; font-weight: 500; letter-spacing: -0.01em; }

p.lead { font-size: 14px; line-height: 1.7; color: var(--ink-2); max-width: 58ch; }

.eyebrow {
  display: flex; align-items: baseline; gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 400;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 22px;
}
.eyebrow .idx { color: var(--accent); letter-spacing: 0.06em; }

.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  margin-bottom: 18px;
}
.breadcrumb a { color: var(--ink-3); transition: color var(--dur); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { opacity: 0.5; }
.breadcrumb .current { color: var(--ink-2); }

.mono-label {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3);
}

a.text-link { color: var(--ink); border-bottom: 1px solid var(--hair-strong); padding-bottom: 1px; transition: border-color var(--dur), color var(--dur); }
a.text-link:hover { color: var(--accent); border-color: var(--accent); }

/* ── Layout ─────────────────────────────────────────────────── */
.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
/* Centred, narrower measure for document-style pages (privacy, terms) */
.container-narrow { max-width: 840px; }

.section { padding-block: clamp(44px, 5vw, 72px); }
.section-tight { padding-block: clamp(32px, 3.5vw, 52px); }
.section-flush { padding-block: 0; }
.section-line { border-top: 1px solid var(--hair); }

.section-head { max-width: 620px; margin-bottom: clamp(40px, 5vw, 64px); }
.section-head p { margin-top: 14px; color: var(--ink-2); }

.grid { display: grid; gap: 1px; background: var(--hair); border: 1px solid var(--hair); }
.grid > * { background: var(--bg); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 88px); align-items: start; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 500; font-size: 12.5px; letter-spacing: 0;
  padding: 8px 20px; border-radius: 6px; white-space: nowrap;
  transition: background var(--dur), border-color var(--dur), color var(--dur), opacity var(--dur);
}
.btn svg { width: 14px; height: 14px; }

.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { opacity: 0.86; }

.btn-ghost { border: 1px solid var(--hair-strong); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: rgba(255,255,255,0.34); background: var(--surface); }

.btn-lg { padding: 10px 26px; font-size: 13px; }
.btn-sm { padding: 7px 16px; font-size: 12px; }

.btn-group { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Nav ────────────────────────────────────────────────────── */
.nav {
  position: fixed; inset-inline: 0; top: 0; z-index: 100;
  transition: background var(--dur), border-color var(--dur);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--hair);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }

.nav-logo { display: flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 600; font-size: 13.5px; letter-spacing: -0.02em; }
.nav-logo .ai { color: var(--ink-3); font-weight: 400; }

/* Brand mark — colours follow the active theme */
.mark { width: 24px; height: 24px; flex-shrink: 0; }
.mark .m-deep { fill: var(--logo-deep); transition: fill var(--dur); }
.mark .m-mid  { fill: var(--logo-mid); }
.mark .m-dot  { fill: var(--logo-dot); transition: fill var(--dur); }
.footer-brand .mark { width: 22px; height: 22px; }

.nav-links { display: flex; gap: 30px; }
.nav-links a { font-size: 13px; color: var(--ink-2); transition: color var(--dur); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }

.nav-actions { display: flex; align-items: center; gap: 12px; }

/* ── Theme toggle ───────────────────────────────────────────── */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex-shrink: 0;
  border: 1px solid var(--hair-strong); border-radius: 6px;
  color: var(--ink-2);
  transition: color var(--dur), border-color var(--dur), background var(--dur);
}
.theme-toggle:hover { color: var(--ink); border-color: rgba(128, 128, 128, 0.45); background: var(--surface); }
.theme-toggle svg { width: 16px; height: 16px; }
/* Icon shows the theme you switch TO: sun while dark, moon while light */
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun  { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

.nav-burger { display: none; width: 40px; height: 40px; position: relative; }
.nav-burger span, .nav-burger span::before, .nav-burger span::after {
  content: ''; position: absolute; left: 50%; width: 18px; height: 1.5px;
  background: var(--ink); transform: translateX(-50%);
  transition: transform var(--dur) var(--ease), opacity var(--dur);
}
.nav-burger span { top: 50%; }
.nav-burger span::before { top: -6px; }
.nav-burger span::after { top: 6px; }
.nav-burger.active span { background: transparent; }
.nav-burger.active span::before { transform: translateX(-50%) translateY(6px) rotate(45deg); }
.nav-burger.active span::after { transform: translateX(-50%) translateY(-6px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 90;
  background: var(--bg);
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 var(--gutter);
  opacity: 0; visibility: hidden;
  transition: opacity var(--dur) var(--ease), visibility var(--dur);
}
.mobile-menu.open { opacity: 1; visibility: visible; }
.mobile-menu a {
  font-size: clamp(1.02rem, 4.2vw, 1.3rem); font-weight: 300; color: var(--ink);
  padding: 14px 0; border-bottom: 1px solid var(--hair);
}
.mobile-menu a.btn { border: none; font-size: 13px; font-weight: 500; margin-top: 28px; align-self: flex-start; padding: 10px 26px; }

/* ── Hero ───────────────────────────────────────────────────── */
.hero { padding-top: clamp(112px, 14vh, 150px); padding-bottom: clamp(40px, 5vw, 64px); }
.hero .lead { margin-top: 26px; }
.hero-ctas { margin-top: 38px; display: flex; gap: 12px; flex-wrap: wrap; }

.page-hero { padding-top: clamp(104px, 12vh, 128px); padding-bottom: clamp(24px, 3vw, 36px); }
.page-hero .lead { margin-top: 20px; }

/* ── Stat strip ─────────────────────────────────────────────── */
.stat-strip {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-block: 1px solid var(--hair);
}
.stat-cell { padding: 30px clamp(16px, 2.5vw, 36px); border-left: 1px solid var(--hair); }
.stat-cell:first-child { border-left: none; }
.stat-num { color: var(--ink); font-size: clamp(1.2rem, 1.8vw, 1.55rem); font-weight: 300; letter-spacing: -0.02em; }
.stat-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin-top: 8px; }

/* ── Cards (hairline cells) ─────────────────────────────────── */
.cell { padding: clamp(26px, 3vw, 40px); transition: background var(--dur); }
.cell:hover { background: var(--bg-raise); }
.cell h3 { margin-bottom: 10px; }
.cell p { font-size: 13px; color: var(--ink-2); }
.cell .idx {
  font-family: var(--font-mono); font-size: 11px; color: var(--accent);
  letter-spacing: 0.08em; display: block; margin-bottom: 18px;
}
.cell .cell-link { display: inline-block; margin-top: 16px; font-size: 12px; color: var(--ink-3); transition: color var(--dur); }
.cell:hover .cell-link { color: var(--accent); }

/* Standalone bordered card (outside .grid) */
.card {
  border: 1px solid var(--hair); border-radius: 8px;
  padding: clamp(26px, 3vw, 40px); background: var(--surface);
}

/* ── Numbered list (SDLC / methodology) ─────────────────────── */
.num-list { border-top: 1px solid var(--hair); }
.num-row {
  padding: clamp(20px, 2.4vw, 28px) 0;
  border-bottom: 1px solid var(--hair);
}
/* The clause/step number sits inline at the head of its heading (or paragraph),
   so text and hairline share one left edge and each row is evenly inset. */
.num-row .num { font-family: var(--font-mono); font-size: 12px; color: var(--accent); margin-right: 12px; }
.num-row h3 { margin-bottom: 8px; }
.num-row h3 { font-size: 0.88rem; }
.num-row p { font-size: 13px; color: var(--ink-2); }

/* ── Case study rows ────────────────────────────────────────── */
.case-row {
  display: grid; grid-template-columns: 1fr 1.5fr;
  gap: clamp(24px, 4vw, 64px);
  padding: clamp(30px, 4vw, 48px) 0;
  border-bottom: 1px solid var(--hair);
}
.case-row:first-of-type { border-top: 1px solid var(--hair); }
.case-tag { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.case-row h3 { font-size: 1rem; margin-top: 10px; font-weight: 400; }
.case-metrics { display: flex; gap: 36px; margin-top: 22px; flex-wrap: wrap; }
.case-metrics .m strong { display: block; color: var(--ink); font-weight: 400; font-size: 0.9rem; }
.case-metrics .m span { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }

/* ── FAQ ────────────────────────────────────────────────────── */
.faq-list { border-top: 1px solid var(--hair); }
.faq-item { border-bottom: 1px solid var(--hair); }
.faq-q {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 22px 0; text-align: left;
  color: var(--ink); font-size: 13px; font-weight: 400;
  transition: color var(--dur);
}
.faq-q:hover { color: var(--accent); }
.faq-q .plus { flex-shrink: 0; width: 16px; height: 16px; color: var(--ink-3); transition: transform var(--dur) var(--ease); }
.faq-item.open .faq-q .plus { transform: rotate(45deg); }
.faq-a-wrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.35s var(--ease); }
.faq-item.open .faq-a-wrap { grid-template-rows: 1fr; }
.faq-a { overflow: hidden; }
.faq-a p { padding-bottom: 22px; font-size: 13px; color: var(--ink-2); }

/* ── Forms ──────────────────────────────────────────────────── */
.field { margin-bottom: 18px; }
.field label { display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
.field input, .field textarea, .field select {
  width: 100%; background: var(--surface); border: 1px solid var(--hair-strong);
  border-radius: 6px; padding: 11px 14px; font-size: 13px; color: var(--ink);
  transition: border-color var(--dur);
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); outline: none; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-3); }
.field textarea { min-height: 130px; resize: vertical; }

/* ── Legal pages ────────────────────────────────────────────── */
.legal-body p + p { margin-top: 12px; }
.legal-body code {
  font-family: var(--font-mono); font-size: 0.92em;
  background: var(--surface-hi); border: 1px solid var(--hair);
  border-radius: 4px; padding: 1px 5px;
}
.legal-body strong { color: var(--ink); font-weight: 500; }

/* ── Contact form ───────────────────────────────────────────── */
.split-form { grid-template-columns: 0.85fr 1.15fr; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

.field .req { color: var(--accent); margin-left: 2px; }

.field select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  padding-right: 36px;
  cursor: pointer;
}
.field select:invalid { color: var(--ink-3); }
.field select option { background: var(--bg-raise); color: var(--ink); }

/* Honeypot — hidden from people, visible to bots */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 26px; }
.form-note { font-size: 12px; color: var(--ink-3); }

.btn[disabled] { opacity: 0.5; pointer-events: none; }

.form-status { margin-top: 16px; font-size: 13px; display: none; }
.form-status.show { display: block; }
.form-status.ok  { color: var(--ink); }
.form-status.err { color: #f87171; }
[data-theme="light"] .form-status.err { color: #dc2626; }

.field .field-error { display: block; margin-top: 6px; font-size: 12px; color: #f87171; }
[data-theme="light"] .field .field-error { color: #dc2626; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"], .field select[aria-invalid="true"] {
  border-color: #f87171;
}

/* ── CTA banner ─────────────────────────────────────────────── */
.cta-banner {
  border-block: 1px solid var(--hair);
  padding: clamp(56px, 8vw, 100px) 0;
  text-align: left;
}
.cta-banner .btn-group { margin-top: 32px; }

/* ── Footer ─────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--hair); padding: clamp(48px, 6vw, 72px) 0 36px; }
.footer-top {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: clamp(28px, 4vw, 56px);
  padding-bottom: clamp(36px, 5vw, 56px);
}
.footer-brand p { font-size: 13px; color: var(--ink-3); margin-top: 14px; max-width: 34ch; }
.footer-col h5 { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); font-weight: 400; margin-bottom: 16px; }
.footer-col a { display: block; font-size: 13px; color: var(--ink-2); padding: 5px 0; transition: color var(--dur); }
.footer-col a:hover { color: var(--ink); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid var(--hair); padding-top: 26px;
  font-size: 12px; color: var(--ink-3);
}
.footer-bottom a { color: var(--ink-3); transition: color var(--dur); }
.footer-bottom a:hover { color: var(--ink); }
.footer-legal { display: flex; gap: 22px; }

/* ── Reveal ─────────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat-cell:nth-child(3) { border-left: none; }
  .stat-cell:nth-child(n+3) { border-top: 1px solid var(--hair); }
  .case-row { grid-template-columns: 1fr; gap: 14px; }
  .split-form { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .nav-links { display: none; }
  .nav-actions .btn { display: none; }
  .nav-burger { display: block; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
