/*
  Sonhelm landing page.
  Tokens come from /tokens.css (copied verbatim from sonhelm-brand/tokens/variables.css).
  Light Default only: the brand defers dark UI, so there is intentionally no dark theme.

  avoid-ai-design-ignore-file: SD1, T1, SD4m
  The Porcelain ground and Industrial Ember accent are the approved Sonhelm palette, not a style pick.
  Inter is required by the brand for website navigation and buttons; Instrument Sans carries everything else.
  IBM Plex Mono is the brand's technical voice; it is used only for status and routing annotations.
*/

/* ---------- Roles ---------- */
:root {
  --canvas: var(--sh-surface-canvas);
  --raised: var(--sh-surface-raised);
  --ink: var(--sh-text-primary);
  --ink-2: var(--sh-text-secondary);
  --ink-muted: var(--sh-text-muted);
  --ember: var(--sh-brand-industrial-ember);
  --graphite: var(--sh-brand-graphite);
  --porcelain: var(--sh-brand-porcelain);
  --titanium: var(--sh-brand-titanium);
  --slate: var(--sh-brand-slate);

  --font-brand: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --font-ui: "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-tech: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --margin: 64px;
  --section: 96px;
  --max: 1440px;
}

@media (max-width: 1023px) {
  :root { --margin: 24px; --section: 80px; }
}
@media (max-width: 767px) {
  :root { --margin: 16px; --section: 64px; }
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-brand);
  font-size: 18px;
  line-height: 28px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--sh-selection-background); color: var(--sh-selection-text); }

:focus-visible {
  outline: 2px solid var(--sh-focus-ring);
  outline-offset: 2px;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--margin);
}

.skip {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 10;
  padding: 8px 16px;
  background: var(--graphite);
  color: var(--porcelain);
  font: 500 16px/24px var(--font-ui);
  border-radius: var(--sh-radius-control);
}
.skip:focus { top: 16px; }

/* ---------- Type ---------- */
.h2 {
  font-family: var(--font-brand);
  font-weight: var(--sh-type-brand-h2-weight);
  font-size: var(--sh-type-brand-h2-size);
  line-height: var(--sh-type-brand-h2-line-height);
  letter-spacing: var(--sh-type-brand-h2-tracking);
  text-wrap: balance;
}
.body-lg { font-size: 20px; line-height: 30px; }
.body { font-size: 18px; line-height: 28px; }
.body-sm { font-size: 16px; line-height: 24px; }
.muted { color: var(--ink-muted); }

.mono {
  font-family: var(--font-tech);
  font-size: var(--sh-type-technical-annotation-size);
  line-height: var(--sh-type-technical-annotation-line-height);
  letter-spacing: var(--sh-type-technical-annotation-tracking);
}

@media (max-width: 767px) {
  .h2 { font-size: 36px; line-height: 44px; letter-spacing: -0.006em; }
  .body-lg { font-size: 18px; line-height: 28px; }
}

/* ---------- Links and buttons ---------- */
.link {
  color: inherit;
  font-family: var(--font-ui);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.link:hover { text-decoration-thickness: 2px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 11px 24px;
  border: 1px solid var(--sh-action-border);
  border-radius: var(--sh-radius-control);
  font: 600 16px/24px var(--font-ui);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease;
  white-space: nowrap;
}

/* Approved primary: Graphite label and 1px Graphite edge on Ember. */
.btn--primary { background: var(--sh-action-default); color: var(--sh-action-on-solid); }
.btn--primary:hover { background: var(--sh-action-hover); }
.btn--primary:active { background: var(--sh-action-pressed); }

/* On the Ember field an Ember button disappears, so actions use Porcelain on Graphite. */
.btn--dark { background: var(--graphite); color: var(--porcelain); }
.btn--dark:hover { background: var(--sh-neutral-800); }
.btn--dark:active { background: var(--sh-neutral-950); }

/* ---------- Hero (Ember marketing field) ---------- */
.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: clamp(680px, 94vh, 980px);
  background: var(--sh-marketing-background);
  color: var(--sh-marketing-text);
}

.nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 48px;
  padding-block: 24px;
}
.nav__logo { flex: none; padding: 13px 0; } /* 0.4H clear space around a 32px lockup */
.nav__logo img { width: 160px; height: auto; }
.nav__links { display: flex; gap: 40px; margin-left: auto; }
.nav__links a {
  color: inherit;
  font: 500 16px/24px var(--font-ui);
  text-decoration: none;
  white-space: nowrap;
  padding-block: 8px;
}
.nav__links a:hover { text-decoration: underline; text-underline-offset: 4px; }

.hero__body:focus { outline: none; }
.hero__body {
  position: relative;
  z-index: 1;
  align-self: center;
  padding-block: 64px;
}
.note {
  font-family: var(--font-tech);
  font-size: 12px;
  line-height: 18px;
  letter-spacing: 0.01em;
  margin-bottom: 32px;
}
.hero__title {
  font-family: var(--font-brand);
  font-weight: var(--sh-type-variations-b-expressive-display-weight);
  font-size: var(--sh-type-variations-b-expressive-display-size);
  line-height: var(--sh-type-variations-b-expressive-display-line-height);
  letter-spacing: var(--sh-type-variations-b-expressive-display-tracking);
  max-width: 12ch;
}
.hero__lead {
  margin-top: 32px;
  max-width: 36ch;
  font-size: var(--sh-type-brand-subheading-size);
  line-height: var(--sh-type-brand-subheading-line-height);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
  margin-top: 48px;
}

/* The Wedge module, oversized and cropped off the field edge, as on the approved poster. */
.hero__wedge {
  --w: clamp(1040px, 92vw, 1560px);
  position: absolute;
  z-index: 0;
  width: var(--w);
  max-width: none;
  right: calc(var(--w) * -0.375);
  bottom: calc(var(--w) * -0.36);
  pointer-events: none;
}

@media (max-width: 1023px) {
  .nav { gap: 24px; }
  .nav__links { gap: 24px; }
  .hero__title {
    font-size: var(--sh-type-website-display-size);
    line-height: var(--sh-type-website-display-line-height);
    letter-spacing: var(--sh-type-website-display-tracking);
  }
  .hero__wedge { --w: 900px; }
}
@media (max-width: 1023px) {
  .nav__links { display: none; }
  .nav__cta { margin-left: auto; }
}
@media (max-width: 767px) {
  .hero { min-height: 0; }
  .nav__cta { margin-left: auto; min-height: 44px; padding: 10px 16px; }
  .nav__logo img { width: 128px; }
  .hero__body { padding-block: 48px 240px; }
  .hero__title { font-size: 56px; line-height: 60px; letter-spacing: -0.025em; }
  .hero__lead { font-size: 20px; line-height: 30px; margin-top: 24px; }
  .hero__actions { margin-top: 32px; }
  .hero__wedge { --w: 680px; bottom: calc(var(--w) * -0.45); }
}
/* Keep the wedge clear of the hero text at tablet and small-laptop widths. */
@media (min-width: 1024px) and (max-width: 1151px) {
  .hero__wedge { right: calc(var(--w) * -0.5); }
}
@media (min-width: 768px) and (max-width: 899px) {
  .hero__body { padding-bottom: 240px; }
  .hero__wedge { --w: 680px; bottom: calc(var(--w) * -0.45); }
}

/* ---------- Signal path / patchbay ---------- */
.chain { padding-block: var(--section); }

.chain__intro {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 24px;
  margin-bottom: 64px;
}
.chain__intro .h2 { grid-column: 1 / span 5; }
.chain__copy { grid-column: 7 / span 6; display: grid; gap: 24px; align-content: start; padding-top: 8px; }
.chain__copy .mono { display: block; margin-top: 8px; }

