/* ============================================================
   Karstedt Additive Engineering — Stylesheet
   Farben und Typografie nach Markenbriefing (Konzept Kap. 0)
   ============================================================ */

:root {
  --ink: #1A1D1F;
  --ink-soft: #3C4145;
  --muted: #5F6569;
  --paper: #FAFAF8;
  --surface: #FFFFFF;
  --surface-dark: #1A1D1F;
  --paper-dark-text: #E9E7E2;
  --accent: #D93102;        /* Unternehmensfarbe */
  --accent-dark: #B02802;   /* Hover / Text auf getönten Flächen */
  --accent-light: #FF5C1F;  /* Akzent auf dunklem Grund (Kontrast ≥ 4,5:1) */
  --line: #E2E0DA;
  --line-dark: #33383C;

  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 1rem;
  --s4: 1.5rem;
  --s5: 2.5rem;
  --s6: 4rem;
  --s7: 6rem;

  --radius: 4px;
  --maxw: 1280px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent-dark); }
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--s4);
}
@media (min-width: 1200px) {
  .wrap { padding: 0 var(--s5); }
}

/* ---------- Typografie ---------- */

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.01em; }

h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-dark);
  display: block;
  margin-bottom: var(--s3);
}

.lead {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 48rem;
}

.mono { font-family: var(--font-mono); }

p { max-width: 46rem; }

/* ---------- Header ---------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  padding: var(--s4);
  max-width: var(--maxw);
  margin: 0 auto;
}
/* gleiche Einrückung wie .wrap, damit Logo und Inhalt fluchten */
@media (min-width: 1200px) {
  .header-inner { padding-left: var(--s5); padding-right: var(--s5); }
}

.brand { display: flex; align-items: center; gap: var(--s3); text-decoration: none; }
.brand img { width: 230px; height: auto; }
@media (max-width: 1100px) {
  .brand img { width: 205px; }
}
@media (max-width: 600px) {
  .brand img { width: 175px; }
}

.header-phone {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.4rem 0.7rem;
}
.header-phone:hover { border-color: var(--accent); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.45rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--ink);
}

.site-nav ul {
  display: flex;
  gap: 0.2rem;
  list-style: none;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.92rem;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius);
}
.site-nav a:hover { color: var(--ink); background: var(--paper); }
.site-nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--accent);
  border-radius: 0;
}

.claim-bar {
  background: var(--surface-dark);
  color: var(--paper-dark-text);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-align: left;
}
.claim-bar .wrap { padding-top: 0.45rem; padding-bottom: 0.45rem; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; width: 100%; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; padding: var(--s2) 0 var(--s3); }
  .header-inner { flex-wrap: wrap; }
  .header-phone { display: none; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
}
.btn:hover { background: var(--accent-dark); }

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
  font-size: 0.95rem;
}
.btn-secondary:hover { background: var(--ink); color: #fff; }

/* Kleinere Ausführung, etwa für den Shop-Verweis in der Fußzeile */
.btn-klein {
  font-size: 0.85rem;
  padding: 0.5rem 0.95rem;
}
.site-footer .btn { color: #fff; }
.site-footer .btn:hover { color: #fff; }

/* ---------- Abschnitte ---------- */

section { padding: var(--s6) 0; }
section.tight { padding: var(--s5) 0; }

.section-dark {
  background: var(--surface-dark);
  color: var(--paper-dark-text);
}
.section-dark h2 { color: #fff; }
.section-dark p { color: var(--paper-dark-text); }
.section-dark .eyebrow { color: var(--accent-light); }

.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* ---------- Hero ---------- */

.hero { padding: var(--s6) 0 var(--s6); }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  gap: var(--s5);
  align-items: center;
}

.hero h1 { max-width: 20ch; }

.hero .lead { margin-top: var(--s4); }

.trust-lines {
  margin-top: var(--s4);
  list-style: none;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.trust-lines li { padding: 0.3rem 0; border-top: 1px solid var(--line); }
.trust-lines li:last-child { border-bottom: 1px solid var(--line); }
.trust-lines li::before { content: "· "; color: var(--accent); font-weight: 700; }

.hero .btn { margin-top: var(--s4); }

@media (max-width: 800px) {
  .hero-grid { grid-template-columns: 1fr; }
}

/* ---------- Bild-Platzhalter ---------- */

.img-placeholder {
  background: repeating-linear-gradient(
    -45deg,
    #F1EFEA,
    #F1EFEA 12px,
    #ECEAE4 12px,
    #ECEAE4 24px
  );
  border: 1px dashed #C9C6BE;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--s3);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.5;
  min-height: 180px;
}
.img-placeholder.tall { min-height: 320px; }
.img-placeholder.short { min-height: 120px; }

.section-dark .img-placeholder {
  background: repeating-linear-gradient(-45deg, #22262A, #22262A 12px, #1E2225 12px, #1E2225 24px);
  border-color: var(--line-dark);
  color: #8A9096;
}

/* ---------- Hero-Video ---------- */

.hero-media {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-dark);
  aspect-ratio: 6 / 5;      /* passt zum Zuschnitt der Aufnahme */
  width: 100%;
}
.hero-media video,
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Reduced Motion: Video verbergen, Standbild zeigen */
.hero-media .poster-fallback { display: none; }
@media (prefers-reduced-motion: reduce) {
  .hero-media video { display: none; }
  .hero-media .poster-fallback { display: block; }
}

@media (max-width: 800px) {
  .hero-media { aspect-ratio: 4 / 3; margin: 0 auto; }
}

/* ---------- Freigestellte Abbildung (CAD, Bauteile) ---------- */

.figure-cutout { display: block; margin: 0; }
.figure-cutout img {
  width: 100%;
  height: auto;
}

/* Honigtopf gegen Formular-Spam — für Menschen unsichtbar,
   aber nicht per display:none, damit Bots ihn ausfüllen */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Fotografie mit optionaler Bildunterschrift */
.figure-wide { display: block; margin: 0; }
.figure-wide img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}
.figure-wide figcaption {
  margin-top: var(--s3);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
  max-width: 46rem;
}
.section-dark .figure-wide figcaption { color: #8A9096; }
.figure-cutout figcaption {
  margin-top: var(--s3);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Querformat-Variante für Videos in Textabschnitten */
.media-16-9 {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-dark);
  aspect-ratio: 16 / 9;
}
.media-16-9 video,
.media-16-9 img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.media-16-9 .poster-fallback { display: none; }
@media (prefers-reduced-motion: reduce) {
  .media-16-9 video { display: none; }
  .media-16-9 .poster-fallback { display: block; }
}

/* ---------- Kachel-Raster ---------- */

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); }

@media (max-width: 800px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s4);
}

a.card {
  display: block;
  text-decoration: none;
  color: inherit;
}
a.card:hover { border-color: var(--accent); }

.card h3 { margin-bottom: var(--s2); }
.card p { font-size: 0.95rem; color: var(--ink-soft); }

.quote-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: var(--s4);
  text-decoration: none;
  color: inherit;
  display: block;
  font-size: 1rem;
}
.quote-card:hover { border-color: var(--accent); }
.quote-card em { font-style: normal; color: var(--ink); }
.quote-card span {
  display: block;
  margin-top: var(--s2);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-dark);
}

