/* ============================================================
   D.W. Semiconductor Test Ltd — dwsemitest.com
   Hand-authored static site. No build step, no framework.
   Shares the ATE·IQ clinical light system (see ateiq.io).

   Contrast rule: --ink-4, --signal and --pass are LIGHT-surface
   tokens and fail WCAG AA on --code-bg. Small text on any dark
   surface must use --code-ink-2 / --code-signal / --code-pass.
   ============================================================ */

:root {
  --signal: #2563EB;
  --signal-2: #1D4ED8;
  --ink: #0F172A;
  --ink-2: #334155;
  --ink-3: #475569;
  --ink-4: #64748B;
  --panel: #FFFFFF;
  --panel-2: #F6F8FB;
  --panel-3: #F8FAFC;
  --line: #E2E8F0;
  --line-2: #EEF2F7;
  --pass: #047857;
  --probe: #B45309;
  --fault: #B91C1C;
  --code-bg: #0E1217;
  --code-bg-2: #111823;
  --code-line: #1E293B;
  --code-ink: #E5E7EB;
  --code-ink-2: #94A3B8;
  --code-signal: #60A5FA;
  --code-pass: #6EE7B7;
  --footer-bg: #0B0F14;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
}

/* ---------- Base ---------- */

html { scroll-behavior: smooth; }

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

body {
  margin: 0;
  background: var(--panel);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--signal);
  text-decoration: none;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
a:hover { color: var(--signal-2); }

::selection { background: #EFF4FE; color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 40px;
  padding-right: 40px;
}

section[id] { scroll-margin-top: 80px; }

/* ---------- Type helpers ---------- */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-4);
  font-weight: 500;
  margin-bottom: 14px;
}

.mono-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-4);
  font-weight: 500;
}

h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 48px;
  line-height: 1.06;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 6px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-primary {
  background: var(--signal);
  color: #FFFFFF;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset,
              0 1px 2px rgba(15, 23, 42, 0.08),
              0 8px 20px -10px rgba(37, 99, 235, 0.55);
}
.btn-primary:hover { background: var(--signal-2); color: #FFFFFF; }

.btn-secondary {
  background: var(--panel);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.btn-secondary:hover { border-color: var(--ink-4); color: var(--ink); }

.btn-sm { padding: 10px 18px; font-size: 14px; }
.btn-md { padding: 13px 22px; font-size: 15px; }
.btn-lg {
  padding: 15px 28px;
  font-size: 16px;
  box-shadow: 0 8px 24px -12px rgba(37, 99, 235, 0.9);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.wordmark:hover { color: var(--ink); }
.wm-bracket { color: var(--signal); font-weight: 400; }
.wm-dot { color: var(--signal); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: 14px;
  font-weight: 500;
}
.site-nav > a:not(.btn) { color: var(--ink-2); }
.site-nav > a:not(.btn):hover { color: var(--ink); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background-color: #F4F6FA;
  background-image:
    radial-gradient(1200px 600px at 30% -10%, rgba(37, 99, 235, 0.07), transparent 60%),
    linear-gradient(to right, rgba(15, 23, 42, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.04) 1px, transparent 1px);
  background-size: auto, 48px 48px, 48px 48px;
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  padding-top: 96px;
  padding-bottom: 88px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 64px;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 12px 6px 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  margin-bottom: 26px;
}
.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--pass);
  display: inline-block;
}
.pill span:last-child {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 500;
}

h1 {
  margin: 0 0 22px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 64px;
  line-height: 1.04;
  letter-spacing: -0.012em;
  color: var(--ink);
}
h1 em, h2 em { font-style: italic; color: var(--signal); }

.lede {
  margin: 0 0 32px;
  max-width: 590px;
  font-size: 18px;
  line-height: 1.62;
  color: var(--ink-2);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}
.hero-email {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-4);
}

/* Wafer map card */

.wafer-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06),
              0 24px 48px -28px rgba(15, 23, 42, 0.28);
}
.wafer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.wafer-yield {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--pass);
  font-weight: 600;
}
.wafer-grid {
  display: grid;
  grid-template-columns: repeat(22, 1fr);
  gap: 2px;
}
.die { aspect-ratio: 1; border-radius: 1px; background: transparent; }
.die-pass { background: var(--pass); }
.die-param { background: var(--probe); }
.die-fail { background: var(--fault); }
.wafer-legend {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-4);
}
.legend-item { display: flex; align-items: center; gap: 6px; }
.swatch { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.swatch-pass { background: var(--pass); }
.swatch-param { background: var(--probe); }
.swatch-fail { background: var(--fault); }
.wafer-count { margin-left: auto; }

/* ---------- Stat strip ---------- */

.stat-strip { border-bottom: 1px solid var(--line); background: var(--panel); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 34px 28px; border-right: 1px solid var(--line); }
.stat:first-child { padding-left: 0; }
.stat:last-child { padding-right: 0; border-right: none; }
.stat-n {
  font-family: var(--font-serif);
  font-size: 40px;
  line-height: 1;
  color: var(--ink);
}
.stat-l {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-top: 10px;
  font-weight: 500;
}

/* ---------- Section shells ---------- */

.band { border-bottom: 1px solid var(--line); background: var(--panel); }
.band-alt { background: var(--panel-3); }
.band-pad { padding-top: 88px; padding-bottom: 88px; }

/* ---------- Capabilities ---------- */

.services-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 44px;
}
.services-side {
  margin: 0;
  max-width: 330px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-3);
}

.hairline-grid {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.hairline-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.hairline-grid.cols-2 { grid-template-columns: 1fr 1fr; border-radius: 8px; }

.svc {
  background: var(--panel);
  padding: 28px 24px 30px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background 0.15s;
}
.svc:hover { background: var(--panel-2); }
.svc-code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--signal);
  font-weight: 600;
  letter-spacing: 0.1em;
}
.svc h3 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.svc p {
  margin: 0;
  font-size: 14px;
  line-height: 1.58;
  color: var(--ink-3);
}

