/*
 * Theme "Night Watch" (custom theme-factory theme, built from HELM's own dark tokens).
 * Layout: an editorial left-aligned 12-column page on a ship's-bridge night palette. One bold moment
 * (the 3D mark on its chart in the hero); everything after it is quiet type, hairlines, and real screens.
 */
:root {
  color-scheme: dark;
  --night: #0f0f0e;       /* page */
  --hold: #131312;        /* alternate bands */
  --deck: #191917;        /* raised surfaces */
  --rule: #292825;        /* hairlines */
  --rule-2: #3a3935;      /* stronger hairlines, inputs */
  --chalk: #ece8e0;       /* primary text */
  --fog: #a8a39a;         /* secondary text */
  --haze: #8c887f;        /* captions */
  --signal: #d0705f;      /* errors only */

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;

  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: clamp(1.5rem, 1.2rem + 1vw, 1.875rem);
  --step-3: clamp(2rem, 1.4rem + 2.4vw, 3.25rem);
  --step-4: clamp(2.5rem, 1.6rem + 3.8vw, 4.5rem);

  --ease: cubic-bezier(0.2, 0, 0, 1);
  --max: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--night);
  color: var(--chalk);
  font: 400 var(--step-0)/1.6 var(--sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--night); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; text-wrap: balance; font-weight: 400; }
p, dl, dd, figure { margin: 0; }
:focus-visible { outline: 2px solid var(--chalk); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: 16px; top: -48px; z-index: 100; background: var(--chalk); color: var(--night); padding: 8px 12px; border-radius: 6px; }
.skip:focus { top: calc(8px + env(safe-area-inset-top, 0px)); }

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 80px);
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
@media (min-width: 760px) {
  .wrap { padding-left: max(40px, env(safe-area-inset-left, 0px)); padding-right: max(40px, env(safe-area-inset-right, 0px)); }
}

/* Buttons: HELM's 8px radius, not pills */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 20px; border-radius: 8px;
  background: var(--chalk); color: var(--night); border: 1px solid var(--chalk);
  font: 600 0.9375rem/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: background 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease);
}
.btn:hover { background: #fff; border-color: #fff; }
.btn--ghost { background: transparent; color: var(--chalk); border-color: var(--rule-2); }
.btn--ghost:hover { background: transparent; border-color: var(--fog); }
.btn--small { min-height: 36px; padding: 0 14px; font-size: 0.8125rem; }
.btn--block { width: 100%; }
.btn:disabled { opacity: 0.35; cursor: default; }

/* Nav */
.nav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: rgba(15, 15, 14, 0.8);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}
.nav__in { display: flex; align-items: center; gap: 32px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 600 1rem/1 var(--sans); letter-spacing: 0.06em; }
.brand__mark { width: 16px; height: 19px; fill: currentColor; }
.nav__links { display: none; gap: 28px; margin-left: auto; }
.nav__links a { color: var(--fog); text-decoration: none; font-size: var(--step--1); transition: color 150ms; }
.nav__links a:hover { color: var(--chalk); }
.nav .btn { margin-left: auto; }
@media (min-width: 920px) { .nav__links { display: flex; } .nav .btn { margin-left: 0; } }

