/* ============================================================================
   home.css — the directory homepage.

   Depends on tokens.css + base.css + archive.css, and is loaded after all
   three: the homepage reuses the archive's card grid (.rgrid / .tcard), its
   empty state (.noresults) and its disclosure block verbatim, and adds only the
   blocks that exist nowhere else.

   NO NEW COLOURS AND NO NEW TYPE. Every value below is a token already declared
   in tokens.css. The only genuinely new thing on this page is form controls —
   the rest of the site has none, because every other filter is a link — so the
   <select> and the checkbox are styled here and nowhere else.

   Same breakpoints as its siblings: 1180 (gutters step down), 980 (two-column
   blocks collapse), 640 (the 390px artboard).
   ========================================================================== */

.home { padding: 0 var(--pad) 8px; }

/* ---------------------------------------------------------------------------
   1 · Hero + the primary filter
   -------------------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: var(--gap);
  align-items: center;
  margin: 32px 0 12px;
  padding: 44px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-hero);
}

.hero-copy .eyebrow { margin-bottom: 12px; }
.hero h1 {
  font-size: 50px;
  line-height: 1.04;
  letter-spacing: -0.026em;
  max-width: 15ch;
}
.hero-lede {
  margin-top: 16px;
  max-width: var(--measure);
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* The one line on the page that is measured rather than written. */
.hero-live {
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 9px 15px;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--ink-2);
  background: var(--success-tint);
  border: 1px solid var(--success-line);
  border-radius: 999px;
}
.hero-live b { color: var(--success-ink); font-weight: 500; }

/* -- The filter form ------------------------------------------------------- */
.hfind {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 26px;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xl);
}
.hfind-t {
  font-size: 19px;
  letter-spacing: -0.012em;
  margin-bottom: 2px;
}
.hfind-f { display: flex; flex-direction: column; gap: 7px; }
.hfind-l {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* A native <select> with the UA arrow replaced by our own chevron. `appearance:
   none` is the only way to make the control match the rest of the system, and
   the chevron is a sibling span rather than a background image so it inherits
   currentColor and needs no data URI. `pointer-events: none` on it keeps the
   whole box clickable, including the arrow. */
.hfind-sel { position: relative; display: block; }
.hfind-s {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 13px 42px 13px 14px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.3;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  /* Long option labels must not stretch the control and blow the grid open. */
  max-width: 100%;
  text-overflow: ellipsis;
}
.hfind-s:hover { border-color: var(--sage-line); }
.hfind-chev {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%) rotate(90deg);
  display: inline-flex;
  font-size: 15px;
  color: var(--ink-3);
  pointer-events: none;
}

.hfind-c {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 2px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-2);
  cursor: pointer;
}
/* 24x24 is the WCAG 2.5.8 (AA) floor for a discrete control, and this is the
   only checkbox on either site. It measured 22x22 at 390px — inside the box
   drawn below, which stays 18px so the tick keeps its proportions. The target
   grows by padding, not by scaling the mark. */
.hfind-c input {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  padding: 3px;
  background-clip: content-box;
  box-sizing: content-box;
  margin: 1px 0 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
}
.hfind-c input:checked {
  background: var(--sage);
  border-color: var(--sage);
  box-shadow: inset 0 0 0 3px var(--surface);
}
.hfind .btn { margin-top: 4px; }
.hfind-note {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-3);
  text-wrap: pretty;
}

/* ---------------------------------------------------------------------------
   Section furniture, shared by every block below the hero
   -------------------------------------------------------------------------- */

.hsec { margin-top: 56px; }
.hsec--tint {
  padding: 36px;
  background: var(--sage-tint);
  border: 1px solid var(--sage-line-soft);
  border-radius: var(--radius-xl);
}

.hsec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 32px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.hsec-head .eyebrow { margin-bottom: 9px; display: flex; align-items: center; gap: 7px; }
/* 28ch, not 22: at 22 a 28-character heading ("Browse by what you're facing")
   broke onto a second line, which reads as an accident rather than a decision.
   The genuinely long ones still wrap, and `text-wrap: balance` from base.css
   splits them evenly when they do. */
.hsec-head h2 { font-size: 32px; letter-spacing: -0.02em; max-width: 28ch; }
.hsec-lede {
  margin-top: 12px;
  max-width: var(--measure);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-3);
  text-wrap: pretty;
}
.hsec--tint .hsec-lede { color: var(--ink-2); }

.hsec-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--sage-deep);
  white-space: nowrap;
}
.hsec-foot { margin-top: 20px; }
.hsec-foot--quiet {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: var(--measure);
  text-wrap: pretty;
}

/* ---------------------------------------------------------------------------
   3 · Why this is different — three tiles, each with a figure
   -------------------------------------------------------------------------- */

.htiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
}
.htile {
  min-width: 0;
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
}
.htile-i {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
  border-radius: 11px;
  background: var(--sage-tint);
  color: var(--sage-deep);
  font-size: 19px;
}
.htile-n {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.htile-n b {
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.htile-n span { font-size: 12.5px; line-height: 1.4; color: var(--ink-3); }
.htile h3 { font-size: 19px; letter-spacing: -0.012em; }
.htile-b {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* ---------------------------------------------------------------------------
   4/5/6 · Browse chips — states, specialties, languages
   -------------------------------------------------------------------------- */

.hchips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr));
  gap: 10px;
}
/* 190px so the twelve leading states land as two rows of six on the desktop
   artboard rather than 5 + 5 + 2, which reads as a list that ran out. */
.hchips--wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); }
.hchips--lang { grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }

.hchip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 13px 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  font-size: 14px;
  line-height: 1.3;
  color: var(--ink);
}
.hchip:hover {
  background: var(--sage-tint);
  border-color: var(--sage-line);
  color: var(--sage-deep);
  text-decoration: none;
}
/* A long term ("Coping with life changes") must wrap inside its own box rather
   than push the grid wider than the page. */
.hchip-l { min-width: 0; overflow-wrap: anywhere; }
.hchip-n {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
}
.hchip:hover .hchip-n { color: var(--sage-deep); }

/* The rest of the states, behind a <details> — the same disclosure primitive
   the filter rail and the profile bio use, and the same no-JavaScript rule. */
.hmore { margin-top: 12px; }
.hmore-sum {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 2px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--sage-deep);
  cursor: pointer;
  list-style: none;
}
.hmore-sum::-webkit-details-marker { display: none; }
.hmore-sum::marker { content: ""; }
.hmore-chev { display: inline-flex; font-size: 14px; }
.hmore[open] > .hmore-sum .hmore-chev { transform: rotate(90deg); }
.hmore[open] .hchips { margin-top: 8px; }

/* ---------------------------------------------------------------------------
   7 · More ways to search
   -------------------------------------------------------------------------- */

.hways {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 14px;
}
.hway {
  display: grid;
  min-width: 0;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--ink);
}
.hway:hover { border-color: var(--sage-line); box-shadow: var(--shadow-md); text-decoration: none; color: var(--ink); }
.hway-i {
  display: inline-flex;
  margin-bottom: 12px;
  font-size: 18px;
  color: var(--sage);
}
.hway-n {
  font-family: var(--font-serif);
  font-size: 27px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.018em;
  font-variant-numeric: tabular-nums;
}
.hway-l { margin-top: 6px; font-size: 14.5px; font-weight: 500; line-height: 1.35; }
.hway-s { margin-top: 5px; font-size: 12.5px; line-height: 1.5; color: var(--ink-3); }

/* ---------------------------------------------------------------------------
   8 · How it works
   -------------------------------------------------------------------------- */

.hsteps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
  counter-reset: hstep;
}
.hstep {
  min-width: 0;
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
}
.hstep-n {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--sage);
  color: var(--on-sage);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1;
}
.hstep h3 { font-size: 18.5px; letter-spacing: -0.012em; }
.hstep p {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: pretty;
}
/* The disclosure, on the path somebody actually walks — not only in the footer. */
.hstep-disc {
  margin-top: 16px;
  padding: 16px 18px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 920px;
}

/* ---------------------------------------------------------------------------
   9 · Prose
   -------------------------------------------------------------------------- */

.hprose-body { max-width: 68ch; }
.hprose-body h3 {
  margin-top: 30px;
  font-size: 21px;
  letter-spacing: -0.014em;
}
.hprose-body h3:first-child { margin-top: 0; }
.hprose-body p {
  margin-top: 12px;
  font-size: 15.5px;
  line-height: 1.72;
  color: var(--ink-2);
  text-wrap: pretty;
}
.hprose-body b { color: var(--ink); font-weight: 500; font-family: var(--font-mono); font-size: 0.92em; }

/* ---------------------------------------------------------------------------
   10 · Blog strip
   -------------------------------------------------------------------------- */

