/* ==========================================================
   Elektrobrocki Vaduz
   Layout: "Werkbank-Etiketten". Eine Spalte (max. 1120px),
   Abschnitte mit Mono-Etiketten; Signalgelb nur fuer
   Handlungen (Buttons) und Etiketten. Kabel im Stil des Logos.
   ========================================================== */

/* ---------- Schriften: lokal gehostet (kein Google-Server) ---------- */
@font-face {
  font-family: "Bricolage";
  src: url("../fonts/bricolage-grotesque-latin-var.woff2") format("woff2-variations"),
       url("../fonts/bricolage-grotesque-latin-var.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("../fonts/ibm-plex-mono-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("../fonts/ibm-plex-mono-latin-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design-Tokens ---------- */
:root {
  --paper: #f3f4f1;      /* Seitenhintergrund, leicht kuehles Grau */
  --card: #ffffff;       /* Flaechen, die hervortreten */
  --ink: #151613;        /* Text, Logo, Linien */
  --muted: #555950;      /* Nebentext */
  --line: #d3d6cf;       /* Trennlinien */
  --plate: #e2e4df;      /* Typenschild (Metall) */
  --signal: #ffd100;     /* Signalgelb */
  --on-signal: #151613;  /* Text auf Gelb, in beiden Themes */
  --foot: #151613;       /* Fusszeile */
  --on-foot: #eef0ea;
  --screen: #151613;     /* Videoflaeche, in beiden Themes dunkel */
  --on-screen: #eef0ea;

  --f-display: "Bricolage", "Arial Narrow", system-ui, sans-serif;
  --f-body: "Bricolage", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --wrap: 1120px;
  --radius: 6px;
  --step: clamp(3.5rem, 7vw, 6.5rem); /* Abstand zwischen Abschnitten */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121311;
    --card: #1b1c1a;
    --ink: #eef0ea;
    --muted: #a4a89f;
    --line: #30322e;
    --plate: #262824;
    --foot: #0b0c0a;
    --on-foot: #eef0ea;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #121311;
  --card: #1b1c1a;
  --ink: #eef0ea;
  --muted: #a4a89f;
  --line: #30322e;
  --plate: #262824;
  --foot: #0b0c0a;
  --on-foot: #eef0ea;
  color-scheme: dark;
}

/* ---------- Grundlagen ---------- */
*, *::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(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 1.125rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: 0.18em; }
a:hover { text-decoration-color: var(--signal); }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; border-radius: 2px; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-family: var(--f-display); text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 5.4vw + 1rem, 5.25rem); font-weight: 800; line-height: 0.98; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.9rem, 2.6vw + 1rem, 3rem); font-weight: 760; line-height: 1.05; letter-spacing: -0.02em; }
h3 { font-size: 1.35rem; font-weight: 680; line-height: 1.2; }
mark { background: var(--signal); color: var(--on-signal); padding: 0 0.1em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--signal); color: var(--on-signal); padding: 8px 12px; z-index: 20; }
.skip:focus { left: max(16px, env(safe-area-inset-left, 0px)); }

/* Aeusserer Rahmen: Seitenabstand mindestens 16px */
.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * 32px);
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 760px) {
  .wrap { padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); }
}

/* Mono-Etikett ueber Ueberschriften */
.eyebrow {
  font-family: var(--f-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.lead { font-size: clamp(1.2rem, 0.8vw + 1rem, 1.45rem); line-height: 1.45; max-width: 36ch; }
.prose { max-width: 62ch; display: grid; gap: 1em; }
.muted { color: var(--muted); }

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 12px 22px;
  border: 2px solid var(--ink); border-radius: var(--radius);
  font-family: var(--f-body); font-size: 1.05rem; font-weight: 650; line-height: 1.2;
  text-decoration: none; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-signal { background: var(--signal); color: var(--on-signal); border-color: var(--on-signal); box-shadow: 4px 4px 0 var(--ink); }
.btn-signal:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn-signal:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--card); }
.btn-ink { background: var(--on-signal); color: var(--signal); border-color: var(--on-signal); }
.btn-ink:hover { transform: translate(-2px, -2px); }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:hover, .btn:active { transform: none; } }

