/* ============================================================
   LITIGO — Design System
   Editorial · Swiss · AI-native · No gradients · No shadows
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --bg: #F2F0EA;
  --bg-elev: #ECEAE3;
  --ink: #0E0E0E;
  --ink-2: #3A3A36;
  --muted: #6E6A60;
  --border: #D5D0C2;
  --border-strong: #B8B2A0;
  --accent: #7A2E2E;
  --accent-ink: #F2F0EA;
  --ok: #2E5E3A;
  --warn: #9A6B1F;

  --serif: "Instrument Serif", "Times New Roman", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --r: 2px;
  --pill: 999px;
  --hair: 1px solid var(--border);
  --hair-strong: 1px solid var(--ink);

  --container: 1200px;
  --gutter: 24px;
  --section-y: clamp(64px, 9vw, 128px);

  --t: 180ms cubic-bezier(.2,.6,.2,1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
hr { border: 0; border-top: 1px solid var(--border); margin: 0; }
::selection { background: var(--ink); color: var(--bg); }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
  line-height: 1.05;
}
h1 { font-size: clamp(2.75rem, 6.2vw, 5rem); }
h2 { font-size: clamp(2rem, 4.2vw, 3.25rem); }
h3 { font-size: clamp(1.5rem, 2.4vw, 2rem); }
h4 { font-size: 1.25rem; line-height: 1.2; }
h5 { font-size: 1rem; font-family: var(--sans); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

p { margin: 0; color: var(--ink-2); }
.lead { font-size: 1.125rem; line-height: 1.55; color: var(--ink-2); max-width: 60ch; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-feature-settings: "ss01"; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; background: var(--accent); border-radius: 50%;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
@media (min-width: 900px) { .container { padding: 0 48px; } }

.section { padding: var(--section-y) 0; border-top: 1px solid var(--border); }
.section--flush { border-top: 0; }

.grid { display: grid; gap: 24px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
}
@media (min-width: 600px) and (max-width: 900px) {
  .cols-3, .cols-4 { grid-template-columns: 1fr 1fr; }
}

.split {
  display: grid; gap: 48px;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: start;
}
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 32px; } }

.stack > * + * { margin-top: 16px; }
.stack-lg > * + * { margin-top: 32px; }
.stack-xl > * + * { margin-top: 48px; }

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 18px;
  border: 1px solid var(--ink);
  background: var(--bg);
  color: var(--ink);
  border-radius: var(--r);
  font-size: 0.9375rem; font-weight: 500;
  transition: background var(--t), color var(--t), border-color var(--t);
  white-space: nowrap;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn--primary { background: var(--ink); color: var(--bg); }
.btn--primary:hover { background: transparent; color: var(--ink); }
.btn--ghost { border-color: var(--border); }
.btn--ghost:hover { border-color: var(--ink); background: var(--bg); color: var(--ink); }
.btn--sm { height: 36px; padding: 0 14px; font-size: 0.875rem; }
.btn--lg { height: 52px; padding: 0 22px; font-size: 1rem; }
.btn .arrow { transition: transform var(--t); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Tags & Badges ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--pill);
  font-size: 0.75rem; color: var(--muted);
  background: var(--bg);
}
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.tag--accent { color: var(--accent); border-color: var(--accent); }
.tag--accent .dot { background: var(--accent); }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 0.6875rem;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Cards ---------- */
.card {
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 28px;
  background: var(--bg);
  transition: border-color var(--t);
}
.card:hover { border-color: var(--ink); }
.card h3, .card h4 { margin-bottom: 8px; }
.card .num-lg { font-family: var(--mono); font-size: 2rem; letter-spacing: -0.02em; }

