/* Fluxford Engineering
   Direction: blueprint slate with the brand's amber flow line. One theme, dark by choice.
   Layout: left-aligned, ruled rows rather than cards; each service page opens with a datasheet-style panel. */

@font-face { font-family: "Barlow"; src: url("fonts/barlow-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/barlow-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/barlow-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Semi Condensed"; src: url("fonts/barlow-semi-condensed-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow Semi Condensed"; src: url("fonts/barlow-semi-condensed-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --bg: #10181e;
  --surface: #16212a;
  --line: #263540;
  --line-strong: #3b4d59;
  --text: #e4eaee;
  --text-2: #a9b7c0;
  --muted: #7f909b;
  --amber: #e0a043;
  --steel: #86a9bd;

  --display: "Barlow Semi Condensed", "Bahnschrift", "Arial Narrow", sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --max: 76rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius: 3px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: .2em; }
a:hover { text-decoration-color: var(--amber); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.08; letter-spacing: -.005em; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.4rem, 6.2vw, 4.25rem); line-height: 1.02; letter-spacing: -.012em; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.375rem); }
h3 { font-size: 1.375rem; line-height: 1.2; }
p { margin: 0; }
.prose > * + * { margin-top: 1em; }
.prose p, .prose li { max-width: 66ch; color: var(--text-2); }
.prose strong { color: var(--text); font-weight: 500; }
.prose ul { margin: 0; padding-left: 1.1em; }
.prose li + li { margin-top: .35em; }
.prose li::marker { color: var(--amber); }
.prose h3 { color: var(--text); margin-top: 1.6em; }
.prose h3:first-child { margin-top: 0; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: .5rem; background: var(--amber); color: var(--bg); padding: .5rem .75rem; z-index: 10; }
.skip:focus { left: .5rem; }
.mono { font-family: var(--mono); font-size: .92em; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; font: 600 1.35rem/1 var(--display); letter-spacing: .005em; white-space: nowrap; }
.brand svg { width: 2rem; height: 2rem; flex: none; }
.brand-sub { font-weight: 500; color: var(--text-2); }
.menu-btn { display: none; font: 500 1rem/1 var(--body); color: var(--text); background: transparent; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: .6rem .85rem; cursor: pointer; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.4rem; }
.site-nav a { display: block; padding: .45rem 0; text-decoration: none; color: var(--text-2); font-weight: 500; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--amber); }
.site-nav .nav-contact { color: var(--amber); }

@media (max-width: 74.99rem) {
  .js .menu-btn { display: inline-block; }
  .header-row { flex-wrap: wrap; }
  .site-nav { flex-basis: 100%; }
  .js .site-nav { display: none; }
  .js .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; padding: .25rem 0 1rem; }
  .site-nav li + li { border-top: 1px solid var(--line); }
  .site-nav a { padding: .8rem 0; font-size: 1.125rem; }
  .site-nav a[aria-current="page"] { box-shadow: none; color: var(--amber); }
  .brand-sub { display: none; }
}

/* Buttons and links */
.actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.btn { display: inline-flex; align-items: center; min-height: 3rem; padding: .7rem 1.15rem; border: 1px solid var(--line-strong); border-radius: var(--radius); text-decoration: none; font-weight: 500; line-height: 1.2; }
.btn:hover { border-color: var(--text-2); }
.btn-primary { background: var(--amber); border-color: var(--amber); color: var(--bg); }
.btn-primary:hover { background: #ebb15e; border-color: #ebb15e; }
.text-link { color: var(--amber); font-weight: 500; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--amber) 45%, transparent); }
.text-link:hover { text-decoration-color: var(--amber); }

/* Home hero */
.hero { padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(2rem, 5vw, 4rem); overflow: hidden; }
.hero-grid { display: grid; gap: 2rem; align-items: center; }
.hero h1 { max-width: 14ch; }
.lede { margin-top: 1.25rem; max-width: 36em; font-size: 1.1875rem; color: var(--text-2); }
.hero .actions { margin-top: 2rem; }
.field { display: block; width: 100%; height: auto; }
.field .lines path { fill: none; stroke: var(--amber); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; opacity: .9; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.4s cubic-bezier(.4, 0, .2, 1) forwards; animation-delay: calc(var(--i) * 70ms); }
.field .body { fill: var(--bg); stroke: var(--steel); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.field .axis { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 6 4 1 4; vector-effect: non-scaling-stroke; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .field .lines path { animation: none; stroke-dashoffset: 0; } }
@media (min-width: 56rem) {
  .hero-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 3.5rem; }
  .hero-art { margin-right: calc(var(--gutter) * -1); }
}