/* ---------- Schrittfolge ---------- */

.steps { counter-reset: step; list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s4); }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; } }

.steps li { counter-increment: step; }
.steps .step-num {
  font-family: var(--font-mono);
  color: var(--accent-dark);
  font-size: 0.85rem;
  display: block;
  margin-bottom: var(--s2);
}
.steps h3 { margin-bottom: var(--s2); }
.steps p { font-size: 0.95rem; color: var(--ink-soft); }

.steps-vertical { list-style: none; max-width: 46rem; }
.steps-vertical > li {
  padding: var(--s4) 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  gap: var(--s3);
}
.steps-vertical .step-num {
  font-family: var(--font-mono);
  color: var(--accent-dark);
  font-size: 1.1rem;
}

/* ---------- Zusagen-Liste ---------- */

.pledge-list {
  list-style: none;
  max-width: 46rem;
}
/* Kein Grid: sonst landet jedes Element eines Listenpunkts in einer
   eigenen Zelle, sobald der Text <strong> oder Links enthält. */
.pledge-list li {
  position: relative;
  padding: 0.65rem 0 0.65rem 1.9rem;
  border-top: 1px solid var(--line);
}
.pledge-list li:last-child { border-bottom: 1px solid var(--line); }
.pledge-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0.65rem;
  color: var(--accent-dark);
  font-weight: 700;
}
.section-dark .pledge-list li { border-color: var(--line-dark); }
.section-dark .pledge-list li::before { color: var(--accent-light); }

/* ---------- Werkstoff-Kacheln ---------- */

.mat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s3);
  margin-top: var(--s4);
}
/* Breite Desktops: alle vier Werkstoffe einer Gruppe in einer Reihe */
@media (min-width: 1100px) {
  .mat-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 620px) {
  .mat-grid { grid-template-columns: 1fr; }
}

.mat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s4);
  display: flex;
  flex-direction: column;
  transition: border-color 160ms ease-out;
}
.mat-card:hover { border-color: var(--accent); }

.mat-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3);
}

