/* Booking + application dialogs, carried over from the previous landing so the lead funnel is unchanged.
   Their theme variables are scoped to <dialog> so they never collide with the page's own tokens. */
@font-face {
  font-family: 'Hanken Grotesk';
  src: url('assets/fonts/hanken-var-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('assets/fonts/plexmono-400-latin.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('assets/fonts/plexmono-500-latin.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
dialog {
  --bg: #121212;
  --bg-raise: #1a1a1a;
  --ink: #f3f2ee;
  --ink-92: rgba(243, 242, 238, 0.92);
  --ink-70: rgba(243, 242, 238, 0.70);
  --ink-65: rgba(243, 242, 238, 0.65);
  --ink-55: rgba(243, 242, 238, 0.55);
  --line: rgba(243, 242, 238, 0.14);
  --line-strong: rgba(243, 242, 238, 0.45);
  --ground: rgba(243, 242, 238, 0.45);
  --accent: #ff5a1f;               /* Sweat orange, matching the landing */
  --logo-color: var(--accent);      /* wordmark is a mask, recolorable independently via ?logo= */
  --sans: 'Hanken Grotesk', 'Trebuchet MS', 'Segoe UI', -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --track-ui: 0.16em;      /* interactive mono: buttons, dialog labels */
  --track-caption: 0.17em; /* ambient mono: clock, footer */
  --track-stamp: 0.19em;   /* deliberate stamp look without sacrificing legibility */
  /* nav/footer gutters match the hero container (1400px max-width − 2×48px padding) */
  --gutter: max(48px, calc((100% - 1304px) / 2));
  color: var(--ink); font-family: var(--sans);
}
html.dialog-open, body.dialog-open { overflow: hidden; }
dialog .btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: var(--track-ui);
  text-indent: var(--track-ui); /* cancels the trailing letter-space so the label optically centers */
  background: var(--accent);
  color: #0e1216;
  padding: 17px 30px;
  border-radius: 2px;
  transition: background 160ms ease, color 160ms ease, transform 120ms ease;
}
dialog .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
dialog .btn:active { transform: translateY(1px); }
dialog .btn-secondary {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink);
}
@media (hover: hover) and (pointer: fine) {
  dialog .btn:hover { background: var(--ink); color: #0e1216; }
  dialog .btn-secondary:hover { border-color: var(--ink); }
}

/* ---------- dialog ---------- */

dialog {
  margin: auto; /* the page's CSS reset removes the UA margin that centres a modal dialog */
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  width: min(460px, calc(100vw - 32px));
  max-height: min(86vh, 86dvh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 38px 40px 34px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  transition: width 220ms ease;
}
dialog.cal-step {
  width: min(900px, calc(100vw - 24px));
  max-height: min(94vh, 94dvh);
}
dialog.application-dialog { width: min(780px, calc(100vw - 32px)); }
dialog.cal-step { padding-top: 0; }
dialog.cal-step .dlg-head {
  position: sticky;
  top: 0;
  z-index: 3;
  padding-top: 38px;
  padding-bottom: 14px;
  margin-bottom: 12px;
  background: linear-gradient(to bottom, var(--bg-raise) 78%, rgba(21, 24, 28, 0));
}
/* Calendly iframes are height:100% — the parent needs an explicit height, not only
   min-height, or the widget collapses to the banner strip. color-scheme:light keeps
   the light calendar visible inside our dark dialog (otherwise the body goes blank). */
.cal-inline,
.calendly-inline-widget {
  min-width: 320px;
  width: 100%;
  height: 700px;
  background: #fff;
  color-scheme: light;
  border-radius: 8px;
  overflow: hidden;
}
.cal-inline iframe,
.calendly-inline-widget iframe {
  display: block !important;
  width: 100% !important;
  height: 700px !important;
  min-height: 700px !important;
  border: 0;
}
#calStep[hidden] { display: none; }
dialog::backdrop {
  background: rgba(10, 13, 16, 0.72);
  backdrop-filter: blur(4px);
}

.dlg-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}
.dlg-head h2 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 26px;
  letter-spacing: -0.01em;
  margin: 0;
}
.dlg-eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: var(--track-stamp);
}
.dlg-close {
  appearance: none; background: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 44px; min-height: 44px;
  font-family: var(--mono); font-size: 11px; letter-spacing: var(--track-ui);
  color: var(--ink-65); padding: 8px;
  margin: -8px;
}
.dlg-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .dlg-close:hover { color: var(--ink); }
}

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fields label {
  display: flex; flex-direction: column; gap: 7px;
  font-family: var(--mono); font-size: 11px; letter-spacing: var(--track-ui);
  color: var(--ink-70);
}
.fields .full { grid-column: 1 / -1; }
.field-control { display: flex; flex-direction: column; gap: 8px; }
.application-field { display: flex; flex-direction: column; gap: 7px; }
.fields input,
.fields select {
  appearance: none;
  background: var(--bg);
  border: 1px solid var(--line-strong); /* ≥3:1 against both the field fill and the dialog surface (WCAG 1.4.11) */
  border-radius: 2px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  min-height: 48px;
  padding: 12px 13px;
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: border-color 140ms ease, outline-color 140ms ease, background 140ms ease;
}
.fields select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-65) 50%),
    linear-gradient(135deg, var(--ink-65) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 13px) calc(50% - 2px);
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  padding-right: 38px;
}
.fields input::placeholder { color: var(--ink-55); opacity: 1; }
.fields input:focus-visible,
.fields select:focus-visible { border-color: var(--accent); outline-color: rgba(226, 161, 60, 0.32); }
.fields input[aria-invalid="true"],
.fields select[aria-invalid="true"],
.use-case-fieldset[aria-invalid="true"] { border-color: var(--accent); background: rgba(226, 161, 60, 0.04); }
.application-fields { gap: 13px 16px; }
.application-fields > label { align-self: end; }
.application-field label { align-self: stretch; text-align: left; }
.conditional-field[hidden] { display: none; }
.use-case-fieldset {
  margin: 4px 0 0;
  padding: 0;
  border: 0;
}
.use-case-fieldset legend {
  padding: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: var(--track-ui);
  color: var(--ink-70);
}
.use-case-fieldset .field-hint { display: block; margin-top: 7px; }
.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.checkbox-grid label {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: 0;
  line-height: 1.35;
}
.checkbox-grid label:has(input:checked) {
  border-color: var(--accent);
  background: rgba(226, 161, 60, 0.07);
}
.checkbox-grid input[type="checkbox"] {
  appearance: auto;
  flex: 0 0 auto;
  width: 17px;
  min-height: 17px;
  margin: 1px 0 0;
  padding: 0;
  accent-color: var(--accent);
}
.application-error { display: block; margin-top: 16px; }
.application-dialog.submitted #applicationForm { display: none; }
.field-hint,
.field-error {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: 0;
}
.field-hint { color: var(--ink-70); }
.field-error { color: var(--accent); }
.field-error[hidden] { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.submit { width: 100%; margin-top: 26px; padding: 15px 0; }
.submit[disabled] { opacity: 0.6; cursor: default; }

#calStep { position: relative; min-height: 700px; outline: none; }
.cal-loading {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  background: var(--bg-raise);
  color: var(--ink-70);
  font-family: var(--sans);
  font-size: 16px;
}
.cal-loading[hidden] { display: none; }
.cal-loading-line,
.cal-loading-grid {
  display: block;
  border: 1px solid var(--line);
  background: rgba(243, 242, 238, 0.035);
}
.cal-loading-line { width: 52%; height: 36px; }
.cal-loading-line-long { width: 78%; }
.cal-loading-grid { flex: 1; min-height: 280px; }

.success { display: flex; flex-direction: column; gap: 14px; text-align: center; padding: 22px 0; }
.success[hidden] { display: none; }
.success:focus { outline: 2px solid transparent; outline-offset: 4px; }
.success:focus-visible { outline-color: var(--accent); }
.success .s-title { font-family: var(--sans); font-weight: 500; font-size: 26px; }
.success .s-body { font-size: 16.5px; line-height: 1.6; color: var(--ink-70); }
.success .s-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.success .s-body a:hover { text-decoration-thickness: 2px; }
.success .s-direct {
  align-self: center;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: var(--track-ui);
  text-decoration: underline;
  text-underline-offset: 4px;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px;
}
.success .s-direct[hidden] { display: none; }
.success .s-close {
  appearance: none; background: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; align-self: center;
  min-width: 44px; min-height: 44px; padding: 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: var(--track-ui);
  color: var(--accent); margin-top: 0;
}
.success .s-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 520px) {
  dialog .btn { width: 100%; text-align: center; }
  dialog { padding: 30px 22px 26px; }
  dialog.cal-step { padding-top: 0; }
  dialog.cal-step .dlg-head { padding-top: 30px; }
  .fields { grid-template-columns: 1fr; }
  .dlg-close { margin-right: -10px; }
  .dlg-close-esc { display: none; }
  .dlg-close-icon { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { dialog .btn, .fields input, .dlg-close, dialog { transition: none; } }

/* per-field validation messages (2026-09-30) */
.inline-error { grid-column: 1 / -1; display: block; margin-top: -6px; font-family: var(--sans); font-size: 13px; line-height: 1.4; color: #b3261e; }
html.dark .inline-error { color: #ff8a80; }
.success .btn.submit { display: inline-flex; justify-content: center; text-decoration: none; }
