/*
  hrz.systems landing page.

  Look: the same tokens as the HRZ console and block page (cool grey surfaces,
  Horizon blue #2747B8, logo navy #021A3C for the hero). Type is Atkinson
  Hyperlegible Next, the console's face, self-hosted.
  Spacing: 8-point grid, 4 for fine detail. Radii by role: 8 controls,
  12 panels, 16 cards that float, 40 the phone body.
*/

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px;
  --s-7: 48px; --s-8: 64px; --s-9: 96px;

  --font: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;

  --bg: #f4f5f7;
  --surface: #ffffff;
  --sunken: #e9ecf0;
  --line: #d5d9df;
  --line-strong: #747b86;
  --text: #14181f;
  --text-2: #454c57;
  --text-3: #5a626e;
  --accent: #2747b8;
  --accent-hover: #1d3690;
  --on-accent: #ffffff;
  --focus: #14181f;

  /* hero: logo navy in both themes */
  --hero: #021a3c;
  --hero-text: #ffffff;
  --hero-text-2: #c5d0e0;
  --hero-btn: #8fb8ff;
  --hero-btn-hover: #b0ccff;
  --on-hero-btn: #0b1530;

  /* the block page inside the phone (same values as engine/blockpage/block.html) */
  --bp-bg: #f4f5f7; --bp-surface: #ffffff; --bp-sunken: #e9ecf0; --bp-line: #d5d9df; --bp-line-strong: #747b86;
  --bp-fg: #14181f; --bp-muted: #454c57; --bp-quiet: #5a626e;
  --bp-act: #2747b8; --bp-act-fg: #ffffff;
  --bp-shadow: 0 1px 2px rgba(20, 24, 31, 0.06), 0 12px 32px rgba(20, 24, 31, 0.08);
  --site-sk: #dfe3e8;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #171a20;
    --sunken: #20242c;
    --line: #2e333d;
    --line-strong: #7a8290;
    --text: #eceef2;
    --text-2: #b8bec9;
    --text-3: #9aa1ae;
    --accent: #8fb8ff;
    --accent-hover: #b0ccff;
    --on-accent: #0b1530;
    --focus: #eceef2;

    --hero: #071427;

    --bp-bg: #0f1115; --bp-surface: #171a20; --bp-sunken: #20242c; --bp-line: #2e333d; --bp-line-strong: #7a8290;
    --bp-fg: #eceef2; --bp-muted: #b8bec9; --bp-quiet: #9aa1ae;
    --bp-act: #8fb8ff; --bp-act-fg: #0b1530;
    --bp-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    --site-sk: #262b34;

    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem; /* 17 */
  line-height: 1.5rem;  /* 24 */
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 4px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--s-4); }

.skip {
  position: absolute; left: var(--s-4); top: -64px; z-index: 10;
  padding: var(--s-3) var(--s-4); background: var(--surface); color: var(--text);
  border-radius: 8px;
}
.skip:focus { top: var(--s-2); }

/* ---------- header (sits on the hero navy) ---------- */