/* ---------- Navbar ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-size: 1.375rem;
  letter-spacing: -0.02em;
}
.brand__mark {
  width: 22px; height: 22px;
  border: 1px solid var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 14px;
  border-radius: var(--r);
}
.nav__links {
  display: flex; align-items: center; gap: 28px;
  font-size: 0.9375rem;
}
.nav__links a { color: var(--ink-2); transition: color var(--t); }
.nav__links a:hover { color: var(--ink); }
.nav__cta { display: flex; align-items: center; gap: 8px; }
.nav__toggle { display: none; }
@media (max-width: 900px) {
  .nav__links, .nav__cta .btn:not(.btn--primary) { display: none; }
  .nav__toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border: 1px solid var(--border); border-radius: var(--r);
  }
}
.nav__mobile {
  display: none; border-top: 1px solid var(--border); background: var(--bg);
}
.nav__mobile.open { display: block; }
.nav__mobile a {
  display: block; padding: 14px var(--gutter);
  border-bottom: 1px solid var(--border); color: var(--ink-2);
}

/* ---------- Hero ---------- */
.hero { padding: clamp(80px, 12vw, 160px) 0 clamp(64px, 9vw, 120px); border-top: 0; }
.hero h1 { max-width: 18ch; }
.hero .lead { font-size: 1.25rem; max-width: 56ch; margin-top: 24px; }
.hero .row { margin-top: 36px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 64px 0 32px; }
.footer__cols {
  display: grid; gap: 32px;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
}
@media (max-width: 900px) { .footer__cols { grid-template-columns: 1fr 1fr; } }
.footer h5 { margin-bottom: 16px; }
.footer ul li { padding: 6px 0; }
.footer ul a { color: var(--ink-2); }
.footer ul a:hover { color: var(--ink); }
.footer__bottom {
  margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 0.8125rem; color: var(--muted);
}

/* ---------- Logo strip ---------- */
.logos {
  display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 32px; align-items: center;
}
@media (max-width: 900px) { .logos { grid-template-columns: repeat(3, 1fr); gap: 24px; } }
.logos .logo {
  font-family: var(--serif); font-size: 1.25rem;
  letter-spacing: -0.01em; color: var(--muted); text-align: center;
  padding: 14px 0;
}

/* ---------- Bento / Feature grid ---------- */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.bento > * {
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 28px;
  background: var(--bg);
  min-height: 220px;
  transition: border-color var(--t);
  display: flex; flex-direction: column; justify-content: space-between;
}
.bento > *:hover { border-color: var(--ink); }
.bento .span-3 { grid-column: span 3; }
.bento .span-2 { grid-column: span 2; }
.bento .span-4 { grid-column: span 4; }
.bento .span-6 { grid-column: span 6; }
@media (max-width: 900px) {
  .bento { grid-template-columns: 1fr; }
  .bento .span-2, .bento .span-3, .bento .span-4, .bento .span-6 { grid-column: span 1; }
}

/* ---------- Metric / Stat ---------- */
.stat { padding: 24px 0; border-top: 1px solid var(--border); }
.stat__num { font-family: var(--mono); font-size: clamp(2rem, 3.5vw, 3rem); letter-spacing: -0.02em; }
.stat__label { color: var(--muted); font-size: 0.875rem; margin-top: 8px; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  text-align: left; padding: 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9375rem; vertical-align: top;
}
.table th { font-weight: 500; color: var(--muted); font-size: 0.8125rem; letter-spacing: 0.04em; text-transform: uppercase; }
.table tr:last-child td { border-bottom: 0; }
.table--bordered { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }

/* ---------- Pricing ---------- */
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--border); border-radius: var(--r); }
@media (max-width: 900px) { .price-grid { grid-template-columns: 1fr; } }
.price {
  padding: 32px; border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.price:last-child { border-right: 0; }
@media (max-width: 900px) {
  .price { border-right: 0; border-bottom: 1px solid var(--border); }
  .price:last-child { border-bottom: 0; }
}
.price h3 { font-family: var(--serif); font-size: 1.5rem; }
.price .amount { font-family: var(--mono); font-size: 2.25rem; letter-spacing: -0.02em; margin: 12px 0 4px; }
.price ul li { padding: 8px 0; border-top: 1px solid var(--border); color: var(--ink-2); font-size: 0.9375rem; display: flex; gap: 10px; }
.price ul li::before { content: "—"; color: var(--muted); }
.price .btn { margin-top: auto; }
.price--featured { background: var(--bg-elev); }

/* ---------- FAQ / Accordion ---------- */
.faq { border-top: 1px solid var(--border); }
.faq__item { border-bottom: 1px solid var(--border); }
.faq__q {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; padding: 24px 0; text-align: left;
  font-family: var(--serif); font-size: 1.25rem; letter-spacing: -0.01em;
}
.faq__q .plus { font-family: var(--mono); font-size: 1.25rem; transition: transform var(--t); color: var(--muted); }
.faq__item.open .faq__q .plus { transform: rotate(45deg); color: var(--ink); }
.faq__a {
  max-height: 0; overflow: hidden; transition: max-height var(--t);
  color: var(--ink-2);
}
.faq__item.open .faq__a { max-height: 480px; padding-bottom: 24px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 32px; flex-wrap: wrap; }
.tab {
  padding: 14px 18px; border-bottom: 1px solid transparent;
  margin-bottom: -1px; color: var(--muted); font-size: 0.9375rem;
  transition: color var(--t), border-color var(--t);
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--ink); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 0.8125rem; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.input, .textarea, .select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--bg);
  padding: 12px 14px;
  font-size: 0.9375rem;
  transition: border-color var(--t);
}
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--ink);
}
.textarea { min-height: 140px; resize: vertical; font-family: var(--sans); }