/* ---------- Kopfzeile ---------- */
.site-header { border-bottom: 2px solid var(--ink); background: var(--paper); }
.header-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 24px; padding-block: 12px;
}
.brand { display: block; color: var(--ink); }
.brand svg { width: 132px; height: auto; aspect-ratio: 2817 / 1588; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 6px; list-style: none; margin: 0; padding: 0; }
.nav a {
  display: block; padding: 8px 12px; border-radius: var(--radius);
  font-weight: 600; font-size: 1.02rem; text-decoration: none;
}
.nav a:hover { background: var(--card); }
.nav a[aria-current="page"] { background: var(--signal); color: var(--on-signal); }
@media (max-width: 559px) {
  .header-inner { padding-block: 10px 8px; }
  .brand svg { width: 128px; }
  .site-header nav { width: 100%; }
  .nav { display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; margin-inline: -8px; }
  .nav a { font-size: 1rem; padding: 8px; }
  .nav-long { display: none; } /* "Standort / Kontakt" wird zu "Kontakt" */
}
@media (min-width: 900px) { .brand svg { width: 156px; } }

/* ---------- Abschnitte ---------- */
main { display: block; }
.section { padding-block: var(--step) 0; }
.section-head { display: grid; gap: 12px; margin-bottom: clamp(28px, 4vw, 48px); }
.page-head { padding-block: clamp(40px, 6vw, 80px) 0; display: grid; gap: 16px; }
.page-head h1 { max-width: 16ch; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(40px, 7vw, 96px) clamp(28px, 4vw, 48px); display: grid; gap: 22px; }
.hero h1 { max-width: 13ch; }

/* Foto mit Preisetikett */
.shelf { position: relative; margin: 0; }
.shelf picture, .shelf img { display: block; width: 100%; }
.shelf img { aspect-ratio: 1661 / 556; object-fit: cover; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--plate); }
.shelf figcaption { margin-top: 10px; font-family: var(--f-mono); font-size: 0.8rem; color: var(--muted); }
.tag {
  position: absolute; right: clamp(20px, 4vw, 56px); bottom: -26px;
  display: grid; gap: 2px;
  padding: 12px 18px 12px 34px;
  background: var(--signal); color: var(--on-signal);
  clip-path: polygon(18px 0, 100% 0, 100% 100%, 18px 100%, 0 50%);
  transform: rotate(-4deg);
  filter: drop-shadow(3px 3px 0 var(--ink));
  font-family: var(--f-mono); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase;
}
.tag::before { /* Loch im Etikett */
  content: ""; position: absolute; left: 14px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px;
  border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 2px var(--on-signal);
}
.tag strong { font-family: var(--f-display); font-size: 1.3rem; font-weight: 800; letter-spacing: -0.01em; text-transform: none; line-height: 1.1; }
@media (max-width: 559px) {
  .shelf img { aspect-ratio: 3 / 2; object-position: 42% 50%; } /* Panorama auf dem Handy enger zuschneiden */
  .tag { right: 12px; bottom: -30px; padding: 10px 14px 10px 30px; }
  .tag strong { font-size: 1.1rem; }
}

/* ---------- Ablauf mit Kabel ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 40px; counter-reset: none; }
.step { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: 18px; row-gap: 6px; align-content: start; }
.step-no {
  grid-row: span 2;
  position: relative; z-index: 1;
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--card); border: 3px solid var(--ink);
  font-family: var(--f-mono); font-weight: 500; font-size: 1rem;
}
.step h3 { padding-top: 12px; }
.step p { color: var(--muted); max-width: 34ch; }
.cable { position: absolute; pointer-events: none; overflow: visible; }
.cable path { fill: none; stroke-linecap: round; }
.cable .c-out { stroke: var(--ink); stroke-width: 10; }
.cable .c-in { stroke: var(--paper); stroke-width: 3.5; }
.cable-h { display: none; }
.cable-v { left: 16px; top: 56px; width: 24px; height: calc(100% - 56px + 40px); }
.step:last-child .cable { display: none; }
@media (min-width: 760px) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
  .step { grid-template-columns: minmax(0, 1fr); row-gap: 10px; }
  .step-no { grid-row: auto; }
  .step h3 { padding-top: 10px; }
  .cable-v { display: none; }
  .cable-h { display: block; left: 56px; top: 16px; height: 24px; width: calc(100% - 56px + 32px); }
}
/* Zeichnen, sobald sichtbar (nur mit JS und ohne "weniger Bewegung") */
.steps.is-drawing .cable { animation: draw-h 0.9s cubic-bezier(.5,.1,.2,1) both; }
.steps.is-drawing .cable-v { animation-name: draw-v; }
.steps.is-drawing .step:nth-child(2) .cable { animation-delay: 0.6s; }
/* Negative Werte: die dicke Kabellinie ragt ueber die SVG-Box hinaus und soll nicht abgeschnitten werden */
@keyframes draw-h { from { clip-path: inset(-10px 100% -10px -10px); } to { clip-path: inset(-10px -10px -10px -10px); } }
@keyframes draw-v { from { clip-path: inset(-10px -10px 100% -10px); } to { clip-path: inset(-10px -10px -10px -10px); } }
.steps-note { margin-top: 28px; font-family: var(--f-mono); font-size: 0.85rem; color: var(--muted); }