/* Bus rows are 80px tall; their lines sit at 40, 120 and 200px below the stages. */
.patchbay {
  --label-col: minmax(240px, 1.4fr);
  --row: 80px;
  display: grid;
  grid-template-columns: var(--label-col) repeat(4, minmax(0, 1fr));
  column-gap: 24px;
  position: relative;
}

/* The main path: one Graphite line through every product mark. */
.patchbay::before {
  content: "";
  position: absolute;
  top: 23px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--graphite);
}
.patchbay__label {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  align-self: start;
  position: relative;
  z-index: 1;
  padding: 15px 12px 0 0;
  background: var(--canvas);
  color: var(--ink-muted);
}

.patchbay__key {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  margin-top: 72px;
  padding-right: 24px;
  font-size: 16px;
  line-height: 24px;
  color: var(--ink-2);
}

.patchbay__stages {
  grid-column: 2 / -1;
  grid-row: 1;
  display: grid;
  grid-template-columns: subgrid;
  position: relative;
}
@supports not (grid-template-columns: subgrid) {
  .patchbay__stages { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 24px; }
}

.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  padding-bottom: 32px;
}
.stage__mark {
  position: relative;
  width: 48px;
  height: 48px;
  box-sizing: content-box;
  padding-right: 12px;
  background: var(--canvas);
}
.stage__name {
  margin-top: 24px;
  font-size: var(--sh-type-website-h6-size);
  line-height: var(--sh-type-website-h6-line-height);
  font-weight: 500;
}
.stage__product {
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-muted);
}
.stage__desc {
  margin-top: 12px;
  font-size: 16px;
  line-height: 24px;
  color: var(--ink-2);
  min-height: 96px; /* four lines, so every stage's choices start on the same line */
}
.stage__out {
  margin-top: 16px;
  min-height: 48px;
  font-size: 16px;
  line-height: 24px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 0;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}
.chips__legend,
.signup__label {
  display: block;
  padding: 0;
  margin-bottom: 8px;
  font: 500 14px/20px var(--font-ui);
  color: var(--ink);
}
.chips__legend { color: var(--ink-muted); font-weight: 500; }
.chips label,
.start__options label { position: relative; display: block; }
.chips input,
.start__options input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.chips span,
.start__options span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--sh-border-strong);
  border-radius: var(--sh-radius-control);
  background: var(--raised);
  font: 600 14px/20px var(--font-ui);
  color: var(--ink-2);
  transition: background-color 120ms ease;
}
.chips span::before,
.start__options span::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border: 1px solid var(--graphite);
  background: var(--raised);
}
.chips input:checked + span::before,
.start__options input:checked + span::before { background: var(--ember); }
.start__options span::before { border-radius: 50%; } /* radios read as radios */
.chips input:hover + span,
.start__options input:hover + span { background: var(--sh-neutral-25); color: var(--ink); }
.chips input:checked + span,
.start__options input:checked + span {
  background: var(--sh-selection-background);
  border-color: var(--sh-selection-border);
  color: var(--sh-selection-text);
}
.chips input:focus-visible + span,
.start__options input:focus-visible + span {
  outline: 2px solid var(--sh-focus-ring);
  outline-offset: 2px;
}

/* Send line from a stage down to the deepest bus it uses, with a tap on each bus. */
.send {
  position: absolute;
  left: 23px;
  top: 100%;
  width: 2px;
  height: 0;
  background: var(--graphite);
  transition: height 220ms cubic-bezier(.2, .7, .2, 1);
}
.stage[data-depth="1"] .send { height: calc(var(--row) * 0.5); }
.stage[data-depth="2"] .send { height: calc(var(--row) * 1.5); }
.stage[data-depth="3"] .send { height: calc(var(--row) * 2.5); }

.tap {
  position: absolute;
  left: 18px;
  width: 12px;
  height: 12px;
  background: var(--ember);
  border: 1px solid var(--graphite);
  opacity: 0;
  transition: opacity 120ms ease;
}
.tap--ai { top: calc(100% + var(--row) * 0.5 - 6px); }
.tap--people { top: calc(100% + var(--row) * 1.5 - 6px); }
.tap--platform { top: calc(100% + var(--row) * 2.5 - 6px); }
.stage[data-ai] .tap--ai,
.stage[data-people] .tap--people,
.stage[data-platform] .tap--platform { opacity: 1; }

