/* The base of every page of FormHelix's own site: tokens, type, buttons, the top bar, the glow
   box that closes a page, and the footer. The landing page adds home.css on top; the docs, legal
   and generated pages add docs.css and site.css. The look is a dark workspace system: a black canvas with raised
   charcoal surfaces, a deep midnight-blue glow at the foot of a hero or closing box, ice blue on
   deep indigo for the primary action and links, pills for every control, soft 16–28px corners on
   cards, hairlines rather than heavy borders, Plus Jakarta Sans headings set light over Inter,
   and JetBrains Mono for labels. Dark is the default; the nav's switch offers a light version of
   the same tokens. */

:root {
  /* ---- type ---- */
  --font-display: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* ---- surfaces (dark, the default) ---- */
  --bg: #000000; /* the canvas */
  --bg-2: #0e0e10; /* bands, sidebars, recessed wells */
  --surface: #1e1f20; /* cards, the nav pill, inputs */
  --surface-2: #282a2c; /* pills on a card, hover */
  --surface-3: #333538; /* hover on a pill */
  --ink: #e3e3e3; /* body copy on the canvas */
  --ink-strong: #ffffff; /* headings, figures */
  --ink-2: #c4c7c5; /* secondary */
  --ink-3: #9aa0a6; /* meta, muted */
  --line: rgba(255, 255, 255, 0.08); /* the hairline */
  --line-2: rgba(255, 255, 255, 0.06);
  --line-3: rgba(255, 255, 255, 0.14); /* a stronger hairline, hover */

  /* The selected segment of a pill switch, and a tab that's on. */
  --slate: #333742;

  /* ---- the accent: ice blue on deep indigo ---- */
  --brand: #a8c7fa; /* links, focus, the accent in text */
  --brand-bright: #d3e3fd;
  --brand-soft: #1f2a44; /* a tinted chip or row */
  --accent-bg: #1f2a44; /* the primary button, AI badges */
  --accent-bg-hover: #283759;
  --accent-fg: #a8c7fa; /* text on --accent-bg */
  --accent-line: rgba(168, 199, 250, 0.3);
  /* A solid blue that carries white text (a checkbox's tick, the odd filled tag). */
  --brand-fill: #0b57d0;
  --brand-fill-hover: #0842a0;
  --on-brand: #a8c7fa;
  --on-dark-accent: #a8c7fa;

  /* Four signal colours for a mono label or a tick: the dark-mode tints, so they stay readable. */
  --blue: #8ab4f8;
  --green: #81c995;
  --yellow: #fdd663;
  --red: #f28b82;
  /* A loss figure, a warning callout. */
  --accent: #f28b82;
  --accent-ink: #f6aea9;

  /* ---- the midnight glow ---- */
  --glow-deep: #0b1426;
  --glow-peak: #132347;
  --glow-hero:
    radial-gradient(
      ellipse 90% 52% at 50% 100%,
      rgba(19, 35, 71, 0.78) 0%,
      rgba(11, 20, 38, 0.45) 48%,
      rgba(0, 0, 0, 0) 85%
    ),
    radial-gradient(circle at 50% 72%, rgba(66, 133, 244, 0.12) 0%, rgba(0, 0, 0, 0) 58%);
  --glow-box: radial-gradient(
    ellipse 85% 75% at 50% 100%,
    rgba(19, 35, 71, 0.85) 0%,
    rgba(11, 20, 38, 0.5) 55%,
    rgba(14, 14, 16, 0.95) 100%
  );
  /* The highlighted words of a heading: ice into blue. */
  --sheen: linear-gradient(90deg, #a8c7fa 0%, #8ab4f8 45%, #4c8df6 100%);

  /* ---- dark wells that stay dark in both themes: code blocks ---- */
  --dk-bg: #0e0e10;
  --dk-bg-2: #131314;
  --dk-surface: #1e1f20;
  --dk-ink: #e3e3e3;
  --dk-ink-2: #c4c7c5;
  --dk-ink-3: #9aa0a6;
  --dk-line: rgba(255, 255, 255, 0.1);
  /* A full-width section that sets itself off from the canvas. */
  --band: #0e0e10;

  /* ---- geometry ---- */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 28px;
  --r-pill: 9999px;
  --maxw: 1152px;
  --gutter: clamp(16px, 4vw, 48px);

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 20px 50px rgba(11, 20, 38, 0.65);
  --shadow-lg: 0 30px 90px rgba(11, 20, 38, 0.9);
  --shadow-float: 0 12px 40px rgba(0, 0, 0, 0.75);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* which of the theme switch's icons shows: the one for the theme it switches to */
  --theme-moon: none;
  --theme-sun: block;
  color-scheme: dark;
}

/* The light version, only ever chosen with the nav's switch (`data-theme` on <html>, set before
   the first paint by partials/theme-init.ejs). The same names, so nothing below needs to know.
   Pictures of a respondent's form — the framed demo, `.form-mock` — keep the form's own light
   colours in both, because that's what a form looks like. */
:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-2: #f8fafd;
  --surface: #f0f4f9;
  --surface-2: #e9eef6;
  --surface-3: #dde3ea;
  --ink: #1f1f1f;
  --ink-strong: #0b0b0c;
  --ink-2: #444746;
  --ink-3: #5e6368;
  --line: rgba(31, 31, 31, 0.1);
  --line-2: rgba(31, 31, 31, 0.07);
  --line-3: rgba(31, 31, 31, 0.18);
  --slate: #ffffff;

  --brand: #0b57d0;
  --brand-bright: #0842a0;
  --brand-soft: #e8f0fe;
  --accent-bg: #d3e3fd;
  --accent-bg-hover: #c2d7fb;
  --accent-fg: #041e49;
  --accent-line: rgba(11, 87, 208, 0.25);
  --on-brand: #0b57d0;
  --on-dark-accent: #a8c7fa;

  --blue: #0b57d0;
  --green: #146c2e;
  --yellow: #8d5f00;
  --red: #b3261e;
  --accent: #d93025;
  --accent-ink: #a50e0e;

  --glow-deep: #e8f0fe;
  --glow-peak: #d3e3fd;
  --glow-hero:
    radial-gradient(
      ellipse 90% 52% at 50% 100%,
      rgba(211, 227, 253, 0.9) 0%,
      rgba(232, 240, 254, 0.55) 48%,
      rgba(255, 255, 255, 0) 85%
    ),
    radial-gradient(circle at 50% 72%, rgba(11, 87, 208, 0.08) 0%, rgba(255, 255, 255, 0) 58%);
  --glow-box: radial-gradient(
    ellipse 85% 75% at 50% 100%,
    rgba(194, 215, 251, 0.95) 0%,
    rgba(232, 240, 254, 0.8) 55%,
    rgba(248, 250, 253, 1) 100%
  );
  --sheen: linear-gradient(90deg, #0b57d0 0%, #1a73e8 50%, #4c8df6 100%);
  --band: #f8fafd;

  --shadow-sm: 0 1px 4px rgba(31, 31, 31, 0.08);
  --shadow-md: 0 20px 50px -20px rgba(31, 41, 55, 0.25);
  --shadow-lg: 0 30px 80px -30px rgba(31, 41, 55, 0.3);
  --shadow-float: 0 12px 40px -12px rgba(31, 41, 55, 0.25);

  --theme-moon: block;
  --theme-sun: none;
  color-scheme: light;
}

/* ============================================================
   Reset / base
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}
/* Sideways overflow is clipped rather than hidden, here and on body: `hidden` would turn body into
   a scroll container, and the sticky top bar would scroll away with the page. */
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;
  background: var(--bg);
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
::selection {
  background: var(--accent-bg);
  color: var(--accent-fg);
}

a {
  color: inherit;
  text-decoration: none;
}
img {
  max-width: 100%;
  display: block;
}
button {
  font-family: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink-strong);
  margin: 0;
  text-wrap: balance;
  overflow-wrap: break-word;
}
p {
  margin: 0;
  text-wrap: pretty;
}

