/*
 * css/pages/home.css: the home page (SPEC 5.2), group home. Tokens and shared components come from css/tokens.css
 * and css/site.css (the stage, the orb, the terminal, the ticker, chips, states, the table); this sheet only lays out
 * what is the home page's own: the stage columns (copy, counters and the typed call beside the orb and the wordmark),
 * the works-with strip, the registry search, the three step band with its drawings and the providers table.
 * Designed at 360px first. Every colour is a token: there is no colour literal in this file.
 */

/* ------------------------------------------------------------------------------------------------ section frame */
.home-head { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; margin-bottom: 32px; }
.home-head .lede { max-width: 60ch; }
.home-head--split { flex-direction: row; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 48px; }
.home-head--split > div { display: flex; flex-direction: column; gap: 16px; min-width: 0; flex: 1 1 520px; }
.home-note { font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.home-note .link { color: var(--dim); }
@media (min-width: 820px) { .home-head { margin-bottom: 40px; } }

/* ------------------------------------------------------------------------------------------------ stage */
.page--home .stage { padding-top: calc(var(--header-h) + var(--s6)); padding-bottom: var(--s9); }
html[data-stage][data-notice] .page--home .stage { padding-top: calc(var(--header-h) + var(--s6) + var(--notice-h, 44px)); }
.home-stage::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 60% 42% at 50% 12%, var(--glow-soft), transparent 72%);
}
.page--home .stage__copy { gap: 22px; }
.page--home .stage__copy .lede { max-width: 44ch; }
.page--home .stage__side { gap: 14px; }
.home-wordmark {
  font: 400 22px/1 var(--font-display); text-transform: uppercase;
  letter-spacing: .34em; margin-right: -.34em; color: var(--text);
}
.home-mine { font-size: 14.5px; line-height: 1.5; color: var(--dim); margin-top: -6px; }