.top { background: var(--hero); color: var(--hero-text); padding-top: env(safe-area-inset-top); }
.top-row { display: flex; align-items: center; justify-content: space-between; min-height: 64px; }
.brand { display: inline-flex; align-items: center; min-height: 48px; }
.brand img { display: block; height: 32px; width: auto; }
.top-link {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 var(--s-2);
  color: var(--hero-text); font-weight: 600; text-decoration: none;
}
.top-link:hover { color: var(--hero-text); text-decoration: underline; }
.top :focus-visible, .hero :focus-visible { outline-color: #ffffff; }

/* ---------- hero ---------- */

.hero { background: var(--hero); color: var(--hero-text); padding: var(--s-5) 0 var(--s-8); }
.hero-grid { display: grid; gap: var(--s-7); }

h1 {
  font-size: 2.5rem;   /* 40 */
  line-height: 3rem;   /* 48 */
  font-weight: 800;
  letter-spacing: -0.01em;
  max-width: 12ch;
}
.lead { margin-top: var(--s-4); color: var(--hero-text-2); max-width: 34rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 var(--s-5);
  border-radius: 8px; border: 1px solid transparent;
  font-weight: 700; text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.btn-hero { margin-top: var(--s-5); background: var(--hero-btn); color: var(--on-hero-btn); }
.btn-hero:hover { background: var(--hero-btn-hover); color: var(--on-hero-btn); }

.hero-phone { display: flex; flex-direction: column; align-items: center; gap: var(--s-3); }
.hero-phone figcaption {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--s-2) var(--s-4);
  color: var(--hero-text-2); font-size: 0.9375rem; line-height: 1.25rem; text-align: center;
}
.replay {
  min-height: 44px; padding: 0 var(--s-4);
  background: transparent; color: var(--hero-text);
  border: 1px solid var(--hero-text-2); border-radius: 8px;
  font: inherit; font-weight: 600; cursor: pointer;
  transition: background-color 120ms ease;
}
.replay:hover { background: rgba(255, 255, 255, 0.08); }
.replay[hidden] { display: none; }

/* ---------- the phone ---------- */

.phone {
  width: 288px; height: 576px; padding: var(--s-2);
  background: #05080d;
  border-radius: 40px;
  box-shadow: 0 0 0 1px #2b3647, 0 24px 48px rgba(0, 0, 0, 0.32);
}
.phone-screen {
  position: relative; height: 100%; overflow: hidden;
  border-radius: 32px;
  background: var(--bp-bg);
  color: var(--bp-fg);
  display: flex; flex-direction: column;
}

/* browser address bar */
.b-bar {
  position: relative; flex: none;
  padding: var(--s-6) var(--s-3) var(--s-2);
  background: var(--bp-surface);
  border-bottom: 1px solid var(--bp-line);
  display: flex; align-items: center; gap: var(--s-2);
}
.b-lock {
  flex: none; width: 8px; height: 8px; margin-left: var(--s-2);
  border: 2px solid var(--bp-quiet); border-radius: 2px;
}
.b-url {
  flex: 1; min-width: 0; height: 32px; padding: 0 var(--s-3);
  display: flex; align-items: center;
  background: var(--bp-sunken); border-radius: 8px;
  font-size: 0.8125rem; line-height: 1rem; color: var(--bp-fg);
  white-space: nowrap; overflow: hidden;
}
.b-progress {
  position: absolute; left: 0; bottom: -1px; width: 100%; height: 4px;
  background: var(--bp-act);
  transform-origin: 0 50%;
  opacity: 0;
}

.b-view { position: relative; flex: 1; }

/* the site that starts loading (grey placeholders, no real content) */
.b-site {
  position: absolute; inset: 0; padding: var(--s-4);
  display: flex; flex-direction: column; gap: var(--s-3);
  background: var(--bp-surface);
  visibility: hidden;
}
.sk { display: block; background: var(--site-sk); border-radius: 4px; }
.sk-banner { height: 96px; border-radius: 8px; }
.sk-line { height: 12px; width: 88%; }
.sk-short { width: 56%; }
.sk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); margin-top: var(--s-1); }
.sk-tile { height: 88px; border-radius: 8px; }

/* the block page, scaled for the phone */
.b-block {
  position: absolute; inset: 0;
  padding: var(--s-5) var(--s-3) var(--s-4);
  background: var(--bp-bg);
  display: flex; flex-direction: column;
}
.bp-logo { display: block; height: 24px; width: auto; margin: 0 auto var(--s-4); }
.bp-card {
  padding: var(--s-4);
  background: var(--bp-surface);
  border: 1px solid var(--bp-line);
  border-radius: 16px;
  box-shadow: var(--bp-shadow);
}
.bp-h { font-size: 1.125rem; line-height: 1.5rem; font-weight: 700; margin-bottom: var(--s-3); }
.bp-site {
  margin-bottom: var(--s-3); padding: var(--s-1) var(--s-2);
  background: var(--bp-sunken); border-radius: 8px;
  font-family: var(--mono); font-size: 0.75rem; line-height: 1rem;
  overflow-wrap: anywhere;
}
.bp-why { margin-bottom: var(--s-3); font-size: 0.8125rem; line-height: 1rem; font-weight: 600; }
.bp-text { margin-bottom: var(--s-4); font-size: 0.8125rem; line-height: 1rem; color: var(--bp-muted); }
.bp-btn {
  display: flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 0 var(--s-3);
  border: 1px solid var(--bp-act); border-radius: 8px;
  background: var(--bp-act); color: var(--bp-act-fg);
  font-size: 0.8125rem; font-weight: 650;
}
.bp-btn + .bp-btn { margin-top: var(--s-2); }
.bp-quiet { background: var(--bp-surface); color: var(--bp-fg); border-color: var(--bp-line-strong); }
.bp-foot { margin-top: auto; text-align: center; color: var(--bp-quiet); font-size: 0.6875rem; line-height: 1rem; }

