/* ============================================================
   THE 808 — design tokens
   Palette drawn from the TR-808 drum machine: ink-blue chassis,
   orange-red step LEDs, warm paper for print-like contrast.

   Flat pass: every soft edge and glow removed in favor of hard,
   pixel-true geometry — the reduction logic of a Nike or Apple
   mark applied to 80s hardware. Same tokens, same components,
   sharper execution. No other file touched.
   ============================================================ */

:root {
  --ink: #12141c;
  --ink-2: #1b2b2c;
  --paper: #efebe2;
  --paper-dim: #cfcabd;
  --signal: #ff5a2e;
  --signal-dim: #99351a;
  --line: #2a2e38;
  --steel: #8890a0;

  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Public Sans", sans-serif;
  --font-mono: "Space Mono", monospace;

  --measure: 62ch;
  --gap: clamp(1.25rem, 2vw, 2.5rem);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* Stop iOS/Safari from inflating text in landscape without
     disabling the user's own pinch-zoom. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Removes the grey flash box iOS/Android Chrome draw over tapped
     links; the :focus-visible outline still handles accessibility. */
  -webkit-tap-highlight-color: rgba(255, 90, 46, 0.15);
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; max-width: var(--measure); }

a {
  color: inherit;
  text-decoration-color: var(--signal-dim);
  text-underline-offset: 3px;
}
a:hover { text-decoration-color: var(--signal); }

/* Fallback first: Safari < 15.4 has no :focus-visible, and without
   this it would render no focus ring at all. Browsers that DO support
   :focus-visible override it below, so mouse users don't see rings. */
a:focus,
button:focus,
input:focus,
textarea:focus {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
  outline: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

img { max-width: 100%; display: block; }

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}

section { padding: clamp(3.5rem, 8vw, 7rem) 0; }

/* ---------- step-bar motif (the one bold, repeated device) ---------- */

.stepbar {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 5px;
  width: 100%;
}
.stepbar span {
  height: 6px;
  background: var(--line);
  border-radius: 0;
}
.stepbar span.lit {
  background: var(--signal);
}
.stepbar.small { gap: 3px; }
.stepbar.small span { height: 3px; }

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

header {
  position: -webkit-sticky; /* older iOS Safari */
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(18, 20, 28, 0.92);
  -webkit-backdrop-filter: saturate(140%) blur(6px); /* Safari, all iOS browsers */
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--line);
}
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--paper);
  text-decoration: none;
}
.logo .mark { width: 26px; height: 26px; flex: none; }
.logo .mark rect { rx: 0; }
.logo .mark rect.on { fill: var(--signal); }
.logo .mark rect.off { fill: var(--line); }

.brand-group { display: flex; align-items: center; gap: 0.7rem; }

nav.links { display: flex; gap: clamp(1rem, 2vw, 2rem); }
nav.links a {
  font-size: 0.92rem;
  text-decoration: none;
  color: var(--steel);
}
nav.links a:hover { color: var(--paper); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--paper);
  width: 44px;
  height: 44px;
  border-radius: 0;
  font-size: 1.1rem;
  cursor: pointer;
  flex: none;
}

@media (max-width: 760px) {
  nav.links {
    position: absolute;
    /* Longhand instead of `inset:` — the shorthand is unsupported on
       Safari < 14.1, where it would silently drop and leave the menu
       unpositioned. */
    top: 100%;
    left: 0;
    right: 0;
    bottom: auto;
    background: var(--ink);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    padding: 1rem clamp(1.25rem, 4vw, 3rem) 1.5rem;
    gap: 1.25rem;
    display: none;
  }
  nav.links.open { display: flex; }
  nav.links a { font-size: 1rem; display: block; padding: 0.4rem 0; }
  .nav-toggle { display: block; }
}

/* No-JS safety net: the mobile menu is hidden until script.js toggles
   it open, so if that script is blocked or fails to load, navigation
   would be unreachable on a phone. With JS off, show the links inline
   and hide the (now inert) toggle button instead. */
.no-js nav.links {
  display: flex;
  position: static;
  flex-direction: row;
  flex-wrap: wrap;
  padding: 0;
  border-bottom: none;
  gap: 1rem;
}
.no-js .nav-toggle { display: none; }
@media (max-width: 760px) {
  .no-js .nav-row { flex-wrap: wrap; gap: 0.5rem 0; }
  .no-js nav.links { width: 100%; }
  .no-js nav.links a { padding: 0.2rem 0; }
}

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

