/* Reset & base element styles */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* no grey/blue flash over buttons on tap — every control has its own
     pressed state */
  -webkit-tap-highlight-color: transparent;
  /* opening the lightbox locks scrolling; reserving the scrollbar's space
     keeps the page from jumping sideways when that happens */
  scrollbar-gutter: stable;
}

/* jump targets (e.g. kontakt.html#kontaktformular) land below the sticky
   header instead of underneath it */
[id] {
  scroll-margin-top: calc(var(--header-height) + var(--space-4));
}

/* no double-tap zoom delay on controls, and a long press on a button
   doesn't select its label */
a,
button,
[role="button"] {
  touch-action: manipulation;
}

button,
.btn,
[role="tab"] {
  -webkit-user-select: none;
  user-select: none;
}

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

  /* Exception (owner's decision, like the hero video): the buttons keep
     their hover animation. It is small, stays inside the button and only
     runs when the pointer is on it. Durations match components.css. */
  .btn {
    transition-duration: var(--duration-fast) !important;
  }
  .btn--flow {
    transition-duration: 500ms, 500ms, var(--duration-fast) !important;
  }
  .btn-flow__text,
  .btn-flow__circle,
  .btn-flow__arrow {
    transition-duration: 700ms, 500ms, 500ms !important;
  }
  .flow-btn__text {
    transition-duration: 700ms !important;
  }
  .flow-btn__circle,
  .flow-btn__arrow {
    transition-duration: 700ms, 500ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-ink);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--color-ink);
  line-height: var(--leading-tight);
  margin: 0 0 var(--space-3);
  font-weight: 600;
  letter-spacing: -0.01em;
  /* long, unhyphenated German compound words (e.g. "Schablonenzentrierhilfen")
     don't wrap by default and can force the whole page wider than the
     viewport on narrow screens — allow a mid-word break as a fallback */
  overflow-wrap: break-word;
}

h1, h2 { text-wrap: balance; }

/* fewer single-word last lines in running text */
p, li, dd, figcaption { text-wrap: pretty; }
h1 { font-size: var(--text-4xl); letter-spacing: -0.015em; }
h2 { font-size: var(--text-3xl); letter-spacing: -0.012em; }
h3 { font-size: var(--text-xl); line-height: var(--leading-snug); }
h4 { font-size: var(--text-lg); line-height: var(--leading-snug); }

@media (max-width: 768px) {
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-lg); }
}

p {
  margin: 0 0 var(--space-3);
  color: var(--color-ink-soft);
}

a {
  color: var(--color-accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  a:hover {
    color: var(--color-accent-hover);
  }
}

::selection {
  background: var(--color-accent-tint);
  color: var(--color-ink);
}

/* on copper-tinted panels the default selection colour would disappear */
.finder ::selection,
.form-status ::selection {
  background: var(--color-accent);
  color: var(--color-accent-foreground);
}

ul, ol {
  margin: 0 0 var(--space-3);
  padding-left: 1.25em;
  color: var(--color-ink-soft);
}

li {
  margin-bottom: var(--space-2);
}

strong {
  color: var(--color-ink);
  font-weight: 600;
}

button {
  font-family: inherit;
}

/* Focus visibility — never remove without replacing */
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: var(--space-3);
  top: var(--space-3);
  transform: translateY(calc(-100% - var(--space-4)));
  background: var(--color-dark);
  color: var(--color-dark-text);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  z-index: 1000;
  transition: transform var(--duration-base) var(--ease-standard);
}

.skip-link:focus {
  transform: none;
}

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

/* Container & section rhythm */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section {
  padding-block: var(--space-7);
}

@media (max-width: 768px) {
  .section {
    padding-block: var(--space-6);
  }
}

.section--surface {
  background: var(--color-surface);
}

.section--dark {
  background: var(--color-dark);
  color: var(--color-dark-text);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: var(--color-dark-text);
}

.section--dark p,
.section--dark li {
  color: var(--color-dark-text-soft);
}

.section--dark a:not(.btn) {
  color: var(--color-accent-light);
}

.section--dark :focus-visible {
  outline-color: var(--color-accent-light);
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-2);
}

.section--dark .eyebrow {
  color: var(--color-accent-light);
}

/* Tabular figures for facts, specs and tables */
.tnum {
  font-variant-numeric: tabular-nums lining-nums;
}

/* Legal pages (Impressum, Datenschutz): readable measure, left-aligned with
   the page header, modest heading sizes */
.legal > * {
  max-width: 72ch;
}

.legal h2 {
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  margin-top: var(--space-6);
}

.legal h2:first-child,
.legal .notice + h2 {
  margin-top: 0;
}

.legal .notice {
  margin-bottom: var(--space-5);
}

.legal h3 {
  font-size: var(--text-lg);
  margin-top: var(--space-5);
}

/* heading that keeps the document outline (h2) at h3 size */
h2.h3 {
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  letter-spacing: -0.01em;
}

/* Links on anthracite never fall back to the dark copper hover colour
   (touch devices keep :hover after a tap) */
.skip-link:hover,
.top-bar a:hover,
.site-footer a:hover,
.section--dark a:not(.btn):hover {
  color: var(--color-dark-text);
}

/* set for two frames by theme.js while the colour scheme flips */
.theme-switching *:not(.theme-switch__knob),
.theme-switching *::before,
.theme-switching *::after {
  transition: none !important;
}