/* JS on: the animation decides what shows. Without JS the finished block page shows. */
.js-motion .b-block { visibility: hidden; }

/* ---------- sections ---------- */

.band { padding: var(--s-8) 0; }
.band-alt { background: var(--surface); border-block: 1px solid var(--line); }

h2 { font-size: 2rem; line-height: 2.5rem; font-weight: 800; letter-spacing: -0.005em; }
h3 { font-size: 1.25rem; line-height: 1.75rem; font-weight: 700; }
.intro { margin-top: var(--s-3); color: var(--text-2); max-width: 40rem; }

/* platforms: a plain definition list, one row per system */
.platforms { margin-top: var(--s-6); border-top: 1px solid var(--line); }
.pf { padding: var(--s-4) 0; border-bottom: 1px solid var(--line); display: grid; gap: var(--s-1); }
.pf dt { font-size: 1.25rem; line-height: 1.75rem; font-weight: 700; }
.pf dd { color: var(--text-2); max-width: 40rem; }
.note {
  margin-top: var(--s-5); padding: var(--s-4);
  background: var(--sunken); border-radius: 12px;
  max-width: 48rem;
}

/* steps: a real sequence, so real numbers */
.steps { list-style: none; padding: 0; margin-top: var(--s-6); counter-reset: step; display: grid; gap: var(--s-5); }
.steps li { counter-increment: step; display: grid; grid-template-columns: 48px 1fr; column-gap: var(--s-4); align-content: start; }
.steps li::before {
  content: counter(step);
  grid-row: span 2;
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--accent); color: var(--accent);
  font-size: 1.25rem; font-weight: 800;
}
.steps h3 { padding-top: var(--s-2); }
.steps p { margin-top: var(--s-1); color: var(--text-2); max-width: 36rem; }

/* who it's for: one larger panel, one plain column */
.who { margin-top: var(--s-6); display: grid; gap: var(--s-6); }
.who-main {
  padding: var(--s-5);
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
}
.who-main p, .who-side p { margin-top: var(--s-2); color: var(--text-2); }
.who-main ul { margin-top: var(--s-4); padding-left: var(--s-5); display: grid; gap: var(--s-2); }
.who-main li::marker { color: var(--accent); }
.who-side { padding: 0 var(--s-1); }

/* contact */
.contact { background: var(--hero); color: var(--hero-text); padding: var(--s-8) 0; }
.contact p { margin-top: var(--s-2); color: var(--hero-text-2); max-width: 32rem; }
.contact-row { display: grid; gap: var(--s-5); align-items: center; }
.btn-cta { background: var(--hero-btn); color: var(--on-hero-btn); justify-self: start; }
.btn-cta:hover { background: var(--hero-btn-hover); color: var(--on-hero-btn); }
.contact :focus-visible { outline-color: #ffffff; }

/* footer */
.foot { padding: var(--s-6) 0 calc(var(--s-6) + env(safe-area-inset-bottom)); color: var(--text-3); font-size: 0.9375rem; line-height: 1.25rem; }
.foot-row { display: grid; gap: var(--s-3); }
.foot a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- wider screens ---------- */

@media (max-width: 479px) {
  .btn-hero, .btn-cta { width: 100%; }
}

@media (min-width: 768px) {
  .wrap { padding: 0 var(--s-6); }
  .hero { padding: var(--s-6) 0 var(--s-9); }
  h1 { font-size: 3.5rem; line-height: 4rem; }
  .lead { font-size: 1.25rem; line-height: 2rem; }
  .pf { grid-template-columns: 160px 1fr; gap: var(--s-5); padding: var(--s-5) 0; }
  .steps { grid-template-columns: repeat(3, 1fr); gap: var(--s-6); }
  .steps li { grid-template-columns: 1fr; }
  .steps li::before { grid-row: auto; margin-bottom: var(--s-3); }
  .steps h3 { padding-top: 0; }
  .who { grid-template-columns: 3fr 2fr; align-items: start; }
  .who-side { padding: var(--s-5) 0 0; }
  .contact-row { grid-template-columns: 1fr auto; }
  .foot-row { grid-template-columns: 1fr auto; align-items: center; }
  .band { padding: var(--s-9) 0; }
}

@media (min-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr auto; align-items: center; gap: var(--s-8); }
  h1 { font-size: 4.5rem; line-height: 5rem; }
  .phone { width: 320px; height: 656px; }
  .hero-phone { padding-right: var(--s-6); }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .replay { transition: none; }
}
