/* Support Technology Systems / FieldIQ
   Concept: the engineer's world. Schematic paper, a real fault panel, wire-colour ferrules.
   Boldness lives in the hero panel; everything else stays quiet. */

:root {
  /* Colour */
  --paper: #EDF1F3;       /* schematic paper, cool grey */
  --paper-2: #E2E8EB;     /* alternate band */
  --card: #FFFFFF;
  --ink: #14212B;         /* text, logos */
  --ink-2: #4A5A66;       /* secondary text */
  --line: #C3CED5;        /* rules, schematic lines */
  --signal: #E04A1B;      /* brand accent: probe tip, LEDs, highlights */
  --signal-strong: #B8370F; /* accent for buttons / text on light (AA with white) */
  --on-signal: #FFFFFF;
  --night: #14212B;       /* dark bands */
  --night-2: #1C2C38;
  --on-night: #E8EEF1;
  --on-night-2: #A6B6C1;
  --panel: #2A3237;       /* enclosure */
  --panel-edge: #3A444A;
  --lcd: #F2B33D;         /* amber backlit LCD */
  --lcd-ink: #2B1A02;
  --ok: #1A7A4C;
  --focus: #1E6FD9;
  /* Wire colours (UK) for ferrules */
  --wire-red: #C62828;
  --wire-blue: #1E5AA8;
  --wire-grey: #5E6A73;
  --wire-green: #26773A;
  --wire-brown: #7A4A22;
  --wire-orange: #A3410F;
  --wire-yellow: #7A5A00;
  --wire-magenta: #8E2B57;
  --wire-black: #0B1218;

  /* Type */
  --f-display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-lcd: "DotGothic16", "Courier New", monospace;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: clamp(1.9rem, 1.4rem + 2vw, 2.75rem);
  --step-4: clamp(2.9rem, 1.6rem + 5.6vw, 5.75rem);

  /* Space and shape */
  --s1: 0.5rem; --s2: 0.75rem; --s3: 1rem; --s4: 1.5rem; --s5: 2rem; --s6: 3rem; --s7: 5rem;
  --r-sm: 6px; --r-md: 10px; --r-lg: 18px;
  --maxw: 1180px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0F171D; --paper-2: #15212A; --card: #19262F;
    --ink: #E6ECEF; --ink-2: #9EAFBA; --line: #2B3B46;
    --signal: #FF6A3D; --signal-strong: #C7401A; --on-signal: #FFFFFF;
    --night: #0A1116; --night-2: #13202A; --on-night: #E6ECEF; --on-night-2: #9EAFBA;
    --panel: #2F383E; --panel-edge: #434E55;
    --focus: #6AA8FF;
    color-scheme: dark;
  }
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: var(--step-0);
  line-height: 1.6;
  font-variation-settings: "wdth" 100;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.05; margin: 0; text-wrap: balance; }
h2 { font-size: var(--step-3); font-weight: 800; font-stretch: 75%; font-variation-settings: "wdth" 75; letter-spacing: -0.01em; }
h3 { font-size: var(--step-1); font-weight: 700; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.wrap {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--paper); padding: 10px 14px; z-index: 100; }
.skip:focus { left: 12px; top: 12px; }

.logo-dark { display: none; }
@media (prefers-color-scheme: dark) { .logo-light { display: none; } .logo-dark { display: block; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 1.4rem;
  font: 700 var(--step-0)/1 var(--f-body);
  text-decoration: none; border-radius: var(--r-sm); border: 2px solid transparent;
  cursor: pointer; transition: background-color .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--signal-strong); color: var(--on-signal); }
.btn-primary:hover { background: var(--signal); }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-sm { min-height: 40px; padding: 0 1rem; font-size: var(--step--1); }

/* Header */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; gap: var(--s4); min-height: 68px; }
.brand img { height: 30px; width: auto; }
.brand-sts { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-height: 44px; }
.brand-sts img { height: 22px; }
.brand-name { font: 700 16px/1.1 var(--f-display); font-variation-settings: "wdth" 75; letter-spacing: -0.005em; }
@media (max-width: 380px) { .brand-name { font-size: 14px; } }
.nav { display: flex; gap: var(--s4); margin-left: auto; }
.nav a { text-decoration: none; font-weight: 600; font-size: var(--step--1); color: var(--ink-2); }
.nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 760px) { .nav { display: none; } .header-row .btn { margin-left: auto; } }

