/* ==========================================================================
   Reiter Automation — Relaunch 2026
   Hand-written stylesheet. No framework, no external requests.
   ========================================================================== */

/* --- Design tokens ------------------------------------------------------ */
:root {
  /* Brand — sampled from the company logo */
  --brand:        #e60000;
  --brand-dark:   #b80000;
  --brand-soft:   rgba(230, 0, 0, .10);
  --graphite:     #747170;

  /* Neutrals */
  --ink:          #14161a;
  --ink-2:        #3c4149;
  --muted:        #6b7280;
  --line:         #e5e7eb;
  --bg:           #ffffff;
  --bg-alt:       #f6f7f9;

  /* Dark sections (hero, footer) */
  --dark:         #0e1015;
  --dark-2:       #171a21;
  --dark-line:    rgba(255, 255, 255, .12);
  --dark-text:    #c9cdd6;

  /* Shape & motion */
  --radius:       18px;
  --radius-sm:    10px;
  --maxw:         1180px;
  --gutter:       clamp(1rem, 4vw, 2.5rem);
  --shadow:       0 1px 2px rgba(16, 18, 22, .05), 0 12px 32px -12px rgba(16, 18, 22, .18);
  --shadow-lg:    0 24px 64px -24px rgba(16, 18, 22, .45);
  --ease:         cubic-bezier(.22, .61, .36, 1);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font-family: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont,
               "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(1rem, .96rem + .2vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4 {
  color: var(--ink);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -.02em;
  margin: 0 0 .5em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.25rem, 1.5rem + 3.2vw, 3.75rem); letter-spacing: -.035em; }
h2 { font-size: clamp(1.75rem, 1.2rem + 2.1vw, 2.65rem); letter-spacing: -.03em; }
h3 { font-size: clamp(1.15rem, 1.05rem + .45vw, 1.4rem); }

p { margin: 0 0 1.1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration-color: var(--brand); text-underline-offset: 3px; }

ul { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --- Layout helpers ----------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(4rem, 2rem + 8vw, 7.5rem); }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--line); }

/* Anchors must clear the sticky header */
[id] { scroll-margin-top: 6.5rem; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  margin: 0 0 1rem;
  color: var(--brand);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 2px;
  background: var(--brand);
}

.section-head { max-width: 46rem; margin-bottom: clamp(2.5rem, 1rem + 4vw, 4rem); }
.section-head p { color: var(--muted); font-size: 1.125rem; }

.lead { font-size: 1.0625rem; color: var(--ink-2); }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100%;
  z-index: 200;
  padding: .75rem 1.25rem;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* --- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .8rem 1.5rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  font-size: .9688rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .2s var(--ease), border-color .2s var(--ease),
              color .2s var(--ease), transform .2s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn .arrow { transition: transform .2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); }

