/* ============================================================
   RADHAUS HARTMANN – Design System (Web-Scale)
   Abgeleitet aus: _Templates/dark-industrial (Design System by René)
   Erweitert für Marketing-Websites: Fluid Type, Motion, 3D, Layout

   HINWEIS: Sobald das finale Design-System (MD) vorliegt, müssen
   ausschliesslich die Tokens in Block 1 angepasst werden.
   ============================================================ */

/* ------------------------------------------------------------
   1. TOKENS
   ------------------------------------------------------------ */
:root {
  /* --- Flächen ------------------------------------------- */
  --bg:              #0b0b0c;   /* Haupthintergrund              */
  --bg-elev:         #121213;   /* Leicht angehoben (Sektionen)  */
  --bg-card:         #161616;   /* Karten                        */
  --bg-dark:         #0e0e0e;   /* Card-Header, Footer           */
  --bg-code:         #111111;   /* Hinweis-Boxen                 */

  --border:          #242426;
  --border-light:    #333336;

  /* --- Akzente ------------------------------------------- */
  --accent:          #e8b84b;   /* Primär: Gold                  */
  --accent-deep:     #b98d2b;   /* Gold, dunkler (Verläufe)      */
  --accent-red:      #c0392b;   /* Sekundär: Signalrot           */
  --accent-red-muted: rgba(192, 57, 43, .4);
  --accent-soft:     rgba(232, 184, 75, .14);
  --accent-line:     rgba(232, 184, 75, .32);

  /* --- Text ---------------------------------------------- */
  --text:            #e8e8e0;
  --text-muted:      #8b8b83;
  --text-dark:       #55554f;

  /* --- Typografie ---------------------------------------- */
  --font-headline:   'Bebas Neue', 'Arial Narrow', sans-serif;
  --font-mono:       'IBM Plex Mono', ui-monospace, monospace;
  --font-body:       'IBM Plex Sans', system-ui, -apple-system, sans-serif;

  --tracking-display: .02em;
  --tracking-label:   .28em;

  /* --- Raster & Abstände --------------------------------- */
  --space-2xs:  4px;
  --space-xs:   8px;
  --space-sm:  16px;
  --space-md:  24px;
  --space-lg:  40px;
  --space-xl:  56px;
  --space-2xl: 88px;
  --section-y: clamp(72px, 11vw, 160px);

  --shell:      1280px;   /* Volle Sektionsbreite  */
  --measure:     680px;   /* Lesebreite Fliesstext */
  --gutter:     clamp(20px, 5vw, 64px);

  /* --- Form ---------------------------------------------- */
  --radius:      4px;
  --radius-lg:  10px;

  /* --- Motion -------------------------------------------- */
  --ease:       cubic-bezier(.22, .61, .36, 1);
  --ease-out:   cubic-bezier(.16, 1, .3, 1);
  --dur-fast:   .18s;
  --dur:        .38s;
  --dur-slow:   .9s;

  /* --- Ebenen -------------------------------------------- */
  --z-bg:      0;
  --z-content: 10;
  --z-header:  100;
  --z-overlay: 200;
}

/* ------------------------------------------------------------
   2. RESET & BASE
   ------------------------------------------------------------ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* Sticky-Nav-Offset für Ankersprünge */
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
  /* Bewusst KEIN overflow-x-Guard auf html/body:
     beides macht das Dokument zum Scroll-Container und
     position:sticky (Werkstatt-Sektion) funktioniert nicht mehr.
     Überbreite Elemente werden stattdessen lokal geclippt. */
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(15px, .4vw + 14px, 17px);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }

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

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

/* Screenreader-only */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* Skip-Link */
.skip-link {
  position: fixed; top: 8px; left: 8px;
  z-index: var(--z-overlay);
  padding: 10px 18px;
  background: var(--accent); color: var(--bg);
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: var(--tracking-label); text-transform: uppercase;
  transform: translateY(-200%);
  transition: transform var(--dur) var(--ease);
}
.skip-link:focus-visible { transform: translateY(0); }

/* ------------------------------------------------------------
   3. TYPOGRAFIE
   ------------------------------------------------------------ */
.display,
h1, h2, h3 {
  font-family: var(--font-headline);
  font-weight: 400;
  line-height: .92;
  letter-spacing: var(--tracking-display);
  text-transform: uppercase;
  color: var(--text);
  text-wrap: balance;
}

.display-xl { font-size: clamp(52px, 12vw, 168px); }
.display-lg { font-size: clamp(38px, 7.2vw, 104px); }
.display-md { font-size: clamp(30px, 4.4vw, 62px); }
.display-sm { font-size: clamp(22px, 2.4vw, 34px); }

.display .accent     { color: var(--accent); }
.display .accent-red { color: var(--accent-red); }

/* Konturschrift – für Layering / 3D-Tiefe */
.display .outline {
  color: transparent;
  -webkit-text-stroke: 1px var(--accent-line);
}

/* Overline / Label */
.label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-mono);
  font-size: clamp(10px, .25vw + 9px, 11px);
  font-weight: 400;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1;
}
.label::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--accent);
  flex: none;
}
.label--bare::before { display: none; }

.lead {
  font-size: clamp(17px, .6vw + 15px, 21px);
  font-weight: 300;
  line-height: 1.6;
  color: var(--text);
  max-width: var(--measure);
  text-wrap: pretty;
}

.body-text {
  color: var(--text-muted);
  max-width: var(--measure);
  text-wrap: pretty;
}

.mono {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .04em;
}

