/* Archivo, latin subset (SIL OFL, see assets/fonts/OFL.txt) */
@font-face {
  font-family: "Archivo";
  src: url("assets/fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #070b14;
  --bg-raised: #0c1322;
  --ink: #edf1f8;
  --ink-dim: #9aa6bc;
  --accent: #2f6bff;
  --accent-text: #5b8bff;   /* links, small text */
  --accent-fill: #2a62f0;   /* button bg */
  --accent-fill-hover: #2257e0;
  --accent-soft: rgba(47, 107, 255, 0.14);
  --line: rgba(154, 166, 188, 0.16);
  --nav-h: 4.5rem;
  --radius: 14px;
  --container: 1120px;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Archivo", var(--font);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1px);
  scrollbar-color: #26344f var(--bg);
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(47, 107, 255, 0.45); color: #fff; }

img { max-width: 100%; display: block; }

/* background specks, drawn by script.js */
.bg-dust {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

h1, h2, h3, h4 {
  margin: 0 0 0.6em;
  font-family: var(--display);
  font-stretch: 87.5%;
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.6rem, 8vw, 4.9rem);
  font-weight: 700;
}

h2 { font-size: clamp(1.8rem, 4.2vw, 2.7rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }

p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: var(--ink); text-decoration-color: rgba(154, 166, 188, 0.5); text-underline-offset: 3px; }
a:hover { color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
/* headings focused by script */
[tabindex="-1"]:focus { outline: none; }

.container {
  width: min(var(--container), 100% - 2.5rem);
  margin-inline: auto;
}

.section { padding: clamp(4.5rem, 10vw, 7.5rem) 0; position: relative; }

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 100;
  background: var(--accent-fill);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  text-decoration: none;
}
.skip-link:focus { top: 0.75rem; }

/* Buttons */

.btn {
  display: inline-block;
  padding: 0.85rem 1.6rem;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.btn-primary {
  background: var(--accent-fill);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-fill-hover);
  color: #fff;
  transform: translateY(-1px);
}

/* must follow :hover */
.btn:active { transform: scale(0.98); }

/* Nav */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 11, 20, 0.42);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease, background-color 200ms ease;
}
.nav.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(7, 11, 20, 0.58);
}

