/* ==========================================================================
   family.css — shared design system for the Syndicate brand family
   --------------------------------------------------------------------------
   CANONICAL COPY   sites/_family/family.css
   MIRRORED COPIES  sites/fractionalsyndicate/src/family.css
                    sites/syndicatesystems/src/family.css

   ALL THREE COPIES MUST STAY IN SYNC. Edit the canonical copy first, then
   copy it over both site copies. Never edit a site copy directly.

   This file owns the palette, type, spacing, and base components.
   It does NOT decide which accent a site uses or whether a site is
   light-led or navy-led. Each site sets that in its own styles.css by
   overriding --accent-on-light / --accent-on-navy and choosing the surface
   class on <body>.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Palette and global tokens
   -------------------------------------------------------------------------- */

:root {
  /* Brand neutrals. Shared by both sites, never overridden. */
  --ink: #0b1b33;        /* primary text on light; dark section backgrounds */
  --ink-2: #13284a;      /* raised surfaces on navy */
  --steel: #eef1f4;      /* light page background (cool, not cream) */
  --paper: #ffffff;      /* cards and alternate light sections */
  --line: #cbd3dd;       /* borders and dividers on light */
  --line-dark: #2a4066;  /* borders and dividers on navy */
  --muted: #44505f;      /* secondary text on light */
  --muted-dark: #b7c3d3; /* secondary text on navy */

  /* Per-site accents. Each site overrides these two in its own styles.css.
     The defaults below are deliberately neutral so an un-themed page is
     still legible rather than silently wrong. */
  --accent-on-light: var(--ink);
  --accent-on-navy: var(--muted-dark);

  /* Type */
  --font-display: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* One radius scale. Buttons 4px, panels 6px. Nothing else. */
  --radius-btn: 4px;
  --radius-panel: 6px;

  /* Layout */
  --maxw: 1200px;
  --gutter: 24px;
  --measure: 70ch; /* ~70 characters at 18px body */

  /* Vertical rhythm */
  --space-section: 104px;
  --space-section-lg: 112px;
}

/* --------------------------------------------------------------------------
   2. Surface contexts
   --------------------------------------------------------------------------
   Every component reads --fg / --fg-muted / --surface / --border / --accent.
   Those are re-declared by the surface class on an ancestor, so the same
   markup works on light and navy without variant classes on each component.

   Apply .on-steel / .on-paper / .on-navy to <body> or to a <section>.
   -------------------------------------------------------------------------- */

:root,
.on-steel {
  --bg: var(--steel);
  --surface: var(--paper);
  --surface-2: var(--steel);
  --fg: var(--ink);
  --fg-muted: var(--muted);
  --border: var(--line);
  --accent: var(--accent-on-light);
  /* Text placed on top of an --accent fill. White on both light accents
     (#9C520A 5.7:1, #1D5F8C 6.9:1) clears AA. */
  --accent-fg: var(--paper);
}

.on-paper {
  --bg: var(--paper);
  --surface: var(--steel);
  --surface-2: var(--paper);
  --fg: var(--ink);
  --fg-muted: var(--muted);
  --border: var(--line);
  --accent: var(--accent-on-light);
  --accent-fg: var(--paper);
}

.on-navy {
  --bg: var(--ink);
  --surface: var(--ink-2);
  --surface-2: var(--ink);
  --fg: var(--paper);
  --fg-muted: var(--muted-dark);
  --border: var(--line-dark);
  --accent: var(--accent-on-navy);
  /* The navy accents are light tints, so white on top of them fails AA
     (2.1:1 and 1.9:1). Navy text on the accent fill clears it comfortably
     (8.2:1 and 9.2:1). This is the one place --accent-fg flips. */
  --accent-fg: var(--ink);
}

/* --------------------------------------------------------------------------
   3. Base
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* --------------------------------------------------------------------------
   4. Type
   --------------------------------------------------------------------------
   Display face is Archivo 700/800, set tight with slight negative tracking.
   The expanded width axis is reserved for the hero headline only.
   -------------------------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--fg);
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.625rem, 6.5vw, 4.5rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.022em;
}

/* Hero headline only. Requires the wdth axis to be loaded from Google Fonts. */
.hero-headline {
  font-stretch: 112%;
}

h2 {
  font-size: clamp(1.875rem, 3.6vw, 2.625rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.018em;
}

h3 {
  font-size: 1.3125rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h4 {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.005em;
}

p {
  margin: 0 0 1.1em;
  max-width: var(--measure);
}

p:last-child {
  margin-bottom: 0;
}

strong,
b {
  font-weight: 600;
  color: var(--fg);
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* Sentence-case label above a headline. Not all caps, not monospace. */
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--fg-muted);
  margin: 0 0 14px;
}

.lede {
  font-size: 1.1875rem;
  line-height: 1.55;
  color: var(--fg-muted);
}

.muted {
  color: var(--fg-muted);
}

.prose {
  max-width: var(--measure);
}

.small {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--fg-muted);
}

/* --------------------------------------------------------------------------
   5. Layout
   -------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  background: var(--bg);
  color: var(--fg);
  padding-block: var(--space-section);
}

.section-lg {
  padding-block: var(--space-section-lg);
}

/* Heading block that opens a section. Slightly wider than the body measure
   so a display-size headline still breaks at two or three lines. */
.section-head {
  max-width: 760px;
  margin-bottom: 44px;
}

.section-head > p {
  margin-top: 18px;
  color: var(--fg-muted);
}

.stack > * + * {
  margin-top: 18px;
}