/* the four counters: small label, big mono figure, hairlines between */
.home-figures { align-self: stretch; display: flex; flex-direction: column; gap: 12px; min-width: 0; container-type: inline-size; }
.home-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.home-stat { min-width: 0; padding: 14px 12px 14px 0; border-bottom: 1px solid var(--line); }
.home-stat:nth-child(2n) { padding-left: 14px; border-left: 1px solid var(--line); }
.home-stat dt { font: 600 11px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.home-stat dd { margin-top: 8px; min-height: 30px; font: 500 24px/1.2 var(--font-mono); color: var(--text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.home-stat dd.is-launch { display: flex; align-items: center; font-size: 14px; line-height: 1.35; color: var(--muted); }
.home-stat dd .sk--num { width: 4.5em; }

/* four across once the column can hold a figure of eight characters in each cell: the stage's copy column is that wide
   from 1280px up and again between 640px and 1023px, where it spans the page */
@container (min-width: 600px) {
  .home-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
  .home-stat { border-bottom: 0; padding-right: 14px; }
  .home-stat + .home-stat { padding-left: 14px; border-left: 1px solid var(--line); }
}

/* the typed call: every line is laid twice, the typed one over its hidden full text, so the frame never grows */
.home-flow { align-self: stretch; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.home-term { min-height: 260px; box-shadow: var(--shadow-pop); }
.home-term.term--script { min-height: 0; }
.home-term .term__row { min-height: 20px; }
.home-term .term__row > .term__event { grid-area: 1 / 1; padding-left: 2ch; text-indent: -2ch; line-height: 1.55; overflow-wrap: anywhere; }
.home-term .home-term__ghost { visibility: hidden; }

@media (min-width: 640px) {
  .page--home .stage { padding-top: calc(var(--header-h) + var(--s8)); padding-bottom: var(--s10); }
  html[data-stage][data-notice] .page--home .stage { padding-top: calc(var(--header-h) + var(--s8) + var(--notice-h, 44px)); }
  .page--home .stage__copy { gap: 26px; }
  .home-wordmark { font-size: 26px; }
}
@media (min-width: 1024px) {
  .page--home .stage__content { align-items: start; }
  .page--home .stage__side { padding-top: var(--s2); }
  .home-wordmark { font-size: clamp(26px, 2.3vw, 34px); }
}

/* ------------------------------------------------------------------------------------------------ works with */
.home-works {
  display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding-top: 14px;
  background: var(--bg-deep); border-block: 1px solid var(--line); color: var(--body);
}
.home-works__label {
  flex: none; padding-inline: var(--gutter); text-align: center;
  font: 600 11px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); white-space: nowrap;
}
.home-works .ticker { flex: 1 1 auto; min-width: 0; height: 56px; border: 0; background: transparent; }
.home-works .ticker__label { display: none; }
.home-works .ticker__item { gap: 0; padding: 0 26px; }
.home-works .ticker__value { font: 400 17px/1 var(--font-display); letter-spacing: .02em; color: var(--dim); }
@media (min-width: 820px) {
  .home-works { flex-direction: row; align-items: center; gap: 0; padding-top: 0; }
  .home-works__label { padding: 0 8px 0 var(--gutter); text-align: left; }
  .home-works .ticker { height: 72px; }
  .home-works .ticker__value { font-size: 19px; }
}

/* ------------------------------------------------------------------------------------------------ search */
.home-finder { display: flex; flex-direction: column; gap: 14px; }
.home-finder__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.home-finder__field { flex: 1 1 360px; }
.home-finder__field .input { height: 56px; font-size: 17px; }
.home-finder__field .input::-webkit-search-cancel-button { cursor: pointer; }
.home-finder__state { display: inline-flex; align-items: center; gap: 10px; min-height: 24px; font: 500 12.5px/1.4 var(--font-mono); color: var(--muted); }
.home-finder__foot, .home-providers__foot { font-size: 14px; line-height: 1.5; color: var(--muted); }
.home-providers__foot { margin-top: 14px; }

.home-hits { list-style: none; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r3); background: var(--panel); overflow: hidden; box-shadow: var(--shadow-card); }
.home-hits > li + li { border-top: 1px solid var(--line-row); }
.home-hit {
  display: grid; grid-template-columns: 3px minmax(0, 1fr) 18px; align-items: center; gap: 8px 14px;
  min-height: 64px; padding: 14px 14px 14px 12px; color: var(--body);
  transition: background-color var(--t1);
}
.home-hit:hover { background: var(--panel-2); }
.home-hit:focus-visible { outline-offset: -2px; background: var(--panel-2); }
.home-hit .tone-bar { grid-row: 1 / span 2; }
.home-hit__main { grid-column: 2; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.home-hit__top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.home-hit__name { font: 600 16px/1.35 var(--font-body); color: var(--text); overflow-wrap: anywhere; }
/* one line of summary, hard truncated: the whole text is one click away on /service/:id */
.home-hit__sum { font-size: 14px; line-height: 1.45; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-hit__side { grid-column: 2; grid-row: 2; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; min-width: 0; }
.home-hit__price { font: 500 13.5px/1.35 var(--font-mono); color: var(--text); font-variant-numeric: tabular-nums; }
.home-hit__meta { font: 400 12px/1.35 var(--font-mono); color: var(--faint); }
.home-hit__go { grid-column: 3; grid-row: 1 / span 2; width: 18px; height: 18px; color: var(--muted); transition: transform var(--t2) var(--ease-out), color var(--t1); }
.home-hit:hover .home-hit__go { color: var(--accent); transform: translateX(2px); }
@media (min-width: 640px) {
  .home-hit { grid-template-columns: 3px minmax(0, 1fr) auto 18px; gap: 4px 20px; padding: 14px 18px 14px 14px; }
  .home-hit .tone-bar { grid-row: 1; }
  .home-hit__side { grid-column: 3; grid-row: 1; flex-direction: column; flex-wrap: nowrap; align-items: flex-end; gap: 3px; white-space: nowrap; }
  .home-hit__go { grid-column: 4; grid-row: 1; }
}

/* ------------------------------------------------------------------------------------------------ three steps */
.home-steps { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.home-step {
  display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 20px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r3); box-shadow: var(--shadow-card);
}
.home-step .kicker { margin-top: 8px; }
.home-step__text { font-size: 15.5px; line-height: 1.55; color: var(--body); }
@media (min-width: 640px) { .home-step { padding: 24px; } }
@media (min-width: 820px) { .home-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }

/* the drawings: strokes and fills are tokens, so both themes redraw them */
.home-step__art {
  display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; padding: 10px 14px;
  background: var(--panel-3); border: 1px solid var(--line-row); border-radius: var(--r2);
  fill: none; stroke: none; stroke-linecap: round; stroke-linejoin: round;
}
.home-step__art .dg-line { stroke: var(--line-input); stroke-width: 1.5; }
.home-step__art .dg-accent { stroke: var(--accent); stroke-width: 1.75; }
.home-step__art .dg-fill { fill: var(--panel-2); }
.home-step__art .dg-tint { fill: var(--accent-tint); }
.home-step__art .dg-dot, .home-step__art .dg-bar { fill: var(--accent); }
.home-step__art .dg-dash { stroke-dasharray: 3 4; }

/* ------------------------------------------------------------------------------------------------ providers table */
.home-table-wrap { box-shadow: var(--shadow-card); }
.home-table td { vertical-align: top; }
.home-table th.r, .home-table td.r { text-align: right; }
.home-table td.num { padding-top: 16px; white-space: nowrap; color: var(--text); }
.home-svc { display: flex; align-items: stretch; gap: 14px; min-width: 0; }
.home-svc .tone-bar { min-height: 40px; }
.home-svc__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.home-svc__top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.table a.link.home-svc__name { font-size: 15.5px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.table a.link.home-svc__name:hover { color: var(--accent); }
.home-svc__sum {
  max-width: 68ch; font-size: 13.5px; line-height: 1.45; color: var(--muted); overflow: hidden; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
}
.home-unit { font-size: 12px; color: var(--muted); }
.home-calls { display: block; margin-top: 3px; font-size: 12px; color: var(--faint); }
@media (min-width: 640px) {
  .home-table th:first-child { width: 56%; }
}
@media (max-width: 639px) {
  .home-table thead {
    position: absolute; width: 1px; height: 1px; overflow: hidden; white-space: nowrap;
    clip: rect(0 0 0 0); clip-path: inset(50%);
  }
  .home-table, .home-table tbody, .home-table td { display: block; }
  .home-table tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; padding: 16px 14px; border-bottom: 1px solid var(--line-row); }
  .home-table tbody tr:last-child { border-bottom: 0; }
  .home-table td, .home-table td.num { padding: 0; border: 0; white-space: normal; overflow-wrap: anywhere; }
  .home-table td:first-child { grid-column: 1 / -1; }
  .table a.link.home-svc__name { display: inline-flex; align-items: center; min-height: 44px; margin-block: -10px; }
  .home-table td.r { text-align: left; }
  .home-table td[data-label]::before {
    content: attr(data-label); display: block; margin-bottom: 4px;
    font: 600 11px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
  }
}
