/*
 * Hemi marketing pages — direction C, "demonstration".
 *
 * The premise: the diagram makes the argument and the words get out of its way. Every section is
 * a headline, one sentence, and one visual. If a section needs a paragraph, it belongs in the
 * FAQ or it does not belong.
 *
 * Colour, radii, weights and the wordmark all come from design/tokens.css, which is copied in at
 * build time so there is one source shared with the app. Light and dark both come from there:
 * dark is the bare :root, light is :root[data-theme="light"]. Nothing here defines a colour.
 *
 * NEW VALUES, marked because tokens.css is explicit that the app has no heading scale to
 * extract — 81 of 99 of its size declarations sit at 12-14px and its largest is the 34px sign-in
 * wordmark. A page that introduces itself needs more. The ceiling here is 52px, not the 64px a
 * marketing page usually reaches for, because the product's argument is that it does not
 * oversell.
 */

:root {
  --display: clamp(32px, 5.6vw, 52px);
  --headline: clamp(22px, 3vw, 30px);
  --gutter: clamp(20px, 5vw, 48px);
  --section-y: clamp(64px, 9vw, 104px);
  --page-max: 1000px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }
img { height: auto; }

*:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter); }

/* ------------------------------------------------------------------ header */

header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 0;
}

.wordmark {
  font-family: var(--font-wordmark);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.6px;
  line-height: 1;
  color: var(--text);
  text-decoration: none;
}
.wordmark:hover { color: var(--accent-light); }

nav.site { display: flex; align-items: center; gap: 20px; }
nav.site a { color: var(--text-secondary); text-decoration: none; font-size: 13.5px; font-weight: 500; }
nav.site a:hover, nav.site a[aria-current="page"] { color: var(--text); }

/* Sign in is a button, not a link — it is the second thing a returning clinician looks for and
   the first thing they fail to find when it is set as quiet text among other quiet text. */
.signin {
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 7px 16px;
  color: var(--text-body) !important;
  font-weight: 600 !important;
}
.signin:hover { border-color: var(--text-muted); color: var(--text) !important; }

.toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 20px;
  padding: 6px 13px;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.toggle:hover { color: var(--text); border-color: var(--border-strong); }

/* ------------------------------------------------------------------ type */

h1, h2, h3 { margin: 0; font-weight: 600; color: var(--text); }

h1 {
  font-size: var(--display);
  line-height: 1.04;
  letter-spacing: -1.6px;
  max-width: 13ch;
  margin-inline: auto;
}

h2 {
  font-size: var(--headline);
  line-height: 1.12;
  letter-spacing: -0.9px;
  max-width: 19ch;
  margin-inline: auto;
}

h3 { font-size: 16px; letter-spacing: -0.2px; }

.sub {
  font-size: 17.5px;
  color: var(--text-secondary);
  margin: 22px auto 0;
  max-width: 42ch;
}

.cap {
  font-size: 16.5px;
  color: var(--text-secondary);
  margin: 16px auto 0;
  max-width: 40ch;
}

.tiny { font-size: 13px; color: var(--text-muted); }

/* ------------------------------------------------------------------ buttons */

.cta {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  padding: 13px 24px;
  border-radius: 12px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 120ms ease;
}
.cta:hover:not(:disabled) { background: var(--accent-hover); }
.cta:disabled { opacity: 0.6; cursor: default; }

.ghost {
  display: inline-block;
  margin-left: 18px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}
.ghost:hover { color: var(--text); }

/* ------------------------------------------------------------------ sections */

.hero { text-align: center; padding: clamp(48px, 7vw, 80px) 0 0; }
.stage { margin: clamp(44px, 6vw, 68px) auto 0; }

section { padding: var(--section-y) 0; text-align: center; }
.panel { margin: clamp(34px, 5vw, 52px) auto 0; max-width: 760px; }

/* ------------------------------------------------------------------ how it works */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 34px;
  margin: clamp(34px, 5vw, 52px) auto 0;
  max-width: 820px;
  text-align: left;
}
.step-n {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  color: var(--text-label);
  margin-bottom: 14px;
}
.steps p { margin: 8px 0 0; color: var(--text-secondary); font-size: 14.5px; }
.steps svg { margin-bottom: 16px; }

/* ------------------------------------------------------------------ about strip */

.strip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: clamp(44px, 6vw, 64px) 0;
}
.strip p { margin: 0 auto; max-width: 44ch; font-size: 17px; color: var(--text-body); }

/* ------------------------------------------------------------------ form */

form.early { max-width: 420px; margin: clamp(30px, 4vw, 40px) auto 0; text-align: left; }
.field { display: block; margin-bottom: 14px; }
.field > span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-label);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
input, textarea {
  width: 100%;
  font-family: inherit;
  background: var(--block);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 13px;
  font-size: 15px;
}
textarea { min-height: 76px; resize: vertical; line-height: 1.5; }
.status { margin: 14px 0 0; font-size: 14px; min-height: 1.4em; }
.status.ok { color: var(--accent-light); }
.status.bad { color: var(--alert); }

/* ------------------------------------------------------------------ faq */

.qa { max-width: 640px; margin: clamp(34px, 5vw, 48px) auto 0; text-align: left; }
.qa > div { padding: 20px 0; border-top: 1px solid var(--border); }
.qa > div:last-child { border-bottom: 1px solid var(--border); }
.qa h3 { margin-bottom: 6px; }
.qa p { margin: 0; color: var(--text-secondary); font-size: 15px; }

/* ------------------------------------------------------------------ footer */

footer.site {
  border-top: 1px solid var(--border);
  padding: 26px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  color: var(--text-muted);
}
footer.site a { color: var(--text-secondary); text-decoration: none; }
footer.site a:hover { color: var(--text); }

/* ------------------------------------------------------------------ narrow */

@media (max-width: 640px) {
  /* Measured at 560px: without this the wordmark and the nav collide and render as
     "HemiAbout". Caught in the mockup review. */
  header.site { flex-wrap: wrap; gap: 12px; }
  nav.site { gap: 14px; flex-wrap: wrap; }
  h1 { letter-spacing: -1px; }
  .steps { grid-template-columns: 1fr; gap: 26px; }
  .ghost { display: block; margin: 16px 0 0; }
}
