/* ============================================================
   millerteck.com — design system
   Hand-written. No framework, no build step, no dependencies.
   ============================================================ */

:root {
  /* surfaces */
  --bg:        #0a0a0b;
  --surface:   #131316;
  --surface-2: #1a1a1d;
  --border:    #26262b;
  --border-lit:#35353c;

  /* text */
  --text:      #f2f2f3;
  --muted:     #8a8a93;
  --dim:       #5a5a62;

  /* accent — signal amber */
  --accent:      #e8a33d;
  --accent-soft: rgba(232, 163, 61, 0.12);
  --accent-line: rgba(232, 163, 61, 0.32);

  /* status */
  --ok:   #7fe84d;
  --warn: #e8a33d;
  --off:  #6a6a72;

  /* type */
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;

  /* rhythm */
  --wide:  1120px;
  --prose: 680px;

  --r:  4px;
  --r2: 8px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
a { color: inherit; }

/* ---------- ambient grid ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: .16;
  mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 20%, transparent 78%);
}

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 0 28px; position: relative; z-index: 1; }
.prose { max-width: var(--prose); }
section { position: relative; z-index: 1; }
.rule { height: 1px; background: var(--border); border: 0; margin: 0; }

/* ---------- skip link ---------- */
.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #0a0a0b;
  padding: 10px 16px; font-weight: 600; z-index: 100;
}
.skip:focus { left: 8px; top: 8px; }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,10,11,.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-head .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; height: 62px;
}
.brand {
  font-family: var(--mono);
  font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
  text-decoration: none; font-weight: 500; white-space: nowrap;
}
.brand .dot { color: var(--accent); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  font-family: var(--mono);
  font-size: 12px; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
  padding: 7px 11px; border-radius: var(--r);
  transition: color .16s ease, background .16s ease;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--accent); }

/* ---------- hero ---------- */
.hero { padding: 104px 0 88px; }
.eyebrow {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 22px;
  display: flex; align-items: center; gap: 10px;
}
.eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--accent-line); max-width: 140px; }
h1 {
  font-size: clamp(2.1rem, 5.4vw, 3.7rem);
  line-height: 1.06; letter-spacing: -.03em; font-weight: 600;
  margin: 0 0 26px; max-width: 17ch;
}
.lede { font-size: 1.115rem; color: var(--muted); max-width: 62ch; margin: 0 0 34px; }
.lede strong { color: var(--text); font-weight: 500; }

/* ---------- buttons ---------- */
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .04em;
  text-decoration: none; padding: 11px 18px;
  border: 1px solid var(--border-lit); border-radius: var(--r);
  color: var(--text); background: var(--surface);
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}
.btn:hover { border-color: var(--accent-line); color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #0a0a0b; font-weight: 600; }
.btn-primary:hover { background: #f0b055; border-color: #f0b055; color: #0a0a0b; }
.btn .arw { transition: transform .16s ease; }
.btn:hover .arw { transform: translateX(3px); }

/* ---------- section heads ---------- */
.sec { padding: 84px 0; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; margin-bottom: 40px; flex-wrap: wrap; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); letter-spacing: -.02em; font-weight: 600; margin: 0; }
h3 { font-size: 1.16rem; letter-spacing: -.01em; font-weight: 600; margin: 0 0 12px; }
.sec-num { font-family: var(--mono); font-size: 11.5px; letter-spacing: .16em; color: var(--dim); text-transform: uppercase; }

/* ---------- feature cards ---------- */
.features { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r2); overflow: hidden; }
.feature {
  background: var(--surface); padding: 30px 30px 28px;
  text-decoration: none; display: block;
  transition: background .18s ease;
  position: relative;
}
.feature:hover { background: var(--surface-2); }
.feature::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--accent); transform: scaleY(0); transform-origin: top;
  transition: transform .22s ease;
}
.feature:hover::before { transform: scaleY(1); }
.feature-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.feature-idx { font-family: var(--mono); font-size: 11.5px; color: var(--accent); letter-spacing: .1em; }
.feature h3 { margin: 0 0 10px; font-size: 1.28rem; }
.feature p { color: var(--muted); margin: 0 0 18px; font-size: .95rem; max-width: 68ch; }
.feature .more { font-family: var(--mono); font-size: 12px; color: var(--dim); display: inline-flex; align-items: center; gap: 7px; }
.feature:hover .more { color: var(--accent); }