/* Hero */
.hero { position: relative; overflow: hidden; }
.hero__scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero__in { position: relative; display: grid; gap: 24px; justify-items: start; padding-block: 300px 72px; }
.hero__title { font: 300 var(--step-4)/1.02 var(--serif); letter-spacing: -0.022em; max-width: 12ch; }
.hero__title span { display: block; }
.hero__lede { max-width: 46ch; color: var(--fog); font-size: var(--step-1); line-height: 1.55; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.hero__note { color: var(--haze); font-size: var(--step--1); }
@media (min-width: 920px) {
  .hero__in { padding-block: 152px 136px; }
  .hero__in > * { max-width: 540px; }
  .hero__title { max-width: 13ch; }
}
/* The one orchestrated load: copy rises in sequence while the scene fades up. */
@media (prefers-reduced-motion: no-preference) {
  .js .hero__in > * { animation: rise 900ms var(--ease) both; }
  .js .hero__in > :nth-child(2) { animation-delay: 90ms; }
  .js .hero__in > :nth-child(3) { animation-delay: 180ms; }
  .js .hero__in > :nth-child(4) { animation-delay: 260ms; }
  .js .hero__scene { animation: fade 1400ms var(--ease) both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Stage */
.stage { padding-block: 40px 16px; overflow: hidden; }
.stage__persp { perspective: 2000px; perspective-origin: 50% 0%; }
.stage__frame {
  margin: 0 auto; max-width: var(--max);
  border-radius: 12px; overflow: hidden; background: var(--deck);
  outline: 1px solid rgba(255, 255, 255, 0.08); outline-offset: -1px;
  transform-origin: 50% 0%;
  transform: rotateX(var(--tilt, 18deg)) scale(var(--scale, 0.94));
  box-shadow: 0 80px 140px -60px rgba(0, 0, 0, 0.95);
  will-change: transform;
}
.stage__cap { margin: 20px auto 0; max-width: var(--max); color: var(--haze); font-size: var(--step--1); text-align: center; }

/* Works with */
.works { padding-block: 64px 72px; border-bottom: 1px solid var(--rule); }
.works__in { display: grid; gap: 28px; }
.works__title { font: 500 var(--step--1)/1.4 var(--sans); color: var(--fog); }
.works__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
@media (min-width: 640px) { .works__list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .works__list { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.works__list li { display: flex; align-items: center; gap: 12px; color: var(--fog); font-size: var(--step--1); min-width: 0; }
.logo { flex: none; width: 20px; height: 20px; background: var(--fog); -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.logo--text { background: none; -webkit-mask: none; mask: none; display: inline-grid; place-items: center; border: 1.5px solid var(--fog); border-radius: 5px; font: 600 11px/1 var(--sans); color: var(--fog); }

/* Sections */
.section { padding-block: clamp(88px, 11vw, 144px); }
.section--alt { background: var(--hold); border-block: 1px solid var(--rule); }
.head { display: grid; gap: 18px; max-width: 760px; margin-bottom: clamp(44px, 6vw, 72px); }
.head h2, .everywhere h2, .invite h2, .faq h2 { font: 300 var(--step-3)/1.08 var(--serif); letter-spacing: -0.016em; }
.head p { color: var(--fog); font-size: var(--step-1); max-width: 58ch; }

/* How it works: a real sequence, joined by a line */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 40px; counter-reset: step; }
@media (min-width: 880px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px; } }
.steps li { position: relative; display: grid; gap: 10px; align-content: start; }
.steps__n {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--rule-2);
  display: inline-grid; place-items: center; font: 400 1.125rem/1 var(--serif); color: var(--chalk);
  background: var(--night); position: relative; z-index: 1; margin-bottom: 10px;
}
@media (min-width: 880px) {
  .steps li:not(:last-child)::after { content: ""; position: absolute; top: 18px; left: 52px; right: -32px; height: 1px; background: var(--rule-2); }
}
.steps h3 { font: 400 var(--step-2)/1.2 var(--serif); }
.steps p { color: var(--fog); max-width: 36ch; }

/* Trial quiz */
.quiz { display: grid; gap: 32px; align-items: start; }
@media (min-width: 980px) { .quiz { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 56px; } }
.quiz__form { display: grid; gap: 28px; min-width: 0; }
.q { border: 0; margin: 0; padding: 0; min-width: 0; }
.q legend { padding: 0; margin-bottom: 16px; font: 400 var(--step-2)/1.2 var(--serif); }
.q__hint { margin-top: 18px; color: var(--haze); font-size: var(--step--1); max-width: 50ch; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 15px;
  border: 1px solid var(--rule-2); border-radius: 8px; color: var(--fog); font-size: 0.9375rem;
  transition: background 140ms var(--ease), color 140ms var(--ease), border-color 140ms var(--ease);
}
.chip:hover span { border-color: var(--haze); color: var(--chalk); }
.chip input:checked + span { background: var(--chalk); border-color: var(--chalk); color: var(--night); }
.chip input:focus-visible + span { outline: 2px solid var(--chalk); outline-offset: 3px; }

.field { display: grid; gap: 8px; }
.field label { font-size: var(--step--1); color: var(--fog); }
.opt { color: var(--haze); }
.field input, .field select {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--rule-2); background: var(--night); color: var(--chalk); font: 400 1rem var(--sans);
}
.field input::placeholder { color: var(--haze); }
.field input:focus, .field select:focus { outline: none; border-color: var(--fog); }
.field--q { max-width: 340px; }

.trial { display: none; gap: 10px; }
.trial__step { font-size: var(--step--1); color: var(--haze); }
.trial__bar { height: 2px; background: var(--rule); overflow: hidden; }
.trial__bar i { display: block; height: 100%; width: 20%; background: var(--chalk); transition: width 420ms var(--ease); }
.trial__nav { display: none; gap: 10px; justify-content: space-between; padding-top: 20px; border-top: 1px solid var(--rule); }
.trial__nav .btn { min-width: 128px; }
.quiz__form.is-stepped { min-height: 360px; align-content: start; }
.quiz__form.is-stepped .trial { display: grid; }
.quiz__form.is-stepped .trial__nav { display: flex; }
.quiz__form.is-stepped .q { display: none; }
.quiz__form.is-stepped .q.is-current { display: block; animation: step 320ms var(--ease) both; }
.quiz__form.is-stepped .q legend { font-size: var(--step-3); font-weight: 300; line-height: 1.1; margin-bottom: 24px; letter-spacing: -0.012em; }
@keyframes step { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }

.plan { min-width: 0; padding: 28px; border-radius: 12px; background: var(--deck); border: 1px solid var(--rule); display: grid; gap: 24px; }
@media (min-width: 980px) { .plan { position: sticky; top: calc(88px + env(safe-area-inset-top, 0px)); } }
.plan__head { display: flex; gap: 14px; align-items: flex-start; padding-bottom: 20px; border-bottom: 1px solid var(--rule); }
.plan__mark { width: 26px; height: 30px; fill: var(--chalk); flex: none; margin-top: 3px; }
.plan__who { min-width: 0; }
.plan__label { font: 400 1.5rem/1.15 var(--serif); }
.plan__sum { font-size: var(--step--1); color: var(--haze); margin-top: 4px; }
.plan__state { margin-left: auto; font-size: 0.75rem; padding: 4px 9px; border-radius: 6px; border: 1px solid var(--rule-2); color: var(--fog); white-space: nowrap; }
.plan__state.is-ready { background: var(--chalk); color: var(--night); border-color: var(--chalk); }
.plan__block { display: grid; gap: 10px; transition: opacity 300ms var(--ease); }
.plan__block h3 { font: 500 var(--step--1)/1.4 var(--sans); color: var(--fog); }
.plan.is-building .plan__block { opacity: 0.3; }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { padding: 4px 10px; border: 1px solid var(--rule-2); border-radius: 6px; font-size: 0.875rem; }
.agentlist { list-style: none; margin: 0; padding: 0; display: grid; border-top: 1px solid var(--rule); }
.agentlist li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: 0.9375rem; }
.agentlist .when { color: var(--haze); font-size: 0.8125rem; white-space: nowrap; }
.plan__build { display: grid; gap: 14px; }
.buildlog { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 0.875rem; color: var(--fog); }
.buildlog li { display: flex; gap: 12px; justify-content: space-between; animation: step 240ms var(--ease) both; }
.buildlog li.is-done::after { content: "Done"; color: var(--haze); }
.plan__hello { font: 300 2rem/1.1 var(--serif); }
.plan__hello:empty { display: none; }
.plan__actions { display: grid; gap: 10px; }
.plan__restart { background: none; border: 0; padding: 6px; color: var(--fog); font: 500 var(--step--1) var(--sans); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; justify-self: center; }
.plan__restart:hover { color: var(--chalk); }

/* Tour */
.tour { display: grid; gap: 24px; }
.tour__tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--rule); }
.tour__tabs::-webkit-scrollbar { display: none; }
.tour__tabs button {
  flex: none; padding: 12px 14px 14px; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  color: var(--haze); font: 500 0.9375rem/1 var(--sans); cursor: pointer; transition: color 150ms var(--ease), border-color 150ms var(--ease);
}
.tour__tabs button:hover { color: var(--chalk); }
.tour__tabs button[aria-selected="true"] { color: var(--chalk); border-bottom-color: var(--chalk); }
.tour__panel { display: grid; gap: 28px; }
@media (min-width: 1040px) { .tour__panel { grid-template-columns: minmax(0, 1fr) 280px; align-items: end; gap: 48px; } }
.tour__frame { border-radius: 12px; overflow: hidden; background: var(--deck); outline: 1px solid rgba(255, 255, 255, 0.07); outline-offset: -1px; aspect-ratio: 16 / 10; max-width: 100%; }
.tour__frame img { width: 100%; height: 100%; object-fit: cover; transition: opacity 240ms var(--ease); }
.tour__frame.is-swapping img { opacity: 0; }
.tour__copy { display: grid; gap: 12px; min-width: 0; padding-bottom: 6px; }
.tour__copy h3 { font: 400 var(--step-2)/1.2 var(--serif); }
.tour__copy p { color: var(--fog); }

