/* ============================================================
   BASE.CSS — Reset, Token-Verwendung, funktionale Komponenten
   ------------------------------------------------------------
   Diese Datei kennt KEINE konkreten Stil-Entscheidungen.
   Sie konsumiert nur die Tokens, die jedes Theme auf
   body[data-theme="…"] definiert:

   Farben     --c-bg, --c-surface, --c-ink, --c-ink-soft,
              --c-accent, --c-accent-ink, --c-line
   Schriften  --font-display, --font-body, --font-alt
   Form       --radius-s, --radius-m, --radius-img, --btn-radius
   Motion     --ease, --dur
   ============================================================ */

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

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body, sans-serif);
  background: var(--c-bg, #fff);
  color: var(--c-ink, #111);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color .55s ease, color .55s ease;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display, serif); line-height: 1.08; }
p  { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a  { color: inherit; text-decoration: none; }
em { font-style: italic; }
blockquote { margin: 0; }
button {
  font: inherit; color: inherit;
  background: none; border: 0; padding: 0; cursor: pointer;
}

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

::selection {
  background: var(--c-accent, #c00);
  color: var(--c-accent-ink, #fff);
}

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

/* ---------- Skip-Link ---------- */
.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 1000;
  padding: .6em 1.2em;
  background: var(--c-ink); color: var(--c-bg);
  transition: top .25s ease;
}
.skip-link:focus { top: 1rem; }

/* ---------- Theme-Veil (Sweep beim Stil-Wechsel) ---------- */
#theme-veil {
  position: fixed; inset: 0; z-index: 900;
  background: var(--c-ink, #111);
  transform: scaleY(0);
  transform-origin: bottom;
  pointer-events: none;
}
#theme-veil.veil--in {
  transform: scaleY(1);
  transition: transform .42s cubic-bezier(.7, 0, .3, 1);
}
#theme-veil.veil--out {
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .5s cubic-bezier(.7, 0, .3, 1);
}

/* ---------- Header (funktionales Gerüst) ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background-color .4s ease, box-shadow .4s ease,
              border-color .4s ease, transform .4s ease;
}
.header__inner {
  display: flex; align-items: center;
  gap: clamp(1rem, 2.5vw, 2.5rem);
  padding: .9rem clamp(1.25rem, 4vw, 3rem);
}

.brand {
  display: inline-flex; align-items: center; gap: .65rem;
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.15rem; line-height: 1;
  letter-spacing: .02em;
}
.brand__mark { width: 30px; height: 30px; flex: none; }
.brand__name { display: inline-flex; align-items: baseline; gap: .45em; }
.brand__sub {
  font-family: var(--font-body);
  font-style: normal; font-weight: 400;
  font-size: .62em; letter-spacing: .14em; text-transform: uppercase;
  color: var(--c-ink-soft);
}

.main-nav { display: flex; gap: clamp(1rem, 2vw, 1.8rem); margin-left: auto; }
.main-nav__link {
  font-size: .85rem; letter-spacing: .04em;
  position: relative; padding: .3em 0;
}

/* Stil-Wechsler */
.theme-switcher {
  display: flex; align-items: center; gap: .3rem;
  flex: none;
}
.theme-switcher__label {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .18em;
  color: var(--c-ink-soft); margin-right: .35rem;
}
.theme-btn {
  display: inline-flex; align-items: center; gap: .35em;
  padding: .42em .6em;
  font-size: .72rem; line-height: 1; letter-spacing: .05em;
  color: var(--c-ink-soft);
  border: 1px solid transparent;
  border-radius: var(--btn-radius, 0);
  transition: color .25s, background-color .25s, border-color .25s;
  white-space: nowrap;
}
.theme-btn__num { font-variant-numeric: tabular-nums; }
.theme-btn[aria-pressed="true"] {
  color: var(--c-accent-ink);
  background: var(--c-accent);
}
.theme-btn:not([aria-pressed="true"]):hover { color: var(--c-ink); }
@media (max-width: 1700px) { .theme-btn__name { display: none; } }
@media (max-width: 640px) {
  .theme-switcher__label { display: none; }
  /* 8 Stile: auf schmalen Screens horizontal scrollbar statt Overflow */
  .theme-switcher {
    flex: 1 1 auto; min-width: 0;
    overflow-x: auto;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .theme-switcher::-webkit-scrollbar { display: none; }
  .brand { flex: none; }
}
@media (max-width: 480px) {
  .brand__sub { display: none; }
  .theme-btn { padding: .42em .45em; }
  .header__inner { gap: .6rem; }
}

/* Burger */
.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  flex-direction: column; justify-content: center; align-items: center;
  gap: 7px; flex: none;
}
.nav-toggle__bar {
  width: 22px; height: 2px; background: currentColor;
  transition: transform .3s var(--ease, ease), opacity .3s;
}
body.nav-open .nav-toggle__bar:first-child { transform: translateY(4.5px) rotate(45deg); }
body.nav-open .nav-toggle__bar:last-child  { transform: translateY(-4.5px) rotate(-45deg); }

/* Mobile-Navigation als Overlay */
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    position: fixed; inset: 0; z-index: -1;
    flex-direction: column; justify-content: center; align-items: center;
    gap: 2.2rem;
    background: var(--c-bg);
    opacity: 0; visibility: hidden;
    transition: opacity .35s ease, visibility .35s;
  }
  body.nav-open .main-nav { opacity: 1; visibility: visible; }
  .main-nav__link {
    font-size: 1.6rem;
    font-family: var(--font-display);
    opacity: 0; transform: translateY(14px);
    transition: opacity .4s ease, transform .4s var(--ease, ease);
  }
  body.nav-open .main-nav__link { opacity: 1; transform: none; }
  body.nav-open .main-nav__link:nth-child(2) { transition-delay: .06s; }
  body.nav-open .main-nav__link:nth-child(3) { transition-delay: .12s; }
  body.nav-open .main-nav__link:nth-child(4) { transition-delay: .18s; }
  body.nav-open { overflow: hidden; }
}