.buses {
  grid-column: 1 / -1;
  grid-row: 2;
}
.bus {
  display: grid;
  grid-template-columns: var(--label-col) repeat(4, minmax(0, 1fr));
  column-gap: 24px;
  align-items: center;
  height: var(--row);
}
.bus__label {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.bus__label img { flex: none; width: 24px; height: 24px; }
.bus__label p { font-size: 16px; line-height: 24px; }
.bus__label strong { display: block; font-weight: 500; }
.bus__desc { display: block; font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.bus__line {
  grid-column: 2 / -1;
  grid-row: 1;
  height: 2px;
  background: var(--slate);
}

@media (max-width: 1199px) {
  .chain__intro .h2,
  .chain__copy { grid-column: 1 / -1; }
  .chain__intro { margin-bottom: 48px; }

  .patchbay { display: block; }
  .patchbay::before,
  .patchbay__label,
  .patchbay__key,
  .send,
  .tap,
  .bus__line { display: none; }
  .patchbay__stages {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 48px 24px;
  }
  .stage { padding-bottom: 0; }
  .stage__desc { min-height: 0; }

  .buses {
    display: grid;
    gap: 16px;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--sh-divider-default);
  }
  .bus { display: block; height: auto; }
  }
@media (max-width: 599px) {
  .patchbay__stages { grid-template-columns: 1fr; gap: 40px; }
  }

/* ---------- The last 10% (Graphite brand field) ---------- */
.quality {
  position: relative;
  overflow: hidden;
  background: var(--graphite);
  color: var(--porcelain);
  padding-block: var(--section);
  --sh-focus-ring: var(--porcelain);
}
.quality__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
}
.quality__text { grid-column: 1 / span 5; grid-row: 1; display: grid; gap: 24px; align-content: center; }
.quality__text .h2 { margin-bottom: 8px; }
.quality__text .body { color: var(--sh-neutral-150); }
.quality__art {
  grid-column: 7 / -1;
  grid-row: 1;
  align-self: center;
  width: calc(100% + var(--margin) + 8vw);
  max-width: none;
}

.paths {
  grid-column: 1 / -1;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px 24px;
  margin-top: 80px;
}
.path { border-top: 2px solid var(--porcelain); padding-top: 24px; }
.reward {
  margin-top: 16px;
  padding-top: 24px;
  border-top: 2px solid var(--porcelain);
}
.reward__title { font-size: 20px; line-height: 28px; font-weight: 500; }
.reward p { margin-top: 8px; font-size: 16px; line-height: 24px; color: var(--sh-neutral-150); }
.path__title {
  font-size: var(--sh-type-website-h5-size);
  line-height: var(--sh-type-website-h5-line-height);
  font-weight: 500;
}
.path__text { margin: 12px 0 16px; max-width: 52ch; color: var(--sh-neutral-150); }

@media (max-width: 1023px) {
  .quality__text { grid-column: 1 / -1; max-width: 640px; }
  .quality__art { grid-column: 1 / -1; grid-row: 2; width: 120%; margin: 48px 0 0 -6%; }
  .paths { grid-row: 3; margin-top: 48px; }
}
@media (max-width: 767px) {
  .paths { grid-template-columns: 1fr; }
}

/* ---------- Sonhelm Create ---------- */
.create { padding-block: var(--section); background: var(--raised); }
.create__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 48px;
}
.create__head { grid-column: 1 / span 5; display: grid; gap: 24px; align-content: start; }
.create__tile { width: 64px; height: 64px; }
.create__head .link { justify-self: start; }
.facts {
  grid-column: 7 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px 24px;
  margin: 0;
  align-content: start;
}
.fact { border-top: 2px solid var(--graphite); padding-top: 16px; }
.fact dt { font-size: 20px; line-height: 28px; font-weight: 500; }
.fact--lead { grid-column: 1 / -1; }
.fact.fact--lead dt { font-size: 24px; line-height: 32px; }
.fact.fact--lead dd { font-size: 18px; line-height: 28px; max-width: 60ch; }
.fact dd { margin: 8px 0 0; font-size: 16px; line-height: 24px; color: var(--ink-2); }