.nav-inner {
  width: min(var(--container), 100% - 2.5rem);
  margin-inline: auto;
  min-height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.wordmark em { font-style: normal; color: var(--accent-text); }
.wordmark img { width: 34px; height: 34px; }

.site-nav { display: flex; align-items: center; gap: 1.8rem; }
.site-nav ul {
  display: flex;
  gap: 1.8rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav ul a {
  text-decoration: none;
  color: var(--ink-dim);
  font-weight: 600;
  font-size: 1rem;
  padding-block: 0.3rem;
  background: linear-gradient(currentColor, currentColor) no-repeat left bottom / 0 1.5px;
  transition: color 140ms ease, background-size 220ms var(--ease-out);
}
.site-nav ul a:hover,
.site-nav ul a:focus-visible { color: var(--ink); background-size: 100% 1.5px; }

/* scroll-spy */
.site-nav ul a.is-active {
  color: var(--ink);
  background-image: linear-gradient(var(--accent-text), var(--accent-text));
  background-size: 100% 2px;
}

.btn-nav { padding: 0.6rem 1.2rem; font-size: 0.95rem; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 200ms ease, opacity 200ms ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Scrubber */

/* 10px hit area, 3px drawn; keep under ~13px or it overlaps the nav button */
.scrubber {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 10px;
  z-index: 9999;
  overflow: hidden;
  cursor: pointer;
  pointer-events: auto;
}

/* track + ticks every 8% */
.scrubber::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0 1px, transparent 1px 8%),
    rgba(255, 255, 255, 0.08);
  transition: height 140ms ease;
}

.scrubber-fill {
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: height 140ms ease;
}

/* playhead rides this layer's left edge */
.scrubber-head-layer {
  position: absolute;
  inset: 0;
  transform: translateX(0);
}
.scrubber-head {
  position: absolute;
  top: 0;
  left: -5px;
  width: 10px;
  height: 7px;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

@media (hover: hover) {
  .scrubber:hover::before,
  .scrubber:hover .scrubber-fill { height: 5px; }
}

html:not(.js) .scrubber { display: none; }

/* Hero */

.hero {
  position: relative;
  isolation: isolate;
  min-height: calc(92vh - var(--nav-h));
  min-height: calc(92svh - var(--nav-h));
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: clamp(5rem, 12vw, 8rem) 0;
  border-bottom: 1px solid var(--line);
}

.hero-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 800ms ease;
}
.hero.has-video .hero-video { opacity: 1; }
/* darken footage for text contrast */
.hero.has-video::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(7, 11, 20, 0.62);
  pointer-events: none;
}
.hero.has-video .hero-sub,
.hero.has-video .hero-call { color: var(--ink); }
.hero.has-video :focus-visible { outline-color: #fff; }

.hero-inner { position: relative; z-index: 2; }
.hero h1 { max-width: 820px; }

.hero-sub {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: var(--ink-dim);
  max-width: 40em;
  margin-bottom: 2.2rem;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.4rem;
}
.hero-call { color: var(--ink-dim); }
.hero-call a { font-weight: 600; white-space: nowrap; }

.hero-controls {
  position: absolute;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 1.75rem);
  z-index: 2;
  display: flex;
  gap: 0.5rem;
}
.hero-controls[hidden] { display: none; }
.hero-control {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  background: rgba(7, 11, 20, 0.6);
  border: 1px solid rgba(237, 241, 248, 0.25);
  border-radius: 8px;
  padding: 0.45rem 0.95rem;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease;
}
.hero-control:hover { border-color: var(--ink); background: rgba(7, 11, 20, 0.85); }

/* Services */

.service-list {
  margin-top: 2.5rem;
  border-top: 1px solid var(--line);
}

.card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) 1.5fr auto;
  align-items: baseline;
  gap: 0.5rem 2.5rem;
  padding: 1.9rem 0;
  border-bottom: 1px solid var(--line);
  transition: border-color 200ms ease;
}
.card h3 {
  margin: 0;
  font-size: clamp(1.4rem, 2.7vw, 1.85rem);
}
.card p { margin: 0; color: var(--ink-dim); }

/* stretched link: the whole row opens the panel */
.card-trigger {
  color: inherit;
  text-decoration: none;
  transition: color 160ms ease;
}
.card-trigger::after {
  content: "";
  position: absolute;
  inset: 0;
}
.card-trigger:focus-visible { outline: none; }
.card-trigger:focus-visible::after {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.card-more {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-text);
  white-space: nowrap;
}

@media (hover: hover) {
  .card:hover { border-bottom-color: rgba(154, 166, 188, 0.4); }
  .card:hover .card-trigger { color: #fff; }
}

/* Service panel: the <dialog> is a transparent full-screen layer, .sd-panel is the box.
   script.js grows it out of the clicked row and back. */

.service-dialog {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: clamp(0.75rem, 3vw, 2rem);
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: hidden;
}
.service-dialog[open] { display: grid; place-items: center; }
.service-dialog::backdrop { background: transparent; }

.sd-scrim {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 14, 0.74);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.sd-panel {
  position: relative;
  width: min(720px, 100%);
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #26344f transparent;
  padding: clamp(1.6rem, 5vw, 2.5rem);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.8);
  transform-origin: 0 0;
}

.sd-close {
  position: absolute;
  top: clamp(0.9rem, 3vw, 1.4rem);
  right: clamp(0.9rem, 3vw, 1.4rem);
  z-index: 1;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(7, 11, 20, 0.6);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease;
}
.sd-close:hover { border-color: var(--ink-dim); background: rgba(154, 166, 188, 0.1); }
.sd-close svg { width: 18px; height: 18px; }