/* ---------- Sektionen: Grundgerüst ---------- */
.section {
  max-width: var(--container, 1440px);
  margin-inline: auto;
  padding: clamp(4.5rem, 10vw, 9rem) clamp(1.25rem, 5vw, 4rem);
}

.section-head { margin-bottom: clamp(2.5rem, 6vw, 5rem); }
.section-head__index { display: inline-block; }
.section-head__label { display: inline-block; }
.section-head__title { margin-top: .35em; }
.section-head__desc  { max-width: 38ch; color: var(--c-ink-soft); }

/* ---------- Hero: Grundgerüst ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-content: center;
  padding: 7rem clamp(1.25rem, 5vw, 4rem) 4rem;
  max-width: var(--container, 1440px);
  margin-inline: auto;
}
.hero__title { margin: 0; }
.hero__line  { display: block; overflow: hidden; }
.hero__word  { display: inline-block; }
.hero__media img {
  width: 100%; height: 100%; object-fit: cover;
  background: var(--c-surface);
}
.hero__media { margin: 0; }
.hero__media-caption { font-size: .72rem; color: var(--c-ink-soft); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.hero__deco { pointer-events: none; }
.hero__scroll-hint {
  position: absolute; bottom: 1.5rem;
  font-size: .68rem; letter-spacing: .25em; text-transform: uppercase;
  color: var(--c-ink-soft);
}

/* ---------- Buttons: nur Funktionales ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .6em;
  padding: .9em 1.8em;
  font-size: .85rem; line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--btn-radius, 0);
  transition: background-color .3s var(--ease, ease), color .3s,
              border-color .3s, transform .3s var(--ease, ease),
              box-shadow .3s var(--ease, ease);
  cursor: pointer;
}

/* ---------- Ticker (Standard: aus) ---------- */
.ticker { display: none; overflow: hidden; }
.ticker__track {
  display: flex; gap: 2.2rem; width: max-content;
  padding: .8em 0;
  animation: ticker-scroll 30s linear infinite;
  white-space: nowrap;
}
@keyframes ticker-scroll { to { transform: translateX(-50%); } }

