/* ============================================================
   BRIGHTLABEL STUDIO · Base
   Reset, Typo-Grundlagen, Layout-Primitive, Reveal-System, A11y
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--ink-text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }

h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg, canvas, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

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

/* ── Fokus: sichtbar, aber nicht laut ─────────────────────── */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  top: .75rem;
  left: .75rem;
  z-index: 999;
  padding: .7rem 1.1rem;
  background: var(--accent);
  color: #fff;
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform var(--d-fast) var(--e-out);
}
.skip-link:focus-visible { transform: translateY(0); }

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

section {
  position: relative;
  background: var(--bg);
  color: var(--fg);
  overflow-x: clip;
}

/* Nahtstelle zwischen den Kontrastzonen: helle Flächen legen sich
   mit weicher Kante über die dunkle Ebene. */
[data-theme='paper'] {
  border-radius: var(--seam) var(--seam) 0 0;
  margin-top: calc(var(--seam) * -1);
  padding-top: var(--seam);
  z-index: var(--z-base);
}
[data-theme='ink'] + [data-theme='ink'] { border-top: 1px solid var(--ink-line-soft); }

/* ── Typografie-Bausteine ─────────────────────────────────── */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  color: var(--faint);
}
.kicker::before {
  content: '';
  width: 1.6rem;
  height: 1px;
  background: var(--accent-ctx);
}

h1, h2, h3 {
  font-weight: 700;
  letter-spacing: var(--tr-head);
  line-height: var(--lh-tight);
  text-wrap: balance;
}

em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent-ctx);
  letter-spacing: -.01em;
}

p { text-wrap: pretty; }

.link-underline {
  position: relative;
  display: inline-block;
  color: var(--fg);
  font-weight: 500;
}
.link-underline::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform-origin: right;
  transform: scaleX(1);
  transition: transform var(--d-mid) var(--e-out);
}
.link-underline:hover::after { transform-origin: left; transform: scaleX(0); }

/* ── Reveal-System (IntersectionObserver, CSS-getrieben) ──── */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  transition:
    opacity var(--d-reveal) var(--e-out),
    transform var(--d-reveal) var(--e-out);
  transition-delay: calc(var(--reveal-d, 0) * 90ms);
  will-change: opacity, transform;
}
.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
  will-change: auto;
}

/* Zeilenweiser Aufstieg für Überschriften */
.line { display: block; overflow: hidden; padding-bottom: .06em; }
.line__i { display: block; }
.js [data-split] .line__i {
  transform: translate3d(0, 105%, 0);
  transition: transform 1.15s var(--e-out);
  transition-delay: calc(var(--i, 0) * 95ms);
  will-change: transform;
}
.js [data-split].is-in .line__i { transform: none; will-change: auto; }

/* Failsafe: ohne JS oder ohne rAF bleibt alles sichtbar */
html.no-js [data-reveal],
html.no-js [data-split] .line__i,
html.motion-off [data-reveal],
html.motion-off [data-split] .line__i {
  opacity: 1 !important;
  transform: none !important;
}

/* ── Reduced Motion ───────────────────────────────────────── */
@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;
  }
  .js [data-reveal],
  .js [data-split] .line__i { opacity: 1 !important; transform: none !important; }
  .cursor { display: none !important; }
}

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