/* ovrEngineered, LLC — site styles
   Single stylesheet, no framework, no build step. */

/* ---------- tokens ---------- */

/* Palette is taken from the ovrEngineered logo sheet: near-black #17181a,
   off-white #fbfbfa, one green accent oklch(0.7 0.14 152) = #4fb772.

   --accent is the brand green, used for graphics (logo node, borders, button
   fills). It only reaches 2.5:1 on a light background, so it must never carry
   text there. --accent-ink is the text-safe counterpart: a darker green in
   light mode, the brand green itself in dark mode where it already clears AA. */
:root {
  --bg: #fbfbfa;
  --surface: #f2f2f0;
  --border: #e0e0dc;
  --text: #17181a;
  --muted: #5c5d60;
  --accent: #4fb772;
  --accent-ink: #007f3d;
  --accent-text: #17181a;
  --focus: #2563eb;

  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  --measure: 68ch;
  --container: 1080px;
  --radius: 6px;

  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: clamp(1.35rem, 1.1rem + 1vw, 1.7rem);
  --step-3: clamp(1.8rem, 1.3rem + 2.2vw, 2.85rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15191a;
    --surface: #1b1f20;
    --border: #2a2e2f;
    --text: #fbfbfa;
    --muted: #9a9a96;
    --accent: #4fb772;
    --accent-ink: #4fb772;
    --accent-text: #17181a;
    --focus: #7aa5ff;
  }
}

/* ---------- base ---------- */

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

/* The page background lives here rather than on body, so the fixed .circuit
   layer can sit at z-index -1 and still paint above it. */
html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 0 0 0.5em; }
h1 { font-size: var(--step-3); letter-spacing: -0.022em; }
h2 { font-size: var(--step-2); letter-spacing: -0.014em; }
h3 { font-size: var(--step-1); letter-spacing: -0.006em; }

p, ul, ol { margin: 0 0 1.1em; }
p { max-width: var(--measure); }

a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

img, svg { max-width: 100%; height: auto; }

/* ---------- layout ---------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.35rem;
}

.section { padding-block: clamp(2.75rem, 7vw, 4.75rem); }
.section + .section { border-top: 1px solid var(--border); }

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  background: var(--bg);
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(8px);
  z-index: 5;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 62px;
  flex-wrap: wrap;
}

/* Logo. img/logo.svg resolves its own light/dark colors internally via a
   prefers-color-scheme block, because an SVG loaded through <img> cannot
   inherit currentColor from this page. */
.logo {
  display: block;
  height: 19px;
  width: auto;
}
.logo-link { display: block; line-height: 0; }

@media (max-width: 30rem) {
  .logo { height: 16px; }
}

.site-nav {
  display: flex;
  gap: 1.15rem;
  align-items: center;
  font-size: 0.94rem;
  flex-wrap: wrap;
}
.site-nav a { text-decoration: none; color: var(--muted); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }

/* ---------- hero ---------- */

.hero { padding-block: clamp(3rem, 9vw, 6rem); }
.hero p.lede {
  font-size: var(--step-1);
  color: var(--muted);
  max-width: 58ch;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin: 0 0 0.85rem;
}

/* ---------- cards ---------- */

.grid {
  display: grid;
  gap: 1.15rem;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  margin-top: 1.9rem;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  background: var(--surface);
}
.card h3 { margin-bottom: 0.35rem; }
.card p { margin-bottom: 0.7rem; color: var(--muted); max-width: none; }
.card p:last-child { margin-bottom: 0; }

.card-featured { border-color: color-mix(in srgb, var(--accent) 42%, var(--border)); }

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.05rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}
.card-links a { color: var(--accent-ink); }

.tags {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--muted);
}
.tags li {
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.1rem 0.42rem;
  background: var(--bg);
}

/* ---------- prose (legal pages) ---------- */

.prose { max-width: var(--measure); }
.prose h2 { margin-top: 2.1rem; }
.prose h3 { margin-top: 1.5rem; }
.prose li { margin-bottom: 0.4rem; }
.prose .updated {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
}

/* ---------- entity / contact details ---------- */

.entity {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  background: var(--surface);
  font-style: normal;
}
.entity dl { margin: 0; display: grid; gap: 0.5rem 1rem; }
.entity dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
.entity dd { margin: 0 0 0.6rem; }
.entity dd:last-child { margin-bottom: 0; }

@media (min-width: 34rem) {
  .entity dl { grid-template-columns: 10rem 1fr; align-items: baseline; }
  .entity dd { margin-bottom: 0; }
}

/* ---------- form ---------- */

.form { max-width: 34rem; margin-top: 1.6rem; }

.field { margin-bottom: 1.05rem; }
.field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.32rem;
}
.field .hint { font-weight: 400; color: var(--muted); }

.field input, .field textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.7rem;
}
.field textarea { min-height: 8.5rem; resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible { border-color: var(--focus); }

/* Honeypot — hidden from people, reachable by naive bots. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.btn {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-text);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0.62rem 1.15rem;
}
.btn:hover { filter: brightness(1.08); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; filter: none; }

.form-status {
  margin-top: 0.95rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.93rem;
}
.form-status[hidden] { display: none; }
.form-status.is-error { border-color: #d14343; }
.form-status.is-ok { border-color: #2f855a; }

.field-error {
  display: block;
  color: #d14343;
  font-size: 0.85rem;
  margin-top: 0.25rem;
}
@media (prefers-color-scheme: dark) {
  .field-error, .form-status.is-error { color: #ff8f8f; }
  .form-status.is-error { border-color: #ff8f8f; }
}

/* Shown only when JavaScript is unavailable. */
.nojs-note {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0.85rem 1rem;
  margin-top: 1.6rem;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 2.2rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.site-footer .footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
  justify-content: space-between;
}
.site-footer address { font-style: normal; }
.site-footer .legal-name { color: var(--text); font-weight: 600; }
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.15rem;
  align-items: flex-start;
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }
.site-footer .colophon { margin: 1.6rem 0 0; font-size: 0.84rem; }