@media (max-width: 1023px) {
  .create__head, .facts { grid-column: 1 / -1; }
}
@media (max-width: 599px) {
  .facts { grid-template-columns: 1fr; gap: 32px; }
}

/* ---------- Questions ---------- */
.faq { padding-block: var(--section); background: var(--raised); }
.faq__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 32px;
}
.faq__grid .h2 { grid-column: 1 / span 4; }
.faq__list { grid-column: 6 / -1; border-top: 2px solid var(--graphite); }
.faq details { border-bottom: 1px solid var(--sh-divider-default); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding-block: 16px;
  font-size: 20px;
  line-height: 28px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: none;
  width: 24px;
  text-align: center;
  font: 500 24px/24px var(--font-ui);
}
.faq details[open] summary::after { content: "\2212"; }
.faq summary:hover { text-decoration: underline; text-underline-offset: 4px; }
.faq details p { padding-bottom: 24px; max-width: 60ch; color: var(--ink-2); }

@media (max-width: 1023px) {
  .faq__grid .h2, .faq__list { grid-column: 1 / -1; }
}
@media (max-width: 767px) {
  .faq summary { font-size: 18px; line-height: 26px; }
}

/* ---------- Early access ---------- */
.access { padding-block: var(--section); overflow: hidden; }
.access__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 64px;
  align-items: end;
}
.access__text { grid-column: 1 / span 6; display: grid; gap: 24px; }
.access__text .h2 { margin-bottom: 8px; }
.access__art { grid-column: 7 / -1; width: calc(100% + var(--margin) + 160px); max-width: none; }

.signup { margin-top: 16px; max-width: 560px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.signup { position: relative; }
.signup__note { font-size: 14px; line-height: 20px; }
.start { margin: 0 0 24px; padding: 0; border: 0; min-inline-size: 0; }
.start__options { display: flex; flex-wrap: wrap; gap: 8px; }
.signup__row { display: flex; gap: 8px; }
.input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid var(--sh-border-strong);
  border-radius: var(--sh-radius-control);
  background: var(--raised);
  color: var(--ink);
  font: 400 16px/24px var(--font-ui);
}
.input::placeholder { color: var(--sh-text-muted); }
.input[aria-invalid="true"] { border-color: var(--sh-status-error-border); }
.signup__status {
  min-height: 24px;
  margin-top: 12px;
  font-size: 16px;
  line-height: 24px;
}
.signup__status[data-tone="error"] { color: var(--sh-status-error-text); }
.signup__status[data-tone="ok"] { color: var(--sh-status-success-text); }

@media (max-width: 1023px) {
  .access__text { grid-column: 1 / -1; }
  .access__art { grid-column: 1 / -1; width: 100%; max-width: 560px; }
}
@media (max-width: 599px) {
  .signup__row { flex-direction: column; }
  .signup__row .btn { width: 100%; }
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--sh-divider-default); }
.footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
  padding-block: 32px;
}
.footer__row img { width: 120px; height: auto; }
.footer__row p { flex: 1; min-width: 0; }
.footer__top { padding-block: 8px; }

@media (max-width: 767px) {
  .footer__row { flex-direction: column; align-items: flex-start; }
}

/* ---------- Legal pages (privacy, form fallback) ---------- */
.legal { max-width: 760px; padding-block: 64px 96px; }
.legal > * + * { margin-top: 24px; }
.legal h2 {
  margin-top: 48px;
  font: 600 20px/28px var(--font-ui);
}
.legal ul { list-style: disc; padding-left: 24px; }
.legal li + li { margin-top: 8px; }
.legal__top { max-width: 760px; padding-block: 24px; }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
