/* The Family Helpdesk — one stylesheet, Direction B brand system.
   Palette, type scale and pairing rules are the brand system's; the only decisions
   made here are layout ones. Two grounds, deliberately: ink for the home page, the
   start page and navigation; cool white for long-form reading. Do not unify them. */

:root {
  --ink:      #14181B;
  --ink-2:    #1D2429;   /* raised panel on ink */
  --white:    #F2F4F5;   /* cool white — the reading ground */
  --mist:     #C6CED4;
  --steel:    #46525A;
  --orange:   #E2580F;   /* FIELD COLOR ONLY — never type.
                            UI-SCALE type on an orange field is always --ink:
                            4.79:1, passes AA for normal text. At UI scale cool
                            white on orange is 3.38:1 and marigold is 1.83:1;
                            both fail, so neither is available in this stylesheet.
                            DISPLAY-SCALE type is a different threshold — the
                            brand system's thumbnail template T4 puts a cool-white
                            numeral on orange at 3.38:1, which passes the 3:1
                            large-text rule. T4 is correct; do not "fix" it to
                            match this file. */
  --marigold: #F0A81E;   /* accent type, on dark only — never on light */
  --paper-2:  #E7EAEC;   /* raised panel on cool white */

  --sans: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --head: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

  --measure: 34rem;      /* long-form line length */
  --pad: clamp(1.25rem, 4vw, 3.5rem);
}

/* Self-hosted, no CDN. If a woff2 is missing the stack above keeps the site
   fully legible — see GET-FONTS.md at the repo root. */
