/* Reset, type, and the shared pieces: buttons, fields, cards, chips, toasts. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--hdr-h) + 16px); -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text-body);
  font: 400 var(--fs-base) / var(--lh) var(--font);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
svg.ic { flex: none; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote, fieldset { margin: 0; }
ul, ol { padding: 0; list-style: none; }
fieldset { border: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
strong, b { font-weight: 700; }
main:focus { outline: none; }
[hidden] { display: none !important; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-stretch: 112%;
  font-weight: 800;
  line-height: var(--lh-tight);
  letter-spacing: -.022em;
  color: var(--text);
  text-wrap: balance;
}
h3, h4 { font-stretch: 106%; font-weight: 700; letter-spacing: -.012em; line-height: 1.2; }
p { text-wrap: pretty; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
/* clear of an iPhone's notch when it's held sideways (the page uses viewport-fit=cover) */
@supports (padding: max(0px)) {
  .wrap { padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right)); }
}
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--text-3); }
.small { font-size: var(--fs-sm); }
.skip {
  position: fixed; left: 12px; top: -60px; z-index: 200; padding: 10px 16px; border-radius: var(--r-sm);
  background: #0052c9; color: #fff; font-weight: 700; text-decoration: none; transition: top var(--t) var(--ease);
}
.skip:focus { top: 12px; color: #fff; }

/* the line over every section name: like DETAILING on the logo */
.eyebrow {
  display: flex; align-items: center; gap: 12px;
  font: 700 var(--fs-xs) / 1.2 var(--font);
  letter-spacing: .2em; text-transform: uppercase; color: var(--accent);
}
.eyebrow::before { content: ''; width: 24px; height: 2px; border-radius: 2px; background: var(--brand-grad); flex: none; }
.dark .eyebrow { color: #5cb8ff; }
.grad { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* ---- buttons ---- */
.btn {
  --h: 46px;
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  height: var(--h); padding: 0 20px; border-radius: var(--r-sm);
  border: 1px solid transparent; background: none;
  font: 650 .9375rem / 1 var(--font); letter-spacing: -.005em; white-space: nowrap;
  text-decoration: none; color: var(--text); cursor: pointer; user-select: none;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease), box-shadow var(--t) var(--ease), transform var(--t-fast) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-sm { --h: 38px; padding: 0 14px; font-size: var(--fs-sm); }
.btn-lg { --h: 52px; padding: 0 26px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-primary {
  background: var(--btn-grad); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 1px 2px rgba(0, 40, 120, .3), 0 10px 22px -10px rgba(0, 98, 224, .75);
}
.btn-primary:hover { background: var(--btn-grad-hi); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24), 0 1px 2px rgba(0, 40, 120, .3), 0 14px 28px -10px rgba(0, 98, 224, .85); }
.btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--text); box-shadow: var(--shadow-xs); }
.btn-outline:hover { border-color: var(--accent-line); color: var(--accent); background: var(--surface); }
.btn-ghost { background: var(--hover); border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: color-mix(in srgb, var(--text) 9%, transparent); border-color: color-mix(in srgb, var(--text) 28%, transparent); color: var(--text); }
.btn-ghost-dark { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-ghost-dark:hover { background: var(--hover); color: var(--text); }
.btn-danger-ghost { background: transparent; border-color: color-mix(in srgb, var(--red) 40%, transparent); color: var(--red); }
.btn-danger-ghost:hover { background: var(--red-soft); color: var(--red); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--red) 88%, #000); color: #fff; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.is-loading { pointer-events: none; opacity: .85; }
.btn .spinner { width: 16px; height: 16px; }
.btn-icon {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
  border-radius: var(--r-sm); border: 1px solid transparent; background: transparent; color: var(--text-2);
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.btn-icon:hover { background: var(--hover); color: var(--text); }

/* ---- fields ---- */
.field { display: grid; gap: 7px; margin-bottom: 16px; min-width: 0; }
.field > label, .field > legend, .label { font-weight: 600; font-size: var(--fs-sm); color: var(--text); }
.field > legend { margin-bottom: 7px; }
.opt { font-weight: 500; color: var(--text-3); }
.hint { font-size: var(--fs-xs); color: var(--text-3); }
input:where(:not([type="checkbox"], [type="radio"], [type="range"], [type="file"])), select, textarea {
  width: 100%; height: 48px; padding: 0 14px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text);
  font-size: 1rem; line-height: 1.3;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
textarea { height: auto; min-height: 120px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--text-3); opacity: .8; }
input:where(:not([type="checkbox"], [type="radio"], [type="range"])):hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--text) 30%, transparent); }
input:where(:not([type="checkbox"], [type="radio"], [type="range"])):focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: var(--ring);
}
select {
  appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%237b8699' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; flex: none; cursor: pointer; }
.is-invalid, input.is-invalid, select.is-invalid, textarea.is-invalid { border-color: var(--red) !important; }
.is-invalid:focus-visible { box-shadow: 0 0 0 3px var(--red-soft) !important; }
.field-err { display: flex; gap: 6px; align-items: flex-start; color: var(--red); font-size: var(--fs-sm); font-weight: 500; }
.field-err svg { margin-top: 2px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: var(--fs-sm); color: var(--text-2); cursor: pointer; margin: 4px 0 18px; }
.check input { margin-top: 2px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }

/* choice pills: a radio or checkbox drawn as a button */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { position: relative; }
.pill input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.pill span {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px;
  border: 1px solid var(--border-strong); border-radius: var(--r-full); background: var(--surface);
  font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); transition: all var(--t) var(--ease);
}
.pill:hover span { border-color: color-mix(in srgb, var(--text) 30%, transparent); color: var(--text); }
.pill input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); box-shadow: inset 0 0 0 1px var(--accent); }
.pill input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

