/* Schriften lokal (DSGVO): Dateien siehe assets/fonts/README.md */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/Archivo-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/Archivo-Medium.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/IBMPlexMono-Medium.woff2") format("woff2");
}

:root {
  /* Palette: helles, neutrales Technikgrau mit leicht warmem Stich */
  --bg: #ecedeb;
  --tile: #f7f7f5;
  --tile-accent: #e3e3e0;  /* neutrales Hellgrau, ohne Blau- oder Beigestich */
  --dark: #22262b;
  --text: #1a1d21;
  --muted: #62676d;
  --faint: #656a70;   /* ≥4.5:1 auf Hintergrund */
  --line: #d7d9d5;
  --line-strong: #bfc3be;
  --accent: #003c71;
  --accent-soft: #3b5f86;
  --green-tint: #93bd3c;        /* nah am Logogrün (#84bd00), leicht gedämpft */
  --green-tint-hover: #86ae32;
  --green-tint-line: #86ae32;
  --green-ink: #22351a;         /* dunkles Grün für Nebentext */
  --header-h: 76px;
  --gap: 12px;
  --pad: clamp(18px, 2vw, 28px);
  --font: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-header: var(--font);
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 200;
  padding: .6rem 1rem;
  background: var(--text);
  color: #fff;
  font-size: 14px;
}
.skip-link:focus { top: 12px; }
img { display: block; max-width: 100%; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.wrap {
  width: min(100% - 48px, 1440px);
  margin-inline: auto;
}

/* ---------- Header (Stil: blackspruce) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  font-family: var(--font-header);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}

.site-header[data-scrolled="true"] { border-bottom-color: var(--line); }

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;   /* Mitte: Logo + Navigation, rechts: Sprache */
  align-items: center;
  gap: 1rem;
}

.logo { grid-column: 2; display: inline-flex; align-items: center; }
.logo img { height: 24px; width: auto; }

.header-right { grid-column: 3; justify-self: end; display: flex; align-items: center; }

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: .15rem;
  font-family: var(--font-mono);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .06em;
  color: var(--faint);
}

.lang-switch a { padding: .5rem .4rem; color: var(--text); transition: color .2s; }
.lang-switch a:hover { color: var(--faint); }

/* ---------- Tiles ---------- */
.tiles-section { padding-block: 12px 72px; }

.tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 260px;
  gap: var(--gap);
}

.span-2 { grid-column: span 2; }
.rows-2 { grid-row: span 2; }

/* Desktop: feste Plätze im 4×4-Raster, damit alle Kanten exakt bündig sind */
@media (min-width: 1025px) {
  .tiles { grid-template-rows: repeat(4, 260px); grid-auto-rows: 0; }
  .tiles > :nth-child(1) { grid-area: 1 / 1 / 2 / 3; }  /* Kurzbeschreibung */
  .tiles > :nth-child(2) { grid-area: 1 / 3 / 3 / 5; }  /* Sondermaschinen */
  .tiles > :nth-child(3) { grid-area: 2 / 1 / 3 / 2; }  /* Retrofit */
  .tiles > :nth-child(4) { grid-area: 2 / 2 / 3 / 3; }  /* Elektrotechnik */
  .tiles > :nth-child(5) { grid-area: 3 / 1 / 5 / 3; }  /* Software */
  .tiles > :nth-child(6) { grid-area: 3 / 3 / 4 / 4; }  /* Service */
  .tiles > :nth-child(7) { grid-area: 3 / 4 / 4 / 5; }  /* Karriere */
  .tiles > :nth-child(8) { grid-area: 4 / 3 / 5 / 5; }  /* Projektanfrage */
  .tile { min-height: 0; height: auto; }
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--tile);
  border: 1px solid var(--line);
  color: var(--text);
  isolation: isolate;
}

/* Photo tiles */
.tile--photo { border: 0; }

.tile--photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* einheitlicher Look: entsättigt, leicht kontrastreicher, graphitfarbene Tönung */
  filter: saturate(.4) contrast(1.03) brightness(1.06);
  transition: transform .6s cubic-bezier(.2,.7,.2,1), filter .6s;
  z-index: -1;
}

.tile--photo .tint {
  position: absolute;
  inset: 0;
  background: var(--dark);
  mix-blend-mode: color;
  opacity: .2;
  z-index: 0;
  pointer-events: none;
  transition: opacity .6s;
}

.tile--photo:hover .tint,
.tile--photo:focus-visible .tint { opacity: 0; }

.tile--photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26, 29, 33, .85) 0%, rgba(26, 29, 33, .55) 30%, rgba(26, 29, 33, 0) 65%);
  z-index: 0;
}

.tile--photo .tile-body {
  color: #fff;
  z-index: 1;
}

.tile--photo:hover img,
.tile--photo:focus-visible img { transform: scale(1.04); filter: saturate(1) contrast(1.03) brightness(1.04); }

/* Common body */
.tile-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: var(--pad);
}

