/* Blackstone Engineering
   Layout: datasheet. Dark basalt hero with photo, then service rows set like a
   component spec sheet (name | description | details). Accent is the Blackstone
   Group petrol (#205f5f / #6bb8b2), used for CTAs, trace lines and focus. */

@font-face { font-family: "Archivo"; src: url("fonts/archivo-var.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --paper: #f2f4f3;
  --panel: #e7ebea;
  --ink: #14181b;
  --muted: #566064;
  --line: #cfd6d5;
  --basalt: #1a1f23;
  --basalt-2: #232a2f;
  --on-basalt: #e8ecea;
  --on-basalt-muted: #9fa9ad;
  --accent: #6bb8b2;
  --accent-strong: #205f5f;
  --accent-ink: #0d1517;
  --link: #205f5f;
  --todo-bg: #fff1bf;
  --todo-fg: #5c4300;
  --ok: #1f7a4d;
  --err: #a12d23;

  --f-display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --f-body: "IBM Plex Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  --step-3: clamp(2.1rem, 1.5rem + 2.6vw, 3.4rem);
  --step-4: clamp(2.1rem, 1.1rem + 3.4vw, 3.7rem);
  --wrap: 72rem;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px), 4vw);
  --gutter-r: max(16px, env(safe-area-inset-right, 0px), 4vw);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1315; --panel: #161b1e; --ink: #e5e9e8; --muted: #9aa4a8; --line: #2a3236;
    --basalt: #0a0d0f; --basalt-2: #151a1d; --on-basalt: #e8ecea; --on-basalt-muted: #9fa9ad;
    --accent: #6bb8b2; --accent-strong: #6bb8b2; --accent-ink: #0d1517; --link: #8fd0ca;
    --todo-bg: #3d3209; --todo-fg: #ffe28a; --ok: #5cc48f; --err: #ff8a7d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f1315; --panel: #161b1e; --ink: #e5e9e8; --muted: #9aa4a8; --line: #2a3236;
  --basalt: #0a0d0f; --basalt-2: #151a1d; --on-basalt: #e8ecea; --on-basalt-muted: #9fa9ad;
  --accent: #6bb8b2; --accent-strong: #6bb8b2; --accent-ink: #0d1517; --link: #8fd0ca;
  --todo-bg: #3d3209; --todo-fg: #ffe28a; --ok: #5cc48f; --err: #ff8a7d;
  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; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--f-body); font-size: var(--step-0); line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.05; text-wrap: balance; margin: 0; }
