/* PMF Pre-Interview Form
   Built against Leyn AB design-system (leyn-AB/design-system, tokens/design.tokens.json
   + tokens/surfaces/web.tokens.json). Dark theme only — see DESIGN.md §1 "dark first".
   Do not hand-tune values here; if something needed isn't a token, extend the source
   design system instead (DESIGN.md §1, "Don't invent one-off values"). */

/* ---- Fonts (self-hosted, licensed — assets/README.md: Leyn's own product, keep repo private) ---- */
@font-face {
  font-family: "Akkurat LP";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("assets/fonts/akkurat-regular.woff2") format("woff2");
}
@font-face {
  font-family: "Akkurat LP";
  font-style: italic;
  font-weight: 300;
  font-display: swap;
  src: url("assets/fonts/akkurat-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Akkurat Mono LP";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/akkurat-mono.woff2") format("woff2");
}
@font-face {
  font-family: "GT Walsheim";
  font-style: normal;
  font-weight: 300 500;
  font-display: swap;
  src: url("assets/fonts/gt-walsheim.ttf") format("truetype");
}

/* ---- Tokens: tokens/design.tokens.json → color (dark theme, the system default) ---- */
:root {
  --color-night: #0E141B;
  --color-panel: #121A23;
  --color-surface: #18222E;
  --color-line: #27323F;
  --color-faint: #5C6672;
  --color-text: #EAF0F4;
  --color-mid: #A8B2AC;
  --color-soft: #8B95A1;
  --color-accent: #C4D82E;
  --color-accent-deep: #9FAF26;
  --color-accent-hover: #D6E85B;

  /* fontFamily — each role gets a same-depth fallback chain (a named
     geometric/grotesque/mono match before the generic keyword) so a
     fallback render sits close to the intended one, not just "any sans". */
  --font-display: "GT Walsheim", "Century Gothic", "Segoe UI", "Akkurat LP", Helvetica, sans-serif;
  --font-body: "Akkurat LP", Helvetica, Arial, sans-serif;
  --font-mono: "Akkurat Mono LP", ui-monospace, "SF Mono", Menlo, "Cascadia Code", "Roboto Mono",
    Consolas, "Liberation Mono", monospace;

  /* fontSize (px steps used on this surface) */
  --size-10: 10px; --size-11: 11px; --size-14: 14px; --size-16: 16px;
  --size-18: 18px; --size-20: 20px; --size-25: 25px; --size-28: 28px;
  --size-39: 39px; --size-49: 49px; --size-55: 55px; --size-61: 61px;
  --size-76: 76px; --size-95: 95px; --size-107: 107px;

  /* lineHeight */
  --lh-figure: 1; --lh-display: 1.04; --lh-title: 1.08; --lh-prose: 1.5; --lh-mono: 1.5;

  /* letterSpacing */
  --ls-display: -0.03em; --ls-title: -0.024em; --ls-subline: -0.01em;
  --ls-label: 0.14em; --ls-label-wide: 0.16em; --ls-eyebrow: 0.18em;

  /* space (indexed scale, tokens/design.tokens.json → space) */
  --space-1: 6px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px;
  --space-6: 24px; --space-7: 26px; --space-8: 28px; --space-9: 32px; --space-11: 40px;
  --space-13: 44px; --space-15: 56px; --space-17: 72px; --space-18: 88px;

  /* radius / border / shadow */
  --radius-default: 6px; --radius-small: 3px; --radius-pill: 999px;
  --border-hairline: 1px; --border-track: 6px;
  --shadow-dropdown: 0 24px 60px -24px rgba(0, 0, 0, 0.62);

  /* motion (tokens/surfaces/web.tokens.json → duration/easing) */
  --duration-micro: 180ms; --duration-state: 250ms; --duration-entrance: 700ms;
  --easing-state: cubic-bezier(0.4, 0, 0.2, 1);

  /* layout */
  --content-max-width: 620px; /* single-question flow — narrower than the 1180px marketing measure */
}

/* ---- Base (DESIGN.md §3, required on body) ---- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--color-night);
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--size-16);
  line-height: var(--lh-prose);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-synthesis: none;
  -webkit-font-synthesis: none;
  font-kerning: normal;
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

a { color: var(--color-accent-deep); }
a:hover { color: var(--color-accent); }

/* ---- Chrome: minimal header with the mark, no nav (this is a form, not the marketing site) ---- */
.chrome-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6) var(--space-4) var(--space-3);
}
.chrome-header img { height: 22px; width: auto; display: block; }

/* ---- Progress (border.track = 6px height, radius.pill) ---- */
.progress-track {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
}
.progress-track .bar {
  height: var(--border-track);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  overflow: hidden;
}
.progress-track .fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: var(--radius-pill);
  transition: width var(--duration-state) var(--easing-state);
}

/* ---- Screen shell ---- */
main {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-15) var(--space-4) var(--space-18);
  min-height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--size-11);
  font-weight: 400;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--color-soft);
  margin: 0 0 var(--space-4);
}

.screen-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(28px, 4.2vw, var(--size-49));
  letter-spacing: var(--ls-title);
  line-height: var(--lh-title);
  margin: 0 0 var(--space-6);
}

.screen-helper {
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--color-mid);
  font-size: var(--size-16);
  line-height: var(--lh-prose);
  margin: 0 0 var(--space-6);
}

/* ---- Option rows (single/multi choice). Extends the shared "Selected state"
   rule (DESIGN.md §5: panel2 fill + inset 2px accent bar, never a border swap)
   to a choosable row, since the system has no native <select>/radio component
   of its own to reuse here. ---- */