/* ---------- Zwei Spalten ---------- */
.split { display: grid; gap: clamp(32px, 5vw, 64px); }
.split > * { min-width: 0; }
@media (min-width: 860px) { .split { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.block { display: grid; gap: 16px; align-content: start; }
.rule { border: 0; border-top: 2px solid var(--ink); margin: 0 0 20px; }

/* ---------- Typenschild ---------- */
.plate-wrap { display: grid; gap: 32px; align-items: center; }
@media (min-width: 860px) { .plate-wrap { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 64px; } }
.plate {
  position: relative;
  background:
    repeating-linear-gradient(90deg, transparent 0 3px, rgba(127,127,127,.05) 3px 4px),
    var(--plate);
  border: 2px solid var(--ink); border-radius: 10px;
  padding: 26px 30px 22px;
  font-family: var(--f-mono); font-size: 0.92rem;
}
.plate .rivet { position: absolute; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ink); background: var(--paper); }
.plate .r1 { left: 9px; top: 9px; } .plate .r2 { right: 9px; top: 9px; } .plate .r3 { left: 9px; bottom: 9px; } .plate .r4 { right: 9px; bottom: 9px; }
.plate-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }
.plate dl { margin: 0; }
.plate dl div { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--muted); }
.plate dt { color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8rem; padding-top: 2px; }
.plate dd { margin: 0; font-weight: 500; }
.plate-foot { display: flex; gap: 14px; align-items: center; padding-top: 14px; font-size: 0.8rem; line-height: 1.45; }
.plate-foot svg { width: 34px; height: 40px; flex: none; color: var(--ink); }
@media (max-width: 459px) {
  .plate { padding: 22px 18px 18px; }
  .plate dl div { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

/* ---------- Verkauf: Fakten ---------- */
.facts { display: grid; gap: 0; border-top: 2px solid var(--ink); margin: 0; }
.facts div { display: grid; gap: 4px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-family: var(--f-mono); font-size: 0.78rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0; font-size: 1.12rem; }
@media (min-width: 640px) {
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
}

/* ---------- Gelbes Band: Geraete abgeben ---------- */
.band { margin-top: var(--step); background: var(--signal); color: var(--on-signal); border-block: 2px solid var(--on-signal); }
.band-inner { display: grid; gap: 28px; align-items: center; padding-block: clamp(44px, 6vw, 80px); }
.band h2 { max-width: 14ch; }
.band p { max-width: 46ch; }
.band .eyebrow { color: var(--on-signal); }
.band-logo { color: var(--on-signal); width: min(100%, 420px); justify-self: center; }
.band-logo svg { width: 100%; height: auto; aspect-ratio: 2817 / 1588; }
@media (min-width: 860px) { .band-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); } .band-logo { justify-self: end; } }