/* Agents: a 24-hour watch bill */
.watch { position: relative; display: grid; border-top: 1px solid var(--rule); margin-bottom: 64px; }
.watch__row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px 32px; padding: 18px 0; border-bottom: 1px solid var(--rule); align-items: center; }
@media (min-width: 900px) { .watch__row { grid-template-columns: 200px minmax(0, 1fr) minmax(0, 300px); } }
.watch__name { display: grid; gap: 2px; }
.watch__name b { font-weight: 600; font-size: 0.9375rem; }
.watch__name small { color: var(--haze); font-size: 0.8125rem; }
.watch__what { color: var(--fog); font-size: 0.9375rem; }
.watch__track { position: relative; height: 22px; }
.watch__track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--rule-2); }
.watch__row--axis { padding-block: 12px; }
.watch__row--axis .watch__track::before { display: none; }
.watch__row--axis .watch__track > span { position: absolute; top: 2px; transform: translateX(-50%); font-size: 0.75rem; color: var(--haze); white-space: nowrap; }
.watch__row--axis .watch__track > span:first-child { transform: none; }
.watch__row--axis .watch__track > span:nth-child(5) { transform: translateX(-100%); }
@media (max-width: 899px) { .watch__row--axis .watch__name, .watch__row--axis { display: none; } }
.dot { position: absolute; top: 50%; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%; background: var(--chalk); box-shadow: 0 0 0 4px var(--hold); }
.band { position: absolute; left: 0; right: 0; top: 50%; height: 10px; margin-top: -5px; }
.band--dense { background: repeating-linear-gradient(90deg, var(--chalk) 0 1px, transparent 1px calc(100% / 96)); opacity: 0.75; }
.band--hourly { background: repeating-linear-gradient(90deg, var(--chalk) 0 2px, transparent 2px calc(100% / 24)); }
.band--ondemand { height: 1px; margin-top: 0; background: repeating-linear-gradient(90deg, var(--fog) 0 6px, transparent 6px 12px); }
.watch__now { position: absolute; top: 34px; bottom: 0; width: 0; border-left: 1px dashed var(--fog); pointer-events: none; }
.watch__now span { position: absolute; bottom: -26px; left: 0; transform: translateX(-50%); font-size: 0.75rem; color: var(--chalk); background: var(--hold); padding: 0 6px; }
.agents__shot { display: grid; gap: 14px; }
.agents__shot img { border-radius: 12px; outline: 1px solid rgba(255, 255, 255, 0.07); outline-offset: -1px; }
.agents__shot figcaption { color: var(--haze); font-size: var(--step--1); }