p { margin: 0; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.label { font-family: var(--f-mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: 0.5rem 1rem; z-index: 50; }
.skip:focus { left: 1rem; }
mark.todo { background: var(--todo-bg); color: var(--todo-fg); padding: 0 0.25em; border-radius: 2px; font-family: var(--f-mono); font-size: 0.9em; }

/* Header */
.site-head { background: var(--basalt); color: var(--on-basalt); border-bottom: 1px solid var(--basalt-2); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.9rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 0.7rem; color: inherit; text-decoration: none; }
.brand img { width: 2rem; height: auto; }
.brand-name { font-family: var(--f-display); font-stretch: 112%; font-weight: 800; font-size: 1.05rem; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1.05; }
.brand-name small { display: block; font-weight: 700; font-stretch: 100%; letter-spacing: 0.34em; font-size: 0.64rem; color: var(--accent); margin-top: 0.2rem; }
.nav { display: flex; align-items: center; gap: 0.25rem 1.4rem; flex-wrap: wrap; font-size: 0.92rem; }
.nav a { color: var(--on-basalt); text-decoration: none; }
.nav a:hover { color: var(--accent); }
.lang { font-family: var(--f-mono); font-size: 0.8rem; display: inline-flex; gap: 0.15rem; border: 1px solid #3a4348; border-radius: 3px; overflow: hidden; }
.lang a, .lang span { padding: 0.15rem 0.5rem; }
.lang span { background: var(--on-basalt); color: var(--basalt); }

/* Hero */
.hero { background: var(--basalt); color: var(--on-basalt); position: relative; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; padding-block: clamp(2.5rem, 6vw, 5rem); }
/* Headline scales with its column so long German words like "Fahrzeugelektronik." never break */
.hero .wrap > div:first-child { container-type: inline-size; min-width: 0; }
.hero h1 { font-size: min(var(--step-4), 10.5cqi); font-weight: 800; font-stretch: 82%; letter-spacing: -0.01em; hyphens: manual; overflow-wrap: normal; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede { margin-top: 1.4rem; max-width: 34rem; font-size: 1.12rem; color: var(--on-basalt-muted); }
.hero .lede strong { color: var(--on-basalt); font-weight: 500; }
.cta-row { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 2rem; }
.btn { display: inline-flex; align-items: center; gap: 0.5rem; font: 600 0.98rem/1 var(--f-body); padding: 0.95rem 1.4rem; border-radius: 3px; text-decoration: none; border: 1px solid transparent; cursor: pointer; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost { border-color: #4a545a; color: var(--on-basalt); }
.btn-ghost:hover { border-color: var(--on-basalt); }

.photo { position: relative; margin: 0; background: var(--basalt-2); border-radius: 2px; overflow: hidden; }
/* Fallback when the image file is missing: PCB-style trace pattern */
.photo::before {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, transparent 0 48%, rgba(107,184,178,.35) 48% 49%, transparent 49%) 0 0 / 120px 120px,
    linear-gradient(0deg, transparent 0 70%, rgba(107,184,178,.22) 70% 71%, transparent 71%) 0 0 / 120px 120px,
    radial-gradient(circle at 48.5% 70.5%, rgba(107,184,178,.55) 0 4px, transparent 5px) 0 0 / 120px 120px,
    linear-gradient(160deg, #20272b, #12171a);
}
.photo img { position: relative; width: 100%; height: 100%; object-fit: cover; }
.photo figcaption { position: absolute; left: 0; bottom: 0; padding: 0.35rem 0.6rem; font: 400 0.68rem/1.3 var(--f-mono); color: #cfd6d5; background: rgba(10,13,15,.72); letter-spacing: 0.02em; }
.photo figcaption a { color: inherit; }
.hero .photo { aspect-ratio: 1 / 1; max-height: 34rem; width: 100%; }

/* Interface strip */
.trace { background: var(--basalt-2); color: var(--on-basalt-muted); border-top: 1px solid #2c3439; }
.trace .wrap { display: flex; align-items: center; gap: 0.6rem 1.6rem; flex-wrap: wrap; padding-block: 1rem; font-family: var(--f-mono); font-size: 0.82rem; }
.trace .label { color: var(--accent); }
.trace ul { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; list-style: none; margin: 0; padding: 0; }
.trace li { color: var(--on-basalt); }

/* Sections */
.section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.section-head { display: grid; gap: 0.8rem; max-width: 44rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head h2 { font-size: var(--step-3); font-weight: 750; font-stretch: 92%; }
.section-head p { color: var(--muted); font-size: 1.08rem; }

/* Service spec rows */
.specs { border-top: 2px solid var(--ink); }
.spec { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.5fr) minmax(0, 1fr); gap: 1rem 2rem; padding-block: 1.8rem; border-bottom: 1px solid var(--line); }
.spec h3 { font-size: var(--step-1); font-weight: 700; font-stretch: 100%; }
.spec .code { font-family: var(--f-mono); font-size: 0.75rem; color: var(--muted); letter-spacing: 0.06em; display: block; margin-bottom: 0.4rem; }
.spec p { color: var(--ink); min-width: 0; }
.spec ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; font-family: var(--f-mono); font-size: 0.84rem; color: var(--muted); }
.spec li::before { content: "– "; color: var(--accent-strong); }

/* Photo band */
.band { display: grid; grid-template-columns: 1.5fr 1fr 1fr; grid-template-rows: repeat(2, clamp(9rem, 17vw, 14rem)); gap: 0.5rem; }
.band .photo.big { grid-row: span 2; }
.photo.tall { aspect-ratio: 4 / 5; max-height: 26rem; }
.contact-aside .photo.tall { margin-top: 0.6rem; }

/* Workbench: real ECU photos */
.bench { padding-top: 0; }
.bench-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr) minmax(0, 0.8fr); gap: 0.5rem 1.5rem; align-items: stretch; }
.bench-text { display: grid; gap: 0.8rem; align-content: center; padding-right: 1rem; }
.bench-text h2 { font-size: var(--step-2); font-weight: 750; font-stretch: 92%; }
.bench-text p:last-child { color: var(--muted); }
.bench .photo { height: clamp(16rem, 30vw, 24rem); }
.bench .photo img { object-position: center 40%; }

/* Process (real sequence) */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; counter-reset: s; }
.steps li { counter-increment: s; padding: 1.2rem 1.2rem 1.4rem 0; border-top: 2px solid var(--line); position: relative; min-width: 0; }
.steps li::before { content: counter(s, decimal-leading-zero); display: block; font: 500 0.8rem/1 var(--f-mono); color: var(--muted); margin-bottom: 0.8rem; }
.steps li::after { content: ""; position: absolute; top: -2px; left: 0; width: 2.2rem; height: 2px; background: var(--accent-strong); }
.steps strong { display: block; font-family: var(--f-display); font-size: 1.1rem; font-weight: 700; margin-bottom: 0.3rem; }
.steps span { color: var(--muted); font-size: 0.95rem; }

/* Contact */
.contact { background: var(--panel); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.3fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.contact-aside { display: grid; gap: 1.2rem; }
.mail { font-family: var(--f-mono); font-size: 1.05rem; word-break: break-all; }
.note { font-size: 0.9rem; color: var(--muted); }
form { display: grid; gap: 1.1rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.field { display: grid; gap: 0.35rem; min-width: 0; }
.field label { font-weight: 500; font-size: 0.92rem; }
.field label span { color: var(--muted); font-weight: 400; }
input, textarea, select {
  font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line);
  border-radius: 3px; padding: 0.7rem 0.8rem; width: 100%;
}
input:focus, textarea:focus { border-color: var(--ink); outline: 2px solid var(--accent); outline-offset: 0; }
textarea { min-height: 9rem; resize: vertical; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.form-foot .note { max-width: 30rem; }
.status { font-size: 0.95rem; padding: 0.8rem 1rem; border-left: 3px solid currentColor; background: var(--paper); }
.status.ok { color: var(--ok); }
.status.err { color: var(--err); }

/* Footer */
.site-foot { background: var(--basalt); color: var(--on-basalt-muted); font-size: 0.9rem; }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 1.2rem 2rem; flex-wrap: wrap; padding-block: 2.2rem; align-items: center; }
.site-foot a { color: var(--on-basalt); }
.site-foot nav { display: flex; gap: 0.4rem 1.4rem; flex-wrap: wrap; }

/* Legal pages */
.legal { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.legal .wrap { max-width: 50rem; }
.legal h1 { font-size: var(--step-3); font-weight: 750; font-stretch: 92%; margin-bottom: 0.6rem; }
.legal h2 { font-size: var(--step-1); font-weight: 700; margin-top: 2.4rem; margin-bottom: 0.6rem; }
.legal h3 { font-size: 1.02rem; font-family: var(--f-body); font-weight: 600; margin-top: 1.4rem; margin-bottom: 0.4rem; }
.legal p, .legal ul, .legal dl { margin-block: 0 0.9rem; max-width: 65ch; }
.legal ul { padding-left: 1.2rem; }
.legal dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.35rem 1.4rem; }
.legal dt { color: var(--muted); }
.legal dd { margin: 0; }
.legal .stand { color: var(--muted); font-family: var(--f-mono); font-size: 0.82rem; }
.credits { font-size: 0.92rem; }
.credits li { margin-bottom: 0.35rem; }

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero .photo { aspect-ratio: 16 / 10; }
  .spec { grid-template-columns: 1fr; gap: 0.6rem; }
  .steps { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .bench-grid { grid-template-columns: 1fr 1fr; }
  .bench-text { grid-column: span 2; padding-right: 0; }
  .band { grid-template-columns: 1fr 1fr; grid-template-rows: none; grid-auto-rows: clamp(8rem, 30vw, 13rem); }
  .band .photo.big { grid-column: span 2; grid-row: span 2; }
  .contact-aside .photo.tall { display: none; }
}
@media (max-width: 560px) {
  .nav { gap: 0.25rem 1rem; }
  .nav .nav-link { display: none; }
  .steps { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }
  .legal dl { grid-template-columns: 1fr; }
  .legal dd { margin-bottom: 0.5rem; }
}