.options {
  display: flex;
  flex-direction: column;
  border-top: var(--border-hairline) solid var(--color-line);
}
.option-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: var(--border-hairline) solid var(--color-line);
  padding: var(--space-4) var(--space-3);
  font-family: var(--font-body);
  font-size: var(--size-16);
  font-weight: 300;
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--duration-state) var(--easing-state),
    box-shadow var(--duration-state) var(--easing-state);
}
.option-row:hover { background: var(--color-panel); }
.option-row:focus-visible { outline: none; box-shadow: inset 0 0 0 1px var(--color-accent); }
.option-row[aria-checked="true"] {
  background: var(--color-surface);
  box-shadow: inset 2px 0 0 var(--color-accent);
}
.option-row .mark {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-pill);
  border: var(--border-hairline) solid var(--color-line);
  display: flex;
  align-items: center;
  justify-content: center;
}
.option-row[data-type="multi"] .mark { border-radius: var(--radius-small); }
.option-row[aria-checked="true"] .mark { border-color: var(--color-accent); }
.option-row[aria-checked="true"] .mark::after {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: inherit;
  background: var(--color-accent);
}
.option-row .label { flex: 1 1 auto; }

.other-specify {
  margin: var(--space-3) 0 0;
  padding-left: var(--space-3);
}

/* ---- Text fields (DESIGN.md §5 Form: borderless input, bottom hairline only) ---- */
.field { margin-bottom: var(--space-6); }
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--size-11);
  font-weight: 400;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--color-soft);
  margin-bottom: var(--space-2);
}
.field input[type="text"],
.field input[type="email"] {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: var(--border-hairline) solid var(--color-line);
  border-radius: 0;
  padding: 0 0 9px;
  font-family: var(--font-mono);
  font-size: var(--size-16);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--duration-micro) linear;
}
.field input::placeholder { color: var(--color-soft); opacity: 0.45; }
.field input:focus { border-bottom-color: var(--color-accent); }

/* ---- Buttons (DESIGN.md §5 Buttons) ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--size-11);
  font-weight: 400;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  border-radius: var(--radius-default);
  cursor: pointer;
  transition: opacity var(--duration-micro) linear, border-color var(--duration-micro) linear,
    color var(--duration-micro) linear;
}
.btn-primary {
  background: var(--color-accent);
  color: var(--color-night);
  border: none;
  padding: 14px 22px;
}
.btn-primary:hover { opacity: 0.88; }
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border: var(--border-hairline) solid var(--color-line);
  padding: 14px 22px;
}
.btn-ghost:hover { border-color: var(--color-accent); }
.btn-text {
  background: none;
  border: none;
  color: var(--color-accent-deep);
  padding: 0;
  text-transform: none;
  letter-spacing: normal;
  font-family: var(--font-body);
  font-size: var(--size-14);
}
.btn-text:hover { color: var(--color-accent); }

.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: var(--space-8);
  flex-wrap: wrap;
}
.actions .left { display: flex; gap: var(--space-4); align-items: center; }

/* ---- Callout (used for the routing "end of form" / disqualified screens) ---- */
.callout {
  border: var(--border-hairline) solid var(--color-line);
  border-radius: var(--radius-default);
  padding: 22px 24px;
  color: var(--color-mid);
  font-size: var(--size-16);
}

/* ---- Save state ---- */
.save-state {
  font-family: var(--font-mono);
  font-size: var(--size-10);
  letter-spacing: var(--ls-label-wide);
  text-transform: uppercase;
  color: var(--color-soft);
}

footer.form-footer {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 var(--space-4) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  color: var(--color-soft);
  font-family: var(--font-mono);
  font-size: var(--size-10);
  letter-spacing: var(--ls-label-wide);
  text-transform: uppercase;
}
footer.form-footer a { color: var(--color-soft); text-decoration: none; }
footer.form-footer a:hover { color: var(--color-accent); }
.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--color-soft);
  cursor: pointer;
  border-radius: var(--radius-small);
  transition: color var(--duration-micro) linear;
}
.copy-btn:hover,
.copy-btn.copied { color: var(--color-accent); }
.copy-btn:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--color-accent); }

/* ---- Consent (contact screen) ---- */
.consent-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  border-top: var(--border-hairline) solid var(--color-line);
  cursor: pointer;
  font-size: var(--size-14);
  line-height: var(--lh-prose);
  color: var(--color-mid);
}
.consent-row input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--color-accent);
  cursor: pointer;
}
.consent-row a { color: var(--color-accent-deep); }
.consent-row a:hover { color: var(--color-accent); }

.privacy-toggle {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--color-accent-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.privacy-toggle:hover,
.privacy-toggle[aria-expanded="true"] { color: var(--color-accent); }

.privacy-fold {
  position: relative;
  margin: 0 0 var(--space-4);
  border: var(--border-hairline) solid var(--color-line);
  border-radius: var(--radius-default);
  overflow: hidden;
  background: var(--color-night);
}
.privacy-close {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: var(--border-hairline) solid var(--color-line);
  border-radius: var(--radius-pill);
  background: var(--color-panel);
  color: var(--color-soft);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: color var(--duration-micro) linear, border-color var(--duration-micro) linear;
}
.privacy-close:hover { color: var(--color-accent); border-color: var(--color-accent); }
.privacy-close:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--color-accent); }
.privacy-frame {
  display: block;
  width: 100%;
  height: 340px;
  border: none;
  background: var(--color-night);
}

/* honeypot — hidden from sighted and screen-reader users, left open for bots */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 480px) {
  main { padding-top: var(--space-9); }
  .actions { flex-direction: column-reverse; align-items: stretch; }
  .actions .left { justify-content: center; }
}