.sd-title {
  font-size: clamp(2rem, 5.2vw, 2.9rem);
  font-weight: 700;
  margin-bottom: 0.5em;
  padding-right: 3rem;
}
.sd-lead {
  color: var(--ink-dim);
  font-size: clamp(1rem, 2vw, 1.125rem);
}
.sd-list {
  list-style: none;
  margin: 1.6rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.8rem;
}
.sd-list li {
  position: relative;
  padding-left: 1.3rem;
}
.sd-list li::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-text);
}
.sd-good { color: var(--ink-dim); margin-top: 1.6rem; }
.sd-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.9rem;
}

/* html has scrollbar-gutter: stable, so this doesn't shift the page */
html.dialog-open { overflow: hidden; }

/* no JS or no <dialog>: details sit under the list */
html:not(.js) .service-dialog,
.no-dialog .service-dialog {
  display: block;
  position: static;
  width: auto;
  height: auto;
  margin-top: 2.5rem;
  padding: 0;
  overflow: visible;
}
html:not(.js) .sd-panel,
.no-dialog .sd-panel {
  width: auto;
  max-height: none;
  overflow: visible;
}
html:not(.js) .service-dialog [data-close],
.no-dialog .service-dialog [data-close] { display: none; }
html:not(.js) .sd-service[hidden],
.no-dialog .sd-service[hidden] { display: block; }
html:not(.js) .sd-service + .sd-service,
.no-dialog .sd-service + .sd-service {
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
}

/* Statement band */

.section-statement {
  padding: clamp(4.5rem, 9vw, 7rem) 0;
  background: rgba(2, 24, 62, 0.86);
}
.statement-title {
  font-size: clamp(2.2rem, 4.8vw, 3.4rem);
  font-weight: 700;
  margin-bottom: 0.45em;
}
.statement-copy {
  color: var(--ink-dim);
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  max-width: 32em;
}

/* About */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 38em);
  gap: clamp(2rem, 6vw, 4.5rem);
  align-items: center;
}
.about-grid:has(.headshot) { grid-template-columns: 1.6fr 1fr; }
.about-text p { color: var(--ink-dim); font-size: 1.125rem; }

.headshot { margin: 0; }
.headshot img { width: 100%; height: auto; border-radius: 8px; }

/* Contact */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}
.contact-intro > p { color: var(--ink-dim); }

.contact-details {
  list-style: none;
  margin: 2.2rem 0 0;
  padding: 0;
  display: grid;
  gap: 1.1rem;
}
.contact-details li { display: grid; gap: 0.15rem; }
.detail-label {
  font-size: 0.9rem;
  color: var(--ink-dim);
}
.contact-details a {
  overflow-wrap: anywhere;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  transition: color 140ms ease;
}
.contact-details a:hover { color: var(--accent-text); }

.contact-form {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.2rem);
  display: grid;
  gap: 1.2rem;
}

.field { display: grid; gap: 0.45rem; }
.field label { font-size: 0.9rem; font-weight: 600; color: var(--ink-dim); }

.field input,
.field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  padding: 0.75rem 0.95rem;
  transition: border-color 140ms ease;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus,
.field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}

.char-count {
  justify-self: end;
  font-size: 0.8rem;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}
.char-count:empty { display: none; }
.char-count.is-limit { color: var(--accent-text); }

.contact-form .btn { justify-self: start; }
.contact-form.is-sending .btn { opacity: 0.65; cursor: progress; }

.form-note {
  font-size: 0.85rem;
  color: var(--ink-dim);
  margin: 0;
  transition: color 200ms ease;
}
.contact-form.is-sent .form-note { color: var(--ink); }
.contact-form.is-sent .form-note::before {
  content: "✓";
  content: "✓" / "";
  margin-right: 0.45em;
  color: var(--accent-text);
  font-weight: 700;
}

/* Footer */