/* ---------- Platforms ---------- */

.split {
  padding-top: 88px;
  padding-bottom: 88px;
  display: grid;
  gap: 72px;
  align-items: start;
}
.split-platforms { grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); }
.split-ateiq { grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr); }
.split-about { grid-template-columns: minmax(0, 1fr) minmax(0, 0.72fr); }

.split h2 { margin-bottom: 22px; }

.body-copy {
  margin: 0 0 18px;
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink-2);
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 6px 11px;
}

.platform-table {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.pt-head {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  padding: 13px 20px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-4);
  font-weight: 600;
}
.pt-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line-2);
  font-size: 14px;
}
.pt-row:last-child { border-bottom: none; }
.pt-name { font-weight: 600; color: var(--ink); }
.pt-level {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 12px;
}
.pt-work { color: var(--ink-3); font-size: 13.5px; }
.dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  display: inline-block;
  flex-shrink: 0;
}
.dot-primary { background: #2563EB; }
.dot-handson { background: #0369A1; }

/* ---------- Engagement ---------- */

.steps-h2 { margin-bottom: 48px; max-width: 760px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.step {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 26px 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.step-n {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--signal);
  font-weight: 600;
}
.step h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.step p {
  margin: 0;
  font-size: 14px;
  line-height: 1.58;
  color: var(--ink-3);
}
.step-meta {
  margin-top: auto;
  padding-top: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-4);
}

/* ---------- ATE·IQ ---------- */

.mini { background: var(--panel); padding: 16px 18px; }
.mini-t { font-size: 14.5px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.mini-d { font-size: 13.5px; line-height: 1.5; color: var(--ink-3); }
.ateiq-cards { margin-bottom: 26px; }
.ateiq-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}
.ateiq-link { font-size: 15px; font-weight: 500; }

.terminal {
  background: var(--code-bg);
  border: 1px solid var(--code-line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 24px 48px -28px rgba(15, 23, 42, 0.5);
}
.terminal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--code-line);
  background: var(--code-bg-2);
}
.terminal-mark {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--code-ink);
}
.terminal-mark .wm-bracket,
.terminal-mark .wm-dot,
.footer-mark .wm-bracket,
.footer-mark .wm-dot { color: var(--code-signal); }
.terminal-tag {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--code-ink-2);
}
.terminal-body {
  padding: 18px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--code-ink-2);
}
.t-chev { color: var(--code-signal); }
.t-ok { color: var(--code-ink); }
.t-pass { color: var(--code-pass); }
.t-dim { color: var(--code-ink-2); }
.t-gap { margin-top: 10px; }

/* ---------- About ---------- */

.facts {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel-3);
}
.fact {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.fact-k {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-4);
  font-weight: 500;
}
.fact-v { color: var(--ink); font-weight: 500; text-align: right; }
.facts-cta { padding: 20px; }
.facts-cta .btn { display: flex; width: 100%; padding: 12px 18px; font-size: 14px; }

/* ---------- CTA band ---------- */

.cta {
  position: relative;
  overflow: hidden;
  background: var(--code-bg);
}
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(226, 232, 240, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(226, 232, 240, 0.055) 1px, transparent 1px);
  background-size: 48px 48px;
}
.cta-inner {
  position: relative;
  padding-top: 84px;
  padding-bottom: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 56px;
  flex-wrap: wrap;
}
.cta h2 {
  margin: 0 0 14px;
  font-size: 46px;
  line-height: 1.08;
  color: #FFFFFF;
}
.cta-sub {
  margin: 0;
  max-width: 560px;
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--code-ink-2);
}
.cta-right { display: flex; flex-direction: column; gap: 12px; }
.cta-meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--code-ink-2);
  text-align: center;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--footer-bg);
  border-top: 1px solid rgba(226, 232, 240, 0.09);
}
.footer-inner {
  padding-top: 28px;
  padding-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--code-ink-2);
  letter-spacing: 0.05em;
}
.footer-mark { color: var(--code-ink); font-weight: 700; }
.footer-mail { color: var(--code-ink-2); }
.footer-mail:hover { color: #FFFFFF; }

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .container { padding-left: 28px; padding-right: 28px; }

  .hairline-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }

  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 28px; }
  .stat:first-child { padding-left: 0; }
  .stat:nth-child(2) { border-right: none; padding-right: 0; }
  .stat:nth-child(3) { border-top: 1px solid var(--line); padding-left: 0; }
  .stat:nth-child(4) { border-top: 1px solid var(--line); padding-right: 0; }
}

@media (max-width: 860px) {
  h1 { font-size: 44px; }
  h2 { font-size: 34px; }
  .cta h2 { font-size: 34px; }

  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .split-platforms,
  .split-ateiq,
  .split-about { grid-template-columns: 1fr; gap: 48px; }

  .services-head { flex-direction: column; align-items: flex-start; gap: 18px; }

  .pt-row { font-size: 13px; }
  .pt-work { font-size: 13px; }

  .cta-inner { flex-direction: column; align-items: stretch; }
  .cta-right .btn { width: 100%; }
}

@media (max-width: 560px) {
  .container { padding-left: 20px; padding-right: 20px; }

  .site-nav > a:not(.btn) { display: none; }

  .hairline-grid.cols-4,
  .hairline-grid.cols-2 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }

  .stat-grid { grid-template-columns: 1fr; }
  .stat { border-right: none; border-top: 1px solid var(--line); padding: 24px 0; }
  .stat:first-child { border-top: none; }
}
