/* ==========================================================================
   Fahrklar - Stylesystem
   Ein Tokenset, kein Framework. Alles selbst gehostet, keine Fremdaufrufe.
   ========================================================================== */

/* --- Schrift: Bespoke Slab, lokal ---------------------------------------- */
@font-face {
  font-family: "Bespoke Slab";
  src: url("../fonts/BespokeSlab-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Bespoke Slab";
  src: url("../fonts/BespokeSlab-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Bespoke Slab";
  src: url("../fonts/BespokeSlab-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* --- Token ---------------------------------------------------------------- */
:root {
  --bg:        #14120f;
  --bg-lift:   #191713;
  --surface:   #1e1b16;
  --surface-2: #24201a;

  --ink:       #f4efe6;
  --ink-2:     #cfc7ba;
  --muted:     #a49a8c;

  --signal:      #8ecfae;   /* trocken - der einzige Farbton der Seite */
  --signal-deep: #2f6a51;
  --signal-dim:  #4f8a6e;
  --rain:        #6d6862;   /* Regen bleibt bewusst farblos */

  --line:      rgba(244, 239, 230, 0.11);
  --line-soft: rgba(244, 239, 230, 0.06);

  --display: "Bespoke Slab", "Iowan Old Style", Georgia, serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --shell: 1240px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --block: clamp(4.5rem, 9vw, 8.5rem);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  line-height: 1.62;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Feines Korn auf der Grundflaeche, nie ueber dem Inhalt. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

/* Sprungziele duerfen nie unter dem festen Kopfbereich landen */
:target, [id] { scroll-margin-top: 6.5rem; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.012em;
  margin: 0;
  text-wrap: balance;
}

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

a { color: inherit; }

::selection { background: var(--signal-deep); color: #fff; }

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

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  background: var(--ink);
  color: var(--bg);
  padding: 0.6rem 1rem;
  border-radius: 3px;
  transition: top 0.2s var(--ease);
}
.skip:focus { top: 1rem; }

/* --- Raster --------------------------------------------------------------- */
.shell {
  width: min(100% - var(--gutter) * 2, var(--shell));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}
.shell--narrow { width: min(100% - var(--gutter) * 2, 68ch); }

/* Textspalte innerhalb der Schale: alles teilt sich dieselbe linke Kante */
.textcol { max-width: 72ch; }
.textcol--wide { max-width: 78ch; }

.block { padding-block: var(--block); }

/* --- Typografische Rollen ------------------------------------------------- */
.display-xl {
  font-size: clamp(2.7rem, 5.8vw, 5rem);
  line-height: 1.0;
  letter-spacing: -0.02em;
}

/* Abschnittskopf: Ueberschrift links, Einordnung rechts.
   Fuellt die Flaeche, statt eine halbe Bildschirmbreite leer zu lassen. */
.headpair {
  display: grid;
  gap: clamp(1.2rem, 3vw, 3rem);
  align-items: end;
}
@media (min-width: 900px) {
  .headpair { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }
}
.headpair p { color: var(--ink-2); max-width: 46ch; }
.display-l  { font-size: clamp(2.1rem, 4.6vw, 3.7rem); }
.display-m  { font-size: clamp(1.55rem, 2.6vw, 2.3rem); }
.display-s  { font-size: clamp(1.2rem, 1.6vw, 1.45rem); }

.lead {
  font-size: clamp(1.1rem, 1.05rem + 0.4vw, 1.34rem);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 56ch;
}

.prose { max-width: 68ch; color: var(--ink-2); }
.prose p { margin-bottom: 1.25em; }
.prose h2 {
  font-size: clamp(1.5rem, 2.4vw, 2.05rem);
  color: var(--ink);
  margin-top: 2.4em;
  margin-bottom: 0.6em;
}
.prose h3 {
  font-size: clamp(1.2rem, 1.6vw, 1.4rem);
  color: var(--ink);
  margin-top: 1.9em;
  margin-bottom: 0.5em;
}
.prose ul { margin: 0 0 1.3em; padding-left: 0; list-style: none; }
.prose ul li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.55em;
}
.prose ul li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.72em;
  width: 0.62rem;
  height: 2px;
  border-radius: 2px;
  background: var(--signal-dim);
}
.prose a { color: var(--signal); text-underline-offset: 0.22em; }
.prose strong { color: var(--ink); font-weight: 600; }

.data {
  font-family: var(--display);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.note {
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.55;
}

/* --- Aktionen ------------------------------------------------------------- */
.act {
  --act-bg: var(--ink);
  --act-fg: #16130f;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.92rem 1.5rem;
  background: var(--act-bg);
  color: var(--act-fg);
  font: 500 1rem/1 var(--body);
  text-decoration: none;
  border: 0;
  border-radius: 2px;
  cursor: pointer;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}
.act:hover { --act-bg: var(--signal); }
.act svg { width: 1em; height: 1em; transition: transform 0.25s var(--ease); }
.act:hover svg { transform: translateX(0.22rem); }

.act--quiet {
  --act-bg: transparent;
  --act-fg: var(--ink);
  padding-inline: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding-bottom: 0.45rem;
}
.act--quiet:hover { --act-bg: transparent; --act-fg: var(--signal); }

.act[disabled] {
  --act-fg: var(--muted);
  border-bottom-color: var(--line-soft);
  cursor: default;
}
.act[disabled]:hover { --act-fg: var(--muted); }

.linkarrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--signal);
  text-decoration: none;
  font-weight: 500;
}
.linkarrow svg { width: 0.9em; height: 0.9em; transition: transform 0.25s var(--ease); }
.linkarrow:hover svg { transform: translateX(0.22rem); }

/* --- Kopfbereich ---------------------------------------------------------- */
.masthead {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  transition: background-color 0.35s var(--ease), border-color 0.35s var(--ease);
  border-bottom: 1px solid transparent;
}
.masthead.is-stuck {
  background: rgba(20, 18, 15, 0.9);
  backdrop-filter: blur(9px) saturate(115%);
  border-bottom-color: var(--line-soft);
}
.masthead__in {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-block: 1.05rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  margin-right: auto;
}
.brand svg { width: 1.75rem; height: 1.75rem; }
.brand span {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.32rem;
  letter-spacing: 0.012em;
}

.nav { display: flex; align-items: center; gap: 1.75rem; }
.nav a {
  text-decoration: none;
  color: var(--ink-2);
  font-size: 0.97rem;
  transition: color 0.2s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--signal); }

.nav__act {
  padding: 0.6rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--ink);
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}
.nav a.nav__act:hover { background: var(--ink); color: #16130f; }

.lang-switch { position: relative; }
.lang-switch__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.45rem 0.7rem;
  background: none;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--ink-2);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.lang-switch__toggle:hover { color: var(--ink); border-color: var(--ink-2); }
