/* site/assets/home/home.css: the landing page's own layer.

   Loaded after /assets/craton-ui.css and built only from its --ui-* tokens,
   so both themes come from the design system. Everything here is a page
   part the design system does not have yet (the answer card with its map,
   the layer diagram, the backtest chart, the rate list);
   each is written so it could move into craton-ui.css unchanged.
   Nothing here fetches anything: no remote fonts, images or imports. */

.hm-page main { overflow-x: clip; }

/* ---------------------------------------------------------------- hero */

.hm-hero {
  position: relative; overflow: hidden; isolation: isolate;
  padding: var(--ui-space-8) 0 var(--ui-space-9);
  background: var(--ui-bg); color: var(--ui-ink);
}
.hm-hero-backdrop { position: absolute; inset: 0; z-index: -1; }
/* The loop carries a caption strip and logos along its bottom edge; the
   frame runs past the band so they sit under the fade. */
.hm-hero-backdrop video {
  position: absolute; left: 0; top: 0; width: 100%; height: calc(100% + 64px);
  object-fit: cover; object-position: 50% 30%; opacity: 0.85;
}
.hm-hero-backdrop::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 34%, rgba(7, 9, 13, 0.5), rgba(7, 9, 13, 0.82) 70%),
    linear-gradient(180deg, rgba(7, 9, 13, 0.1) 40%, var(--ui-bg) 100%);
}
.hm-hero-text { max-width: 900px; margin: 0 auto; text-align: center; }
.hm-hero .ui-hero-title { color: #ffffff; }
.hm-hero .ui-lede { margin-left: auto; margin-right: auto; max-width: 40ch; }
.hm-hero .ui-actions { justify-content: center; }
.hm-hero-fine {
  margin: var(--ui-space-6) auto 0; max-width: 72ch; text-align: center;
  font-size: var(--ui-type-fine); line-height: 1.5; color: var(--ui-muted);
}

/* The answer card: one stored run, drawn the way the start flow draws it. */
.hm-answer {
  margin: var(--ui-space-7) auto 0; max-width: 1000px;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--ui-space-7);
  align-items: center; padding: 26px 28px 20px;
  border-radius: var(--ui-radius-xl); background: var(--ui-glass-strong);
  border: 1px solid var(--ui-line-strong); box-shadow: var(--ui-shadow-3);
  -webkit-backdrop-filter: blur(22px) saturate(1.2); backdrop-filter: blur(22px) saturate(1.2);
}
.hm-answer p { margin: 0; }
.hm-answer-top {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 14.5px; font-weight: var(--ui-weight-semibold); color: var(--ui-ink-2);
}
.hm-answer-top::before {
  content: ""; flex: none; width: 8px; height: 8px; margin-top: 0.45em; border-radius: 50%; background: var(--ui-good);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ui-good) 22%, transparent);
}
.hm-answer .ui-stat-num { margin-top: 14px; font-size: var(--ui-type-stat-md); line-height: 1; }
.hm-answer .ui-stat-label { margin-top: 10px; font-size: 16.5px; }
.hm-answer .ui-chips { margin-top: 16px; }
.hm-answer .ui-chip { font-size: 13.5px; min-height: 30px; }
.hm-answer-id {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 18px;
  padding-top: 14px; border-top: 1px solid var(--ui-line);
  font-size: 13px; color: var(--ui-muted);
}
.hm-answer-id a { color: var(--ui-accent); font-weight: var(--ui-weight-medium); }

.hm-map {
  position: relative; margin: 0; border-radius: var(--ui-radius-lg); overflow: hidden;
  background: var(--ui-sea); border: 1px solid var(--ui-line);
}
.hm-map svg { display: block; width: 100%; height: auto; }
.hm-land { fill: none; stroke: var(--ui-land); stroke-width: 2.3; stroke-linecap: round; }
.hm-halo { fill: var(--ui-tint); opacity: 0.28; }
.hm-pin { fill: var(--ui-tint); stroke: var(--ui-surface); stroke-width: 2; }
/* The labels on the pins are the design system's .ui-map-label. */
.hm-map .ui-map-legend { left: 10px; bottom: 10px; }