/* ---------- badges / meta ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 100px;
  border: 1px solid var(--border-lit); color: var(--muted); white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--off); }
.badge[data-s="deployed"] { color: var(--ok); border-color: rgba(127,232,77,.28); }
.badge[data-s="deployed"]::before { background: var(--ok); }
.badge[data-s="prototype"] { color: var(--warn); border-color: var(--accent-line); }
.badge[data-s="prototype"]::before { background: var(--warn); }
.badge[data-s="spike"] { color: var(--dim); }

.stack { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  padding: 3px 8px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--r);
}

/* ---------- capability strip ---------- */
.caps { display: grid; grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r2); overflow: hidden; }
.cap { background: var(--surface); padding: 26px 24px; }
.cap h3 { font-size: .98rem; margin-bottom: 9px; display: flex; align-items: center; gap: 9px; }
.cap h3::before { content: ""; width: 6px; height: 6px; background: var(--accent); border-radius: 1px; flex: none; }
.cap p { color: var(--muted); font-size: .88rem; margin: 0; }

/* ---------- filters ---------- */
.filters { display: flex; flex-direction: column; gap: 14px; margin-bottom: 34px; }
.filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-label { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); min-width: 62px; }
.fchip {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em;
  padding: 6px 12px; border-radius: 100px; cursor: pointer;
  background: transparent; color: var(--muted);
  border: 1px solid var(--border-lit);
  transition: all .15s ease;
}
.fchip:hover { color: var(--text); border-color: var(--muted); }
.fchip[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.count { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.count b { color: var(--accent); font-weight: 500; }

/* ---------- project grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r2); padding: 24px 22px;
  display: flex; flex-direction: column; gap: 13px;
  transition: border-color .18s ease, transform .18s ease;
}
.card:hover { border-color: var(--border-lit); transform: translateY(-2px); }
.card.is-link { text-decoration: none; }
.card.is-link:hover { border-color: var(--accent-line); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card h3 { margin: 0; font-size: 1.03rem; }
.card p { color: var(--muted); font-size: .89rem; margin: 0; flex: 1; }
.card .stack { margin-top: auto; padding-top: 4px; }
.card-link { font-family: var(--mono); font-size: 11.5px; color: var(--accent); display: inline-flex; gap: 6px; align-items: center; }
.empty { color: var(--dim); font-family: var(--mono); font-size: 13px; padding: 40px 0; text-align: center; grid-column: 1 / -1; }

/* ---------- case study ---------- */
.cs-head { padding: 78px 0 42px; }
.cs-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 22px; }
.cs-head h1 { font-size: clamp(1.9rem, 4.4vw, 2.9rem); max-width: 20ch; margin-bottom: 20px; }
.cs-sum { font-size: 1.06rem; color: var(--muted); max-width: 64ch; margin: 0; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r2); overflow: hidden; margin: 44px 0; }
.fact { background: var(--surface); padding: 20px 22px; }
.fact dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin-bottom: 7px; }
.fact dd { margin: 0; font-size: .93rem; color: var(--text); }