/* ------------------------------------------------------------
   4. LAYOUT
   ------------------------------------------------------------ */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { position: relative; padding-block: var(--section-y); }
.section--elev { background: var(--bg-elev); }
.section--flush { padding-block: 0; }

/* Sektionskopf: Label + Headline + Text */
.section-head { margin-bottom: clamp(40px, 5vw, 72px); }
.section-head .label { margin-bottom: var(--space-sm); }
.section-head .display { margin-bottom: var(--space-md); }

/* Kopf mit Text rechts (Desktop) */
.section-head--split {
  display: grid;
  gap: var(--space-md) var(--space-2xl);
  align-items: end;
}
@media (min-width: 900px) {
  .section-head--split { grid-template-columns: 1.1fr .9fr; }
  .section-head--split .body-text { padding-bottom: 8px; }
}

.grid { display: grid; gap: var(--space-md); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }

/* Trenner mit Verlauf */
.divider {
  height: 1px;
  border: 0;
  background: linear-gradient(to right, var(--accent-red-muted), transparent);
}

/* Feines Raster als Hintergrundtextur */
.texture-grid::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 40%, #000 20%, transparent 78%);
  pointer-events: none;
  z-index: var(--z-bg);
}
.texture-grid > * { position: relative; z-index: var(--z-content); }

/* ------------------------------------------------------------
   5. UI-ELEMENTE
   ------------------------------------------------------------ */

/* --- Buttons -------------------------------------------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-bd: var(--border-light);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 30px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-bd);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  transition: color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              transform var(--dur-fast) var(--ease);
}
/* Wischeffekt beim Hover */
.btn::after {
  content: "";
  position: absolute; inset: 0;
  background: var(--accent);
  transform: translateY(101%);
  transition: transform var(--dur) var(--ease-out);
  z-index: -1;
}
.btn:hover::after,
.btn:focus-visible::after { transform: translateY(0); }
.btn:hover, .btn:focus-visible { color: var(--bg); border-color: var(--accent); }
.btn:active { transform: translateY(1px); }

.btn--primary { --btn-bg: var(--accent); --btn-fg: var(--bg); --btn-bd: var(--accent); }
.btn--primary::after { background: var(--text); }
.btn--primary:hover, .btn--primary:focus-visible { color: var(--bg); border-color: var(--text); }

.btn--ghost { --btn-fg: var(--text-muted); }
.btn--sm { padding: 11px 20px; font-size: 11px; }

.btn .icon { width: 14px; height: 14px; flex: none; }

/* --- Tags ----------------------------------------------- */
.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  padding: 3px 9px;
  border-radius: 3px;
  white-space: nowrap;
}
.tag--gold { background: var(--accent-soft); color: var(--accent); }
.tag--red  { background: rgba(192,57,43,.15); color: #e0685a; }
.tag--mute { background: rgba(255,255,255,.05); color: var(--text-muted); }

/* --- Karte ---------------------------------------------- */
.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* --- Hinweis-Box ---------------------------------------- */
.hint {
  padding: 12px 16px;
  background: var(--bg-code);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}
.hint--red { border-left-color: var(--accent-red); }

/* ------------------------------------------------------------
   6. 3D-PRIMITIVE
   ------------------------------------------------------------ */

/* Perspektiv-Bühne: Kinder dürfen im Raum kippen */
.stage { perspective: 1200px; perspective-origin: 50% 50%; }
.stage--near { perspective: 800px; }

/* Element, das per JS (data-tilt) im Raum kippt */
.tilt {
  transform-style: preserve-3d;
  transform:
    rotateX(var(--rx, 0deg))
    rotateY(var(--ry, 0deg))
    translateZ(var(--tz, 0px));
  transition: transform var(--dur-slow) var(--ease-out);
  will-change: transform;
}
.tilt.is-live { transition: transform .12s linear; }

/* Ebene, die aus der Karte heraussteht */
.tilt__layer { transform: translateZ(var(--depth, 40px)); transform-style: preserve-3d; }

/* Lichtreflex, folgt dem Zeiger */
.tilt__glare {
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    circle at var(--gx, 50%) var(--gy, 50%),
    rgba(255,255,255,.16), transparent 55%
  );
  transition: opacity var(--dur) var(--ease);
}
.tilt:hover .tilt__glare { opacity: 1; }

/* ------------------------------------------------------------
   7. SCROLL-REVEAL
   ------------------------------------------------------------ */
[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition:
    opacity .8s var(--ease-out),
    transform .8s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal="left"]  { transform: translate3d(-32px, 0, 0); }
[data-reveal="right"] { transform: translate3d(32px, 0, 0); }
[data-reveal="scale"] { transform: scale(.94); }
[data-reveal].is-in   { opacity: 1; transform: none; }

/* Zeilenweiser Aufbau grosser Headlines
   padding-top schafft Platz für Umlautpunkte, die sonst
   von overflow:hidden abgeschnitten werden. */
.reveal-line {
  display: block;
  overflow: hidden;
  padding-top: .22em;
  margin-top: -.22em;
}
.reveal-line > span {
  display: block;
  transform: translateY(110%);
  transition: transform 1s var(--ease-out);
  transition-delay: var(--line-delay, 0ms);
}
.is-in .reveal-line > span,
.reveal-line.is-in > span { transform: translateY(0); }

/* ------------------------------------------------------------
   8. MOTION-PRÄFERENZEN
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .reveal-line > span { transform: none; }
  .tilt { transform: none !important; }
}