/* Hero */
.hero { position: relative; overflow: hidden; padding-block: var(--s6) 160px; border-bottom: 1px solid var(--line); }
.hero::before { /* schematic grid paper */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 32px 32px; opacity: .45;
  mask-image: linear-gradient(180deg, #000 0%, #000 60%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 60%, transparent 100%);
}
.schematic { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 140px; color: var(--ink-2); opacity: .35; pointer-events: none; }
.schematic-labels { font-family: var(--f-body); }
.hero-grid {
  position: relative; display: grid; gap: var(--s6);
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center;
}
.kicker { font-weight: 600; color: var(--ink-2); margin-bottom: var(--s3); }
.hero h1 {
  font-size: var(--step-4); font-weight: 800; letter-spacing: -0.02em; line-height: .92;
  font-stretch: 62%; font-variation-settings: "wdth" 62;
  max-width: 11ch;
}
.lede { font-size: var(--step-1); line-height: 1.5; color: var(--ink-2); margin-top: var(--s4); max-width: 34ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s5); }
.fine { font-size: var(--step--1); color: var(--ink-2); margin-top: var(--s3); }

/* The rig: panel + lead + FieldIQ card */
.rig { margin: 0; position: relative; display: grid; grid-template-columns: 1fr; justify-items: start; }
.panel {
  width: min(100%, 400px);
  background: linear-gradient(160deg, var(--panel-edge), var(--panel) 40%);
  border-radius: var(--r-lg); padding: 18px 20px 20px;
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 24px 48px -20px rgba(10,20,28,.55);
  color: #C9D2D7;
}
.panel-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.panel-name { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #9AA6AD; }
.panel-screws { display: flex; gap: 8px; }
.panel-screws i { width: 9px; height: 9px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #8A969D, #4C565C); }
.lcd {
  background: var(--lcd);
  background-image: linear-gradient(180deg, rgba(255,255,255,.22), rgba(0,0,0,.06));
  color: var(--lcd-ink); border-radius: 6px; padding: 14px 16px; min-height: 118px;
  font-family: var(--f-lcd); font-size: clamp(17px, 1.2rem + .4vw, 22px); line-height: 1.35; letter-spacing: .04em;
  box-shadow: inset 0 0 0 3px rgba(0,0,0,.25), inset 0 6px 14px rgba(0,0,0,.18);
  overflow: hidden;
}
.lcd-line { min-height: 1.35em; white-space: pre; }
.lcd-line.dim { opacity: .75; }
.lcd .cursor { display: inline-block; width: .6em; height: 1em; background: currentColor; vertical-align: -0.12em; animation: blink 1s steps(1) infinite; }
.leds { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0 0; padding: 0; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
.leds li { display: flex; align-items: center; gap: 6px; }
.led { width: 11px; height: 11px; border-radius: 50%; background: #3E474C; box-shadow: inset 0 1px 2px rgba(0,0,0,.6); flex: none; }
.led-power.on { background: #3BD27A; box-shadow: 0 0 10px #3BD27A; }
.led-fault.on { background: #FFB020; box-shadow: 0 0 10px #FFB020; }
.led-fire.on { background: #FF3B2F; box-shadow: 0 0 12px #FF3B2F; }
.blink { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: .25; } }

.lead { width: 60px; height: 70px; margin-left: 40px; color: var(--signal); }
.diag {
  position: relative; justify-self: end; width: min(100%, 380px); margin-top: -16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px 20px; box-shadow: 0 20px 40px -24px rgba(10,20,28,.45);
}
.diag-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.diag-head img { border-radius: 7px; }
.diag-title { display: block; font-weight: 700; line-height: 1.2; }
.diag-sub { display: block; font-size: var(--step--1); color: var(--ink-2); }
.diag-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 8px; }
.diag-steps li { counter-increment: s; display: grid; grid-template-columns: 26px 1fr; gap: 10px; font-size: .97rem; line-height: 1.4; }
.diag-steps li::before {
  content: counter(s); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--ink); font-weight: 700; font-size: 13px;
}
.diag-steps li.done::before { content: "✓"; background: var(--ok); border-color: var(--ok); color: #fff; }
.diag-steps li.in { animation: rise .35s ease-out both; }
.diag-cause { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: .97rem; }
.diag-cause span { color: var(--ink-2); display: block; font-size: var(--step--1); }
.diag-cause b { color: var(--signal-strong); }
@media (prefers-color-scheme: dark) { .diag-cause b { color: var(--signal); } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.rig-note { font-size: 12px; color: var(--ink-2); margin-top: 14px; max-width: 46ch; justify-self: end; text-align: right; }

.demo-toggle {
  justify-self: end; margin-top: 6px; background: none; border: 0; padding: 6px 2px;
  font: 600 12px/1 var(--f-body); color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.demo-toggle:hover { color: var(--ink); }

@media (max-width: 900px) {
  .demo-toggle { justify-self: start; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
  .hero h1 { max-width: 12ch; }
  .rig { justify-items: stretch; }
  .panel { width: 100%; max-width: 440px; }
  .diag { width: calc(100% - 24px); max-width: 420px; justify-self: end; margin-top: -14px; }
  .rig-note { text-align: left; justify-self: start; }
}

/* Bands */
.band { padding-block: var(--s7); }
.band-plain { background: var(--paper-2); }
.band-dark { background: var(--night); color: var(--on-night); }
.section-lede { color: var(--ink-2); font-size: var(--step-1); margin-top: var(--s3); max-width: 50ch; }
.band-dark .section-lede { color: var(--on-night-2); }

/* Problem */
.problem { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: var(--s6); align-items: start; }
.problem-list { display: grid; gap: var(--s4); font-size: var(--step-1); line-height: 1.55; max-width: 58ch; }
.problem-list p:last-child { color: var(--ink); font-weight: 600; }
.problem-list p:not(:last-child) { color: var(--ink-2); }
@media (max-width: 800px) { .problem { grid-template-columns: minmax(0, 1fr); gap: var(--s4); } }

/* Steps (a real sequence) */
.steps { list-style: none; margin: var(--s5) 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5); position: relative; }
.steps::before { content: ""; position: absolute; top: 27px; left: 28px; right: 28px; border-top: 2px dashed var(--line); }
.steps li { position: relative; display: grid; gap: var(--s2); align-content: start; }
.step-n {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--paper); border: 2px solid var(--ink);
  font: 800 1.6rem/1 var(--f-display); font-variation-settings: "wdth" 75; margin-bottom: var(--s2);
}
.steps li:last-child .step-n { background: var(--signal-strong); border-color: var(--signal-strong); color: var(--on-signal); }
.steps p { color: var(--ink-2); max-width: 32ch; }
@media (max-width: 760px) {
  .steps { grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
  .steps::before { top: 28px; bottom: 28px; left: 27px; right: auto; border-top: 0; border-left: 2px dashed var(--line); }
  .steps li { grid-template-columns: 56px 1fr; column-gap: var(--s3); }
  .steps li .step-n { grid-row: span 2; margin: 0; }
}

/* Systems: terminal rail */
.terminals { list-style: none; margin: var(--s5) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2px; background: var(--night-2); border: 2px solid var(--night-2); border-radius: var(--r-md); overflow: hidden; }
.terminal { background: var(--night); padding: var(--s3) var(--s4); display: flex; align-items: center; gap: var(--s2); min-height: 64px; }
.terminal-name { font-weight: 700; color: var(--on-night); }
.terminal-more a { color: var(--on-night-2); font-size: .95rem; font-weight: 600; }
.terminal-more a:hover { color: var(--on-night); }
.ferrule {
  flex: none; display: inline-block; min-width: 52px; text-align: center;
  background: var(--c); color: #fff; font-weight: 800; font-size: 12px; letter-spacing: .08em;
  padding: 5px 8px; border-radius: 3px;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.2), 0 0 0 1px rgba(255,255,255,.25);
}

/* Pricing */
.plans { margin-top: var(--s5); display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--s4); }
.plan { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); display: flex; flex-direction: column; gap: var(--s3); }
.plan h3 { font-size: var(--step-2); font-weight: 800; font-variation-settings: "wdth" 75; }
.plan .price { color: var(--ink-2); }
.plan .price b { font: 800 2.4rem/1 var(--f-display); font-variation-settings: "wdth" 75; color: var(--ink); margin-right: 4px; }
.plan > p:not(.price) { color: var(--ink-2); flex: 1; }
.plan .btn { align-self: flex-start; }
.price-lock { margin-top: var(--s3); max-width: 60ch; padding: var(--s3) var(--s4); background: var(--card); border: 1px solid var(--line); border-left-width: 1px; border-radius: var(--r-sm); color: var(--ink-2); }
.price-lock b { color: var(--ink); }
.discounts { width: 100%; border-collapse: collapse; font-size: .95rem; font-variant-numeric: tabular-nums; }
.discounts caption { text-align: left; font-weight: 700; margin-bottom: 6px; }
.discounts th { text-align: left; font-weight: 600; color: var(--ink-2); border-bottom: 1px solid var(--line); padding: 6px 4px; }
.discounts td { padding: 6px 4px; border-bottom: 1px solid var(--line); }

/* Built for */
.built { display: grid; gap: var(--s5); justify-items: start; }
.facts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5) var(--s6); width: 100%; }
.facts div { border-top: 2px solid var(--ink); padding-top: var(--s3); }
.facts dt { font: 700 var(--step-1)/1.2 var(--f-display); margin-bottom: var(--s1); }
.facts dd { margin: 0; color: var(--ink-2); max-width: 44ch; }
@media (max-width: 700px) { .facts { grid-template-columns: minmax(0, 1fr); gap: var(--s4); } }

/* About + contact */
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s6); align-items: start; }
.about { display: grid; gap: var(--s3); }
.about img { margin-bottom: var(--s2); }
.about p { color: var(--ink-2); max-width: 52ch; }
.contact { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); display: grid; gap: var(--s3); }
.contact h2 { font-size: var(--step-2); }
.contact > p { color: var(--ink-2); }
form { display: grid; gap: var(--s3); }
.field { display: grid; gap: 6px; }
label { font-weight: 600; font-size: .95rem; }
.opt { font-weight: 400; color: var(--ink-2); }
input, textarea {
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; width: 100%;
}
input:focus, textarea:focus { border-color: var(--focus); outline: 2px solid var(--focus); outline-offset: 0; }
[aria-invalid="true"] { border-color: var(--wire-red); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.consent { font-size: var(--step--1); color: var(--ink-2); }
form .btn { justify-self: start; }
.form-status { font-weight: 600; min-height: 1.6em; }
.form-status.ok { color: var(--ok); }
.form-status.err { color: var(--wire-red); }
@media (prefers-color-scheme: dark) { .form-status.err { color: #FF7B72; } .form-status.ok { color: #4CD38A; } }
@media (max-width: 860px) { .about-grid { grid-template-columns: minmax(0, 1fr); } .contact { padding: var(--s4); } }

/* Footer */
.site-footer { background: var(--night); color: var(--on-night-2); padding-block: var(--s6) calc(var(--s5) + env(safe-area-inset-bottom, 0px)); }
.footer-row { display: grid; gap: var(--s4); }
.footer-row img { height: 28px; width: auto; }
.footer-row nav { display: flex; flex-wrap: wrap; gap: var(--s4); }
.footer-row nav a { color: var(--on-night); text-decoration: none; font-weight: 600; }
.footer-row nav a:hover { text-decoration: underline; }
.legal { font-size: var(--step--1); max-width: 80ch; }

/* Simple content page (privacy, 404) */
.page { padding-block: var(--s6) var(--s7); }
.page h1 { font-size: var(--step-3); font-weight: 800; font-variation-settings: "wdth" 75; margin-bottom: var(--s4); }
.page h2 { font-size: var(--step-2); margin: var(--s5) 0 var(--s2); }
.page p, .page li { color: var(--ink-2); max-width: 68ch; }
.page p + p { margin-top: var(--s3); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
