/* SovereignStackAI — Direction B "Built for the trades". Mobile first, one column. */

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62.5% 125%;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/source-sans-3-latin.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}

:root {
  --char: #1f2124;
  --line: #3a3e44;
  --amber: #ffb300;
  --concrete: #efede8;
  --steel: #8a9099;
  --field-border: #6f757d; /* 3:1 or better on white and on concrete */
  --done: #2f7d4f;
  --ink: #1f2124;
  --ink-soft: #4d5157;
  --on-dark: #ffffff;
  --on-dark-soft: #cfd2d6;
  --error: #a3241a;
  --radius: 6px;
  --head: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--concrete);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.1875rem; /* 19px */
  line-height: 1.55;
}

.wrap {
  max-width: 40rem;
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2 {
  font-family: var(--head);
  font-stretch: 112%;
  font-weight: 800;
  line-height: 1.06;
  margin: 0 0 16px;
  letter-spacing: -0.005em;
}

h1 { font-size: clamp(2.1rem, 8.5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 6vw, 2.2rem); }

p { margin: 0 0 14px; }

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--char);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--amber);
}

/* On the dark blocks a charcoal ring would vanish, so flip it to amber. */
.dark :focus-visible,
.topbar :focus-visible,
.footer :focus-visible {
  outline-color: var(--amber);
  box-shadow: none;
}

/* The form card is light, inside the dark #form block. */
#form-body form :focus-visible,
.confirmation :focus-visible {
  outline-color: var(--char);
  box-shadow: 0 0 0 5px var(--amber);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Top bar + nameplate ---------- */

.topbar {
  background: var(--char);
  color: var(--on-dark);
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.plate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 2px solid currentColor;
  border-radius: var(--radius);
  padding: 5px 9px 5px 12px;
  position: relative;
  font-family: var(--head);
  font-stretch: 125%;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1;
}

.plate::before, .plate::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 5px;
  height: 5px;
  margin-top: -2.5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

.plate::before { left: 3px; }
.plate::after { right: 3px; }

.plate-name { font-size: 0.95rem; }

.plate-ai {
  background: var(--amber);
  color: var(--char);
  padding: 3px 6px;
  border-radius: 3px;
  font-size: 0.8rem;
  margin-right: 4px;
}

/* ---------- Blocks ---------- */

.block { padding: 48px 0; }

.block + .block { border-top: 1px solid #dcd9d2; }

.dark {
  background-color: var(--char);
  color: var(--on-dark);
  border-top: none;
}

#promise {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
  padding: 40px 0 52px;
}

.kicker {
  display: inline-block;
  font-family: var(--head);
  font-stretch: 110%;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--char);
  background: var(--amber);
  padding: 3px 9px;
  border-radius: 3px;
  margin-bottom: 18px;
}

.keeps {
  font-family: var(--head);
  font-stretch: 105%;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--on-dark);
}

.lead { color: var(--on-dark-soft); font-size: 1.2rem; }

.fine { color: var(--on-dark-soft); font-size: 1rem; margin-top: 14px; }

/* ---------- Buttons ---------- */

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 14px 24px;
  margin-top: 8px;
  border: 0;
  border-radius: 4px;
  background: var(--amber);
  color: var(--char);
  font-family: var(--head);
  font-stretch: 108%;
  font-weight: 800;
  font-size: 1.1rem;
  text-decoration: none;
  cursor: pointer;
  width: 100%;
}

.cta:hover { background: #ffc233; }

.cta:disabled { opacity: 0.55; cursor: not-allowed; }

.cta-quiet {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--ink);
  margin-top: 20px;
}

.cta-quiet:hover { background: #e3e0d9; }

@media (min-width: 560px) {
  .cta { width: auto; }
}

/* ---------- Who ---------- */

.not { color: var(--ink-soft); }

/* ---------- Functions ---------- */

.functions {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: grid;
  gap: 10px;
}

.functions li {
  background: #ffffff;
  border-radius: var(--radius);
  border-top: 5px solid var(--char);
  padding: 14px 16px;
  color: var(--ink);
}

.functions strong {
  display: block;
  font-family: var(--head);
  font-stretch: 110%;
  font-weight: 800;
  font-size: 1.1rem;
}

.functions span { color: var(--ink-soft); }

.hardware {
  font-size: 1rem;
  color: var(--ink-soft);
  border-left: 3px solid var(--steel);
  padding-left: 12px;
}

/* ---------- Example (work orders) ---------- */

.orders {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 10px;
}

.order {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  background: var(--char);
  color: var(--on-dark);
  border-radius: var(--radius);
  padding: 12px 14px 12px 18px;
  position: relative;
}

.order::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  background: var(--amber);
  border-radius: 0 2px 2px 0;
}