@font-face { font-family: 'Archivo'; src: url('fonts/archivo-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Archivo'; src: url('fonts/archivo-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Public Sans'; src: url('fonts/public-sans-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Public Sans'; src: url('fonts/public-sans-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Public Sans'; src: url('fonts/public-sans-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('fonts/jetbrains-mono-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('fonts/jetbrains-mono-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap; }

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

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

body {
  margin: 0;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.55;
  text-wrap: pretty;
}
body.ground-ink   { background: var(--ink);   color: var(--white); }
body.ground-white { background: var(--white); color: var(--ink); }

img, svg { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { font-family: var(--head); font-weight: 700; letter-spacing: -0.03em;
  line-height: 1.06; margin: 0; }

/* ---------- links ----------
   Orange is a field color and never type, so light-ground links are ink with a
   thick underline; the hover state puts a marigold FIELD behind ink text. On ink,
   marigold is the accent type color. */
a { color: inherit; }
.ground-white a { color: var(--ink); text-decoration-thickness: 2px;
  text-underline-offset: 3px; }
.ground-white a:hover { background: var(--marigold); color: var(--ink);
  text-decoration-color: var(--ink); }
.ground-ink a { color: var(--marigold); text-decoration-thickness: 2px;
  text-underline-offset: 3px; }
.ground-ink a:hover { color: var(--white); }

:focus-visible { outline: 3px solid var(--marigold); outline-offset: 3px; }
.ground-white :focus-visible { outline-color: var(--orange); }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--pad); top: 0.75rem; z-index: 10; background: var(--orange);
  color: var(--ink); padding: 0 1.25rem; font-weight: 700; text-decoration: none;
  display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- header ---------- */
.topbar {
  background: var(--ink); color: var(--white);
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 2rem;
  padding: 1rem var(--pad);
  border-bottom: 3px solid var(--orange);
}
.lockup { display: flex; align-items: center; gap: 0.75rem; text-decoration: none;
  color: var(--white); padding: 0.25rem 0; }
.lockup:hover { background: none; color: var(--white); }
.lockup-text { display: flex; flex-direction: column; }
.lockup-text strong { font-family: var(--head); font-weight: 700; font-size: 1.25rem;
  letter-spacing: -0.03em; line-height: 1.1; }
.lockup-text span { font-size: 0.85rem; font-weight: 600; color: var(--mist); }
.topbar nav { margin-left: auto; }
.topbar ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; list-style: none;
  margin: 0; padding: 0; }
.topbar a { color: var(--white); font-weight: 600; font-size: 1.05rem;
  text-decoration: none; display: flex; align-items: center;
  min-height: 44px; padding: 0 0.35rem; }
.topbar a:hover { color: var(--marigold); text-decoration: underline;
  text-decoration-thickness: 2px; text-underline-offset: 5px; }
.topbar a[aria-current="page"] { color: var(--marigold);
  box-shadow: inset 0 -4px 0 var(--orange); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; background: var(--orange);
  font-weight: 700; font-size: 1.125rem; line-height: 1.3;
  padding: 0.85rem 1.5rem; min-height: 44px; text-decoration: none;
  border: 3px solid var(--orange);
}
/* Both grounds named so this beats .ground-ink a / .ground-white a on specificity.
   The button is identical on ink and on cool white, by intent rather than by
   accident of which ground rule happens to win. */
.ground-ink .btn, .ground-white .btn { color: var(--ink); }
.ground-ink .btn:hover, .ground-white .btn:hover {
  background: var(--ink); border-color: var(--ink); color: var(--white); }

/* ---------- home ---------- */
main { display: block; }
.hero { padding: clamp(2.5rem, 6vw, 5rem) var(--pad) clamp(2rem, 5vw, 4rem);
  display: grid; gap: clamp(2rem, 5vw, 4rem);
  grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 60rem) { .hero { grid-template-columns: minmax(0, 1fr) 16rem; } }
.hero h1 { font-size: clamp(2.25rem, 6vw, 3.375rem); max-width: 22ch; }
.lede { font-size: clamp(1.25rem, 2.5vw, 1.5rem); font-weight: 600; line-height: 1.4;
  max-width: 30ch; margin: 1.25rem 0 0; }
.ground-ink .lede { color: var(--mist); }
.positioning { margin: 2rem 0 0; padding: 1.5rem 1.75rem;
  background: var(--ink-2); border-left: 6px solid var(--orange); max-width: 44rem; }
.positioning p { font-family: var(--mono); font-size: 1.0625rem; line-height: 1.65;
  margin: 0; color: var(--white); }
.positioning cite { display: block; margin-top: 0.9rem; font-family: var(--sans);
  font-style: normal; font-weight: 700; font-size: 0.95rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--marigold); }
.hero-cta { margin: 2rem 0 0; }

.portrait { margin: 0; }
.portrait img { background: var(--ink-2); padding: 2.5rem; width: 100%;
  max-width: 16rem; }
.portrait figcaption { margin-top: 0.75rem; font-family: var(--mono);
  font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--mist); }

.videos { padding: clamp(2rem, 5vw, 4rem) var(--pad); border-top: 2px solid var(--steel); }
.videos h2, .signup h2, .routes-soon h2 { font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600; }
.vid-grid { display: grid; gap: 1.75rem; margin-top: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.vid a { display: flex; flex-direction: column; gap: 0.5rem; text-decoration: none;
  background: var(--ink-2); padding-bottom: 1.25rem; height: 100%; color: var(--white); }
.vid a:hover { color: var(--white); }
.vid a:hover .vid-title { text-decoration: underline; text-decoration-thickness: 2px;
  text-underline-offset: 4px; text-decoration-color: var(--marigold); }
.vid img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--ink); }
.vid-kicker { font-family: var(--mono); font-size: 0.8125rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--marigold); margin: 1rem 1.25rem 0; }
.vid-title { font-family: var(--head); font-weight: 700; font-size: 1.3125rem;
  letter-spacing: -0.02em; line-height: 1.2; margin: 0 1.25rem; }
.vid-meta { font-size: 0.9375rem; font-weight: 600; color: var(--mist);
  margin: 0.25rem 1.25rem 0; }
.videos-more { margin: 2rem 0 0; font-weight: 700; }
.videos-more a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- start / 404 ---------- */
.page-head { padding: clamp(2.5rem, 6vw, 4.5rem) var(--pad) 0; }
.page-head h1 { font-size: clamp(2.25rem, 5.5vw, 3.375rem); }
.narrow { max-width: 44rem; padding-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.routes { list-style: none; margin: 2.5rem 0 0; padding: 0 var(--pad);
  display: grid; gap: 1.25rem; max-width: 56rem; }
.page-head .routes { padding: 0; margin-top: 2rem; }
.route { background: var(--ink-2); border-left: 6px solid var(--orange);
  padding: 1.5rem 1.75rem; }
.route h2 { font-size: clamp(1.375rem, 3vw, 1.75rem); }
.route h2 a { text-decoration: none; }
.route h2 a:hover { text-decoration: underline; text-decoration-thickness: 3px;
  text-underline-offset: 5px; }
.route p { margin: 0.75rem 0 0; color: var(--mist); }
.route-go a { font-weight: 700; color: var(--marigold); }
.routes.plain { display: grid; gap: 0.5rem; font-weight: 700; }
.routes.plain a { display: inline-flex; align-items: center; min-height: 44px; }
/* The recovery address on the two signup-failure pages. Its own line, not inline
   mid-sentence: it is the only remaining route to getting subscribed, and inside a
   line box the 44px minimum cannot apply. */
.rescue { display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.4rem; }
.rescue a { display: inline-flex; align-items: center; min-height: 44px;
  font-weight: 700; }

.confirm { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 1rem;
  max-width: 40rem; }
.confirm li { background: var(--ink-2); border-left: 6px solid var(--orange);
  padding: 1rem 1.25rem; color: var(--mist); }
.confirm strong { color: var(--white); }

.routes-soon { padding: clamp(2rem, 5vw, 3.5rem) var(--pad) 0; max-width: 52rem; }
.routes-soon p { color: var(--mist); }
.routes-soon strong { color: var(--white); }

/* ---------- long-form ---------- */
.prose { padding: clamp(2.5rem, 6vw, 4.5rem) var(--pad) clamp(3rem, 7vw, 5rem);
  max-width: calc(var(--measure) + var(--pad) * 2); }
.prose h1 { font-size: clamp(2.125rem, 5vw, 3rem); }
.prose h2 { font-size: clamp(1.375rem, 3vw, 1.75rem); font-weight: 600;
  margin: 2.75rem 0 0; }
.prose p { margin: 1.25rem 0 0; }
.prose .lede { color: var(--steel); }
.prose-cta { margin-top: 2.5rem; }
.policy { font-family: var(--head); font-weight: 700; font-size: 1.25rem;
  line-height: 1.35; letter-spacing: -0.02em;
  border-left: 6px solid var(--orange); padding: 1.125rem 1.25rem;
  background: var(--paper-2); margin: 2rem 0 0; }
.policy-list { margin: 1.25rem 0 0; padding-left: 1.25rem; }
.policy-list li { margin-top: 0.75rem; }

.items { list-style: none; counter-reset: item; margin: 2.5rem 0 0; padding: 0;
  display: grid; gap: 2rem; }
.item { border-top: 3px solid var(--ink); padding-top: 1.25rem; }
.item h2 { margin: 0; }
.item-when { font-family: var(--mono); font-size: 0.9375rem; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--steel); }
.item-get { margin-top: 1.5rem; }

/* ---------- signup ---------- */
.signup { padding: clamp(2.5rem, 6vw, 4rem) var(--pad); margin-top: clamp(2.5rem, 6vw, 4rem); }
.signup.dark { background: var(--ink-2); border-top: 3px solid var(--orange); }
.signup.light { background: var(--paper-2); border-top: 3px solid var(--ink);
  padding: clamp(1.75rem, 4vw, 2.5rem); }
.signup-copy { max-width: 34rem; margin: 1rem 0 0; }
.signup.dark .signup-copy { color: var(--mist); }
.signup-optional { margin: 0.75rem 0 0; font-family: var(--mono); font-size: 0.9375rem;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--steel); }
.signup-form { margin-top: 1.75rem; max-width: 34rem; }
.signup-form label { display: block; font-weight: 700; font-size: 1rem;
  letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 0.6rem; }
.signup.dark .signup-form label { color: var(--marigold); }
.signup-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.signup-row input { flex: 1 1 15rem; font-family: var(--sans); font-weight: 500;
  font-size: 1.125rem; padding: 0.8rem 0.9rem; min-height: 52px;
  border: 3px solid var(--ink); background: var(--white); color: var(--ink); }
.signup.dark .signup-row input { border-color: var(--mist); }
.signup-row input::placeholder { color: var(--steel); }
.signup-row button { font-family: var(--sans); font-weight: 700; font-size: 1.125rem;
  padding: 0.8rem 1.5rem; min-height: 52px; cursor: pointer;
  background: var(--orange); color: var(--ink); border: 3px solid var(--orange); }
.signup-row button:hover { background: var(--ink); border-color: var(--ink);
  color: var(--white); }
.signup.dark .signup-row button:hover { background: var(--white); color: var(--ink);
  border-color: var(--white); }

/* ---------- footer ---------- */
.sitefoot { background: var(--ink); color: var(--white); border-top: 3px solid var(--orange);
  padding: clamp(2.5rem, 6vw, 3.5rem) var(--pad); }
.foot-inner { display: grid; gap: 1.75rem; max-width: 70rem; }
.foot-cols { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.sitefoot h2 { font-size: 1rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--marigold); font-family: var(--sans); }
.sitefoot p { margin: 0.75rem 0 0; }
.sitefoot a { color: var(--marigold); display: inline-flex; align-items: center;
  min-height: 44px; }
.sitefoot a:hover { color: var(--white); }
.foot-links { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.25rem; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.foot-warn { font-size: 1rem; color: var(--mist); max-width: 30rem; }
.foot-warn.light { color: var(--steel); }
.foot-legal { font-family: var(--mono); font-size: 0.875rem; color: var(--mist);
  border-top: 1px solid var(--steel); padding-top: 1.25rem; }

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