.hero { padding-top: clamp(3rem, 8vw, 6rem); }
.hero .stepbar { margin-bottom: clamp(2rem, 6vw, 3.5rem); }
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  max-width: 14ch;
}
.hero .lede {
  margin-top: 1.25rem;
  max-width: 46ch;
  color: var(--paper-dim);
  font-size: 1.15rem;
}
.hero .lede em {
  color: var(--paper);
  font-style: normal;
  border-bottom: 1px solid var(--signal-dim);
}
.hero .actions {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.btn {
  display: inline-block;
  background: var(--signal);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  padding: 0.8rem 1.6rem;
  border-radius: 0;
  text-decoration: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  /* .btn is used on both <a> and <button>; iOS styles native buttons
     differently, so normalize and keep them visually identical. */
  -webkit-appearance: none;
  appearance: none;
  line-height: 1.2;
  text-align: center;
}
.btn:hover { background: #ff7350; }
.btn.ghost {
  background: none;
  border: 1px solid var(--line);
  color: var(--paper);
}
.btn.ghost:hover { border-color: var(--steel); }

/* ---------- section headings ---------- */

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.5rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.section-head .note {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--steel);
  padding-bottom: 0.2rem;
}
@media (max-width: 480px) {
  .section-head { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
}

/* ---------- research pillars ---------- */

.pillars {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: var(--gap);
}
.pillar {
  border-top: 2px solid var(--signal);
  padding-top: 1.25rem;
}
.pillar:nth-child(n+2) { border-top-color: var(--line); }
.pillar h3 { font-size: 1.25rem; margin-bottom: 0.7rem; }
.pillar p { color: var(--paper-dim); font-size: 0.98rem; }

@media (max-width: 860px) {
  .pillars { grid-template-columns: 1fr; }
}

/* ---------- radar list ---------- */

.radar-group { margin-bottom: clamp(2rem, 5vw, 3rem); }
.radar-group h3 {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--steel);
  font-weight: 400;
  margin-bottom: 1rem;
}
.radar-row {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 1rem;
  align-items: baseline;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}
.radar-row .dot {
  width: 7px; height: 7px; border-radius: 0;
  background: var(--signal);
  align-self: center;
}
.radar-row h4 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.02rem;
  margin: 0 0 0.3rem;
}
.radar-row p {
  margin: 0;
  font-size: 0.94rem;
  color: var(--paper-dim);
  max-width: 58ch;
}
.radar-row .src {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--steel);
  text-decoration: underline;
  white-space: nowrap;
}
.radar-row .src:hover { color: var(--signal); }

@media (max-width: 640px) {
  .radar-row { grid-template-columns: 14px 1fr; }
  .radar-row .src { grid-column: 2; }
}

/* ---------- strategy / stat block ---------- */

.strategy {
  background: var(--ink-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat-block {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
}
.stat-block .num {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 10vw, 6.5rem);
  color: var(--signal);
  line-height: 1;
}
.stat-block .num small {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--steel);
  margin-top: 0.6rem;
}
@media (max-width: 640px) {
  .stat-block { grid-template-columns: 1fr; }
}

/* ---------- services / info cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}
.info-card {
  border: 1px solid var(--line);
  padding: 1.5rem;
  border-radius: 0;
}
.info-card .badge-mark {
  width: 20px;
  height: 20px;
  margin-bottom: 1rem;
}
.info-card .badge-mark rect { rx: 0; }
.info-card .badge-mark .on { fill: var(--signal); }
.info-card .badge-mark .off { fill: var(--line); }
.info-card h3 { margin: 0 0 0.5rem; font-size: 1.15rem; }
.info-card p { color: var(--paper-dim); font-size: 0.92rem; margin-bottom: 1rem; }
.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--signal);
  border: 1px solid var(--signal-dim);
  padding: 0.25rem 0.6rem;
  border-radius: 0;
}
@media (max-width: 860px) {
  .card-grid { grid-template-columns: 1fr; }
}

/* ---------- duo grid (two-up, about page) ---------- */

.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}
@media (max-width: 760px) {
  .duo { grid-template-columns: 1fr; }
}

/* ---------- delivery ethos (services page) ---------- */

.process {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--gap);
}
.process-step {
  border-top: 2px solid var(--signal);
  padding-top: 1.25rem;
}
.process-step .step-index {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--signal);
  margin-bottom: 0.6rem;
}
.process-step h3 { font-size: 1.08rem; margin-bottom: 0.5rem; }
.process-step p { color: var(--paper-dim); font-size: 0.9rem; margin-bottom: 0; }

