/* Mantaq public site.
 *
 * Colour comes entirely from tokens.css (the brand kit's file, copied here
 * unmodified so there is one source of truth). Nothing in this file invents a
 * colour.
 *
 * The brand rules this obeys, from mantaq-kit/README.md:
 *   - blue is inputs, links and focus
 *   - lime is reason, progress and success
 *   - AMBER IS THE PRIMARY ACTION, and there is at most ONE amber button per
 *     screen. The homepage spends it on "Sign in"; the privacy page has no
 *     primary action, so it has no amber at all.
 *   - the mark is never recoloured and the gradient never reverses, which is why
 *     mark.svg and wordmark.svg are used as images rather than inlined and
 *     restyled
 */

/* --------------------------------------------------------------- reset */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--mq-bg);
  color: var(--mq-text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ------------------------------------------------------- layout rhythm */

/* One spacing scale, so vertical rhythm is consistent rather than ad hoc. */
:root {
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 72px;
  --measure: 68ch;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--s-4);
}


section { padding: var(--s-8) 0 0; }

/* ------------------------------------------------------------ type */

h1, h2, h3 { line-height: 1.25; letter-spacing: -0.02em; margin: 0; }

h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); font-weight: 700; }
h2 { font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.6rem); font-weight: 650; }
h3 { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }

p { margin: 0 0 var(--s-4); max-width: var(--measure); }
ul, ol { margin: 0 0 var(--s-4); padding-left: var(--s-5); max-width: var(--measure); }
li { margin-bottom: var(--s-2); }

.lede {
  font-size: clamp(1.05rem, 1rem + 0.35vw, 1.2rem);
  color: var(--mq-text-muted);
  max-width: 58ch;
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mq-text-faint);
  margin: 0 0 var(--s-3);
}

.section-intro { color: var(--mq-text-muted); margin-bottom: var(--s-5); }

/* Blue is the link colour: inputs and information. */
a { color: var(--mq-input); text-decoration: none; }
a:hover { text-decoration: underline; }
/* Things that are links but do not read as links: the logo, and anything
   styled as a button. Underlining either looks like a mistake. */
.brand:hover,
.btn:hover { text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--mq-focus);
  outline-offset: 2px;
  border-radius: 4px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
  background: var(--mq-surface-2);
  border: 1px solid var(--mq-border);
  border-radius: 6px;
  padding: 1px 6px;
  white-space: nowrap;
}

/* ---------------------------------------------------------- header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-5) 0;
}

.brand { display: inline-flex; align-items: center; }
/* mantaq-wordmark.svg is the horizontal lockup and already contains the mark —
   pairing it with mark.svg drew the mark twice. 560x140 (4:1), height sets size. */
/* 4:1 lockup, so height alone sets the size. Sized to sit closer to the
   wordmark in the app's sidebar rather than reading as a small site header. */
.brand img.logo { height: 36px; width: auto; }

/* The kit ships a light and a dark cut; swap, never recolour.
   All four rules are deliberately the same specificity (0,2,1). An earlier
   version set `display` on `.brand img.logo` (0,2,1) while hiding via
   `.brand .on-dark` (0,2,0) — the hide never won and BOTH logos rendered. */
.brand img.on-light { display: block; }
.brand img.on-dark  { display: none; }
@media (prefers-color-scheme: dark) {
  .brand img.on-light { display: none; }
  .brand img.on-dark  { display: block; }
}

.site-header nav { display: flex; gap: var(--s-5); font-size: 0.9rem; }
.site-header nav a { color: var(--mq-text-muted); }
.site-header nav a:hover { color: var(--mq-text); text-decoration: none; }

/* ------------------------------------------------------------ hero */

.hero { padding: var(--s-7) 0 0; }
.hero h1 { max-width: 16ch; margin-bottom: var(--s-4); }
.hero .lede { margin-bottom: var(--s-6); }

/* A single hairline carrying the brand's blue → lime → amber direction.
   Used once, under the hero, as a quiet restatement of the mark. */
.rule-gradient {
  height: 2px;
  border: 0;
  margin: var(--s-7) 0 0;
  background: var(--mq-gradient);
  border-radius: 2px;
  opacity: 0.9;
}