/* Sections */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; border-top: 1px solid var(--line); }
.section-head { display: grid; gap: .75rem; margin-bottom: clamp(1.75rem, 4vw, 2.75rem); }
.section-head p { color: var(--text-2); max-width: 60ch; }
.split { display: grid; gap: 1.25rem 3rem; }
@media (min-width: 56rem) { .split { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); } }

/* Services index (home) */
.index { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); }
.index li { border-bottom: 1px solid var(--line); }
.index-row { display: grid; gap: .5rem 2.5rem; padding: 1.5rem 0; text-decoration: none; }
.index-name { font: 500 clamp(1.6rem, 3.2vw, 2.25rem)/1.1 var(--display); transition: color .15s; }
.index-desc { color: var(--text-2); max-width: 52ch; }
.index-tools { color: var(--steel); font-size: .9375rem; }
.index-row:hover .index-name { color: var(--amber); }
@media (min-width: 56rem) {
  .index-row { grid-template-columns: minmax(0, 4fr) minmax(0, 5fr) minmax(0, 3fr); align-items: baseline; padding: 1.85rem 0; }
}
@media (prefers-reduced-motion: reduce) { .index-name { transition: none; } }

/* Modbus trace exhibit */
.feature-grid { display: grid; gap: 2.25rem; align-items: start; }
@media (min-width: 60rem) { .feature-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 4rem; } }
.feature-copy p { color: var(--text-2); margin-top: 1rem; max-width: 52ch; }
.feature-copy .text-link { display: inline-block; margin-top: 1.5rem; }
.trace { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1rem, 3vw, 1.75rem); }
.trace figcaption { color: var(--text-2); font-size: .9375rem; margin-bottom: 1.25rem; }
.frame + .frame { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px dashed var(--line-strong); }
.frame-head { display: flex; justify-content: space-between; gap: 1rem; font-size: .9375rem; margin-bottom: .75rem; }
.frame-head b { font: 600 1.05rem/1.2 var(--display); letter-spacing: .01em; }
.frame-head span { color: var(--muted); }
.bytes { display: flex; flex-wrap: wrap; gap: .4rem; }
.grp { appearance: none; display: grid; gap: .3rem; justify-items: start; padding: .45rem .55rem .5rem; background: transparent; color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--radius); cursor: pointer; text-align: left; font: inherit; }
.grp .hex { font: 500 1.05rem/1 var(--mono); letter-spacing: .02em; }
.grp .lbl { font-size: .8125rem; line-height: 1.2; color: var(--text-2); }
.grp.k-addr .hex { color: var(--amber); }
.grp.k-fn .hex { color: var(--steel); }
.grp.k-crc .hex { color: var(--muted); }
.grp:hover { border-color: var(--text-2); }
.grp[aria-pressed="true"] { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 12%, transparent); }
.note { margin-top: .9rem; min-height: 3.2em; color: var(--text); font-size: .9688rem; }
.notes { margin: .9rem 0 0; display: grid; gap: .35rem; font-size: .9375rem; }
.notes div { display: grid; grid-template-columns: 4.5rem 1fr; gap: .75rem; }
.notes dt { font-family: var(--mono); color: var(--text-2); }
.notes dd { margin: 0; color: var(--text-2); }
.js .notes { display: none; }
.no-js-only { }
.js .no-js-only { display: none; }
.decoded { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); display: grid; gap: .25rem; font-size: .9688rem; }
.decoded span { color: var(--text-2); }
.decoded .mono { color: var(--text); }

/* Process */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2rem; counter-reset: step; }
.steps li { counter-increment: step; display: grid; gap: .5rem; padding-top: 1.1rem; border-top: 2px solid var(--line-strong); }
.steps li::before { content: counter(step); font: 600 1.05rem/1 var(--display); color: var(--amber); }
.steps p { color: var(--text-2); }
@media (min-width: 48rem) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 72rem) { .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2.5rem; } }