@media (max-width: 960px) {
  .process { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .process { grid-template-columns: 1fr; }
}

/* ---------- CTA strip (services page) ---------- */

.cta-strip {
  background: var(--ink-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.cta-strip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
  flex-wrap: wrap;
}
.cta-strip h2 { font-size: clamp(1.5rem, 3vw, 2rem); max-width: 22ch; }
.cta-strip p { color: var(--paper-dim); margin-top: 0.5rem; margin-bottom: 0; max-width: 46ch; }
.cta-strip .btn { flex: none; }

@media (max-width: 640px) {
  .cta-strip-row { flex-direction: column; align-items: flex-start; }
}

/* ---------- contact page ---------- */

.contact-page-hero { padding-top: clamp(3rem, 8vw, 5rem); padding-bottom: 1rem; }
.contact-page-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); max-width: 16ch; }
.contact-page-hero .lede { margin-top: 1rem; max-width: 46ch; color: var(--paper-dim); font-size: 1.1rem; }

.contact-options {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(1.5rem, 5vw, 3rem);
  align-items: start;
}
.email-card, .form-card {
  border: 1px solid var(--line);
  border-radius: 0;
  padding: clamp(1.5rem, 4vw, 2.25rem);
}
.email-card { background: var(--ink-2); }
.email-card h2, .form-card h2 { font-size: 1.3rem; margin-bottom: 0.6rem; }
.email-card p { color: var(--paper-dim); font-size: 0.95rem; margin-bottom: 1.5rem; }
.email-card .btn { width: 100%; text-align: center; word-break: break-word; }
.email-card .response-note { margin-top: 1.25rem; font-size: 0.82rem; color: var(--steel); }

.form-card form { gap: 1.25rem; }
.form-card .field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.form-card .optional-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--steel);
  font-weight: 400;
  text-transform: none;
  margin-left: 0.35rem;
}

.form-success {
  border: 1px solid var(--signal-dim);
  background: rgba(255, 90, 46, 0.08);
  border-radius: 0;
  padding: 1.5rem;
}
.form-success p:first-child { color: var(--paper); font-weight: 700; margin-bottom: 0.4rem; }
.form-success p:last-child { color: var(--paper-dim); margin: 0; }

.form-error {
  border: 1px solid var(--signal-dim);
  color: var(--signal);
  font-size: 0.9rem;
  padding: 0.85rem 1rem;
  border-radius: 0;
  margin-bottom: 1.25rem;
}

@media (max-width: 760px) {
  .contact-options { grid-template-columns: 1fr; }
  .form-card .field-row { grid-template-columns: 1fr; gap: 1.25rem; }
}

/* ---------- contact (legacy — kept in case an old embedded-section
   link still points at it; the contact page above is now primary) ---------- */

.contact { background: var(--ink-2); }
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
}
.contact h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); max-width: 12ch; }
.contact .lede { color: var(--paper-dim); margin-top: 1rem; }

form { display: flex; flex-direction: column; gap: 1.1rem; }
label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--steel);
  display: block;
  margin-bottom: 0.4rem;
}
input, textarea {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--line);
  color: var(--paper);
  padding: 0.75rem 0.9rem;
  font-family: var(--font-body);
  /* Must stay >= 16px: iOS WebKit (Safari, and Chrome/Firefox/DuckDuckGo
     on iOS, which all use it) auto-zooms the page when a field smaller
     than this receives focus. */
  font-size: 16px;
  border-radius: 0;
  /* iOS applies its own inner shadow + rounding to form controls
     without this. */
  -webkit-appearance: none;
  appearance: none;
}
input:focus, textarea:focus { border-color: var(--signal); }
textarea { resize: vertical; min-height: 110px; }
.form-note { font-size: 0.85rem; color: var(--steel); margin-top: 0.5rem; }

@media (max-width: 760px) {
  .contact-grid { grid-template-columns: 1fr; }
}

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

footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem 0;
}
.foot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.foot-links { display: flex; gap: 1.5rem; list-style: none; padding: 0; margin: 0; }
.foot-links a { font-size: 0.88rem; color: var(--steel); text-decoration: none; }
.foot-links a:hover { color: var(--paper); }
.copyright { font-family: var(--font-mono); font-size: 0.78rem; color: var(--steel); margin-top: 1.5rem; }