/* ---------- Code / Citation block ---------- */
.code, pre.code {
  font-family: var(--mono); font-size: 0.8125rem; line-height: 1.7;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px; overflow-x: auto;
  color: var(--ink);
  white-space: pre;
}
.cite {
  font-family: var(--mono); font-size: 0.75rem; color: var(--muted);
  border-left: 2px solid var(--accent); padding-left: 10px;
}

/* ---------- Workflow diagram ---------- */
.flow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; align-items: stretch; }
@media (max-width: 900px) { .flow { grid-template-columns: 1fr 1fr; } }
.flow .node {
  border: 1px solid var(--border); border-radius: var(--r);
  padding: 16px; font-size: 0.875rem;
  position: relative;
}
.flow .node h5 { color: var(--muted); margin-bottom: 6px; font-size: 0.6875rem; }
.flow .node .label { font-family: var(--serif); font-size: 1.0625rem; letter-spacing: -0.01em; color: var(--ink); }
.flow .node + .node::before {
  content: "→"; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 14px; color: var(--muted);
}
@media (max-width: 900px) { .flow .node + .node::before { display: none; } }

/* ---------- Dashboard mock ---------- */
.dash {
  border: 1px solid var(--border); border-radius: var(--r);
  background: var(--bg);
  overflow: hidden;
}
.dash__bar {
  height: 36px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 14px; gap: 8px;
}
.dash__dot { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--border); }
.dash__body { display: grid; grid-template-columns: 200px 1fr; min-height: 360px; }
@media (max-width: 700px) { .dash__body { grid-template-columns: 1fr; } }
.dash__side { border-right: 1px solid var(--border); padding: 16px; font-size: 0.8125rem; }
@media (max-width: 700px) { .dash__side { border-right: 0; border-bottom: 1px solid var(--border); } }
.dash__side .nav-item { padding: 8px 10px; border-radius: var(--r); color: var(--muted); display: flex; gap: 8px; align-items: center; }
.dash__side .nav-item.active { background: var(--bg-elev); color: var(--ink); }
.dash__main { padding: 20px; }
.dash__row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.dash__row:last-child { border-bottom: 0; }

/* ---------- Utility ---------- */
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; } .mt-5 { margin-top: 48px; }
.mt-6 { margin-top: 64px; } .mt-7 { margin-top: 96px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.aic { align-items: center; }
.jcb { justify-content: space-between; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; } .gap-3 { gap: 24px; }
.hide-mobile { }
@media (max-width: 700px) { .hide-mobile { display: none; } }

/* ---------- Status dots ---------- */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot--ok { background: var(--ok); }
.dot--warn { background: var(--warn); }
.dot--err { background: var(--accent); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(8px); transition: opacity 420ms ease, transform 420ms ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation: none !important; transition: none !important; }
}

/* ---------- Focus ---------- */
a:focus-visible, button:focus-visible, .btn:focus-visible,
.input:focus-visible, .textarea:focus-visible, .select:focus-visible {
  outline: 2px solid var(--ink); outline-offset: 2px;
}

/* ---------- Big editorial blocks ---------- */
.kicker {
  font-family: var(--serif); font-size: clamp(1.625rem, 2.6vw, 2.25rem);
  letter-spacing: -0.02em; line-height: 1.2; max-width: 28ch;
}

/* ---------- Auth layout ---------- */
.auth { min-height: calc(100vh - 64px); display: grid; grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } }
.auth__panel { padding: 64px clamp(24px, 6vw, 80px); border-right: 1px solid var(--border); display: flex; flex-direction: column; justify-content: center; }
.auth__aside { padding: 64px clamp(24px, 6vw, 80px); background: var(--bg-elev); display: flex; flex-direction: column; justify-content: center; gap: 16px; }
@media (max-width: 900px) { .auth__panel { border-right: 0; border-bottom: 1px solid var(--border); } }