/* Project list */
.projects { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); }
.project { display: grid; gap: .6rem 3rem; padding: 1.75rem 0; border-bottom: 1px solid var(--line); }
.project h3 { font-size: 1.5rem; }
.project .status { color: var(--amber); font-size: .9375rem; font-weight: 500; }
.project p { color: var(--text-2); max-width: 62ch; }
.project .tech { color: var(--steel); font-size: .9375rem; }
.project-body { display: grid; gap: .6rem; }
@media (min-width: 56rem) { .project { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); } .project-meta { display: grid; gap: .4rem; align-content: start; } }
.project-teaser { list-style: none; margin: 0; padding: 0; display: grid; gap: 0 2.5rem; border-top: 1px solid var(--line-strong); }
.project-teaser li { padding: 1.4rem 0; border-bottom: 1px solid var(--line); display: grid; gap: .4rem; }
.project-teaser p { color: var(--text-2); }
@media (min-width: 56rem) { .project-teaser { grid-template-columns: repeat(3, minmax(0, 1fr)); } .project-teaser li { border-bottom: 0; } }
.more { margin-top: 1.75rem; }

/* Service page hero with datasheet panel */
.page-hero { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2.5rem, 6vw, 4rem); }
.page-hero-grid { display: grid; gap: 2.25rem; align-items: start; }
.page-hero h1 { max-width: 16ch; }
@media (min-width: 60rem) { .page-hero-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 4rem; } }
.spec { margin: 0; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); font-size: .9688rem; }
.spec-title { padding: .7rem 1rem; border-bottom: 1px solid var(--line-strong); font: 600 1.05rem/1.2 var(--display); display: flex; justify-content: space-between; gap: 1rem; }
.spec-title span { color: var(--muted); font: 400 .875rem/1.4 var(--body); }
.spec dl { margin: 0; }
.spec dl div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: .65rem 1rem; }
.spec dl div + div { border-top: 1px solid var(--line); }
.spec dt { color: var(--muted); }
.spec dd { margin: 0; color: var(--text); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: .9688rem; font-variant-numeric: tabular-nums; }
caption { caption-side: top; text-align: left; padding: .85rem 1rem; color: var(--text-2); border-bottom: 1px solid var(--line); }
th, td { text-align: left; padding: .6rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { color: var(--muted); font-weight: 500; background: var(--surface); }
tbody tr:last-child td { border-bottom: 0; }
td.mono, th.mono { font-family: var(--mono); font-size: .9rem; white-space: nowrap; }

/* Word order panel */
.orders { display: grid; gap: 1rem; margin-top: 1.5rem; }
.order { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; background: var(--surface); display: grid; gap: .5rem; }
.order h3 { font-size: 1.15rem; }
.regs { display: flex; flex-wrap: wrap; gap: .4rem; }
.regs span { font: 500 1rem/1 var(--mono); padding: .45rem .55rem; border: 1px solid var(--line-strong); border-radius: var(--radius); }
.order .result { color: var(--text-2); }
.order .result b { font-family: var(--mono); font-weight: 500; color: var(--text); }
.order.bad .result b { color: var(--amber); }
@media (min-width: 48rem) { .orders { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Contact */
.cta { padding: clamp(3rem, 7vw, 5rem) 0; border-top: 1px solid var(--line); }
.cta-grid { display: grid; gap: 1.25rem 3rem; align-items: end; }
.cta p { color: var(--text-2); max-width: 52ch; }
.email-big { font: 500 clamp(1.6rem, 5vw, 2.75rem)/1.1 var(--display); color: var(--text); text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 2px; text-underline-offset: .18em; overflow-wrap: anywhere; }
.email-big:hover { color: var(--amber); }
@media (min-width: 56rem) { .cta-grid { grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); } }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 2.5rem 0 3rem; color: var(--text-2); font-size: .9375rem; }
.footer-grid { display: grid; gap: 1.75rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; }
.footer-grid a { text-decoration: none; }
.footer-grid a:hover { color: var(--text); }
.footer-brand { display: flex; align-items: center; gap: .55rem; color: var(--text); font: 600 1.15rem/1 var(--display); }
.footer-brand svg { width: 1.6rem; height: 1.6rem; }
@media (min-width: 56rem) { .footer-grid { grid-template-columns: auto 1fr auto; align-items: center; gap: 2.5rem; } .footer-grid ul { justify-content: center; } }

/* 404 */
.notfound { padding: clamp(4rem, 12vw, 8rem) 0; }
.notfound .lede { margin-bottom: 2rem; }

/* Grid children may shrink below their content (keeps wide tables scrolling inside their box) */
.split > *, .feature-grid > *, .page-hero-grid > *, .hero-grid > *, .cta-grid > * { min-width: 0; }
.project-teaser li { align-content: start; }
.order .result b { white-space: nowrap; }
.section.tight { padding: clamp(2.25rem, 5vw, 3.75rem) 0; }
