/* ==========================================================================
   E1 robotics – „Teach-Pendant“
   The site behaves like a robot's teach pendant: the header is the six-axis
   joint panel, sections are axes, the FAQ is the message window and the
   enquiry is a Lastenheft. Graphite, cobalt and signal green on warm white.
   ========================================================================== */

/* ---------- Fonts (self-hosted, SIL Open Font License) ---------- */
@font-face {
  font-family: 'Chivo';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('../fonts/chivo-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Chivo';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('../fonts/chivo-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Chivo Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/chivo-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Chivo Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/chivo-mono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens ---------- */
:root {
  /* Warm white paper and its darker sheet tone */
  --paper: #f5f3ee;
  --paper-2: #ebe7df;
  --sheet: #fbfaf7;
  --line: #d9d4ca;
  /* Graphite steps, darkest first */
  --ink: #16191d;
  --graphite: #1e2329;
  --graphite-2: #22272e;
  --graphite-3: #2d333b;
  --graphite-4: #3b424c;
  --steel: #59616c;           /* muted text on paper: 5.6:1 */
  --fog: #a9b0ba;             /* muted text on graphite: 6.9:1 */
  --chalk: #e9e6df;           /* text on graphite: 12:1 */
  /* Cobalt: text/buttons on paper 6.7:1, light tint on graphite 6.7:1 */
  --cobalt: #1d48c9;
  --cobalt-deep: #163aa5;
  --cobalt-light: #8eabff;
  /* Signal green: dark ink on paper 5.6:1, LED tone on graphite 8.7:1 */
  --green: #1f9d55;
  --green-ink: #12703a;
  --green-led: #3ee07f;
  --red: #c4343d;

  --font: 'Chivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Chivo Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --step-0: 1rem;
  --step-1: clamp(1.125rem, 1.05rem + 0.3vw, 1.25rem);
  --step-2: clamp(1.4rem, 1.2rem + 0.9vw, 1.85rem);
  --step-3: clamp(1.85rem, 1.4rem + 2vw, 2.9rem);
  --step-4: clamp(2.2rem, 1.4rem + 3.2vw, 3.6rem);

  --space-s: clamp(12px, 1.5vw, 18px);
  --space-m: clamp(20px, 3vw, 32px);
  --space-l: clamp(40px, 6vw, 80px);
  --space-xl: clamp(64px, 9vw, 128px);
  --gutter: clamp(16px, 4vw, 40px);

  --radius: 10px;
  --radius-s: 6px;
  --shadow: 0 1px 0 rgb(22 25 29 / 0.04), 0 14px 34px -18px rgb(22 25 29 / 0.35);
  --ease: cubic-bezier(0.65, 0, 0.35, 1);
  --head-h: 72px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--head-h) + 16px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
body.nav-open { overflow: hidden; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
h1, h2, h3 { line-height: 1.15; text-wrap: balance; font-weight: 800; letter-spacing: -0.015em; }
p, li, dd { text-wrap: pretty; }
img, svg { display: block; max-width: 100%; }
a { color: var(--cobalt); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--cobalt-deep); text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-family: var(--mono); font-size: 0.92em; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }
.nobr { white-space: nowrap; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 12px 18px;
  background: var(--cobalt);
  color: #fff;
  font-weight: 700;
  border-radius: var(--radius-s);
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; color: #fff; }

.wrap { width: 100%; max-width: 1280px; margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Components: LEDs, buttons ---------- */
.led {
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-led);
  box-shadow: 0 0 0 3px rgb(62 224 127 / 0.18);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 12px 24px;
  border: 2px solid transparent;
  border-radius: var(--radius-s);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}
.btn:active { transform: translateY(1px); }
.btn-cobalt { background: var(--cobalt); color: #fff; }
.btn-cobalt:hover { background: var(--cobalt-deep); color: #fff; }
.btn-line { border-color: var(--ink); color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--paper); }

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

/* ==========================================================================
   Header: six-axis joint panel (desktop) / pendant status strip (mobile)
   ========================================================================== */
.pendant-head {
  /* Joint values (degrees) – main.js tweens them; the arm and readouts follow. */
  --a1: 0;
  --a2: -90;
  --a3: 90;
  --a4: 0;
  --a5: 0;
  --a6: 0;
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--graphite);
  color: var(--chalk);
  border-bottom: 1px solid var(--graphite-3);
  transition: box-shadow 0.25s;
}
.pendant-head.is-scrolled { box-shadow: 0 10px 24px -14px rgb(0 0 0 / 0.6); }

.head-bar {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  grid-template-areas: "brand status start toggle";
  align-items: center;
  gap: 12px;
  max-width: 1280px;
  min-height: var(--head-h);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.brand {
  grid-area: brand;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--chalk);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: #fff; }
.brand-arm { width: 40px; height: 40px; flex: none; }
.brand-word { font-size: 1.3rem; line-height: 1; letter-spacing: -0.01em; }
.brand-word b { font-weight: 900; }
.brand-rest { font-weight: 300; }

/* The logo is a small copy of the hero arm and follows the same joint values. */
.logo-a2, .logo-a3, .logo-a5 { transform-box: view-box; }
.logo-a2 { transform-origin: 22px 30px; transform: rotate(calc((var(--a2) + 90) * 1deg)); }
.logo-a3 { transform-origin: 22px 14px; transform: rotate(calc((var(--a3) - 90) * 1deg)); }
.logo-a5 { transform-origin: 8px 14px; transform: rotate(calc(var(--a5) * 1deg)); }

.head-status {
  grid-area: status;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--fog);
  white-space: nowrap;
}
.head-status-text { overflow: hidden; text-overflow: ellipsis; }
.head-status-axis {
  padding: 2px 8px;
  border: 1px solid var(--graphite-4);
  border-radius: 4px;
  color: var(--cobalt-light);
}

/* One joint key: id, value, name and a limit scale with the current position. */
.joint {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "id val" "name name" "scale scale";
  align-items: baseline;
  gap: 1px 10px;
  min-width: 108px;
  padding: 7px 11px 9px;
  border: 1px solid var(--graphite-4);
  border-radius: var(--radius-s);
  background: var(--graphite-2);
  color: var(--chalk);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s, border-color 0.2s;
}
.joint:hover { background: var(--graphite-3); border-color: var(--cobalt-light); color: #fff; text-decoration: none; }
.joint-id { grid-area: id; font-family: var(--mono); font-size: 0.75rem; font-weight: 700; color: var(--cobalt-light); }
.joint-val { grid-area: val; justify-self: end; font-family: var(--mono); font-size: 0.75rem; color: var(--fog); font-variant-numeric: tabular-nums; }
.joint-name { grid-area: name; font-size: 0.9375rem; font-weight: 700; line-height: 1.3; }
.joint-scale { grid-area: scale; position: relative; height: 3px; margin-top: 5px; border-radius: 2px; background: var(--graphite-4); }
.joint-scale i {
  --v: 0;
  position: absolute;
  top: -2px;
  left: calc((var(--v) + 180) / 3.6 * 1%);
  width: 4px;
  height: 7px;
  margin-left: -2px;
  border-radius: 1px;
  background: var(--green-led);
}
[data-axis="a1"] .joint-scale i { --v: var(--a1); }
[data-axis="a2"] .joint-scale i { --v: var(--a2); }
[data-axis="a3"] .joint-scale i { --v: var(--a3); }
[data-axis="a4"] .joint-scale i { --v: var(--a4); }
[data-axis="a5"] .joint-scale i { --v: var(--a5); }
[data-axis="a6"] .joint-scale i { --v: var(--a6); }
.joint[aria-current="true"] { border-color: var(--cobalt-light); background: #24304d; }
.joint[aria-current="true"] .joint-id { color: var(--green-led); }

/* A6 is the call to action: the green-lit start key of the panel. */
.joint-start { grid-area: start; background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.joint-start .joint-id { color: #dbe4ff; }
.joint-start .joint-val { color: #dbe4ff; }
.joint-start .joint-scale { background: rgb(255 255 255 / 0.25); }
.joint-start:hover { background: var(--cobalt-deep); border-color: var(--cobalt-light); }
.joint-start[aria-current="true"] { background: var(--cobalt-deep); }
.joint-start[aria-current="true"] .joint-id { color: var(--green-led); }

/* Jog-key menu toggle (mobile and tablet) */
.jog-toggle {
  grid-area: toggle;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 12px 6px 8px;
  border: 1px solid var(--graphite-4);
  border-radius: var(--radius-s);
  background: var(--graphite-2);
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.jog-toggle:hover { border-color: var(--cobalt-light); }
.jog-icon { display: grid; grid-template-columns: repeat(2, 14px); gap: 3px; }
.jog-icon i {
  position: relative;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--graphite-4);
}
.jog-icon i::before, .jog-icon i:last-child::after {
  content: "";
  position: absolute;
  inset: 6px 3px;
  background: var(--chalk);
  border-radius: 1px;
}
.jog-icon i:last-child::after { inset: 3px 6px; }
.jog-toggle[aria-expanded="true"] .jog-icon i { background: var(--cobalt); }

/* Mobile and tablet: the joints fold into the jog-key menu. */
@media (max-width: 1099.98px) {
  .joint-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    max-height: calc(100dvh - var(--head-h) - 40px);
    overflow-y: auto;
    padding: 12px var(--gutter) 20px;
    background: var(--graphite);
    border-bottom: 1px solid var(--graphite-3);
    box-shadow: 0 24px 40px -20px rgb(0 0 0 / 0.7);
  }
  .joint-panel.is-open { display: block; }
  .joint-list { display: grid; gap: 8px; max-width: 640px; margin: 0 auto; padding: 0; list-style: none; }
  .joint-list .joint {
    grid-template-columns: 44px 1fr auto;
    grid-template-areas: "id name val";
    align-items: center;
    min-height: 56px;
    padding: 6px 14px 6px 6px;
  }
  .joint-list .joint-id {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 5px;
    background: var(--graphite-3);
    box-shadow: inset 0 -3px 0 rgb(0 0 0 / 0.35);
    font-size: 0.875rem;
  }
  .joint-list .joint-name { font-size: 1.0625rem; }
  .joint-list .joint-val { font-size: 0.875rem; }
  .joint-list .joint-scale { display: none; }

  .joint-start {
    grid-template-columns: auto auto;
    grid-template-areas: "id name";
    align-items: center;
    min-width: 0;
    min-height: 44px;
    padding: 6px 12px;
  }
  .joint-start .joint-val, .joint-start .joint-scale { display: none; }
}

@media (max-width: 899.98px) {
  .head-bar {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "brand . start toggle" "status status status status";
    gap: 0 8px;
    min-height: 0;
    padding-top: 10px;
  }
  .head-status {
    justify-content: space-between;
    margin: 10px calc(-1 * var(--gutter)) 0;
    padding: 6px var(--gutter);
    background: var(--ink);
    border-top: 1px solid var(--graphite-3);
    font-size: 0.75rem;
  }
  .head-status-axis { padding-block: 0; }
}
@media (max-width: 379.98px) {
  .head-status-long { display: none; }
  .jog-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .jog-toggle { justify-content: center; min-width: 44px; }
}
@media (max-width: 419.98px) {
  .brand-rest { display: none; }
  .brand { gap: 6px; }
  .jog-toggle { padding-inline: 8px; }
  .joint-start .joint-id { display: none; }
}

/* Desktop: the full joint panel sits in the bar. */
@media (min-width: 1100px) {
  .head-bar { grid-template-columns: auto 1fr auto; grid-template-areas: "brand nav start"; gap: 18px; }
  .head-status, .jog-toggle { display: none; }
  .joint-panel { grid-area: nav; justify-self: end; }
  .joint-list { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
}
@media (min-width: 1100px) and (max-width: 1239.98px) {
  .joint { min-width: 98px; padding-inline: 9px; }
  .brand-word { font-size: 1.15rem; }
}

/* ==========================================================================
   Hero: cell with the arm, teach pendant with the program listing
   ========================================================================== */
.hero { padding-block: clamp(28px, 5vw, 64px) 16px; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "copy" "cell" "pendant";
  gap: var(--space-m);
}
.hero-copy { grid-area: copy; }
.hero-title { font-size: var(--step-4); line-height: 1.02; letter-spacing: -0.025em; }
.hero-title .hw { display: inline-block; }
.hero-lead { max-width: 36em; margin-top: var(--space-m); font-size: var(--step-1); color: #353b43; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: var(--space-m); }

/* The cell */
.cell {
  grid-area: cell;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--graphite-3);
  border-radius: 16px;
  background: var(--graphite-2);
  box-shadow: var(--shadow);
}
.cell-art {
  --a1: 0;
  --a2: -90;
  --a3: 90;
  --a4: 0;
  --a5: 0;
  --a6: 0;
  --grip: 1;
  width: 100%;
  height: auto;
  margin-top: auto;
}
.cell-sign { font-family: var(--mono); font-size: 14px; font-weight: 700; fill: var(--cobalt-light); letter-spacing: 0.12em; }
.cell-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--graphite-3);
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--cobalt-light);
  white-space: nowrap;
}
.cell-bar-state { display: inline-flex; align-items: center; gap: 8px; color: var(--green-led); font-weight: 400; }
.cell-axes {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--graphite-3);
  background: #1a1e23;
}
.cell-axes li { display: grid; gap: 2px; padding: 10px 12px; font-family: var(--mono); font-size: 0.75rem; }
.cell-axes li + li { border-left: 1px solid var(--graphite-3); }
.cell-axes span { color: var(--cobalt-light); font-weight: 700; }
.cell-axes b { color: var(--chalk); font-weight: 400; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 559.98px) {
  .cell-axes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cell-axes li:nth-child(4) { border-left: 0; }
  .cell-axes li:nth-child(n + 4) { border-top: 1px solid var(--graphite-3); }
  .cell-bar-state { display: none; }
}
.arm-badge { font-family: var(--mono); font-size: 13px; font-weight: 700; fill: var(--paper); letter-spacing: 0.1em; }

/* Joint transforms in the SVG's own units; the hierarchy carries the rest. */
.arm-a2, .arm-a3, .arm-a5, .arm-a1-mark, .arm-a4-mark, .arm-a6-mark, .arm-finger { transform-box: view-box; }
.arm-a2 { transform-origin: 360px 350px; transform: rotate(calc((var(--a2) + 90) * 1deg)); }
.arm-a3 { transform-origin: 360px 200px; transform: rotate(calc((var(--a3) - 90) * 1deg)); }
.arm-a5 { transform-origin: 220px 200px; transform: rotate(calc(var(--a5) * 1deg)); }
.arm-a1-mark { transform: translate(calc(sin(var(--a1) * 1deg) * 34px), calc((cos(var(--a1) * 1deg) - 1) * 7px)); }
.arm-a4-mark { transform: translateY(calc(sin(var(--a4) * 1deg) * 10px)); }
.arm-a6-mark { transform: translateX(calc(sin(var(--a6) * 1deg) * 11px)); }
.arm-finger-l { transform: translateX(calc(var(--grip) * -7px)); }
.arm-finger-r { transform: translateX(calc(var(--grip) * 7px)); }
.arm-finger { transition: transform 0.25s var(--ease); }

/* Pick-and-place: which copy of the part is visible depends on the cycle step. */
.part { transition: opacity 0.15s; }
.arm-held { opacity: 0; }
.cell-art[data-cycle="start"] .part-placed { opacity: 0; }
.cell-art[data-cycle="hold"] .part-active,
.cell-art[data-cycle="hold"] .part-placed { opacity: 0; }
.cell-art[data-cycle="hold"] .arm-held { opacity: 1; }
.cell-art[data-cycle="done"] .part-active { opacity: 0; }

/* The teach pendant */
.pendant { grid-area: pendant; justify-self: start; width: 100%; max-width: 480px; }
.pendant-body {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border-radius: 22px;
  background: linear-gradient(160deg, #343b45, var(--graphite-3) 40%, #262b32);
  box-shadow: var(--shadow), inset 0 1px 0 rgb(255 255 255 / 0.08);
}
.pendant-screen {
  min-width: 0;
  padding: 10px 0 12px;
  border: 1px solid #0b0d10;
  border-radius: 10px;
  background: #101317;
  color: var(--chalk);
}
.pendant-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0 12px 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--graphite-3);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--fog);
  white-space: nowrap;
}
.pendant-bar > span:last-child { display: inline-flex; align-items: center; gap: 8px; color: var(--green-led); }
.listing { margin: 0; padding: 0; list-style: none; counter-reset: line; }
.listing li {
  position: relative;
  display: flex;
  min-height: 1.75em;
  align-items: center;
  padding: 0 12px 0 46px;
  counter-increment: line;
  font-size: clamp(0.75rem, 0.7rem + 0.25vw, 0.84rem);
  white-space: pre;
  overflow: hidden;
}
.listing li::before {
  content: counter(line);
  position: absolute;
  left: 0;
  width: 26px;
  text-align: right;
  font-family: var(--mono);
  color: #6f7883;
}
.listing code { font-size: inherit; color: var(--chalk); text-overflow: ellipsis; overflow: hidden; }
.listing .listing-comment { color: #7ee2a8; }
.listing li.is-current { background: rgb(62 224 127 / 0.12); }
.listing li.is-current::after {
  content: "";
  position: absolute;
  left: 32px;
  top: 50%;
  border: 5px solid transparent;
  border-left: 7px solid var(--green-led);
  transform: translateY(-50%);
}
.pendant-keys { display: grid; grid-template-columns: repeat(2, 34px); align-content: center; gap: 8px; }
.pkey {
  display: grid;
  place-items: center;
  height: 34px;
  border-radius: 7px;
  background: var(--graphite-2);
  box-shadow: inset 0 -3px 0 rgb(0 0 0 / 0.4), 0 1px 0 rgb(255 255 255 / 0.06);
  font-family: var(--mono);
  font-weight: 700;
  color: var(--fog);
}
.pendant-estop {
  position: absolute;
  top: -14px;
  right: 22px;
  width: 30px;
  height: 30px;
  border: 4px solid var(--graphite-4);
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #e0545c, var(--red) 60%, #8e2128);
}
@media (max-width: 1099.98px) {
  .pendant-body { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .pendant-keys { display: none; }
}
.pendant-caption { margin-top: 12px; font-family: var(--mono); font-size: 0.8125rem; color: var(--steel); }

@media (min-width: 720px) {
  .hero-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-areas: "copy copy" "cell pendant"; align-items: center; }
  .pendant { justify-self: stretch; }
}
@media (min-width: 1100px) {
  .hero-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    grid-template-rows: auto 1fr;
    grid-template-areas: "copy cell" "pendant cell";
    column-gap: clamp(40px, 5vw, 72px);
    row-gap: 36px;
    align-items: start;
  }
  .cell { align-self: stretch; }
  .pendant { align-self: end; max-width: 460px; }
}

/* ==========================================================================
   Sections: each one is an axis
   ========================================================================== */
.sec { padding-block: var(--space-xl); }
.axis-head { max-width: 760px; margin-bottom: var(--space-l); }
.axis-tag {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 4px 4px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--sheet);
  font-family: var(--mono);
  font-size: 0.8125rem;
  white-space: nowrap;
}
.axis-id {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 28px;
  padding-inline: 6px;
  border-radius: 5px;
  background: var(--graphite);
  color: var(--green-led);
  font-weight: 700;
}
.axis-name { color: var(--ink); font-weight: 700; }
.axis-val { padding-right: 10px; color: var(--steel); font-variant-numeric: tabular-nums; }
.axis-head h2 { font-size: var(--step-3); }
.axis-intro { margin-top: 18px; font-size: var(--step-1); color: #3c424a; max-width: 40em; }

/* Dark axes */
.sec-bahn, .sec-meldungen { background: var(--graphite); color: var(--chalk); }
.sec-bahn .axis-tag, .sec-meldungen .axis-tag { border-color: var(--graphite-4); background: var(--graphite-2); }
.sec-bahn .axis-name, .sec-meldungen .axis-name { color: var(--chalk); }
.sec-bahn .axis-val, .sec-meldungen .axis-val { color: var(--fog); }
.sec-bahn .axis-intro, .sec-meldungen .axis-intro { color: #c9ced6; }

/* ---------- A1: cell layout ---------- */
.layout { --plan-rot: 180deg; display: grid; gap: var(--space-m); align-items: start; }
.layout-plan { position: relative; width: 100%; max-width: 600px; margin-inline: auto; }
.plan-art { width: 100%; height: auto; }
.plan-arm { transform-box: view-box; transform-origin: 260px 260px; transform: rotate(var(--plan-rot)); transition: transform 0.9s var(--ease); }
.plan-station > :first-child { transition: stroke 0.2s, fill 0.2s; }
.plan-station.is-active > :first-child { stroke: var(--cobalt); fill: #e3e8f8; }
.plan-beams { stroke-dasharray: 4 3; }

.plan-keys { position: absolute; inset: 0; }
.plan-keys[hidden] { display: none; }
.plan-key {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--graphite-3);
  border-radius: 8px;
  background: var(--sheet);
  box-shadow: 0 6px 16px -10px rgb(22 25 29 / 0.6);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.875rem;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.plan-key:hover { border-color: var(--cobalt); color: var(--cobalt); }
.plan-key-no {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 5px;
  background: var(--graphite);
  color: var(--chalk);
  font-family: var(--mono);
  font-size: 0.8125rem;
}
.plan-key[aria-selected="true"] { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.plan-key[aria-selected="true"] .plan-key-no { background: var(--ink); color: var(--green-led); }
[data-pin="s1"] { left: 13%; top: 50%; }
[data-pin="s2"] { left: 27.7%; top: 16%; }
[data-pin="s3"] { left: 72.3%; top: 14%; }
[data-pin="s4"] { left: 86%; top: 50%; }
[data-pin="s5"] { left: 72.7%; top: 86%; }
[data-pin="s6"] { left: 27.7%; top: 85.4%; }

.layout-panels { display: grid; gap: var(--space-s); }
.station {
  position: relative;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--sheet);
  box-shadow: var(--shadow);
}
.station-no { font-family: var(--mono); font-size: 0.875rem; font-weight: 700; color: var(--cobalt); }
.station h3 { margin-top: 6px; font-size: var(--step-2); }
.station > p:not(.station-no):not(.station-meta) { margin-top: 14px; color: #353b43; }
.station-list { display: grid; gap: 8px; margin-top: 18px; padding: 0; list-style: none; }
.station-list li { position: relative; padding-left: 22px; }
.station-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.55em;
  width: 9px;
  height: 9px;
  border: 2px solid var(--cobalt);
  border-radius: 2px;
}
.station-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
}
.station-meta span { font-family: var(--mono); font-size: 0.8125rem; font-weight: 700; color: var(--green-ink); }

@media (max-width: 559.98px) {
  .plan-key { padding: 4px; }
  .plan-key-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}
@media (min-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(32px, 4vw, 64px); }
  .layout-panels { position: sticky; top: calc(var(--head-h) + 24px); }
}

/* ---------- A2: trajectory ---------- */
.path-art { display: none; width: 100%; height: auto; overflow: visible; }
.path-line { fill: none; stroke: var(--graphite-4); stroke-width: 3; stroke-dasharray: 2 8; stroke-linecap: round; }
.path-done { fill: none; stroke: var(--cobalt-light); stroke-width: 3; stroke-linecap: round; }
.path-points circle { fill: var(--graphite); stroke: var(--cobalt-light); stroke-width: 3; }
.path-move { font-family: var(--mono); font-size: 14px; font-weight: 700; fill: var(--cobalt-light); letter-spacing: 0.06em; }
.path-label { font-family: var(--mono); font-size: 15px; font-weight: 700; fill: var(--chalk); text-anchor: middle; }
.path-tcp { transform: translate(100px, 140px); }

.path-steps { position: relative; display: grid; gap: 28px; margin: 0; padding: 0 0 0 44px; list-style: none; }
.path-steps::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 10px;
  bottom: 10px;
  border-left: 3px dotted var(--graphite-4);
}
.path-step { position: relative; }
.path-step::before {
  content: "";
  position: absolute;
  left: -38px;
  top: 4px;
  width: 16px;
  height: 16px;
  border: 3px solid var(--cobalt-light);
  border-radius: 50%;
  background: var(--graphite);
}
.path-step-head { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 0.8125rem; }
.path-p { padding: 1px 8px; border: 1px solid var(--cobalt-light); border-radius: 4px; color: var(--cobalt-light); font-weight: 700; }
.path-type { color: var(--fog); }
.path-step h3 { margin-top: 12px; font-size: var(--step-1); color: #fff; }
.path-step p:not(.path-step-head):not(.path-time) { margin-top: 8px; color: #c9ced6; font-size: 0.9688rem; }
.path-time { margin-top: 12px; font-family: var(--mono); font-size: 0.8125rem; color: var(--green-led); }

@media (min-width: 900px) {
  .path-art { display: block; margin-bottom: 18px; }
  .path-steps { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; padding: 0; }
  .path-steps::before, .path-step::before { display: none; }
  .path-step { padding: 0 clamp(8px, 1.2vw, 18px); }
  .path-step + .path-step { border-left: 1px solid var(--graphite-3); }
  .path-step-head { justify-content: center; }
}

/* ---------- A3: safety ---------- */
.safety-grid { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "zones" "copy"; column-gap: clamp(32px, 5vw, 80px); }
.safety-grid > .axis-head { grid-area: head; }
.zones { grid-area: zones; max-width: 460px; margin: 0 auto var(--space-l); }
.zones-art { width: 100%; height: auto; }
.zones-label { font-family: var(--mono); font-size: 13px; font-weight: 700; fill: var(--ink); }
.zones-sweep { transform-box: view-box; transform-origin: 220px 220px; }
.zones-legend { display: grid; gap: 8px; margin-top: 18px; font-size: 0.9375rem; color: #353b43; }
.zl { display: flex; align-items: center; gap: 10px; }
.zl::before { content: ""; flex: none; width: 22px; height: 12px; border-radius: 3px; }
.zl-green::before { background: rgb(31 157 85 / 0.22); border: 2px solid var(--green); }
.zl-cobalt::before { background: rgb(29 72 201 / 0.14); border: 2px solid rgb(29 72 201 / 0.6); }
.zl-dash::before { border: 2px dashed var(--cobalt); }
.safety-copy { grid-area: copy; }
.norms { display: grid; counter-reset: norm; border-top: 1px solid var(--line); }
.norm { position: relative; padding: 16px 0 16px 52px; border-bottom: 1px solid var(--line); counter-increment: norm; }
.norm::before {
  content: "N" counter(norm);
  position: absolute;
  left: 0;
  top: 17px;
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--cobalt);
}
.norm dt { font-weight: 800; }
.norm dd { margin-top: 4px; color: #3c424a; font-size: 0.9688rem; }
.safety-note {
  margin-top: var(--space-m);
  padding: 18px 20px 18px 56px;
  border-radius: var(--radius);
  background: var(--graphite);
  color: var(--chalk);
  position: relative;
  font-size: 0.9688rem;
}
.safety-note::before {
  content: "i";
  position: absolute;
  left: 18px;
  top: 18px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--cobalt-light);
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.875rem;
}
@media (min-width: 1000px) {
  .safety-grid { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); grid-template-areas: "head zones" "copy zones"; }
  .safety-grid > .axis-head { margin-bottom: var(--space-m); }
  .zones { position: sticky; top: calc(var(--head-h) + 32px); width: 100%; margin: 0; }
}

/* ---------- A4: company ---------- */
.sec-firma { background: var(--paper-2); }
.sec-firma .axis-tag { background: var(--paper); }
.firma-grid { display: grid; gap: var(--space-l); align-items: start; }
.firma-grid > .axis-head { margin-bottom: 0; }
.principles { display: grid; gap: 14px; margin-top: var(--space-m); padding: 0; list-style: none; }
.principles li { padding-left: 18px; border-left: 3px solid var(--cobalt); }
.principles strong { font-weight: 800; }
.infobox {
  overflow: hidden;
  border: 10px solid var(--graphite-3);
  border-radius: 18px;
  background: #101317;
  color: var(--chalk);
  box-shadow: var(--shadow);
}
.infobox-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: var(--graphite-2);
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--cobalt-light);
}
.infobox-list { padding: 6px 18px 12px; }
.infobox-list > div {
  display: grid;
  grid-template-columns: minmax(0, 9.5em) minmax(0, 1fr);
  gap: 4px 16px;
  padding-block: 10px;
  border-bottom: 1px solid var(--graphite-3);
}
.infobox-list > div:last-child { border-bottom: 0; }
.infobox-list dt { font-family: var(--mono); font-size: 0.8125rem; color: var(--fog); padding-top: 2px; }
.infobox-list dd { font-size: 0.9688rem; overflow-wrap: anywhere; }
@media (max-width: 479.98px) {
  .infobox-list > div { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 1000px) {
  .firma-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(40px, 6vw, 96px); }
}

/* ---------- A5: message window ---------- */
.msgwin {
  overflow: hidden;
  max-width: 1040px;
  border: 1px solid var(--graphite-4);
  border-radius: 14px;
  background: var(--graphite-2);
  box-shadow: 0 24px 50px -30px rgb(0 0 0 / 0.8);
}
.msgwin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: 8px 12px 8px 20px;
  border-bottom: 1px solid var(--graphite-4);
  background: var(--graphite-3);
}
.msgwin-count { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 0.875rem; font-weight: 700; }
.msgwin-count .led { background: var(--cobalt-light); box-shadow: 0 0 0 3px rgb(142 171 255 / 0.2); }
.msgwin.is-clear .msgwin-count .led { background: var(--green-led); box-shadow: 0 0 0 3px rgb(62 224 127 / 0.18); }
.msgwin-all, .msg-ack {
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--cobalt-light);
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--cobalt-light);
  font-weight: 700;
  font-size: 0.9375rem;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.msgwin-all:hover, .msg-ack:hover { background: var(--cobalt-light); color: var(--ink); }