.mat-name {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.mat-temp {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  color: var(--accent);
  white-space: nowrap;
}

.mat-card p {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin-top: var(--s2);
  flex: 1;
}

/* Balken: Dauergebrauchstemperatur, Maßstab 0–200 °C */
.mat-scale {
  margin-top: var(--s4);
  height: 3px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.mat-scale span {
  display: block;
  height: 100%;
  width: var(--fill, 0%);
  background: var(--accent);
  border-radius: 2px;
}

/* Hochleistungswerkstoffe: dunkle Kacheln */
.mat-card.hl {
  background: var(--surface-dark);
  border-color: var(--line-dark);
}
.mat-card.hl:hover { border-color: var(--accent); }
.mat-card.hl .mat-name { color: #fff; }
.mat-card.hl .mat-temp { color: var(--accent-light); }
.mat-card.hl p { color: #B9BEC2; }
.mat-card.hl .mat-scale { background: #33383C; }
.mat-card.hl .mat-scale span { background: var(--accent-light); }

.mat-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  display: block;
}

.mat-legend {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: var(--s3);
  display: flex;
  align-items: center;
  gap: var(--s2);
}
.mat-legend::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  flex: none;
}

/* ---------- Tabellen ---------- */

table {
  border-collapse: collapse;
  width: 100%;
  max-width: 46rem;
  font-size: 0.95rem;
}
th, td {
  text-align: left;
  padding: 0.6rem 0.8rem 0.6rem 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 500;
}
td.mono { font-size: 0.88rem; white-space: nowrap; }

/* ---------- Express ---------- */

.express-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  border-radius: var(--radius);
  padding: 0.25rem 0.6rem;
  margin-bottom: var(--s3);
}

.express-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s4);
  margin-top: var(--s4);
}
@media (max-width: 800px) { .express-grid { grid-template-columns: 1fr; } }

.express-card {
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  padding: var(--s4);
}
.express-card .big {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  color: #fff;
  line-height: 1.1;
}
.express-card .big small { font-size: 1rem; color: var(--accent-light); }
.express-card p { font-size: 0.95rem; margin-top: var(--s2); }

.express-note { margin-top: var(--s4); font-size: 0.9rem; color: #A7ADB2; }

/* ---------- Formular ---------- */

.contact-form { max-width: 44rem; }

.form-field { margin-bottom: var(--s4); }

.form-field label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}
.form-field .optional { color: var(--muted); font-weight: 400; }

.form-field input,
.form-field textarea {
  width: 100%;
  font: inherit;
  padding: 0.7rem 0.8rem;
  border: 1px solid #C9C6BE;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}
.form-field input:focus,
.form-field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}

.form-hint { font-size: 0.85rem; color: var(--muted); margin-top: 0.3rem; }

/* ---------- Platzhalter-Markierung ---------- */

.placeholder {
  background: #FFF3E8;
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  padding: 0 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--accent-dark);
  white-space: nowrap;
}

.placeholder-box {
  background: #FFF3E8;
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  padding: var(--s4);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent-dark);
  max-width: 46rem;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--surface-dark);
  color: #A7ADB2;
  padding: var(--s5) 0;
  font-size: 0.9rem;
  margin-top: var(--s6);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--s5);
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr; } }

.site-footer h3 {
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: var(--s3);
}
.site-footer ul { list-style: none; }
.site-footer li { padding: 0.2rem 0; }
.site-footer a { color: #C6CBCF; text-decoration: none; }
.site-footer a:hover { color: #fff; }

.footer-claim {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  margin-top: var(--s2);
}

.footer-bottom {
  border-top: 1px solid var(--line-dark);
  margin-top: var(--s5);
  padding-top: var(--s4);
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s3);
}

/* ---------- Rechtstexte (AGB, Datenschutz) ---------- */

.rechtstext {
  max-width: 68rem;
  font-size: 1.02rem;
  line-height: 1.75;
}
.rechtstext h2 {
  font-size: 1.35rem;
  margin-top: var(--s5);
  padding-top: var(--s3);
  border-top: 1px solid var(--line);
}
.rechtstext h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.rechtstext h3 {
  font-size: 1.05rem;
  margin-top: var(--s4);
}
.rechtstext p { margin-top: var(--s3); }

/* Schlichte Aufzählung statt Häkchenliste — in Rechtstexten wirken
   Häkchen wie Zusagen. Volle Breite, damit nichts umbricht. */
.rechtstext ul {
  list-style: none;
  margin-top: var(--s3);
  max-width: none;
}
.rechtstext ul li {
  position: relative;
  padding: 0.35rem 0 0.35rem 1.3rem;
}
.rechtstext ul li::before {
  content: "·";
  position: absolute;
  left: 0.3rem;
  color: var(--accent);
  font-weight: 700;
}
.rechtstext .notice { max-width: none; }

@media (max-width: 700px) {
  .rechtstext { font-size: 1rem; line-height: 1.7; }
}

/* ---------- Sonstiges ---------- */

.page-head { padding: var(--s6) 0 var(--s5); }
.page-head h1 { max-width: 24ch; }
.page-head .lead { margin-top: var(--s3); }

.split {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--s5);
  align-items: start;
}
.split.reverse { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
@media (max-width: 800px) {
  .split, .split.reverse { grid-template-columns: 1fr; }
}

.divider-list > * + * { margin-top: var(--s5); }

.notice {
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: var(--s3) var(--s4);
  max-width: 46rem;
  font-size: 0.95rem;
}