.footer {
  border-top: 1px solid var(--line);
  padding-top: 2.2rem;
  overflow: hidden;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-inner p { color: var(--ink-dim); font-size: 0.9rem; margin: 0; }
.wordmark-footer { font-size: 1rem; }
.wordmark-footer img { width: 28px; height: 28px; }

/* big cropped wordmark; script.js fits it and lifts the letters. Fallback sizes below. */
.footer-mark {
  display: flex;
  justify-content: space-between;
  width: min(var(--container), 100% - 2.5rem);
  height: var(--mark-h, 0.74em);
  margin: clamp(2.5rem, 7vw, 4.5rem) auto 0;
  overflow: hidden;
  font-size: var(--mark-size, min(20vw, 14.5rem));
  font-family: var(--display);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}
.footer-mark span {
  display: block;
  margin-top: var(--mark-shift, 0);
  transition: transform 220ms var(--ease-out);
  will-change: transform;
}

/* Mobile, up to 860px */

@media (max-width: 53.75em) {
  .contact-grid,
  .about-grid,
  .about-grid:has(.headshot) { grid-template-columns: 1fr; }

  .hero { min-height: auto; }
  .hero-ctas .btn { flex: 1 1 auto; text-align: center; }

  .card { grid-template-columns: 1fr; gap: 0.4rem; padding: 1.5rem 0; }
  .card-more { margin-top: 0.3rem; }

  .footer-inner { flex-direction: column; align-items: flex-start; gap: 1.2rem; }

  .js .nav-toggle { display: flex; }

  .js .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    padding: 1rem 1.25rem 1.4rem;
    max-height: calc(100vh - var(--nav-h));
    max-height: calc(100dvh - var(--nav-h));
    overflow-y: auto;
    overscroll-behavior: contain;
    /* solid: backdrop-filter doesn't nest inside .nav */
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 200ms ease, transform 200ms var(--ease-out), visibility 0s linear 200ms;
  }
  .js .site-nav.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity 200ms ease, transform 200ms var(--ease-out), visibility 0s;
  }
  /* keep after .is-open */
  .js .site-nav.no-transition { transition: none; }

  .js .site-nav ul { flex-direction: column; gap: 0; }
  .js .site-nav ul a {
    display: block;
    padding: 0.85rem 0.75rem;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--line);
    background: none;
  }
  .js .site-nav ul a.is-active { box-shadow: inset 2px 0 0 var(--accent-text); }
  .js .btn-nav { margin-top: 0.9rem; text-align: center; }

  html:not(.js) .nav { position: relative; }
  html:not(.js) .nav-inner { flex-wrap: wrap; padding-block: 0.75rem; row-gap: 0.6rem; }
  html:not(.js) .site-nav {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.8rem 1.2rem;
  }
  html:not(.js) .site-nav ul { gap: 1.2rem; }
}

/* keep the nbsp-joined "Colorado Springs" from clipping */
@media (max-width: 23.75em) {
  h1 { font-size: clamp(2.1rem, 11vw, 2.6rem); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-video { transition: none; }
  .card, .card-trigger, .btn, .nav-toggle-bar, .site-nav ul a { transition: none; }
  .js .site-nav, .js .site-nav.is-open { transition: none; }
  .btn-primary:hover { transform: none; }
  .scrubber::before, .scrubber-fill { transition: none; }
  .footer-mark span { transition: none; }
}

@media (forced-colors: active) {
  .nav-toggle-bar { background: ButtonText; }
}

@media print {
  :root {
    color-scheme: light;
    --ink: #111;
    --ink-dim: #444;
    --line: #ccc;
    --accent-text: #1a4fd6;
  }
  body { background: #fff; color: #111; }
  .hero::after, .hero-video, .hero-controls, .site-nav, .nav-toggle, .skip-link, .scrubber,
  .card-more, .service-dialog, .bg-dust, .footer-mark,
  .wordmark img, .contact-form, .hero-ctas {
    display: none !important;
  }
  .nav, .nav.is-scrolled { position: static; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; border: 0; }
  .hero { min-height: 0; padding: 1rem 0; }
  .section { padding: 1.5rem 0; }
  .section-statement { background: none; }
  .card { break-inside: avoid; }
}