.msg-list { margin: 0; padding: 0; list-style: none; }
.msg { border-bottom: 1px solid var(--graphite-3); }
.msg:last-child { border-bottom: 0; }
.msg-row {
  display: grid;
  grid-template-columns: 28px auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px 14px 20px;
}
.msg-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--cobalt-light);
}
.msg-icon::before { content: "i"; font-family: var(--mono); font-weight: 700; font-size: 0.875rem; color: var(--ink); }
.msg-code { font-family: var(--mono); font-size: 0.8125rem; color: var(--fog); }
.msg-q { font-size: 1.0625rem; font-weight: 700; letter-spacing: 0; }
.msg-a { padding: 0 20px 20px 82px; color: #c9ced6; }
.msg-a p { max-width: 62em; }
.msg.is-acked .msg-icon { background: var(--green-led); }
.msg.is-acked .msg-icon::before { content: "✓"; }
.msg-ack[aria-expanded="true"] { border-color: var(--graphite-4); color: var(--fog); }
.msg-ack[aria-expanded="true"]:hover { background: var(--graphite-4); color: var(--chalk); }
@media (max-width: 639.98px) {
  .msg-row { grid-template-columns: 28px minmax(0, 1fr) auto; grid-template-areas: "icon code ack" "q q q"; gap: 10px 12px; padding-inline: 16px; }
  .msg-icon { grid-area: icon; }
  .msg-code { grid-area: code; }
  .msg-q { grid-area: q; }
  .msg-ack { grid-area: ack; }
  .msg-a { padding: 0 16px 18px; }
  .msgwin-bar { padding-left: 16px; }
}

/* ---------- A6: Lastenheft ---------- */
.spec-grid { display: grid; gap: var(--space-m); align-items: start; }
.spec {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--sheet);
  box-shadow: var(--shadow);
}
.spec-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 12px clamp(18px, 3vw, 32px);
  background: var(--graphite);
  color: var(--chalk);
  font-family: var(--mono);
  font-size: 0.8125rem;
  border-radius: 3px 3px 0 0;
}
.spec-block { min-width: 0; margin: 0; padding: clamp(20px, 3vw, 32px); border: 0; border-bottom: 1px solid var(--line); }
.spec-legend { display: flex; align-items: center; gap: 12px; padding: 0; margin-bottom: 18px; font-size: var(--step-1); font-weight: 800; float: left; width: 100%; }
.spec-legend + * { clear: both; }
.spec-no {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 5px;
  background: var(--cobalt);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.875rem;
}
.req-mark { color: var(--red); font-weight: 700; }
.optional { color: var(--steel); font-weight: 400; font-size: 0.875rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid #b9b3a8;
  border-radius: 999px;
  background: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.chip:hover span { border-color: var(--cobalt); }
.chip input:checked + span { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--cobalt); outline-offset: 3px; }
[aria-invalid="true"] .chip span { border-color: var(--red); }