.tile-title {
  margin: 0;
  font-size: clamp(20px, 1.6vw, 24px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -.015em;
}

.tile-text {
  font-size: 14px;
  line-height: 1.45;
  max-width: 34ch;
}


.tile--photo .tile-text { color: rgba(255, 255, 255, .92); }

/* Text tiles: gleicher Aufbau wie Bildkacheln, Inhalt unten links */
.tile-body { margin-top: auto; }

.tile--company .tile-title {
  font-size: clamp(22px, 2vw, 30px);
  max-width: 26ch;
}

.tile--company .tile-text,
.tile--text .tile-text { color: #5c6167; max-width: 60ch; }
.tile--company .tile-text { line-height: 1.45; }

.tile--green,
.tile--company { background: var(--tile-accent); }

/* Karriere (verlinkt): Fläche dunkelt beim Hover leicht ab */
.tile--green { transition: background-color .3s; }
.tile--green:hover,
.tile--green:focus-visible { background: #d6d6d2; }
.tile--green:hover .tile-text,
.tile--green:focus-visible .tile-text { color: #4f545a; }  /* ≥4.5:1 auf Hover-Fläche */

.tile--dark {
  /* Projektanfrage: helle Tönung aus dem Logogrün statt Vollfläche */
  background: var(--green-tint);
  color: var(--text);
  border-color: var(--green-tint-line);
  transition: background-color .3s;
}

.tile--dark:hover { background: var(--green-tint-hover); }
.tile--dark .tile-text { color: var(--green-ink); }

.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Inhaltsseiten ---------- */
.page { max-width: 68ch; padding-block: 40px 80px; }
.page h1 { font-size: clamp(28px, 3vw, 36px); font-weight: 500; line-height: 1.15; letter-spacing: -.015em; margin: 0 0 8px; text-wrap: balance; }
.page .lead { font-size: 18px; line-height: 1.5; color: var(--muted); margin: 0 0 40px; max-width: 56ch; }
.page h2 { font-size: 20px; font-weight: 500; line-height: 1.25; margin: 40px 0 12px; }
.page h3 { font-size: 16px; font-weight: 500; margin: 24px 0 6px; }
.page p { margin: 0 0 14px; }
.page ul { list-style: disc; padding-left: 1.2em; margin: 0 0 14px; }
.page li { margin-bottom: 4px; }
.page a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.page a:hover { text-decoration-color: currentColor; }
.page .meta { font-size: 14px; color: var(--muted); }
.page .btn {
  display: inline-block;
  margin-top: 8px;
  padding: 12px 20px;
  background: var(--green-tint);
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: background-color .3s;
}
.page .btn:hover { background: var(--green-tint-hover); }
.page address { font-style: normal; }
.page--center { text-align: center; padding-block: 96px 120px; max-width: 48ch; margin-inline: auto; }
.page--center .lang-links { display: flex; gap: 24px; justify-content: center; margin-top: 24px; }

/* ---------- Footer (Stil wie Header) ---------- */
.site-footer { background: var(--bg); font-family: var(--font-header); border-top: 1px solid var(--line); }

.subfooter { padding-block: 48px 40px; scroll-margin-top: calc(var(--header-h) + 16px); }

.subfooter-inner {
  display: grid;
  grid-template-columns: 2fr repeat(4, minmax(0, 1fr));
  gap: 28px clamp(24px, 4vw, 64px);
  align-items: start;
}

/* Bildmarke allein in der ersten Zeile, darunter Text und Spalten auf einer Höhe */
.footer-logo { grid-column: 1 / -1; }

.subfooter-intro { display: flex; flex-direction: column; }
.subfooter-intro p { font-size: .875rem; line-height: 1.55; color: var(--muted); max-width: 34ch; }
.footer-logo img { height: 24px; width: auto; }

/* Spalten: Überschrift etwas kräftiger, alle Unterpunkte in derselben Schrift */
.subfooter-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  font-size: .875rem;
  font-weight: 400;
  line-height: 1.55;
  color: var(--muted);
}

.footer-heading {
  margin: 0;
  font-size: .875rem;
  font-weight: 500;
  line-height: inherit;
  color: var(--text);
}

/* weitere Überschrift in derselben Spalte: Abstand nach oben */
.subfooter-col > * + .footer-heading { margin-top: 12px; }


.subfooter-col a { transition: color .2s; }
.subfooter-col span { display: block; }
.subfooter-col a:hover,
.subfooter-col a:focus-visible { color: var(--text); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-block: 8px 28px;
  font-size: .8125rem;
  color: var(--faint);
}

.footer-bottom nav { display: flex; gap: 20px; }
.footer-bottom nav a { transition: color .2s; }
.footer-bottom nav a:hover,
.footer-bottom nav a:focus-visible { color: var(--text); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; }
  .tile { min-height: 260px; }
  .subfooter-inner { grid-template-columns: repeat(4, 1fr); }
  .subfooter-intro { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .wrap { width: min(100% - 32px, 1280px); }
  :root { --pad: 22px; }
  .tiles { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .rows-2 { grid-row: span 1; }
  .tile { min-height: 240px; }
  .subfooter-inner { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .page--center { padding-block: 64px 80px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