.lang-switch__menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 5;
  min-width: 9rem;
  margin: 0;
  padding: 0.4rem;
  list-style: none;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
.lang-switch__menu a {
  display: block;
  padding: 0.5rem 0.7rem;
  border-radius: 2px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.92rem;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.lang-switch__menu a:hover { background: var(--line-soft); color: var(--ink); }
.lang-switch__menu a[aria-current="true"] { color: var(--signal); }

.burger {
  display: none;
  width: 2.6rem;
  height: 2.6rem;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--ink);
  cursor: pointer;
}
.burger svg { width: 1.1rem; height: 1.1rem; }

@media (max-width: 860px) {
  .burger { display: inline-flex; }
  /* Marke und Menueknopf bleiben ueber dem geoeffneten Menue bedienbar */
  .brand, .burger { position: relative; z-index: 2; }
  .nav {
    position: fixed;
    inset: 0 0 auto;
    top: 0;
    z-index: 1;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 5.4rem var(--gutter) 2rem;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    transform: translateY(-101%);
    transition: transform 0.4s var(--ease);
  }
  .nav.is-open { transform: translateY(0); }
  .nav a {
    width: 100%;
    padding-block: 0.95rem;
    border-bottom: 1px solid var(--line-soft);
    font-size: 1.12rem;
  }
  .nav__act { border: 0; padding-inline: 0; }
  .nav a.nav__act:hover { background: none; color: var(--signal); }
  .lang-switch { margin-top: 1.4rem; }
  .lang-switch__menu { position: static; margin-top: 0.6rem; box-shadow: none; }
}

