/* ============================================================
   D SPOT — SIGNAL design system (production)
   Hand-written replacement for the demo's Tailwind utilities.
   Two self-hosted variable fonts. Dark, engineered, restrained.
   ============================================================ */

/* ---------- fonts ---------- */
@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-var-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2013-2014, U+2018-201A, U+201C-201E, U+2026, U+2212;
}
@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-var-latin-ext.woff2") format("woff2");
  font-weight: 400 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+1E00-1EFF, U+2113;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jbmono-var-latin.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2013-2014, U+2018-201A, U+201C-201E, U+2026, U+2212;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jbmono-var-latin-ext.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
  unicode-range: U+0100-02BA, U+1E00-1EFF, U+2113;
}

/* ---------- tokens ---------- */
:root {
  --bg: #0C0F12;
  --surface: #151A1F;
  --edge: #232B33;
  --txt: #E8ECEF;
  --dim: #9AA3AD;
  --signal: #FF3B30;
  --metric: #2BD98F;
  --display: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Courier New", monospace;
  --container: 1152px;
  --pad: 24px;
}

/* ---------- reset-lite & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--txt);
  font-family: var(--display);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
ul, ol { list-style: none; }
h1, h2, h3 { hyphens: auto; overflow-wrap: break-word; }
strong, b { font-weight: 600; color: var(--txt); }

/* blueprint grid backdrop (hero area only, fades out) */
.grid-backdrop::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .35;
  background-image:
    linear-gradient(var(--edge) 1px, transparent 1px),
    linear-gradient(90deg, var(--edge) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 30% 0%, black 0%, transparent 55%);
  -webkit-mask-image: radial-gradient(ellipse at 30% 0%, black 0%, transparent 55%);
}
main, .site-footer { position: relative; z-index: 1; }

/* ---------- accessibility ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--signal); color: var(--bg);
  padding: 10px 18px; font-family: var(--mono); font-size: .75rem; font-weight: 700;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--metric); outline-offset: 3px; border-radius: 2px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- layout ---------- */
.container { max-width: var(--container); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }
.section { border-top: 1px solid var(--edge); padding: 64px 0; }
.section--flush { border-top: 0; }
.section--deep { padding: 80px 0; }

/* ---------- type components ---------- */
.tag {
  font-family: var(--mono); font-size: .6875rem; letter-spacing: .1em;
  color: var(--signal); text-transform: uppercase;
}
.tag--metric { color: var(--metric); }
.tag--dim { color: var(--dim); }
.mono { font-family: var(--mono); }
.dim { color: var(--dim); }
.small { font-size: .875rem; }
.footnote { font-family: var(--mono); font-size: .6875rem; color: var(--dim); margin-top: 16px; }
.footnote a { text-decoration: underline; }
.footnote a:hover { color: var(--txt); }