/* Trust */
.rules { display: grid; border-top: 1px solid var(--rule); }
@media (min-width: 820px) { .rules { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 56px; } }
.rules > div { display: grid; gap: 8px; align-content: start; padding: 26px 0 28px; border-bottom: 1px solid var(--rule); }
.rules dt { font: 400 var(--step-2)/1.2 var(--serif); }
.rules dd { color: var(--fog); max-width: 46ch; }

/* Everywhere */
.everywhere { display: grid; gap: 48px; align-items: center; }
@media (min-width: 1000px) { .everywhere { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 72px; } }
.everywhere__shot img { border-radius: 12px; outline: 1px solid rgba(255, 255, 255, 0.07); outline-offset: -1px; }
.everywhere__copy { display: grid; gap: 32px; min-width: 0; }
.pairs { display: grid; border-top: 1px solid var(--rule); }
.pairs > div { display: grid; gap: 4px; align-content: start; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.pairs dt { font-weight: 600; }
.pairs dd { color: var(--fog); }

/* Invite */
.invite__in { display: grid; gap: 40px; }
@media (min-width: 980px) { .invite__in { grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 96px; align-items: center; } }
.invite__copy { display: grid; gap: 20px; }
.invite__copy p { color: var(--fog); font-size: var(--step-1); max-width: 44ch; }
.invite__form { display: grid; gap: 18px; padding: 32px; border-radius: 12px; background: var(--deck); border: 1px solid var(--rule); }
.hp { position: absolute; left: -9999px; }
.invite__status { font-size: var(--step--1); min-height: 1.4em; }
.invite__status.is-error { color: var(--signal); }
.invite__fine { font-size: 0.8125rem; color: var(--haze); text-align: center; }

/* FAQ */
.faq { display: grid; gap: 32px; }
@media (min-width: 980px) { .faq { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 72px; } }
.faq__list { border-top: 1px solid var(--rule); min-width: 0; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; list-style: none; padding: 22px 40px 22px 0; position: relative; font: 500 1.0625rem/1.4 var(--sans); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 9px; height: 9px; margin-top: -7px; border-right: 1.5px solid var(--fog); border-bottom: 1.5px solid var(--fog); transform: rotate(45deg); transition: transform 200ms var(--ease); }
.faq details[open] summary::after { transform: rotate(225deg); margin-top: -2px; }
.faq details p { padding: 0 0 24px; color: var(--fog); max-width: 62ch; }

/* Footer */
.foot { border-top: 1px solid var(--rule); padding-block: 44px calc(44px + env(safe-area-inset-bottom, 0px)); }
.foot__in { display: grid; gap: 16px; }
@media (min-width: 900px) { .foot__in { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 40px; } }
.foot__fine { font-size: 0.8125rem; color: var(--haze); max-width: 72ch; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stage__frame { transform: none; }
  *, *::before, *::after { animation-duration: 0ms !important; transition-duration: 0ms !important; }
}