/* ------------------------------------------------------ the layer diagram */

.hm-stack { margin: var(--ui-space-8) auto 0; max-width: 980px; }
.hm-stack-top {
  display: flex; align-items: center; gap: 16px; padding: 22px 24px;
  border-radius: var(--ui-radius-lg); border: 1.5px dashed var(--ui-line-strong);
  background: var(--ui-surface);
}
.hm-stack-top svg {
  flex: none; width: 44px; height: 44px; fill: none; stroke: var(--ui-muted);
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.hm-stack-name { display: block; font: 660 20px/1.25 var(--ui-font-display); letter-spacing: -0.015em; color: var(--ui-ink); }
.hm-stack-sub { display: block; margin-top: 2px; font-size: 15px; color: var(--ui-muted); }
.hm-stack-wire {
  position: relative; display: flex; justify-content: center; height: 64px;
}
.hm-stack-wire::before, .hm-stack-wire::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 2px; border-radius: 2px;
  background: linear-gradient(180deg, var(--ui-line-strong), var(--ui-accent));
}
.hm-stack-wire::before { left: 30%; }
.hm-stack-wire::after { right: 30%; }
.hm-stack-wire span {
  align-self: center; position: relative; z-index: 1;
  padding: 5px 14px; border-radius: var(--ui-radius-pill);
  background: var(--ui-accent-soft); color: var(--ui-ink);
  font: var(--ui-weight-semibold) 13px/1.2 var(--ui-font-mono);
}
.hm-stack-base {
  padding: 14px; border-radius: var(--ui-radius-xl);
  background: color-mix(in srgb, var(--ui-accent) 7%, var(--ui-surface));
  border: 1.5px solid color-mix(in srgb, var(--ui-accent) 38%, transparent);
  box-shadow: var(--ui-ring), var(--ui-shadow-1);
}
.hm-stack-brand {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 6px 10px 14px;
}
.hm-stack-brand b { font: var(--ui-weight-bold) 14px/1 var(--ui-font-display); letter-spacing: 0.22em; color: var(--ui-ink); }
.hm-stack-brand span { font-size: 14px; color: var(--ui-muted); }
.hm-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.hm-tile {
  display: flex; flex-direction: column; gap: 4px; height: 100%; min-width: 0;
  padding: 20px 18px 18px; border-radius: var(--ui-radius-lg);
  background: var(--ui-surface); border: 1px solid var(--ui-line);
  color: var(--ui-ink); text-decoration: none;
  transition: transform var(--ui-dur) var(--ui-ease), box-shadow var(--ui-dur) var(--ui-ease);
}
.hm-tile:hover { transform: translateY(-2px); box-shadow: var(--ui-shadow-2); }
.hm-tile:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 3px; }
.hm-tile svg {
  width: 40px; height: 40px; margin-bottom: 14px; fill: none; stroke: var(--ui-accent);
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}
.hm-tile-title { font: 660 18px/1.25 var(--ui-font-display); letter-spacing: -0.015em; }
.hm-tile-line { font-size: 14.5px; line-height: 1.4; color: var(--ui-muted); }

.hm-for { margin: var(--ui-space-7) auto 0; text-align: center; font-size: 16px; color: var(--ui-muted); }
.hm-for a { color: var(--ui-ink-2); }
.hm-center-quiet { display: flex; justify-content: center; }
.hm-center-quiet .ui-quiet { width: min(100%, 620px); }
.hm-center-quiet .ui-quiet > summary { display: flex; justify-content: center; }
.hm-center-quiet .ui-quiet-body { padding-left: 0; max-width: none; }
.hm-builds { margin-top: 8px; }
.hm-builds .ui-row-sub { font-size: 14px; }

/* The model cards are the design system's link choice cards (a.ui-choice). */

/* --------------------------------------------------------- the three steps */