/* --------------------------------------------------------- buttons */

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: var(--mq-radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

/* Amber: the conclusion, the one primary action on the page. */
.btn--primary {
  background: var(--mq-primary);
  color: var(--mq-primary-text);
}
.btn--primary:hover { background: var(--mq-primary-hover); text-decoration: none; }

.btn--quiet {
  background: transparent;
  color: var(--mq-text);
  border-color: var(--mq-border);
}
.btn--quiet:hover { border-color: var(--mq-text-faint); text-decoration: none; }

/* ------------------------------------------------------------ cards */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--s-4);
  margin-top: var(--s-5);
}

.card {
  background: var(--mq-surface);
  border: 1px solid var(--mq-border);
  border-radius: var(--mq-radius-lg);
  padding: var(--s-5);
}
.card h3 { margin-bottom: var(--s-2); }
.card p { color: var(--mq-text-muted); font-size: 0.925rem; margin: 0; }

/* A 2px cap in the brand order, so the three cards read left-to-right as
   input → reason → conclusion rather than as three identical boxes. */
.card { position: relative; overflow: hidden; }
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
}
.card--input::before { background: var(--mq-input); }
.card--reason::before { background: var(--mq-reason); }
.card--conclusion::before { background: var(--mq-primary); }

/* ------------------------------------------------------------ scopes */

.scopes {
  border: 1px solid var(--mq-border);
  border-radius: var(--mq-radius-lg);
  overflow: hidden;
  margin-top: var(--s-5);
}
.scope {
  display: grid;
  grid-template-columns: minmax(180px, 230px) 1fr;
  gap: var(--s-5);
  padding: var(--s-5);
  border-bottom: 1px solid var(--mq-border);
}
.scope:last-child { border-bottom: 0; }
.scope dt { font-weight: 600; font-size: 0.9rem; }
.scope dt small { display: block; font-weight: 400; color: var(--mq-text-faint); margin-top: 2px; }
.scope dd { margin: 0; color: var(--mq-text-muted); font-size: 0.925rem; }

/* ------------------------------------------------------------ table */

table { width: 100%; border-collapse: collapse; font-size: 0.925rem; margin: var(--s-4) 0 var(--s-5); }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--mq-border); vertical-align: top; }
thead th {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--mq-text-faint); font-weight: 600;
}
tbody td { color: var(--mq-text-muted); }
tbody td:first-child { color: var(--mq-text); }

/* ----------------------------------------------------------- callout */

.callout {
  background: var(--mq-surface);
  border: 1px solid var(--mq-border);
  border-left: 3px solid var(--mq-input);
  border-radius: var(--mq-radius);
  padding: var(--s-4) var(--s-5);
  margin: var(--s-5) 0;
}
.callout p:last-child { margin-bottom: 0; }
.callout--reason { border-left-color: var(--mq-reason); }

/* ------------------------------------------------------------ doc */

/* A document reads as one column. The page gutter matches the homepage, but
   everything inside — headings, paragraphs, lists, tables — shares a single
   width so the right edge is straight.

   Previously paragraphs were capped at --measure (68ch) while the table ran to
   900px inside a 1080px container: three different widths on one page, which
   read as broken rather than deliberate. The cap existed for line length; that
   job now belongs to the column itself. */
.doc { max-width: 860px; }
.doc p,
.doc ul,
.doc ol,
.doc table { max-width: none; }

.doc h2 { margin-top: var(--s-7); margin-bottom: var(--s-3); }
.doc > p:first-of-type { font-size: 1.05rem; color: var(--mq-text-muted); }
.updated { color: var(--mq-text-faint); font-size: 0.875rem; margin-top: var(--s-2); }

/* ---------------------------------------------------------- footer */

.site-footer {
  margin-top: var(--s-8);
  padding: var(--s-5) 0 var(--s-7);
  border-top: 1px solid var(--mq-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-5);
  color: var(--mq-text-faint);
  font-size: 0.875rem;
}
.site-footer a { color: var(--mq-text-muted); }
.site-footer .spacer { flex: 1 1 auto; }

/* ---------------------------------------------------------- small */

@media (max-width: 620px) {
  .wrap { padding: 0 var(--s-3); }
  .brand img.logo { height: 30px; }
  section { padding-top: var(--s-7); }
  .scope { grid-template-columns: 1fr; gap: var(--s-2); }
  .actions .btn { flex: 1 1 auto; }
  .site-header nav { gap: var(--s-4); }
}