.order small {
  grid-column: 1 / -1;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #b9bdc3;
}

.order b { font-weight: 600; font-size: 1.05rem; }

.order em {
  font-style: normal;
  font-weight: 800;
  font-size: 0.8rem;
  align-self: center;
  padding: 3px 9px;
  border-radius: 3px;
  background: var(--done);
  color: #ffffff;
}

.order em.tag-in { background: var(--amber); color: var(--char); }

.caption { font-size: 0.95rem; color: var(--ink-soft); }

/* ---------- Control ---------- */

.control-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.control-list li {
  padding-left: 30px;
  position: relative;
}

.control-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.45em;
  width: 14px;
  height: 8px;
  border-left: 3px solid var(--done);
  border-bottom: 3px solid var(--done);
  transform: rotate(-45deg);
}

/* ---------- Form ---------- */

#form { scroll-margin-top: 12px; }

#form-body form,
.confirmation {
  background: var(--concrete);
  color: var(--ink);
  border-radius: var(--radius);
  border-top: 6px solid var(--amber);
  padding: 22px 18px 24px;
}

.field { margin: 0 0 18px; border: 0; padding: 0; min-width: 0; }

label, legend { display: block; font-weight: 700; margin-bottom: 6px; color: var(--ink); }

legend { padding: 0; }

input[type="text"],
textarea {
  width: 100%;
  font: inherit;
  font-size: 1.1rem;
  color: var(--ink);
  background: #ffffff;
  border: 2px solid var(--field-border);
  border-radius: 4px;
  padding: 11px 12px;
  min-height: 48px;
}

input[type="text"]:focus,
textarea:focus { border-color: var(--char); }

input::placeholder, textarea::placeholder { color: #6b7078; }

input[aria-invalid="true"],
textarea[aria-invalid="true"] { border-color: var(--error); }

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--char);
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  margin: 2px 0 0;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 0;
  padding: 8px 14px 8px 10px;
  background: #ffffff;
  border: 2px solid var(--field-border);
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
}

.chip:has(input:focus-visible) { border-color: var(--char); }

.chip:has(input:checked) {
  border-color: var(--char);
  box-shadow: inset 0 -4px 0 var(--amber);
}

.radio, .check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  font-weight: 600;
  cursor: pointer;
}

.detail {
  margin: 4px 0 20px;
  border-top: 1px solid #cfccc4;
  border-bottom: 1px solid #cfccc4;
}

.detail summary {
  display: flex;
  align-items: center;
  min-height: 48px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.detail summary::-webkit-details-marker { display: none; }

.detail summary::before {
  content: "+" / "";
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-right: 10px;
  border: 2px solid var(--ink);
  border-radius: 3px;
  font-weight: 800;
  line-height: 1;
}

.detail[open] summary::before { content: "–" / ""; }

.detail[open] { padding-bottom: 8px; }

.detail > .check { margin-bottom: 18px; }

.control-box {
  background: #ffffff;
  border: 2px solid var(--char);
  border-radius: var(--radius);
  padding: 12px 14px 4px;
}

.help { font-size: 1rem; color: var(--ink-soft); margin: 4px 0 8px; }

.field-error,
.send-error {
  color: var(--error);
  font-weight: 700;
  font-size: 1rem;
  margin: 6px 0 0;
}

.send-error { margin-top: 14px; }

[hidden] { display: none !important; }

.confirmation h2 { font-size: clamp(1.5rem, 5.5vw, 2rem); }

.confirmation h2:focus { outline: none; box-shadow: none; }

.back-top {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
}

/* ---------- Footer ---------- */

.footer {
  background: var(--char);
  color: var(--on-dark-soft);
  font-size: 0.95rem;
  padding: 18px 0 26px;
  border-top: 1px solid var(--line);
}

.footer p { margin: 0; }