.slider + .slider { margin-top: 22px; }
.slider-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.slider-head label { font-weight: 700; }
.slider-out { font-family: var(--mono); font-weight: 700; color: var(--cobalt); font-variant-numeric: tabular-nums; white-space: nowrap; }
.slider-input {
  --fill: 10%;
  display: block;
  width: 100%;
  height: 44px;
  margin: 2px 0 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.slider-input::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, var(--cobalt) var(--fill), var(--line) var(--fill));
}
.slider-input::-moz-range-track { height: 8px; border-radius: 4px; background: var(--line); }
.slider-input::-moz-range-progress { height: 8px; border-radius: 4px; background: var(--cobalt); }
.slider-input::-webkit-slider-thumb {
  width: 26px;
  height: 26px;
  margin-top: -9px;
  border: 3px solid #fff;
  border-radius: 6px;
  background: var(--graphite);
  box-shadow: 0 0 0 1px var(--graphite), 0 3px 8px rgb(0 0 0 / 0.3);
  -webkit-appearance: none;
  appearance: none;
}
.slider-input::-moz-range-thumb { width: 22px; height: 22px; border: 3px solid #fff; border-radius: 6px; background: var(--graphite); }
.slider-input:focus-visible { outline: none; }
.slider-input:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--cobalt); outline-offset: 3px; }
.slider-input:focus-visible::-moz-range-thumb { outline: 3px solid var(--cobalt); outline-offset: 3px; }
.slider-scale { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.75rem; color: var(--steel); }