/* the honeypot field robots fill in and people never see */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.form-status:empty { display: none; }
.form-status { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-sm); margin: 4px 0 16px; font-size: var(--fs-sm); font-weight: 500; }
.form-status svg { margin-top: 2px; }
.form-status.is-ok { background: var(--green-soft); color: var(--green); }
.form-status.is-err { background: var(--red-soft); color: var(--red); }

/* ---- surfaces ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 24px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips > li, .chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--r-full);
  font-size: var(--fs-sm); font-weight: 600; color: var(--text);
}
.rows > div { display: grid; grid-template-columns: minmax(110px, 34%) 1fr; gap: 16px; padding: 12px 0; border-top: 1px solid var(--border); }
.rows > div:first-child { border-top: 0; }
.rows dt { color: var(--text-3); font-size: var(--fs-sm); font-weight: 500; }
.rows dd { color: var(--text); overflow-wrap: anywhere; }

/* ---- feedback ---- */
.spinner { display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast-zone { position: fixed; z-index: var(--z-toast); left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r);
  background: #0e1726; color: #f2f6fc; border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .55); font-size: var(--fs-sm); font-weight: 600;
  animation: toast-in var(--t-slow) var(--ease-out);
}
.toast svg { color: #4cc3ff; }
.toast.is-err svg { color: #ff8a8a; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---- dialogs ---- */
dialog.dlg {
  width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 0; overflow: auto;
  border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--surface); color: var(--text-body);
  box-shadow: var(--shadow-lg);
}
dialog.dlg::backdrop { background: var(--overlay); backdrop-filter: blur(3px); }
dialog.dlg[open] { animation: dlg-in var(--t-slow) var(--ease-out); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 0; }
.dlg-head h2 { font-size: 1.3rem; }
.dlg-body { padding: 14px 22px 4px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding: 14px 22px 22px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *:not(.spinner), *:not(.spinner)::before, *:not(.spinner)::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important;
  }
}
dialog.dlg.dlg-wide { width: min(780px, calc(100vw - 24px)); }
@media (max-width: 560px) {
  dialog.dlg { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: var(--r-lg); }
  .dlg-head { padding: 16px 16px 0; }
  .dlg-body { padding: 12px 16px 4px; }
  .dlg-foot { padding: 12px 16px 16px; }
  .dlg-foot .btn { flex: 1 1 auto; }
}