/* ---------- Projekte / Galerie: Grundgerüst ---------- */
.project { margin: 0; }
.project__media {
  overflow: hidden;
  background: var(--c-surface);
}
.project__media img { width: 100%; height: 100%; object-fit: cover; }
.project__meta { display: grid; gap: .15em; }
.project__cat, .project__year { font-size: .78rem; color: var(--c-ink-soft); }

/* ---------- Werkstatt / About: Grundgerüst ---------- */
.about__fig { margin: 0; overflow: hidden; background: var(--c-surface); }
.about__fig img { width: 100%; height: 100%; object-fit: cover; }
.about__stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem 2rem; }
.stat { display: grid; gap: .15em; }
.stat__value { font-family: var(--font-display); font-size: 2.2rem; line-height: 1; }
.stat__label { font-size: .78rem; color: var(--c-ink-soft); }
.about__quote cite { font-style: normal; font-size: .8rem; color: var(--c-ink-soft); }

/* ---------- Kontakt: Grundgerüst ---------- */
.contact__details { display: grid; gap: .8rem; }
.contact__detail { display: grid; gap: .1em; }
.contact__detail-label {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .16em;
  color: var(--c-ink-soft);
}
.contact__actions { display: flex; flex-wrap: wrap; gap: 1rem; }

/* ---------- Footer: Grundgerüst ---------- */
.footer__inner {
  max-width: var(--container, 1440px);
  margin-inline: auto;
  padding: clamp(2.5rem, 5vw, 4rem) clamp(1.25rem, 5vw, 4rem);
  display: grid; gap: 2rem;
}
.footer__brand { display: flex; align-items: center; gap: .8rem; }
.footer__brand .brand__mark { width: 26px; height: 26px; }
.footer__claim { margin: 0; }
.footer__nav, .footer__legal { display: flex; flex-wrap: wrap; gap: 1.4rem; font-size: .85rem; }
.footer__meta { margin: 0; font-size: .75rem; color: var(--c-ink-soft); }
@media (min-width: 760px) {
  .footer__inner {
    grid-template-columns: 1fr auto auto;
    align-items: center;
  }
  .footer__meta { grid-column: 1 / -1; }
}

/* ---------- Consent-Banner ---------- */
.consent {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 880;
  display: flex; justify-content: center;
  padding: 1rem;
  pointer-events: none;
}
.consent[hidden] { display: none; }
.consent__box {
  pointer-events: auto;
  max-width: 720px;
  background: var(--c-bg); color: var(--c-ink);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-img, 0);
  box-shadow: 0 22px 60px -24px rgba(0, 0, 0, .55);
  padding: 1.5rem 1.7rem;
  animation: consent-in .5s var(--ease, ease) both;
}
@keyframes consent-in {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}
.consent__title { font-size: 1.05rem; margin-bottom: .5em; }
.consent__text  { font-size: .82rem; line-height: 1.65; color: var(--c-ink-soft); }
.consent__text a { text-decoration: underline; text-underline-offset: 3px; color: var(--c-ink); }
.consent__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.1rem; }
.footer__legal button {
  cursor: pointer; font-size: inherit;
  text-decoration: underline; text-underline-offset: 3px;
  color: var(--c-ink-soft);
}
.footer__legal button:hover { color: var(--c-ink); }

/* ---------- Scroll-Reveals ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity var(--dur, .8s) var(--ease, cubic-bezier(.22, 1, .36, 1)),
    transform var(--dur, .8s) var(--ease, cubic-bezier(.22, 1, .36, 1));
  transition-delay: var(--d, 0s);
  will-change: opacity, transform;
}
[data-reveal].is-revealed { opacity: 1; transform: none; }

/* ---------- Reduzierte Bewegung respektieren ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}