/* The words a heading leans on (its `em`), in the ice-to-blue sheen rather than italics. Once a
   page: in the H1 and the closing box. */
h1 em,
h2 em,
.sheen {
  font-style: normal;
  background: var(--sheen);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.wrap {
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* A pill over a heading, led by a four-pointed sparkle in the accent's gradient. */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-2);
}
.eyebrow::before,
.sparkle {
  content: "";
  flex: none;
  display: inline-block;
  width: 14px;
  height: 14px;
  background: var(--sheen);
  -webkit-mask: var(--sparkle-mask) center / contain no-repeat;
  mask: var(--sparkle-mask) center / contain no-repeat;
}
:root {
  --sparkle-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1C12.6 7.3 16.7 11.4 23 12C16.7 12.6 12.6 16.7 12 23C11.4 16.7 7.3 12.6 1 12C7.3 11.4 11.4 7.3 12 1Z'/%3E%3C/svg%3E");
}

/* A mono label over a section heading, in the accent. */
.kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
}

/* ============================================================
   Buttons: pills. The primary is ice blue on deep indigo.
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  line-height: 1;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
  white-space: nowrap;
}
.btn:active {
  transform: scale(0.98);
}

.btn-primary,
.btn-brand {
  background: var(--accent-bg);
  color: var(--accent-fg);
  border-color: var(--accent-line);
}
.btn-primary:hover,
.btn-brand:hover {
  background: var(--accent-bg-hover);
  box-shadow: 0 6px 22px rgba(66, 133, 244, 0.2);
}

.btn-ghost,
.btn-ghost-dark {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover,
.btn-ghost-dark:hover {
  background: var(--surface-2);
  border-color: var(--line-3);
  color: var(--ink-strong);
}

.btn-lg {
  padding: 15px 24px;
  font-size: 15px;
}
.btn-lg.btn-primary {
  box-shadow: 0 0 32px rgba(66, 133, 244, 0.22);
}
:root[data-theme="light"] .btn-lg.btn-primary {
  box-shadow: none;
}

/* ============================================================
   Top bar. Generated pages and the docs get a full-width bar with a hairline under it; the
   landing page's floats as a glass pill (`.nav--float`).
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--bg-2) 88%, transparent);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 64px;
}

.nav--float {
  padding: 16px var(--gutter) 0;
  background: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border: 0;
  pointer-events: none;
}
.nav--float .nav__inner {
  pointer-events: auto;
  position: relative;
  max-width: var(--maxw);
  height: 56px;
  margin-inline: auto;
  padding: 0 10px 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow-float);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--r-pill);
}
/* FormHelix's mark, for now: its initials, "Fh", in ice blue on a deep indigo disc ringed by a
   faint ice hairline. The colours don't follow the theme, because a logo doesn't. Mirrored by
   `.hf-mark` in the dashboard, the form badge's `.stepnav__mark` in views/layout.ejs,
   favicon.svg / apple-touch-icon.png in both apps and marketing/og.html — change them together
   (`bun icons.ts` in marketing/ redraws the PNGs). The second `content` gives the letters an empty
   spoken name where that's supported, since the wordmark beside the disc already says it. */
