/**
 * Shared design system for the marketing page and the dashboard.
 *
 * A light, cool, financial-grade palette: white ground, a saturated blue
 * carrying every action, near-black slate for text. Tokens are named for the
 * role they play rather than the colour they happen to be, so the next palette
 * change touches this file and nothing else.
 *
 * The widget is not styled from here. It is re-skinned per customer from
 * server/src/lib/brand.ts and renders inside a shadow root.
 */

:root {
  /* ground */
  --bg: #ffffff;
  /* Alternating bands, so a long page has rhythm without drawn rules. */
  --bg-alt: #f8faff;
  --surface: #ffffff;
  /* Code and other deliberately inverted panels. */
  --ink-surface: #0f172a;

  /* text */
  --ink: #0f172a;
  --muted: #64748b;
  --on-accent: #ffffff;
  --on-ink: #e2e8f0;

  /* action */
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  /* Tinted fill for accent chips and highlights. */
  --accent-wash: #eff4ff;

  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  /**
   * Signals. Not part of the supplied palette, chosen from the same family at
   * the darker step so each clears 4.5:1 on both grounds — these carry meaning
   * ("published", "not connected") and have to be readable, not decorative.
   */
  --ok: #047857;
  --ok-wash: #ecfdf5;
  --warn: #b45309;
  --warn-wash: #fffbeb;
  --bad: #b91c1c;
  --bad-wash: #fef2f2;

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --data: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /**
   * Fraunces is an optical-size design, so the axes are driven rather than left
   * at their defaults — a face cut for 9pt set at 60px looks thin and loose, and
   * one cut for 144pt set at 14px closes up. opsz is matched to the size it is
   * actually used at.
   *
   * SOFT rounds the terminals, which is where the warmth comes from. WONK is
   * left off: its swashed alternates are what would tip this into a bakery
   * sign, and the brief asked for personality rather than whimsy.
   */
  --optical-hero: "opsz" 144, "SOFT" 20, "WONK" 0;
  --optical-section: "opsz" 72, "SOFT" 22, "WONK" 0;
  --optical-small: "opsz" 24, "SOFT" 16, "WONK" 0;
}

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

/* A layout class must never outrank the hidden attribute. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/**
 * Headings are Plus Jakarta Sans. Fraunces is reserved for the hero alone —
 * a display serif used on every heading stops being an event, and a page that
 * has to convince a sceptical reader needs one voice raised, not five.
 */
h1,
h2,
h3 {
  font-family: var(--body);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0;
}

/* The one display moment. Fraunces at its heaviest, with the optical axis set
   for the size it is actually used at. */
.display {
  font-family: var(--display);
  font-variation-settings: var(--optical-hero);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.02;
  margin: 0;
}

/* An eyebrow is a small label: spaced, monospace, never a sentence. */
.eyebrow {
  font-family: var(--data);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

a {
  color: var(--accent);
}

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

/* ---------------------------------------------------------- the scope ladder

   Four rungs, a filled marker on the active one, a hairline spine connecting
   them. A reach reference on the marketing page, and the rail legend in the
   dashboard. */

.ladder {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.ladder::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: var(--border-strong);
}

.rung {
  position: relative;
  display: grid;
  grid-template-columns: 11px 1fr;
  gap: 14px;
  align-items: baseline;
  padding: 9px 0;
}

.rung-mark {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  transform: translateY(2px);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.rung[aria-selected="true"] .rung-mark,
.rung.is-on .rung-mark {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 4px rgb(29 78 216 / 0.14);
}

.rung-name {
  font-family: var(--data);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}

.rung-reach {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