.hposts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
}
.hpost {
  min-width: 0;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
}
.hpost-t { font-size: 19px; line-height: 1.25; letter-spacing: -0.012em; }
.hpost-t a { color: var(--ink); }
.hpost-t a:hover { color: var(--sage-deep); }
.hpost .tsub { margin-top: 8px; }
.hpost-x {
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* ---------------------------------------------------------------------------
   11 · FAQ
   -------------------------------------------------------------------------- */

.hfaq {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 14px 32px;
}
.hfaq-i {
  min-width: 0;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.hfaq-q { font-size: 18px; letter-spacing: -0.012em; }
.hfaq-a {
  margin-top: 9px;
  font-size: 14px;
  line-height: 1.68;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* Above the 1180 breakpoint the prose sits beside its own heading rather than
   under it: a 68ch column of body text is the right measure and always will be,
   but left alone under a full-width heading it leaves half the desktop artboard
   empty and reads as a section that failed to load. Same column-plus-rail idiom
   the profile page uses, in mirror image. Below 1180 it stacks, which is what a
   narrower screen wants anyway. */
@media (min-width: 1181px) {
  .hprose {
    display: grid;
    grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
    gap: var(--gap);
    align-items: start;
  }
  .hprose > .hsec-head { display: block; margin-bottom: 0; }
  .hprose > .hsec-head h2 { max-width: none; }
}

/* ==========================================================================
   1180 → the hero headline follows the gutters down
   ========================================================================== */
@media (max-width: 1180px) {
  .hero { padding: 36px; }
  .hero h1 { font-size: 42px; }
  .hsec-head h2 { font-size: 28px; }
}

/* ==========================================================================
   980 → the hero stacks; the filter form sits under the promise
   ========================================================================== */
@media (max-width: 980px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: stretch; }
  .hero h1 { max-width: 18ch; }
  .hsec { margin-top: 44px; }
  .hsec--tint { padding: 28px; }
  .hfaq { gap: 0 28px; }
}

/* ==========================================================================
   640 → the 390px artboard
   ========================================================================== */
@media (max-width: 640px) {
  .home { padding-bottom: 0; }

  .hero {
    margin: 18px 0 8px;
    padding: 24px 20px;
    border-radius: 20px;
    gap: 22px;
  }
  .hero h1 { font-size: 30px; line-height: 1.1; letter-spacing: -0.02em; max-width: none; }
  /* THE READING SIZES GO UP, THE CHROME SIZES DO NOT. Every paragraph below is
     something somebody reads a sentence of; captions, counters, eyebrows and
     axis labels are labels and stay where they were. The rule applied across
     the four page sheets is 15px minimum for a paragraph and 16px where it is
     the primary thing on the screen. */
  .hero-lede { margin-top: 12px; font-size: 16px; }
  .hero-live { margin-top: 16px; font-size: 13px; padding: 9px 14px; }
  .hfind { padding: 18px; gap: 12px; border-radius: 16px; }
  .hfind-t { font-size: 17px; }
  .hfind-s { padding: 13px 38px 13px 12px; font-size: 16px; min-height: 48px; }
  .hfind-note { font-size: 13px; }
  /* The checkbox is 18px but the LABEL is the control — it wraps the input, so
     the whole two-line row toggles it. Sized here so that is true of the hit
     box as well as of the behaviour. */
  .hfind-c { min-height: 44px; padding: 4px 0; font-size: 15px; }
  .hfind-c input { width: 22px; height: 22px; }

  .hsec { margin-top: 36px; }
  .hsec--tint { padding: 22px 18px; border-radius: 18px; }
  .hsec-head { margin-bottom: 18px; gap: 12px; }
  .hsec-head h2 { font-size: 24px; letter-spacing: -0.016em; max-width: none; }
  .hsec-lede { margin-top: 10px; font-size: 15.5px; }
  .hsec-more { min-height: 44px; font-size: 15px; }

  .htiles, .hsteps, .hposts, .hways { gap: 12px; }
  .htile, .hstep { padding: 20px; border-radius: 16px; }
  .htile-n b { font-size: 29px; }
  .htile h3, .hstep h3 { font-size: 17px; }
  .htile-b, .hstep p { font-size: 15.5px; }

  .hchips, .hchips--wide, .hchips--lang { grid-template-columns: repeat(auto-fill, minmax(min(100%, 148px), 1fr)); gap: 8px; }
  .hchip { min-height: 48px; padding: 11px 12px; font-size: 14.5px; border-radius: 11px; }
  .hmore-sum { min-height: 44px; }

  .hway { padding: 16px; }
  .hway-n { font-size: 24px; }
  .hway-l { font-size: 15px; }
  .hway-s { font-size: 13.5px; }

  .hprose-body h3 { margin-top: 24px; font-size: 19px; }
  .hprose-body p { margin-top: 10px; font-size: 16px; line-height: 1.68; }

  .hpost { padding: 18px; border-radius: 16px; }
  .hpost-t { font-size: 17px; }
  .hpost-t a { display: inline-block; padding: 12px 0; margin: -12px 0; }
  .hpost-x { font-size: 14.5px; }

  .hfaq-i { padding: 18px 0; }
  .hfaq-q { font-size: 16.5px; }
  .hfaq-a { font-size: 15.5px; }
}

/* Print: the search form is dead weight on paper, the prose is not. */
@media print {
  .hfind, .hways, .hero-live { display: none; }
  .hero, .htile, .hstep, .hpost { box-shadow: none; break-inside: avoid; }
}