.brand__mark {
  --mark: 32px;
  flex: none;
  display: grid;
  place-items: center;
  width: var(--mark);
  height: var(--mark);
  border-radius: 50%;
  background: #1f2a44;
  box-shadow: inset 0 0 0 1px rgba(168, 199, 250, 0.3);
  color: #a8c7fa;
  font-family: var(--font-display);
  font-size: calc(var(--mark) * 0.42);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}
.brand__mark::before {
  content: "Fh";
  content: "Fh" / "";
}
.brand__name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ink-strong);
  white-space: nowrap;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: 2px;
}
/* The bar reads left to right: wordmark, links, then the actions at the far end. */
.nav__inner .nav__links {
  flex: 1;
  justify-content: center;
}
.nav__links a {
  padding: 7px 13px;
  border-radius: var(--r-pill);
  font-size: 14px;
  color: var(--ink-2);
  transition:
    color 0.2s,
    background 0.2s;
}
.nav__links a:hover,
.nav__links a[aria-current] {
  color: var(--ink-strong);
  background: var(--surface-2);
}
.nav__right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.nav__signin {
  padding: 8px 13px;
  border-radius: var(--r-pill);
  font-size: 14px;
  color: var(--ink-2);
  transition:
    color 0.2s,
    background 0.2s;
}
.nav__signin:hover {
  color: var(--ink-strong);
  background: var(--surface-2);
}
.nav .btn {
  padding: 9px 16px;
  font-size: 14px;
}