/* ---------- circuit field ---------- */

/* A fixed layer behind all content: the logo's trace-and-node motif tiled at
   320px, plus a few slow signal pulses travelling along those traces.

   The page background lives on <html> and body is transparent, so this layer
   can sit at z-index -1 without disappearing behind the body's own background. */

.circuit {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='320' viewBox='0 0 320 320'><g fill='none' stroke='%2317181a' stroke-width='1.25' stroke-opacity='0.09' stroke-linecap='round'><path d='M0 58 H320'/><path d='M0 236 H320'/><path d='M104 0 V320'/><path d='M262 0 V320'/><path d='M30 112 H74 A9 9 0 0 1 83 121 V168'/><path d='M158 26 H208 A9 9 0 0 1 217 35 V92'/><path d='M300 148 H214 A9 9 0 0 0 205 157 V196'/><path d='M44 268 H126 A9 9 0 0 0 135 259 V206'/><path d='M186 300 H236 A9 9 0 0 0 245 291 V262'/><path d='M20 196 H62'/><path d='M232 118 H286'/></g><g fill='%234fb772' fill-opacity='0.4'><circle cx='30' cy='112' r='2.8'/><circle cx='83' cy='168' r='2.8'/><circle cx='158' cy='26' r='2.8'/><circle cx='217' cy='92' r='2.8'/><circle cx='300' cy='148' r='2.8'/><circle cx='205' cy='196' r='2.8'/><circle cx='44' cy='268' r='2.8'/><circle cx='135' cy='206' r='2.8'/><circle cx='186' cy='300' r='2.8'/><circle cx='245' cy='262' r='2.8'/><circle cx='20' cy='196' r='2.8'/><circle cx='286' cy='118' r='2.8'/><circle cx='104' cy='58' r='2.8'/><circle cx='262' cy='236' r='2.8'/></g></svg>");
  background-size: 320px 320px;
}

@media (prefers-color-scheme: dark) {
  .circuit { background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='320' viewBox='0 0 320 320'><g fill='none' stroke='%23fbfbfa' stroke-width='1.25' stroke-opacity='0.1' stroke-linecap='round'><path d='M0 58 H320'/><path d='M0 236 H320'/><path d='M104 0 V320'/><path d='M262 0 V320'/><path d='M30 112 H74 A9 9 0 0 1 83 121 V168'/><path d='M158 26 H208 A9 9 0 0 1 217 35 V92'/><path d='M300 148 H214 A9 9 0 0 0 205 157 V196'/><path d='M44 268 H126 A9 9 0 0 0 135 259 V206'/><path d='M186 300 H236 A9 9 0 0 0 245 291 V262'/><path d='M20 196 H62'/><path d='M232 118 H286'/></g><g fill='%234fb772' fill-opacity='0.45'><circle cx='30' cy='112' r='2.8'/><circle cx='83' cy='168' r='2.8'/><circle cx='158' cy='26' r='2.8'/><circle cx='217' cy='92' r='2.8'/><circle cx='300' cy='148' r='2.8'/><circle cx='205' cy='196' r='2.8'/><circle cx='44' cy='268' r='2.8'/><circle cx='135' cy='206' r='2.8'/><circle cx='186' cy='300' r='2.8'/><circle cx='245' cy='262' r='2.8'/><circle cx='20' cy='196' r='2.8'/><circle cx='286' cy='118' r='2.8'/><circle cx='104' cy='58' r='2.8'/><circle cx='262' cy='236' r='2.8'/></g></svg>"); }
}

/* The glow is what separates a travelling pulse from the static node dots it
   passes over — without it the two read as the same brightness. */
.circuit span {
  position: absolute;
  top: 0;
  left: 0;
  width: 5.5px;
  height: 5.5px;
  margin: -2.75px 0 0 -2.75px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 7px 1px var(--accent);
  opacity: 0;
  animation-name: trace-pulse;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.circuit span:nth-child(1) { offset-path: path("M40 378 H460"); animation-duration: 20s; animation-delay: 0s; }
.circuit span:nth-child(2) { offset-path: path("M424 120 V540"); animation-duration: 24s; animation-delay: 5s; }
.circuit span:nth-child(3) { offset-path: path("M640 556 H1060"); animation-duration: 18s; animation-delay: 9s; }
.circuit span:nth-child(4) { offset-path: path("M744 400 V820"); animation-duration: 26s; animation-delay: 2.5s; }
.circuit span:nth-child(5) { offset-path: path("M900 698 H1320"); animation-duration: 22s; animation-delay: 13s; }

/* Travel occupies the first 30% of the cycle; the rest is a dark pause, so the
   field stays quiet rather than constantly busy. */
@keyframes trace-pulse {
  0%   { offset-distance: 0%;   opacity: 0; }
  4%   { opacity: 0.85; }
  26%  { opacity: 0.85; }
  30%  { offset-distance: 100%; opacity: 0; }
  100% { offset-distance: 100%; opacity: 0; }
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  /* Static traces stay; the travelling pulses go away entirely. */
  .circuit span { display: none; }
}