.hm-art-sheet { fill: var(--ui-bg); stroke: var(--ui-line-strong); stroke-width: 1.5; }
.hm-art-ink { stroke: var(--ui-muted); stroke-width: 3; stroke-linecap: round; opacity: 0.55; }
.hm-art-key { stroke: var(--ui-accent); stroke-width: 3; stroke-linecap: round; }
.hm-art-track { stroke: var(--ui-line-strong); stroke-width: 3; stroke-linecap: round; }
.hm-art-done { stroke: var(--ui-good); stroke-width: 3; stroke-linecap: round; }
.hm-art-node { stroke: var(--ui-surface); stroke-width: 3; }
.hm-art-queued { fill: var(--ui-queued); }
.hm-art-running { fill: var(--ui-running); }
.hm-art-good { fill: var(--ui-good); }
.hm-art-halo { fill: var(--ui-running); opacity: 0.18; }
.hm-art-label { fill: var(--ui-muted); font: 600 11px var(--ui-font-text); }
.hm-art-wash { fill: var(--ui-accent-soft); }
.hm-art-line { fill: none; stroke: var(--ui-accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.hm-art-dot { fill: var(--ui-accent); stroke: var(--ui-surface); stroke-width: 2.5; }
.hm-art-base { stroke: var(--ui-line-strong); stroke-width: 1.5; }

/* ------------------------------------------------------------ the proof */

.hm-proof-head {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--ui-space-8);
  align-items: end;
}
.hm-proof-head .ui-lede { max-width: 40ch; }
.hm-proof .ui-stat-num { font-size: var(--ui-type-stat); }
.hm-proof .ui-stat-label { max-width: 40ch; }
.hm-bt { margin: var(--ui-space-8) 0 0; }
.hm-bt-plot { position: relative; }
.hm-bt svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
/* Grid, bars, marks and axis are the design system's chart parts; the axis
   text is drawn a size down because the plot is scaled up from its viewBox. */
.hm-bt .ui-chart-axis { font-size: 11px; }
.bt-cross { stroke: var(--ui-ink-2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.hm-bt-tip {
  display: none; position: absolute; top: -8px; left: 0;
  padding: 6px 10px; border-radius: var(--ui-radius-sm); white-space: nowrap; pointer-events: none;
  background: var(--ui-ink); color: var(--ui-bg); font-size: 13px; font-weight: var(--ui-weight-medium);
  font-variant-numeric: tabular-nums; transform: translateY(-100%);
}
.hm-bt-axis { display: none; }
.hm-bt-fine { margin: var(--ui-space-5) 0 0; max-width: 100ch; }
.hm-bt-fine span[data-figure] { color: var(--ui-ink-2); }

.hm-proofs {
  list-style: none; margin: var(--ui-space-9) 0 0; padding: var(--ui-space-7) 0 0;
  border-top: 1px solid var(--ui-line);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--ui-space-7);
}
.hm-proofs li { min-width: 0; }
.hm-proofs h3 { font-size: 19px; line-height: 1.25; }
.hm-proofs p { margin: 6px 0 10px; font-size: 15.5px; line-height: 1.45; color: var(--ui-muted); }
.hm-proofs a { font-size: 15px; font-weight: var(--ui-weight-medium); }

/* ------------------------------------------------------- the developer band */

.hm-dev { align-items: center; }
.hm-dev .ui-card-links { margin-top: var(--ui-space-6); }
/* The terminal card is the design system's .ui-term; the call sits a
   little closer to its answer here. */
.hm-term pre[data-cede-call] { padding-bottom: 4px; }
.hm-term .hm-resp { padding-top: 10px; }

.hm-more { margin-top: var(--ui-space-8); padding-top: var(--ui-space-2); border-top: 1px solid var(--ui-line); }
.hm-more .ui-quiet { margin-top: var(--ui-space-4); }
.hm-more .ui-quiet-body { max-width: none; }
.hm-more .ui-quiet-body p { max-width: 72ch; }
.hm-more pre[data-cede-call] {
  margin: 0 0 8px; padding: 10px 14px; border-radius: var(--ui-radius-md);
  background: var(--ui-surface); border: 1px solid var(--ui-line);
  font: 12.5px/1.55 var(--ui-font-mono); color: var(--ui-ink-2);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
#hero-json {
  max-height: 420px; overflow: auto; padding: 14px 16px; border-radius: var(--ui-radius-md);
  background: var(--ui-surface); border: 1px solid var(--ui-line);
  font: 12.5px/1.55 var(--ui-font-mono); color: var(--ui-ink-2); white-space: pre;
}
#hero-json .k { color: var(--ui-ink); }
.provenance { margin: 0; }
.provenance code { font-size: 0.85em; }

/* ------------------------------------------------------- the call to act */

.hm-cta .ui-band-head { margin-bottom: var(--ui-space-7); }
.hm-rates {
  width: min(100%, 520px); margin: 0 auto; border-collapse: separate; border-spacing: 0;
  border-radius: var(--ui-radius-md); overflow: hidden;
  background: var(--ui-surface); border: 1px solid var(--ui-line); box-shadow: var(--ui-shadow-1);
}
.hm-rates th, .hm-rates td { padding: 15px 20px; border-top: 1px solid var(--ui-line); font-size: 16px; }
.hm-rates tr:first-child th, .hm-rates tr:first-child td { border-top: 0; }
.hm-rates th { text-align: left; font-weight: var(--ui-weight-regular); color: var(--ui-ink-2); }
.hm-rates td { text-align: right; font-weight: var(--ui-weight-semibold); color: var(--ui-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hm-rates-note { margin: var(--ui-space-4) auto 0; text-align: center; font-size: 14.5px; color: var(--ui-muted); }

/* ------------------------------------------------------- the scope line */

.hm-scope { padding: var(--ui-space-8) 0 var(--ui-space-7); border-top: 1px solid var(--ui-line); background: var(--ui-bg); }
.hm-scope p { margin: 0 0 8px; max-width: 96ch; font-size: 13px; line-height: 1.55; color: var(--ui-muted); }
.hm-scope .hm-clause { color: var(--ui-ink-2); font-weight: var(--ui-weight-medium); }
.hm-scope a { color: var(--ui-muted); }

/* --------------------------------------------------------------- widths */

@media (max-width: 980px) {
  .hm-answer { grid-template-columns: minmax(0, 1fr); gap: var(--ui-space-6); max-width: 620px; }
  .hm-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-proofs { grid-template-columns: minmax(0, 1fr); gap: var(--ui-space-6); }
  .hm-proof-head { grid-template-columns: minmax(0, 1fr); gap: var(--ui-space-7); }
}
@media (max-width: 640px) {
  .hm-art-label { display: none; }  /* the step drawings shrink to a row's thumbnail */
  .hm-bt svg { height: 150px; }
  .hm-bt .ui-chart-mark, .hm-bt .ui-chart-axis { display: none; }
  .hm-bt-axis {
    display: flex; justify-content: space-between; margin-top: -12px;
    font-size: 12.5px; color: var(--ui-muted); font-variant-numeric: tabular-nums;
  }
}
@media (max-width: 480px) {
  .hm-hero { padding: var(--ui-space-8) 0 var(--ui-space-8); }
  .hm-answer { margin-top: var(--ui-space-8); padding: 20px 16px 16px; border-radius: var(--ui-radius-lg); }
  .hm-answer-top { font-size: 13.5px; }
  .hm-stack-top { padding: 16px; gap: 12px; }
  .hm-stack-top svg { width: 36px; height: 36px; }
  .hm-stack-wire { height: 52px; }
  .hm-stack-base { padding: 10px; }
  .hm-tiles { gap: 8px; }
  .hm-tile { padding: 16px 14px 14px; }
  .hm-tile svg { width: 32px; height: 32px; margin-bottom: 10px; }
  .hm-tile-title { font-size: 16.5px; }
  .hm-tile-line { font-size: 13.5px; }
  .hm-rates th, .hm-rates td { padding: 14px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .hm-tile:hover { transform: none; }
}