.title-xl, .title-lg, .title-md {
  font-family: var(--display); font-weight: 900; text-transform: uppercase;
  letter-spacing: -.02em; line-height: 1.05; font-stretch: 115%;
}
.title-xl { font-size: clamp(2.5rem, 5.6vw, 4.25rem); line-height: 1.02; margin-top: 20px; }
.title-lg { font-size: clamp(1.75rem, 3.6vw, 2.5rem); margin-top: 16px; max-width: 26ch; font-stretch: 112%; }
.title-md { font-size: clamp(1.5rem, 3vw, 2rem); margin-top: 16px; font-stretch: 112%; }
.accent { color: var(--signal); }
.lede { margin-top: 24px; max-width: 56ch; font-size: 1.125rem; color: var(--dim); }
.sub { margin-top: 16px; max-width: 60ch; color: var(--dim); }
.breadcrumb { font-family: var(--mono); font-size: .6875rem; color: var(--dim); }
.breadcrumb a:hover { color: var(--txt); }
.breadcrumb .here { color: var(--metric); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; border-radius: 3px; text-decoration: none;
  font-family: var(--mono); font-size: .8125rem; font-weight: 700;
  padding: 13px 22px; cursor: pointer; border: 0; text-align: center;
}
.btn--primary { background: var(--signal); color: var(--bg); }
.btn--primary:hover { background: var(--txt); color: var(--bg); }
.btn--ghost { border: 1px solid var(--edge); color: var(--dim); font-weight: 400; }
.btn--ghost:hover { border-color: var(--dim); color: var(--txt); }
.btn--sm { padding: 9px 16px; font-size: .75rem; }
.actions { margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.actions .aside-note { font-family: var(--mono); font-size: .75rem; color: var(--dim); }
.actions .aside-note a { color: var(--txt); text-decoration: underline; }
.actions .aside-note a:hover { color: var(--metric); }

.link { font-family: var(--mono); font-size: .75rem; color: var(--signal); text-decoration: none; }
.link:hover { color: var(--txt); }

/* ---------- header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(12, 15, 18, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--edge);
}
.site-header .bar {
  display: flex; align-items: center; justify-content: space-between; height: 60px;
}
.brand {
  font-family: var(--display); font-weight: 900; font-stretch: 110%;
  text-transform: uppercase; letter-spacing: .02em; font-size: 1.0625rem; text-decoration: none;
}
.brand em { font-style: normal; color: var(--signal); }
.status { display: none; font-family: var(--mono); font-size: .6875rem; color: var(--dim); }
@media (min-width: 1024px) { .status { display: block; } }
.dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--metric); margin-right: 6px;
  animation: pulse 2.4s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .35 } }

.nav { display: flex; align-items: center; gap: 24px; }
.nav a { font-family: var(--mono); font-size: .75rem; text-decoration: none; color: var(--dim); }
.nav a:hover { color: var(--txt); }
.nav a[aria-current="page"] { color: var(--txt); }
.nav .lang { font-family: var(--mono); font-size: .75rem; color: var(--dim); }
.nav .lang b { color: var(--txt); font-weight: 500; }
.nav .lang a:hover { color: var(--txt); }
.nav-toggle {
  display: none; background: none; cursor: pointer;
  border: 1px solid var(--edge); border-radius: 3px; color: var(--txt);
  font-family: var(--mono); font-size: .6875rem; padding: 6px 10px;
}
@media (max-width: 767px) {
  .nav { display: none; }
  .nav.nav-open {
    display: flex; flex-direction: column; align-items: flex-start; gap: 18px;
    position: absolute; top: 60px; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--edge);
    padding: 24px; z-index: 60;
  }
  .nav-toggle { display: block; }
}

/* ---------- hero ---------- */
.hero { display: grid; gap: 48px; align-items: center; padding: 64px 0; }
@media (min-width: 900px) { .hero { grid-template-columns: 1.05fr .95fr; padding: 80px 0 64px; } }
.page-hero { padding: 56px 0 44px; }

/* ---------- diagram ---------- */
.diagram { border: 1px solid var(--edge); background: var(--surface); border-radius: 6px; padding: 20px; }
.diagram figcaption {
  display: flex; justify-content: space-between; margin-bottom: 12px;
  font-family: var(--mono); font-size: .6875rem; color: var(--dim);
}
.diagram svg { display: block; width: 100%; height: auto; }
.node { fill: var(--bg); stroke: var(--edge); }
.node-label { font-family: var(--mono); font-size: 11px; fill: var(--txt); }
.node-sub { font-family: var(--mono); font-size: 8.5px; fill: var(--dim); }
.wire { stroke: var(--edge); stroke-width: 1.5; fill: none; }
.wire--metric { stroke: var(--metric); }
.wire-live { stroke: var(--signal); stroke-width: 1.5; fill: none; stroke-dasharray: 6 5; animation: flow 1.2s linear infinite; }
.wire-live.wire-ok { stroke: var(--metric); }
@keyframes flow { to { stroke-dashoffset: -11; } }
.packet { fill: var(--signal); }
.packet-ok { fill: var(--metric); }

.log {
  margin-top: 16px; border-top: 1px solid var(--edge); padding-top: 12px;
  font-family: var(--mono); font-size: .6875rem; line-height: 1.9; color: var(--dim);
  white-space: nowrap; overflow: hidden;
}
@media (max-width: 480px) { .log { white-space: normal; } }
.log .ok { color: var(--metric); }
.log .out { color: var(--signal); }
.log > div { opacity: 0; animation: logline .3s forwards; }
.log > div:nth-child(1) { animation-delay: .4s }
.log > div:nth-child(2) { animation-delay: 1.1s }
.log > div:nth-child(3) { animation-delay: 1.8s }
.log > div:nth-child(4) { animation-delay: 2.5s }
@keyframes logline { to { opacity: 1 } }

/* ---------- client strip ---------- */
.clients { border-top: 1px solid var(--edge); border-bottom: 1px solid var(--edge); }
.clients .row {
  display: flex; flex-wrap: wrap; align-items: center;
  column-gap: 32px; row-gap: 8px; padding: 16px 0;
}
.clients .label { font-family: var(--mono); font-size: .6875rem; letter-spacing: .1em; color: var(--dim); }
.clients a {
  font-size: .875rem; font-weight: 500; color: var(--txt);
  text-decoration: underline; text-decoration-color: var(--edge); text-underline-offset: 4px;
}
.clients a:hover { color: var(--metric); text-decoration-color: var(--metric); }

/* ---------- grids & cards ---------- */
.grid { display: grid; gap: 14px; margin-top: 36px; }
@media (min-width: 640px) { .grid--2s { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) {
  .grid--2 { grid-template-columns: 1fr 1fr; }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
  .grid--2s.grid--4 { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 640px) and (max-width: 899px) { .grid--3, .grid--4 { grid-template-columns: 1fr 1fr; } }

.card { border: 1px solid var(--edge); background: var(--surface); border-radius: 6px; padding: 22px 20px; }
.card--hover { transition: border-color .2s; }
.card--hover:hover { border-color: var(--dim); }
.card--flow { display: flex; flex-direction: column; padding: 26px 24px; }
.card--flow .body { flex: 1; }
.card .id { font-family: var(--mono); font-size: .6875rem; color: var(--metric); letter-spacing: .05em; }
.card .id--signal { color: var(--signal); }
.card h3 {
  font-family: var(--display); font-weight: 700; font-stretch: 108%;
  font-size: 1.0625rem; text-transform: uppercase; letter-spacing: .01em;
  margin: 12px 0 8px;
}
.card p { font-size: .875rem; color: var(--dim); }
.card .rule-top { border-top: 1px solid var(--edge); margin-top: 16px; padding-top: 12px; }
.card .io { font-family: var(--mono); font-size: .6875rem; color: var(--dim); border-top: 1px solid var(--edge); margin-top: 16px; padding-top: 12px; }
.card .io b { color: var(--txt); font-weight: 500; }
.card .link { display: inline-block; margin-top: 12px; }
.card .features {
  margin-top: 14px; border-top: 1px solid var(--edge); padding-top: 12px;
  font-family: var(--mono); font-size: .6875rem; line-height: 1.9; color: var(--dim);
}

/* stat/metric cards */
.stat {
  font-family: var(--display); font-weight: 900; font-stretch: 110%;
  font-size: 2.25rem; color: var(--metric); letter-spacing: -.01em; line-height: 1.1;
}
.stat--plain { color: var(--txt); font-size: 1.5rem; }
.stat-label { font-family: var(--mono); font-size: .6875rem; letter-spacing: .06em; color: var(--dim); margin-top: 5px; text-transform: uppercase; }
.stat-note { border-top: 1px solid var(--edge); margin-top: 12px; padding-top: 12px; font-size: .875rem; color: var(--dim); }
.stat-note b { color: var(--txt); font-weight: 500; }

/* meta dl (growth hero) */
.meta-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; margin-top: 32px; font-family: var(--mono); font-size: .75rem; }
@media (min-width: 900px) { .meta-grid { grid-template-columns: repeat(4, 1fr); } }
.meta-grid > div { border: 1px solid var(--edge); background: var(--surface); border-radius: 6px; padding: 14px 16px; }
.meta-grid dt { color: var(--dim); }
.meta-grid dd { margin-top: 4px; color: var(--txt); font-weight: 500; }

/* ---------- service sections (content + proof aside) ---------- */
.svc-split { display: grid; gap: 36px; margin-top: 8px; }
@media (min-width: 1024px) { .svc-split { grid-template-columns: 1fr 340px; } }
.svc-split .aside { align-self: start; }
.feature-grid { display: grid; gap: 10px; margin-top: 24px; max-width: 44rem; }
@media (min-width: 640px) { .feature-grid { grid-template-columns: 1fr 1fr; } }
.feature-grid li {
  border: 1px solid var(--edge); background: var(--surface); border-radius: 3px;
  padding: 12px 16px; font-size: .875rem; color: var(--dim);
}
.feature-grid b { color: var(--txt); font-weight: 500; }
.mono-list { font-family: var(--mono); font-size: .75rem; line-height: 2.1; color: var(--dim); margin-top: 12px; }
.mono-list b { color: var(--txt); font-weight: 500; }

/* ---------- router (symptom cards) ---------- */
.route {
  display: block; border: 1px solid var(--edge); background: var(--surface); border-radius: 6px;
  padding: 20px; text-decoration: none; transition: border-color .2s; margin-top: 12px;
}
.route:hover { border-color: var(--dim); }
.route p { font-size: .875rem; color: var(--dim); }
.route .dest { font-family: var(--mono); font-size: .75rem; color: var(--metric); margin-top: 12px; }
.route--open { border-style: dashed; background: transparent; }
@media (min-width: 768px) {
  .route { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px; }
  .route .dest { margin-top: 0; }
}

/* ---------- phases (growth timeline) ---------- */
.phase {
  display: grid; gap: 16px; border: 1px solid var(--edge); background: var(--surface);
  border-radius: 6px; padding: 22px; margin-top: 12px;
}
@media (min-width: 900px) { .phase { grid-template-columns: 110px 1fr 240px; } }
.phase .when { font-family: var(--mono); font-size: .75rem; color: var(--signal); }
.phase h3 { font-family: var(--display); font-weight: 700; font-size: 1rem; text-transform: uppercase; }
.phase .what { margin-top: 8px; font-size: .875rem; color: var(--dim); }
.phase .receive { font-family: var(--mono); font-size: .6875rem; line-height: 1.8; color: var(--dim); border-top: 1px solid var(--edge); padding-top: 12px; }
@media (min-width: 900px) { .phase .receive { border-top: 0; border-left: 1px solid var(--edge); padding: 0 0 0 20px; } }
.phase .receive span { color: var(--txt); }

/* ---------- quote ---------- */
.quote-card {
  border: 1px solid var(--edge); border-left: 3px solid var(--signal);
  background: var(--surface); border-radius: 6px;
  padding: 32px 36px; margin-top: 24px;
}
.quote-card p { font-size: 1.125rem; line-height: 1.6; max-width: 60ch; }
.quote-card footer { margin-top: 16px; font-family: var(--mono); font-size: .75rem; color: var(--dim); }
.quote-card footer b { color: var(--metric); font-weight: 500; }
.quote-card--sm { padding: 22px 24px; }
.quote-card--sm p { font-size: 1rem; }

/* ---------- founder ---------- */
.founder { display: grid; gap: 36px; margin-top: 36px; align-items: center; }
@media (min-width: 768px) { .founder { grid-template-columns: 180px 1fr; } }
.founder--lg { align-items: start; }
@media (min-width: 768px) { .founder--lg { grid-template-columns: 260px 1fr; } }
.portrait { border: 1px solid var(--edge); border-radius: 6px; overflow: hidden; background: var(--surface); }
.portrait img { width: 100%; filter: saturate(.85); }
.founder .who { margin-top: 12px; font-family: var(--mono); font-size: .75rem; color: var(--dim); }
.founder .who a { color: var(--metric); text-decoration: none; }
.founder .who a:hover { color: var(--txt); }
.founder .copy p + p { margin-top: 16px; }
.founder .copy { color: var(--dim); max-width: 62ch; }

.facts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px;
  border-top: 1px solid var(--edge); margin-top: 20px; padding-top: 20px;
  font-family: var(--mono); font-size: .75rem;
}
.facts dt { color: var(--dim); }
.facts dd { color: var(--txt); }
.facts a { color: var(--metric); text-decoration: none; }
.facts a:hover { color: var(--txt); }

/* ---------- case (work page) ---------- */
.case-split { display: grid; gap: 32px; margin-top: 32px; }
@media (min-width: 1024px) { .case-split { grid-template-columns: 2fr 1fr; } }
.case-split .narrative p + p { margin-top: 18px; }
.case-split .narrative p { color: var(--dim); }
.case-split .aside { align-self: start; display: grid; gap: 14px; }
.case-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: baseline; }
.case-meta .mono, .case-meta a { font-family: var(--mono); font-size: .6875rem; color: var(--dim); }
.case-meta a { color: var(--txt); text-decoration: none; }
.case-meta a:hover { color: var(--metric); }