.body { max-width: var(--prose); }
.body h2 { margin: 56px 0 16px; font-size: 1.32rem; display: flex; align-items: center; gap: 12px; }
.body h2::before {
  content: attr(data-n); font-family: var(--mono); font-size: 11.5px;
  color: var(--accent); letter-spacing: .1em; font-weight: 400;
}
.body h3 { margin: 34px 0 10px; font-size: 1.02rem; color: var(--text); }
.body p { color: #c9c9cf; margin: 0 0 18px; }
.body p strong { color: var(--text); font-weight: 600; }
.body ul { color: #c9c9cf; padding-left: 20px; margin: 0 0 18px; }
.body li { margin-bottom: 9px; }
.body code {
  font-family: var(--mono); font-size: .85em;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 1.5px 5px; border-radius: 3px; color: var(--accent);
}

.pull {
  border-left: 2px solid var(--accent);
  background: linear-gradient(90deg, var(--accent-soft), transparent 70%);
  padding: 18px 22px; margin: 28px 0; border-radius: 0 var(--r) var(--r) 0;
}
.pull p { margin: 0; color: var(--text); font-size: .97rem; }
.pull cite { display: block; margin-top: 10px; font-family: var(--mono); font-size: 11.5px; color: var(--dim); font-style: normal; }

pre {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r2); padding: 18px 20px; overflow-x: auto;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6;
  color: #c9c9cf; margin: 0 0 24px;
}
pre .c { color: var(--dim); }
pre .k { color: var(--accent); }

/* ---------- diagram ---------- */
.diagram {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r2); padding: 26px 22px; margin: 30px 0;
  max-width: none;
}
.diagram figcaption {
  font-family: var(--mono); font-size: 11.5px; color: var(--dim);
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border);
}
.diagram svg { display: block; width: 100%; height: auto; }
.d-box { fill: var(--surface-2); stroke: var(--border-lit); }
.d-box-a { fill: rgba(232,163,61,.09); stroke: var(--accent-line); }
.d-t { fill: var(--text); font-family: var(--mono); font-size: 11px; }
.d-s { fill: var(--muted); font-family: var(--mono); font-size: 9.5px; }
.d-l { fill: var(--accent); font-family: var(--mono); font-size: 9px; letter-spacing: .08em; }
.d-line { stroke: var(--border-lit); stroke-width: 1.2; fill: none; }
.d-line-a { stroke: var(--accent-line); stroke-width: 1.2; fill: none; }

/* ---------- notes ---------- */
.note { border-top: 1px solid var(--border); padding: 44px 0; }
.note:first-of-type { border-top: 0; }
.note-file { font-family: var(--mono); font-size: 11.5px; color: var(--accent); margin-bottom: 12px; letter-spacing: .04em; }
.lessons { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r2); overflow: hidden; }
.lesson { background: var(--surface); padding: 22px 24px; }
.lesson h3 { font-size: .96rem; margin-bottom: 8px; }
.lesson p { color: var(--muted); font-size: .89rem; margin: 0; }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--border); padding: 52px 0 40px; margin-top: 60px; }
.foot-grid { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; align-items: flex-start; }
.foot-links { display: flex; gap: 22px; flex-wrap: wrap; }
.foot-links a { font-family: var(--mono); font-size: 12.5px; color: var(--muted); text-decoration: none; transition: color .16s ease; }
.foot-links a:hover { color: var(--accent); }
.foot-note { font-family: var(--mono); font-size: 11.5px; color: var(--dim); margin: 0; }

/* ---------- contact ---------- */
.contact-box {
  border: 1px solid var(--border); border-radius: var(--r2);
  background: var(--surface); padding: 44px 40px;
  display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; align-items: center;
}
.contact-box h2 { margin-bottom: 10px; }
.contact-box p { color: var(--muted); margin: 0; max-width: 46ch; font-size: .95rem; }

/* ---------- focus ---------- */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px;
}

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .wrap { padding: 0 20px; }
  .hero { padding: 64px 0 56px; }
  .sec { padding: 60px 0; }
  .site-head .wrap { height: auto; padding-top: 12px; padding-bottom: 12px; flex-direction: column; align-items: flex-start; gap: 10px; }
  .nav { gap: 0; margin-left: -11px; }
  .contact-box { padding: 30px 24px; }
  .filter-label { min-width: 0; width: 100%; }
}