.grid {
  display: grid;
  gap: 24px;
  align-items: start;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Main text column beside a narrower side column. */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 56px;
  align-items: start;
}

/* --------------------------------------------------------------------------
   6. Buttons
   --------------------------------------------------------------------------
   Real <a>/<button> elements. Minimum 44px tall.
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-btn);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 86%, var(--fg));
  border-color: color-mix(in srgb, var(--accent) 86%, var(--fg));
}

.btn-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--fg);
}

.btn-secondary:hover {
  border-color: var(--accent);
}

.btn-sm {
  min-height: 44px;
  padding: 9px 16px;
  font-size: 0.9375rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

/* --------------------------------------------------------------------------
   7. Panels and cards
   -------------------------------------------------------------------------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  padding: 30px 28px;
}

.panel > h3 {
  margin-bottom: 12px;
}

.panel > p {
  color: var(--fg-muted);
}

/* The one panel per page that is being pointed at. */
.panel-accent {
  border-color: var(--accent);
  border-width: 1px;
  box-shadow: inset 3px 0 0 var(--accent);
}

/* Small sentence-case marker, e.g. "Start here". */
.tag {
  display: inline-block;
  margin-bottom: 14px;
  padding: 3px 10px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-btn);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--accent);
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  margin-bottom: 12px;
}

.panel-meta {
  font-size: 0.9375rem;
  color: var(--fg-muted);
}

.panel-price {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 0.9375rem;
  color: var(--fg-muted);
}

/* --------------------------------------------------------------------------
   8. Lists
   --------------------------------------------------------------------------
   .item-list  unordered, hairline-separated, optional bold lead-in.
   .plain-list unordered, small accent marker.
   .steps      ordered, numbered. Use ONLY where the content is a real
               sequence. Never number an unordered list.
   -------------------------------------------------------------------------- */

.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: var(--measure);
}

.item-list > li {
  padding-block: 22px;
  border-top: 1px solid var(--border);
  color: var(--fg-muted);
}

.item-list > li:first-child {
  border-top: 0;
  padding-top: 0;
}

.item-list > li:last-child {
  padding-bottom: 0;
}

.item-list > li > strong {
  color: var(--fg);
}

.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: var(--measure);
}

.plain-list > li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 12px;
  color: var(--fg-muted);
}

.plain-list > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.plain-list > li:last-child {
  margin-bottom: 0;
}

.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
}

.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 54px;
  padding-block: 24px;
  border-top: 1px solid var(--border);
  color: var(--fg-muted);
  max-width: calc(var(--measure) + 54px);
}

.steps > li:first-child {
  border-top: 0;
  padding-top: 0;
}

.steps > li:last-child {
  padding-bottom: 0;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 24px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.steps > li:first-child::before {
  top: 0;
}

.steps > li > strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin-bottom: 6px;
}

.step-output {
  display: block;
  margin-top: 8px;
  font-size: 0.9375rem;
  color: var(--fg-muted);
}

/* --------------------------------------------------------------------------
   9. Quote
   -------------------------------------------------------------------------- */

.quote {
  margin: 0;
  padding: 24px 0 24px 24px;
  border-left: 3px solid var(--accent);
  max-width: var(--measure);
}

.quote > p {
  font-size: 1.1875rem;
  line-height: 1.5;
  color: var(--fg);
}

.quote > footer {
  margin-top: 12px;
  font-size: 0.9375rem;
  color: var(--fg-muted);
}

/* --------------------------------------------------------------------------
   10. Header and navigation
   -------------------------------------------------------------------------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 12px 18px;
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-btn);
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--fg);
  text-decoration: none;
}

.brand-accent {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  cursor: pointer;
}

.nav-toggle > span {
  display: block;
  width: 20px;
  height: 2px;
  margin-inline: auto;
  background: var(--fg);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu a:not(.btn) {
  font-size: 1rem;
  font-weight: 500;
  color: var(--fg);
  text-decoration: none;
}

.nav-menu a:not(.btn):hover {
  color: var(--accent);
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   11. Footer
   -------------------------------------------------------------------------- */

.site-footer {
  background: var(--bg);
  color: var(--fg);
  border-top: 1px solid var(--border);
  padding-block: 44px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}

.footer-links a {
  font-size: 0.9375rem;
  color: var(--fg-muted);
}

.footer-legal {
  font-size: 0.9375rem;
  color: var(--fg-muted);
  margin: 0;
  max-width: none;
}

/* --------------------------------------------------------------------------
   12. Focus, motion, and other accessibility guarantees
   -------------------------------------------------------------------------- */

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Both accents clear 3:1 against their own surface, so the ring above is
   visible everywhere. Buttons fill with the accent, so they get a ring in
   the foreground colour instead. */
.btn-primary:focus-visible,
.skip-link:focus-visible {
  outline-color: var(--fg);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   13. Responsive
   --------------------------------------------------------------------------
   Target: no horizontal scrolling at 390px.
   -------------------------------------------------------------------------- */

@media (max-width: 960px) {
  :root {
    --space-section: 72px;
    --space-section-lg: 80px;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .split {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }
}

@media (max-width: 720px) {
  :root {
    --gutter: 20px;
    --space-section: 64px;
    --space-section-lg: 64px;
  }

  body {
    font-size: 17px;
  }

  .nav {
    position: relative;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    min-width: 232px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-panel);
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-menu > li > a:not(.btn) {
    display: block;
    padding: 11px 10px;
    min-height: 44px;
  }

  .panel {
    padding: 24px 20px;
  }

  /* Stack call-to-action pairs rather than letting them wrap unevenly. */
  .btn-row {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-menu .btn {
    width: 100%;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