/* ---------- forms ---------- */
.field { margin-top: 16px; }
.field label {
  display: block; margin-bottom: 6px;
  font-family: var(--mono); font-size: .6875rem; letter-spacing: .08em; color: var(--dim); text-transform: uppercase;
}
.field input, .field textarea {
  width: 100%; border: 1px solid var(--edge); background: var(--surface); border-radius: 3px;
  color: var(--txt); font-family: var(--display); font-size: .9375rem;
  padding: 12px 16px;
}
.field input::placeholder, .field textarea::placeholder { color: rgba(154, 163, 173, .8); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--metric); }
.form-note { margin-top: 12px; font-family: var(--mono); font-size: .6875rem; color: var(--dim); }
.form-note.ok { color: var(--metric); }
.form-note.err { color: var(--signal); }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

/* channels */
.channels { display: grid; gap: 10px; margin-top: 16px; }
@media (min-width: 640px) { .channels { grid-template-columns: 1fr 1fr; } }
.channels a {
  display: block; border: 1px solid var(--edge); background: var(--surface); border-radius: 3px;
  padding: 12px 16px; font-family: var(--mono); font-size: .75rem; color: var(--dim); text-decoration: none;
}
.channels a:hover { border-color: var(--dim); color: var(--txt); }

/* contact split */
.contact-split { display: grid; gap: 40px; }
@media (min-width: 1024px) { .contact-split { grid-template-columns: 1fr 1fr; } }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--edge); }
.site-footer .cols {
  display: grid; gap: 24px; padding: 40px 0 48px;
  font-family: var(--mono); font-size: .71875rem; line-height: 2; color: var(--dim);
}
@media (min-width: 640px) { .site-footer .cols { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .site-footer .cols { grid-template-columns: repeat(4, 1fr); } }
.site-footer b { display: block; color: var(--txt); font-weight: 500; margin-bottom: 4px; }
.site-footer a { text-decoration: none; color: var(--dim); }
.site-footer a:hover { color: var(--signal); }

/* ---------- motion ---------- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dot, .wire-live { animation: none; }
  .wire-live { stroke-dasharray: none; }
  .log > div { opacity: 1; animation: none; }
  .packet, .packet-ok { display: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