.btn--outline { border-color: var(--line); background: #fff; color: var(--ink); }
.btn--outline:hover { border-color: var(--ink); }

.btn--ghost-light { border-color: var(--dark-line); color: #fff; }
.btn--ghost-light:hover { border-color: #fff; background: rgba(255, 255, 255, .08); }

/* --- Header ------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.site-header.is-stuck {
  border-bottom-color: var(--line);
  box-shadow: 0 6px 24px -18px rgba(16, 18, 22, .5);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 4.75rem;
}

.brand { flex: none; margin-right: auto; }
.brand img { width: 168px; height: auto; }

.nav { display: flex; align-items: center; gap: .35rem; }

.nav a {
  position: relative;
  padding: .5rem .85rem;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: .9375rem;
  font-weight: 550;
  text-decoration: none;
  transition: color .18s var(--ease), background-color .18s var(--ease);
}
.nav a:hover { color: var(--ink); background: var(--bg-alt); }
.nav a[aria-current="true"] { color: var(--brand); }

.header-actions { display: flex; align-items: center; gap: .9rem; }

/* Language switch */
.lang {
  display: flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-alt);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.lang a {
  padding: .25rem .7rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  transition: background-color .18s var(--ease), color .18s var(--ease);
}
.lang a:hover { color: var(--ink); }
.lang a[aria-current="page"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }

.nav-toggle {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 18px;
  height: 2px;
  margin-inline: auto;
  border-radius: 2px;
  background: var(--ink);
  transition: transform .25s var(--ease), opacity .2s var(--ease);
}
.nav-toggle span::before,
.nav-toggle span::after { content: ""; position: relative; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after  { top: 4px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after  { transform: translateY(-4px) rotate(-45deg); }

/* --- Hero --------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--dark);
  color: var(--dark-text);
  isolation: isolate;
}
/* Technical grid + red glow, drawn in CSS so nothing extra loads */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, .05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(120% 90% at 20% 0%, #000 35%, transparent 75%);
  mask-image: radial-gradient(120% 90% at 20% 0%, #000 35%, transparent 75%);
}
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -28%;
  right: -10%;
  width: 46rem;
  height: 46rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230, 0, 0, .28), transparent 62%);
  filter: blur(10px);
  pointer-events: none;
}

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(2.5rem, 5vw, 4.5rem);
  align-items: center;
  padding-block: clamp(4rem, 2rem + 9vw, 8rem);
}

.hero h1 { color: #fff; }
.hero h1 .sep { color: var(--brand); }
/* Three terms as the headline: each stays on one line, breaks happen only
   between them, so no term is ever split. */
.hero h1.h1--triad {
  font-size: clamp(1.75rem, 1.05rem + 2.6vw, 3.1rem);
  line-height: 1.18;
  text-wrap: initial;
}
.hero h1.h1--triad > span { white-space: nowrap; }
.hero h1 .accent {
  background: linear-gradient(100deg, var(--brand), #ff5a3c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  max-width: 34rem;
  margin-bottom: 2rem;
  font-size: clamp(1.0625rem, 1rem + .35vw, 1.1875rem);
  color: var(--dark-text);
}
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .75rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--dark-line);
}
.hero-meta li {
  padding: .3rem .8rem;
  border: 1px solid var(--dark-line);
  border-radius: 999px;
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: #fff;
}

/* Framed photo */
.hero-figure { position: relative; margin: 0; }
.hero-figure img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.hero-figure::before {
  content: "";
  position: absolute;
  inset: -10px;
  border: 1px solid var(--dark-line);
  border-radius: calc(var(--radius) + 10px);
  pointer-events: none;
}
.hero-figure figcaption {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  padding: .45rem 1rem;
  border-radius: 999px;
  background: rgba(14, 16, 21, .78);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: .8125rem;
  font-weight: 600;
}

/* --- Service cards ------------------------------------------------------ */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1.25rem;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  border-color: transparent;
  box-shadow: var(--shadow);
}
/* The icons are circular line drawings: they carry their own frame and need
   room to stay legible, so no extra tile around them. */
.card-icon {
  display: block;
  width: 6rem;
  height: 6rem;
  margin-bottom: 1.25rem;
}
.card-icon img { width: 100%; height: 100%; }
/* Reserve a second title line so every card's body text starts at the same height. */
.card h3 { min-height: 2.24em; }
.card p { color: var(--muted); font-size: .9688rem; }
.card-more {
  margin-top: auto;
  padding-top: 1.5rem;
  color: var(--brand);
  font-size: .9375rem;
  font-weight: 650;
}
.card-more .arrow { display: inline-block; transition: transform .2s var(--ease); }
.card:hover .card-more .arrow { transform: translateX(4px); }

/* --- Feature rows ------------------------------------------------------- */
.feature {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.feature + .feature { margin-top: clamp(4rem, 2rem + 7vw, 7rem); }
.feature--flip .feature-media { order: -1; }

/* Two of the photos ship with rounded, transparent corners. Clipping them in a
   white frame keeps every feature image on the same shape. */
.feature-media {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}
.feature-media img { width: 100%; }

/* Inline diagram used in place of a photo. Drawn in the page so it stays sharp
   at any size and picks up the theme colours. */
.feature-media--diagram {
  padding: clamp(1rem, .5rem + 1.6vw, 1.75rem);
  /* Below ~460px the labels would scale into illegibility, so the diagram keeps
     its minimum size and the card scrolls sideways instead. */
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
}
.diagram { display: block; width: 100%; height: auto; }
.diagram text { font-family: inherit; }
.diagram .d-line { fill: none; stroke: var(--ink-2); stroke-width: 1.6; }
.diagram .d-line--dashed { stroke: var(--muted); stroke-dasharray: 5 4; }
.diagram .d-head { fill: var(--ink-2); }
.diagram .d-head--muted { fill: var(--muted); }
.diagram .d-box { fill: #fff; stroke: var(--ink-2); stroke-width: 1.6; }
.diagram .d-box--accent { fill: var(--brand-soft); stroke: var(--brand); stroke-opacity: .75; }
.diagram .d-node { fill: #fff; stroke: var(--ink-2); stroke-width: 1.6; }
.diagram .d-title { fill: var(--ink); font-size: 14px; font-weight: 650; }
.diagram .d-title--accent { fill: var(--brand); }
.diagram .d-title--sm { font-size: 12.5px; }
.diagram .d-chip { fill: #fff; stroke: var(--brand); stroke-opacity: .4; stroke-width: 1.2; }
.diagram .d-chip-text { fill: var(--ink); font-size: 10.5px; font-weight: 600; }
.diagram .d-dest { fill: #fff; stroke: var(--muted); stroke-width: 1.3; }
.diagram .d-dest-text { fill: var(--ink-2); font-size: 10px; font-weight: 600; }
.diagram .d-sub { fill: var(--muted); font-size: 10.5px; }
.diagram .d-flow { fill: var(--ink-2); font-size: 11px; font-weight: 600; }
.diagram .d-sign { fill: var(--ink-2); font-size: 14px; font-weight: 700; }
.diagram .d-sigma { fill: var(--ink); font-size: 16px; font-weight: 600; }

.feature h2 { margin-bottom: 1rem; }
.feature p { color: var(--ink-2); }

.taglist {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1.75rem;
}
.taglist li {
  padding: .35rem .85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--ink-2);
}

/* --- Capability strip --------------------------------------------------- */
.capabilities {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  overflow: hidden;
}
.capabilities > div { padding: 1.75rem; background: var(--bg); }
.capabilities h3 { margin-bottom: .35rem; font-size: 1rem; }
.capabilities p { color: var(--muted); font-size: .9063rem; }
.capabilities .num {
  display: block;
  margin-bottom: .75rem;
  color: var(--brand);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .14em;
}

/* --- Contact ------------------------------------------------------------ */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.contact-card {
  padding: clamp(1.75rem, 1rem + 2vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}
.contact-list { display: grid; gap: 1.25rem; margin: 0; }
.contact-list dt {
  margin-bottom: .15rem;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.contact-list dd { margin: 0; font-size: 1.0625rem; color: var(--ink); }
.contact-list a { font-weight: 600; text-decoration: none; }
.contact-list a:hover { text-decoration: underline; }

.contact-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

/* --- Footer ------------------------------------------------------------- */
.site-footer {
  padding-block: clamp(3rem, 2rem + 4vw, 5rem) 2rem;
  background: var(--dark);
  color: var(--dark-text);
  font-size: .9375rem;
}
.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  gap: clamp(2rem, 5vw, 4rem);
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--dark-line);
}
.footer-wordmark {
  margin: 0 0 .75rem;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -.02em;
}
.footer-wordmark span { color: var(--brand); }
.footer-top h3 {
  margin-bottom: 1rem;
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.footer-links { display: grid; gap: .6rem; }
.footer-links a,
.footer-top p a { color: var(--dark-text); text-decoration: none; transition: color .18s var(--ease); }
.footer-links a:hover,
.footer-top p a:hover { color: #fff; text-decoration: underline; }

/* Ingenieurbüro mark. The artwork carries its own blue backdrop, so it needs no
   plate behind it — just rounded corners to match the rest of the page. */
.seal {
  margin: 0;
  justify-self: start;
  align-self: start;
}
.seal img {
  width: 160px;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 10px 30px -14px rgba(0, 0, 0, .8);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.75rem;
  color: var(--muted);
  font-size: .875rem;
}
.footer-bottom a { color: var(--muted); text-decoration: none; }
.footer-bottom a:hover { color: #fff; }
.footer-bottom nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }

/* --- Legal / text pages ------------------------------------------------- */
.page-head {
  padding-block: clamp(2.5rem, 1.5rem + 4vw, 4.5rem) clamp(1.5rem, 1rem + 2vw, 2.5rem);
  border-bottom: 1px solid var(--line);
}
.prose { max-width: 48rem; padding-block: clamp(2.5rem, 1.5rem + 4vw, 4rem); }
.prose h2 { margin-top: 3rem; font-size: clamp(1.45rem, 1.15rem + 1.1vw, 1.8rem); }
.prose h2:first-of-type { margin-top: 0; }
.prose h3 { margin-top: 2.25rem; font-size: clamp(1.05rem, 1rem + .35vw, 1.2rem); }
.prose p { color: var(--ink-2); }
.prose .meta { display: grid; gap: .35rem; margin-bottom: 2.5rem; }
.prose .meta p { margin: 0; }
.prose .meta a { font-weight: 600; text-decoration: none; }
.prose .meta a:hover { text-decoration: underline; }

/* --- Reveal on scroll --------------------------------------------------- */
/* Gated behind the .js class so the content is never hidden without scripting. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 62rem) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); }
  .hero-figure { max-width: 32rem; }
  .feature,
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .feature--flip .feature-media { order: 0; }
  .footer-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seal { grid-column: 1 / -1; }
}

/* Only on very narrow screens does the diagram need a floor; above this it
   scales down without losing legibility. */
@media (max-width: 34rem) {
  .diagram { min-width: 480px; }
}

@media (max-width: 48rem) {
  .nav-toggle { display: block; }
  .site-header .wrap { flex-wrap: wrap; row-gap: 0; }
  .brand img { width: 140px; }

  .nav {
    order: 3;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    border-top: 1px solid transparent;
    transition: max-height .3s var(--ease), border-color .3s var(--ease);
  }
  .nav.is-open {
    max-height: 22rem;
    border-top-color: var(--line);
    padding-block: .5rem 1rem;
  }
  .nav a { padding: .8rem .25rem; font-size: 1.05rem; }

  .footer-top { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .site-footer, .hero-cta, .contact-actions { display: none; }
  body { color: #000; }
}
