/*
 * The front page.
 *
 * Wider and quieter than the other three views on purpose. The reference, the
 * guides and the toolbox are working surfaces — dense, bordered, a rail down
 * the left. This one is read once, top to bottom, by someone deciding whether
 * to keep reading, so it gets air, a single column of argument, and the brand's
 * display face doing the talking.
 *
 * Tokens, the top bar, the wordmark and the buttons come from `shell.css`,
 * which every view shares. Nothing in here is allowed to restyle those: a
 * button that changes shape between the front page and the toolbox is a button
 * people stop recognising.
 */

.home {
  --home-max: 1080px;
  padding: 0 20px 80px;
}

.home > * {
  max-width: var(--home-max);
  margin-inline: auto;
}

.home-section {
  padding: 64px 0 8px;
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.home-head {
  max-width: 64ch;
  margin-bottom: 28px;
}

.home-head h2 {
  font-size: clamp(24px, 3.4vw, 34px);
  margin: 6px 0 12px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.lede {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 64ch;
}

/* ── Hero ─────────────────────────────────────────────────────────────── */

.home-hero {
  position: relative;
  overflow: hidden;
  margin-top: 28px;
  padding: 56px 44px 40px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--brand-line);
  background: linear-gradient(160deg, var(--brand-soft), var(--surface) 62%);
}

.home-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 46rem;
}

.home-hero h1 {
  font-size: clamp(34px, 6vw, 58px);
  margin: 12px 0 18px;
  max-width: 18ch;
}

.home-lede {
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 54ch;
  margin-bottom: 26px;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
}

.btn-lg {
  height: 44px;
  padding: 0 20px;
  font-size: 15px;
}

/*
 * The carrier names are a list, not a logo wall. We do not host their marks and
 * would need permission for each; the names carry the same message and cannot
 * go stale into a trademark problem.
 */
.carriers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.carriers li {
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

/*
 * The qualifier under the chip row, and the reason the row is allowed to be a
 * bare list of names: it says how many entries there are, when that was
 * measured, and that the bookable list is a different call. Without it the
 * chips read as a sample of something larger, which is the claim this page
 * used to open with and could not support.
 */
.carriers-note {
  max-width: 62ch;
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
}

.carriers-note code {
  font-size: 12px;
}

.home-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin: 36px 0 0;
  padding-top: 26px;
  border-top: 1px solid var(--brand-line);
}

.home-stats dt {
  font-family: var(--display);
  font-weight: 700;
  font-size: 38px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--brand);
}

.home-stats dd {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: var(--text-muted);
  max-width: 26ch;
}

/*
 * The arc from the top of profrakt.no. Decoration, and `aria-hidden` in the
 * markup for that reason — it is what makes a purple page read as Profrakt's
 * purple page rather than a generic gradient.
 */
.home-hero-arc {
  position: absolute;
  right: -140px;
  top: -180px;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 30% 70%,
    color-mix(in srgb, var(--accent) 34%, transparent),
    transparent 64%
  );
  pointer-events: none;
}

/* ── The live checkout ────────────────────────────────────────────────── */

.co-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.co-controls {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 14px;
  align-items: end;
  padding: 18px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.co-field {
  margin: 0;
  min-width: 0;
}

.co-actions {
  display: flex;
  gap: 8px;
}

.co-card .demo-out {
  padding: 18px 20px 4px;
}

.co-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0 0;
}

.co-second {
  padding: 18px 20px 20px;
}

.co-second .demo-out {
  padding: 16px 0 0;
}

/*
 * The option rows themselves are shared with the guides and the toolbox
 * (`.co`, `.co-option`, `.co-price` live in `reference.css`), so a delivery
 * option looks the same wherever it is drawn. Only the front page's additions
 * are here.
 */
.co-timing {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.co-timing b {
  color: var(--ok);
  font-variant-numeric: tabular-nums;
}

.co-badge {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.co-badge[data-tone="ok"] {
  background: var(--ok-soft);
  color: var(--ok);
}

.co-badge[data-tone="info"] {
  background: var(--info-soft);
  color: var(--info);
}

.co-price-now {
  display: block;
}

.co-price-list {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-faint);
  text-decoration: line-through;
}

.home-fineprint {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--text-muted);
  max-width: 72ch;
}

/* ── Milliseconds ─────────────────────────────────────────────────────── */

.speed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.speed-card {
  padding: 20px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.speed-card p {
  color: var(--text-muted);
  margin-bottom: 8px;
}

.speed-card[data-tone="bad"] {
  border-color: color-mix(in srgb, var(--danger) 26%, var(--border));
  background: color-mix(in srgb, var(--danger-soft) 55%, var(--surface));
}

.speed-card[data-tone="good"] {
  border-color: color-mix(in srgb, var(--ok) 30%, var(--border));
  background: color-mix(in srgb, var(--ok-soft) 55%, var(--surface));
}

.speed-kicker {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.speed-line {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  font-family: var(--mono);
  font-size: 11.5px;
}

.speed-meter {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
  align-items: center;
  margin-top: 16px;
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--brand-line);
  background: var(--brand-soft);
}

.speed-metric-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.speed-metric b {
  font-family: var(--display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

.speed-note {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ── Cards ────────────────────────────────────────────────────────────── */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.card-grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  padding: 20px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.card h3 {
  font-size: 15.5px;
  margin-bottom: 8px;
}

.card p {
  color: var(--text-muted);
  margin: 0 0 10px;
}

.card p:last-child {
  margin-bottom: 0;
}

.card-calls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.card-calls code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 11.5px;
}

.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.card-link:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.card-action {
  font-weight: 650;
  color: var(--brand);
  font-size: 13.5px;
}

/* ── Steps ────────────────────────────────────────────────────────────── */

.steps {
  counter-reset: step;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin: 0 0 22px;
  padding: 0;
}

.step {
  counter-increment: step;
  position: relative;
  padding: 18px 20px 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.step::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--brand-ink);
  font-size: 12px;
  font-weight: 700;
}

.step-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.step-head code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
}

.step p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13.5px;
}

/* ── Split, ticks, truths ─────────────────────────────────────────────── */

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.split-col {
  padding: 26px 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.split-col h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

.split-col > p {
  color: var(--text-muted);
}

.ticks {
  list-style: none;
  margin: 14px 0 18px;
  padding: 0;
}

.ticks li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 13.5px;
}

.ticks li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 6px;
  width: 9px;
  height: 5px;
  border-left: 2px solid var(--ok);
  border-bottom: 2px solid var(--ok);
  transform: rotate(-45deg);
}

.home-section-quiet {
  padding-bottom: 16px;
}

.truths {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.truths li {
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-left: 3px solid var(--warn);
  background: var(--surface);
  color: var(--text-muted);
  max-width: 82ch;
}

.truths b {
  color: var(--text);
}

/* ── Narrow ───────────────────────────────────────────────────────────── */

@media (max-width: 720px) {
  .home-hero {
    padding: 36px 22px 28px;
    margin-top: 16px;
  }

  .home-section {
    padding-top: 48px;
  }

  /* The picker row is three columns of nothing on a phone. Stack it, and let
     the button take the full width so it is the obvious next tap. */
  .co-controls {
    grid-template-columns: 1fr;
  }

  .co-actions .btn {
    width: 100%;
  }

  .home-actions .btn {
    flex: 1 1 auto;
  }
}