/* ---------- Kontakt ---------- */
.contact-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.contact {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 20px; align-items: center; gap: 16px;
  padding: 16px 4px; border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.contact:hover { background: var(--card); }
.contact .ico { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; }
.contact .ico svg { width: 20px; height: 20px; }
.contact-k { display: block; font-family: var(--f-mono); font-size: 0.76rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.contact-v { display: block; font-size: 1.12rem; font-weight: 600; overflow-wrap: anywhere; }
.contact .arrow { width: 20px; height: 20px; }

.address-card { background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); padding: 22px; display: grid; gap: 16px; }
.address-card address { font-style: normal; font-size: 1.25rem; font-weight: 650; line-height: 1.35; }

/* Karte und Video: erst nach Klick laden (Datenschutz) */
.embed {
  position: relative; aspect-ratio: 4 / 3; width: 100%; max-width: 100%;
  border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden;
  background-color: var(--plate);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 28px 28px;
  display: grid; place-items: center; text-align: center;
}
.embed-video { aspect-ratio: 16 / 9; background-image: none; background-color: var(--screen); color: var(--on-screen); }
.embed-inner { display: grid; gap: 10px; justify-items: center; padding: 20px; max-width: 34ch; }
.embed-inner small { font-size: 0.82rem; line-height: 1.4; }
.embed-video .embed-inner small { color: var(--on-screen); opacity: 0.8; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.pin { width: 34px; height: 44px; color: var(--ink); }

/* Ueber mich */
.about { display: grid; gap: 28px; }
.about figure { margin: 0; position: relative; width: 180px; align-self: start; }
.about img { width: 180px; aspect-ratio: 181 / 292; object-fit: cover; border: 2px solid var(--ink); border-radius: var(--radius); }
.about .tag { right: -24px; bottom: 18px; transform: rotate(5deg); }
@media (min-width: 760px) { .about { grid-template-columns: 200px minmax(0, 1fr); gap: 56px; } }

/* ---------- Dokument (Kaufbedingungen, Impressum) ---------- */
.doc {
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius);
  padding: clamp(22px, 4vw, 48px); display: grid; gap: 22px; max-width: 820px;
}
.doc h2 { font-size: clamp(1.4rem, 1.2vw + 1rem, 1.9rem); }
.doc ol { margin: 0; padding: 0; list-style: none; counter-reset: item; display: grid; gap: 14px; }
.doc ol li { counter-increment: item; display: grid; grid-template-columns: 2.4em minmax(0, 1fr); gap: 8px; }
.doc ol li::before { content: counter(item, decimal-leading-zero); font-family: var(--f-mono); font-weight: 500; font-size: 0.9rem; padding-top: 0.25em; color: var(--muted); }
.signature { display: grid; gap: 28px; padding-top: 16px; }
@media (min-width: 640px) { .signature { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.signature span { display: block; border-top: 2px solid var(--ink); padding-top: 6px; font-family: var(--f-mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.kv { display: grid; gap: 0; margin: 0; border-top: 1px solid var(--line); }
.kv div { display: grid; grid-template-columns: minmax(0, 9em) minmax(0, 1fr); gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv dt { font-family: var(--f-mono); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 459px) { .kv div { grid-template-columns: minmax(0, 1fr); gap: 2px; } }
.doc-section { display: grid; gap: 12px; }
.doc-section h3 { font-size: 1.1rem; }

/* ---------- Fusszeile ---------- */
.site-footer { margin-top: var(--step); background: var(--foot); color: var(--on-foot); }
.band + .site-footer { margin-top: 0; }
.footer-inner { display: grid; gap: 28px; padding-block: 48px 36px; }
.footer-logo { width: 150px; color: var(--on-foot); }
.footer-logo svg { width: 100%; height: auto; aspect-ratio: 2817 / 1588; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; list-style: none; margin: 0; padding: 0; }
.footer-nav a { text-decoration: none; font-weight: 600; }
.footer-nav a:hover { text-decoration: underline; text-decoration-color: var(--signal); }
.footer-meta { font-family: var(--f-mono); font-size: 0.78rem; letter-spacing: 0.04em; opacity: 0.75; }
@media (min-width: 760px) { .footer-inner { grid-template-columns: auto minmax(0, 1fr); align-items: end; } .footer-nav, .footer-meta { justify-self: end; text-align: right; } .footer-meta { grid-column: 2; } }

/* ---------- Drucken (Kaufbedingungen als Formular) ---------- */
@media print {
  :root { --paper: #fff; --card: #fff; --ink: #000; --muted: #333; }
  .site-header nav, .site-footer, .skip, .no-print { display: none !important; }
  .site-header { border: 0; }
  .doc { border: 0; padding: 0; max-width: none; }
  body { font-size: 11pt; }
}