.nav__burger {
  display: none;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
}
.nav__burger svg {
  width: 18px;
  height: 18px;
}

.theme-toggle {
  display: inline-grid;
  flex: none;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-2);
  transition:
    color 0.2s,
    background 0.2s,
    border-color 0.2s;
}
.theme-toggle:hover {
  color: var(--ink-strong);
  background: var(--surface-2);
  border-color: var(--line-3);
}
.theme-toggle svg {
  width: 16px;
  height: 16px;
}
.theme-toggle__moon {
  display: var(--theme-moon);
}
.theme-toggle__sun {
  display: var(--theme-sun);
}

.nav__mobile {
  display: none;
  position: absolute;
  inset: 100% 0 auto 0;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  padding: 8px var(--gutter) 20px;
  box-shadow: var(--shadow-float);
}
.nav--float .nav__mobile {
  inset: calc(100% + 8px) 0 auto 0;
  max-width: var(--maxw);
  margin-inline: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  pointer-events: auto;
}
.nav__mobile.open {
  display: block;
}
.nav__mobile a {
  display: block;
  padding: 13px 4px;
  font-size: 16px;
  color: var(--ink);
  border-top: 1px solid var(--line-2);
}
.nav__mobile a:first-child {
  border-top: 0;
}
.nav__mobile .btn {
  display: flex;
  margin-top: 12px;
  padding: 14px;
  font-size: 15px;
  border-top: 1px solid var(--accent-line);
}

/* ============================================================
   Section scaffolding
   ============================================================ */
section {
  position: relative;
}
.section {
  padding-block: clamp(64px, 8vw, 96px);
}

/* ============================================================
   Closing box: a glow rising from its foot, once a page
   ============================================================ */
.finale {
  padding-inline: var(--gutter);
  padding-bottom: 80px;
}
.finale .wrap {
  position: relative;
  overflow: hidden;
  max-width: var(--maxw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: clamp(40px, 7vw, 72px) clamp(24px, 5vw, 64px);
  border: 1px solid var(--accent-line);
  border-radius: 32px;
  background: var(--glow-box);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.finale h2 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.08;
  max-width: 760px;
}
.finale p:not(.eyebrow) {
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 560px;
}
.finale__cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  border-top: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-3);
  padding-block: 56px 28px;
}
.footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(4, minmax(0, 1fr));
  gap: 32px;
}
.footer__brand .brand__name {
  font-size: 18px;
}
.footer__brand p {
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-3);
  max-width: 320px;
}
.footer__col {
  min-width: 0;
}
.footer__col h4 {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.5;
  color: var(--ink-strong);
}
.footer__col ul {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.footer__col a {
  font-size: 14px;
  color: var(--ink-3);
  overflow-wrap: anywhere;
  transition: color 0.2s;
}
.footer__col a:hover {
  color: var(--ink-strong);
}
.footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-3);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 960px) {
  .footer__top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer__brand {
    grid-column: 1 / -1;
  }
  .nav__inner {
    gap: 12px;
  }
  .nav__inner .nav__links {
    display: none;
  }
  .nav__burger {
    display: inline-grid;
  }
}
@media (max-width: 720px) {
  .nav__links {
    display: none;
  }
  .nav__signin {
    display: none;
  }
  .nav--float {
    padding-top: 10px;
  }
  /* The switch and the burger stay; "Start free" comes back once the page scrolls. */
  .nav__right > .btn {
    display: none;
  }
  .nav.scrolled .nav__right > .btn {
    display: inline-flex;
    padding: 8px 13px;
    font-size: 13px;
  }
}