.check { display: flex; align-items: flex-start; gap: 12px; margin-top: 22px; cursor: pointer; }
.check input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--cobalt); cursor: pointer; }
.field .check { margin-top: 0; }

.spec-fields { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field > label { font-weight: 700; }
.field input:not([type="checkbox"]), .field select, .field textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid #a7a196;
  border-radius: var(--radius-s);
  background: #fff;
  color: var(--ink);
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--steel); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 1px; border-color: var(--cobalt); }
.field [aria-invalid="true"] { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.field-hint { font-size: 0.875rem; color: var(--steel); }
.field-error { font-size: 0.875rem; font-weight: 700; color: #a3222b; }
.field-error:empty { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.spec-submit { display: grid; gap: 18px; padding: clamp(20px, 3vw, 32px); }
.spec-submit .btn { justify-self: start; }
.form-note { font-size: 0.875rem; color: var(--steel); }
.form-status { margin: 0 clamp(20px, 3vw, 32px); }
.form-status:empty { display: none; }
.form-status.is-success, .form-status.is-error { margin-bottom: clamp(20px, 3vw, 32px); padding: 14px 16px; border-radius: var(--radius-s); font-weight: 600; }
.form-status.is-success { background: #e2f4e8; color: #0c4f28; border: 1px solid #9fd5b2; }
.form-status.is-error { background: #fbe6e7; color: #7c1820; border: 1px solid #eeb2b6; }

/* Live preview of the specification */
.preview { display: grid; gap: var(--space-s); }
.preview-card {
  padding: 22px;
  border-radius: var(--radius);
  background: var(--graphite);
  color: var(--chalk);
  box-shadow: var(--shadow);
}
.preview-title { font-size: var(--step-1); }
.preview-art { width: 100%; height: auto; margin-top: 14px; }
.preview-reach { fill: rgb(142 171 255 / 0.12); stroke: var(--cobalt-light); stroke-width: 1.5; stroke-dasharray: 5 4; transition: r 0.3s var(--ease); }
.preview-load { fill: var(--green-led); transform-box: fill-box; transform-origin: 50% 100%; transition: transform 0.3s var(--ease); }
.preview-axis { font-family: var(--mono); font-size: 12px; fill: var(--fog); }
.preview-list { display: grid; gap: 2px; margin-top: 12px; }
.preview-list > div { display: flex; justify-content: space-between; gap: 12px; padding-block: 6px; border-bottom: 1px solid var(--graphite-3); }
.preview-list dt { color: var(--fog); font-size: 0.875rem; }
.preview-list dd { font-family: var(--mono); font-weight: 700; }
.preview-verdict { margin-top: 16px; padding: 10px 12px; border-left: 3px solid var(--green-led); background: rgb(62 224 127 / 0.08); font-weight: 700; }
.preview-verdict.is-industrial { border-left-color: var(--cobalt-light); background: rgb(142 171 255 / 0.1); }
.preview-note { margin-top: 10px; font-size: 0.8125rem; color: var(--fog); }
.preview-direct { padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--sheet); }
.preview-direct h3 { font-size: var(--step-1); }
.preview-direct p { margin-top: 8px; }

@media (min-width: 640px) {
  .spec-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; }
  .spec-fields > .spec-legend, .field-wide { grid-column: 1 / -1; }
}
@media (min-width: 1000px) {
  .spec-grid { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: clamp(28px, 3vw, 48px); }
  .preview { position: sticky; top: calc(var(--head-h) + 24px); }
}

/* ==========================================================================
   Footer: safety fence with light curtain, the links behind the mesh
   ========================================================================== */
.fence { position: relative; background: var(--ink); color: var(--chalk); }
.fence a { color: var(--chalk); }
.fence a:hover { color: var(--cobalt-light); }
.fence-rail {
  height: 16px;
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(25% - 12px), var(--graphite-4) calc(25% - 12px) 25%),
    linear-gradient(var(--graphite-4) 0 6px, transparent 6px);
}
.fence-field {
  position: relative;
  padding-block: var(--space-l);
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(25% - 12px), #262b32 calc(25% - 12px) 25%),
    var(--ink);
}
/* The mesh lies over everything, so the plates sit behind it. */
.fence-field::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    repeating-linear-gradient(45deg, rgb(233 230 223 / 0.045) 0 1px, transparent 1px 16px),
    repeating-linear-gradient(-45deg, rgb(233 230 223 / 0.045) 0 1px, transparent 1px 16px);
}
/* Light curtain: emitter and receiver bars with beams in between. */
.fence-field::before {
  content: "";
  position: absolute;
  inset: 20px 18px;
  background: repeating-linear-gradient(to bottom, transparent 0 27px, rgb(62 224 127 / 0.26) 27px 28px);
}
.curtain {
  position: absolute;
  top: 12px;
  bottom: 12px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  width: 12px;
  border-radius: 4px;
  background: var(--graphite-3);
}
.curtain-l { left: 6px; }
.curtain-r { right: 6px; }
.curtain i { width: 4px; height: 4px; border-radius: 50%; background: var(--green-led); box-shadow: 0 0 6px var(--green-led); }

.fence-grid { position: relative; z-index: 1; display: grid; gap: 16px; }
.plate {
  position: relative;
  padding: 26px 28px;
  border: 1px solid var(--graphite-4);
  border-radius: 8px;
  background: var(--graphite-2);
}
/* Four mounting screws */
.plate::before {
  content: "";
  position: absolute;
  inset: 8px;
  pointer-events: none;
  background:
    radial-gradient(circle, #5b636e 2.5px, transparent 3px) left top / 8px 8px no-repeat,
    radial-gradient(circle, #5b636e 2.5px, transparent 3px) right top / 8px 8px no-repeat,
    radial-gradient(circle, #5b636e 2.5px, transparent 3px) left bottom / 8px 8px no-repeat,
    radial-gradient(circle, #5b636e 2.5px, transparent 3px) right bottom / 8px 8px no-repeat;
}
.plate-brand { font-size: 1.5rem; font-weight: 900; letter-spacing: -0.01em; }
.plate-text { margin-top: 12px; color: #c9ced6; }
.plate-title { font-family: var(--mono); font-size: 0.8125rem; font-weight: 700; color: var(--cobalt-light); }
.plate-links { display: grid; margin-top: 8px; padding: 0; list-style: none; }
.plate-links a, .plate-links .link-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  text-decoration: none;
}
.plate-links a:hover, .plate-links .link-button:hover { text-decoration: underline; color: var(--cobalt-light); }
.plate-links span { font-family: var(--mono); font-size: 0.8125rem; color: var(--fog); }
.plate-links a[aria-current="page"] { color: var(--cobalt-light); }

.fence-base { border-top: 1px solid var(--graphite-3); background: #101317; }
.fence-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 16px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--fog);
}
.fence-state { display: inline-flex; align-items: center; gap: 10px; color: var(--green-led); }

@media (min-width: 720px) {
  .fence-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plate-firm { grid-column: 1 / -1; }
}
@media (min-width: 1000px) {
  .fence-grid { grid-template-columns: 1.3fr 1fr 1fr; gap: 24px; }
  .plate-firm { grid-column: auto; }
  .curtain-l { left: max(10px, calc((100% - 1280px) / 2 - 4px)); }
  .curtain-r { right: max(10px, calc((100% - 1280px) / 2 - 4px)); }
}

/* ==========================================================================
   Pages: legal documents and the 404
   ========================================================================== */
.doc { padding-block: clamp(32px, 6vw, 72px) var(--space-xl); }
.doc-head { max-width: 860px; margin: 0 auto var(--space-m); }
.doc-code {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--sheet);
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--steel);
}
.doc-code b { padding: 3px 8px; border-radius: 5px; background: var(--graphite); color: var(--green-led); }
.doc-head h1 { margin-top: 18px; font-size: var(--step-3); hyphens: manual; }
.doc-sheet {
  max-width: 860px;
  margin-inline: auto;
  padding: clamp(22px, 5vw, 56px);
  border: 1px solid var(--line);
  border-top: 6px solid var(--graphite);
  border-radius: 4px;
  background: var(--sheet);
  box-shadow: var(--shadow);
}

.prose { overflow-wrap: break-word; }
.prose > * + * { margin-top: 14px; }
.prose h2 { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); font-size: var(--step-2); }
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h3 { margin-top: 24px; font-size: var(--step-1); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 6px; }
.prose dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 20px; }
.prose dt { font-weight: 700; }
.prose .lead { font-size: var(--step-1); color: #353b43; }
.prose .highlight { padding: 18px 20px; border-left: 4px solid var(--cobalt); background: var(--paper-2); }
.prose .highlight > * + * { margin-top: 10px; }
.prose .highlight h3 { margin-top: 0; }

.toc { padding: 18px 22px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--paper); }
.toc h2 { margin: 0; padding: 0; border: 0; font-family: var(--mono); font-size: 0.875rem; color: var(--steel); }
.toc ol { margin-top: 10px; columns: 2 16em; column-gap: 28px; }
.toc li { break-inside: avoid; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-s); }
.table-wrap table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 0.9375rem; }
.table-wrap th, .table-wrap td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table-wrap th { background: var(--paper-2); }
.table-wrap tr:last-child td { border-bottom: 0; }
/* Narrow screens: each row becomes a stacked block of "label / value" pairs. */
@media (max-width: 719.98px) {
  .table-wrap { overflow-x: visible; }
  .table-wrap table { min-width: 0; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; }
  .table-wrap thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .table-wrap tr { border-bottom: 1px solid var(--line); }
  .table-wrap tr:last-child { border-bottom: 0; }
  .table-wrap td { padding: 4px 12px; border-bottom: 0; overflow-wrap: break-word; }
  .table-wrap td:first-child { padding-top: 12px; }
  .table-wrap td:last-child { padding-bottom: 12px; }
  .table-wrap td::before { content: attr(data-label); display: block; font-family: var(--mono); font-size: 0.75rem; font-weight: 700; color: var(--steel); }
  .prose dl { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .prose dd + dt { margin-top: 10px; }
}

/* 404: a fault message on the pendant */
.fault { padding-block: clamp(40px, 8vw, 110px) var(--space-xl); }
.fault-box {
  max-width: 760px;
  margin-inline: auto;
  overflow: hidden;
  border: 10px solid var(--graphite-3);
  border-radius: 20px;
  background: #101317;
  color: var(--chalk);
  box-shadow: var(--shadow);
}
.fault-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: var(--graphite-2);
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--fog);
}
.fault-bar strong { color: #ff8a90; }
.fault-body { padding: clamp(24px, 5vw, 44px); }
.fault-body h1 { font-size: var(--step-3); color: #fff; }
.fault-body p { margin-top: 16px; color: #c9ced6; font-size: var(--step-1); }
.fault-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.fault .btn-line { border-color: var(--chalk); color: var(--chalk); }
.fault .btn-line:hover { background: var(--chalk); color: var(--ink); }

/* ==========================================================================
   Cookie consent: banner and dialog in the pendant look
   ========================================================================== */
.consent {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  max-width: 560px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 22px 22px 20px;
  border: 1px solid var(--graphite-4);
  border-top: 4px solid var(--cobalt-light);
  border-radius: 12px;
  background: var(--graphite-2);
  color: var(--chalk);
  box-shadow: 0 24px 60px -20px rgb(0 0 0 / 0.75);
}
.consent a { color: var(--cobalt-light); }
.consent-title { font-size: 1.1875rem; color: #fff; }
.consent-text { margin-top: 8px; font-size: 0.9375rem; color: #c9ced6; }
.consent-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.consent-btn {
  flex: 1 1 10em;
  min-height: 46px;
  padding: 10px 16px;
  border: 1px solid var(--chalk);
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--chalk);
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.consent-btn:hover { background: var(--chalk); color: var(--ink); }
.consent-link {
  min-height: 44px;
  padding: 8px 4px;
  border: 0;
  background: none;
  color: var(--cobalt-light);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}
.consent-link:hover { color: #fff; }
.consent :focus-visible, .consent-dialog :focus-visible { outline-color: var(--cobalt-light); }
.consent-dialog {
  width: min(600px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--graphite-4);
  border-top: 4px solid var(--cobalt-light);
  border-radius: 12px;
  background: var(--graphite-2);
  color: var(--chalk);
}
.consent-dialog::backdrop { background: rgb(16 19 23 / 0.7); }
.consent-dialog a { color: var(--cobalt-light); }
.consent-dialog-inner { padding: 26px clamp(18px, 4vw, 30px) clamp(18px, 4vw, 26px); }
.consent-categories { margin-top: 18px; padding: 0; list-style: none; border-top: 1px solid var(--graphite-4); }
.consent-category { padding-block: 14px; border-bottom: 1px solid var(--graphite-4); }
.consent-category-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.consent-category h3 { font-size: 1.0625rem; color: #fff; }
.consent-category p { margin-top: 6px; color: #c9ced6; font-size: 0.9063rem; }
.consent-always { font-family: var(--mono); font-size: 0.8125rem; font-weight: 700; color: var(--green-led); white-space: nowrap; }
.consent-switch { position: relative; display: inline-flex; flex: none; padding: 8px 0; cursor: pointer; }
.consent-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.consent-switch-track {
  position: relative;
  width: 52px;
  height: 28px;
  border: 1px solid var(--fog);
  border-radius: 14px;
  background: var(--graphite);
  transition: background-color 0.2s, border-color 0.2s;
}
.consent-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--fog);
  transition: transform 0.2s, background-color 0.2s;
}
.consent-switch input:checked + .consent-switch-track { background: var(--green); border-color: var(--green-led); }
.consent-switch input:checked + .consent-switch-track::after { transform: translateX(24px); background: #fff; }
.consent-switch input:focus-visible + .consent-switch-track { outline: 3px solid var(--cobalt-light); outline-offset: 3px; }
.consent-btn-save { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.consent-btn-save:hover { background: var(--cobalt-deep); border-color: var(--cobalt-light); color: #fff; }

/* ==========================================================================
   Motion (all of it switched off under prefers-reduced-motion)
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .js .hero-title .hw { animation: word-in 0.7s var(--ease) both; }
  .js .hero-title .hw:nth-child(2) { animation-delay: 0.07s; }
  .js .hero-title .hw:nth-child(3) { animation-delay: 0.14s; }
  .js .hero-title .hw:nth-child(4) { animation-delay: 0.21s; }
  .js .hero-title .hw:nth-child(5) { animation-delay: 0.28s; }
  .js .hero-title .hw:nth-child(6) { animation-delay: 0.35s; }
  .js .hero-title .hw:nth-child(7) { animation-delay: 0.42s; }
  .js .hero-title .hw:nth-child(8) { animation-delay: 0.49s; }
  .js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
  .js .reveal.is-in { opacity: 1; transform: none; }
  .zones-sweep { animation: sweep 7s linear infinite; }
  .fence-field::before { animation: beams 3.2s ease-in-out infinite; }
  .msg:not(.is-acked) .msg-icon { animation: blink 2.4s steps(1) infinite; }
  .path-tcp { transition: transform 0.12s linear; }
}
@keyframes word-in {
  from { opacity: 0; transform: translateY(-0.45em); }
  to { opacity: 1; transform: none; }
}
@keyframes sweep { to { transform: rotate(360deg); } }
@keyframes beams { 50% { opacity: 0.45; } }
@keyframes blink { 80% { opacity: 0.45; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Print
   ========================================================================== */
@media print {
  .pendant-head, .consent, .consent-dialog, .fence-rail, .curtain, .plan-keys, .msgwin-bar, .msg-ack, .skip-link, .preview { display: none; }
  body, .sec-bahn, .sec-meldungen, .fence, .fence-field, .fence-base { background: #fff; color: #000; }
  .fence-field::before, .fence-field::after { display: none; }
  .doc-sheet, .station, .spec { box-shadow: none; }
}
