/* ============================================================
   LogicStudios — Basis: Tokens, Richtungen, Themes, Gerüst
   ============================================================ */

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

:root {
  --accent: #3478f6;
  --accent-ink: #ffffff;
  --density: 1;
  --maxw: 1180px;
  --nav-h: 64px;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

/* ---------- Richtungen (Typografie + Formensprache) ---------- */
:root[data-dir="monolith"], :root[data-fonts="monolith"] {
  --font-display: "Helvetica Neue", Helvetica, "Segoe UI", system-ui, sans-serif;
  --font-body: "Helvetica Neue", Helvetica, "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --track-display: -0.035em;
  --weight-display: 700;
}
:root[data-dir="editorial"], :root[data-fonts="editorial"] {
  --font-display: "Newsreader", Georgia, serif;
  --font-body: "Helvetica Neue", Helvetica, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --track-display: -0.02em;
  --weight-display: 500;
}
:root[data-dir="technisch"], :root[data-fonts="technisch"] {
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --track-display: -0.025em;
  --weight-display: 700;
}

:root[data-dir="monolith"]  { --radius: 24px; --radius-s: 14px; --line-w: 0px; }
:root[data-dir="editorial"] { --radius: 10px; --radius-s: 7px;  --line-w: 1px; }
:root[data-dir="technisch"] { --radius: 6px;  --radius-s: 4px;  --line-w: 1px; }

/* ---------- Themes ---------- */
:root[data-theme="dark"] {
  --bg: #0a0a0c;
  --bg-2: #101013;
  --card: #141418;
  --card-2: #1a1a20;
  --ink: #f5f5f7;
  --ink-2: rgba(245, 245, 247, 0.64);
  --ink-3: rgba(245, 245, 247, 0.4);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --nav-bg: rgba(10, 10, 12, 0.72);
  --glow-alpha: 0.16;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
:root[data-theme="light"] {
  --bg: #f6f6f7;
  --bg-2: #ededf0;
  --card: #ffffff;
  --card-2: #f1f1f4;
  --ink: #131316;
  --ink-2: rgba(19, 19, 22, 0.64);
  --ink-3: rgba(19, 19, 22, 0.4);
  --line: rgba(19, 19, 22, 0.1);
  --line-strong: rgba(19, 19, 22, 0.2);
  --nav-bg: rgba(246, 246, 247, 0.75);
  --glow-alpha: 0.1;
  --shadow: 0 24px 60px rgba(20, 20, 30, 0.12);
}
:root[data-dir="editorial"][data-theme="dark"] { --bg: #121013; --bg-2: #181519; --card: #1b171c; --card-2: #221d23; --nav-bg: rgba(18, 16, 19, 0.72); }
:root[data-dir="editorial"][data-theme="light"] { --bg: #f7f5f2; --bg-2: #efece7; --card: #fffdfa; --nav-bg: rgba(247, 245, 242, 0.75); }
:root[data-dir="technisch"][data-theme="dark"] { --bg: #0a0d12; --bg-2: #0f131a; --card: #11161e; --card-2: #161c26; --nav-bg: rgba(10, 13, 18, 0.72); }
:root[data-dir="technisch"][data-theme="light"] { --bg: #f3f5f8; --bg-2: #e9edf2; --card: #ffffff; --nav-bg: rgba(243, 245, 248, 0.75); }

html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Technisch: feines Raster im Hintergrund */
:root[data-dir="technisch"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  opacity: 0.35;
  z-index: 0;
}

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

img { max-width: 100%; display: block; }
a { color: inherit; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(20px, 4vw, 48px); position: relative; z-index: 1; }

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- Typo-Skala ---------- */
h1, h2, h3 { font-family: var(--font-display); font-weight: var(--weight-display); letter-spacing: var(--track-display); margin: 0; text-wrap: balance; }
.display { font-size: clamp(44px, 7.2vw, 96px); line-height: 1.02; }
.h2 { font-size: clamp(32px, 4.6vw, 56px); line-height: 1.08; }
.h3 { font-size: clamp(20px, 2vw, 26px); line-height: 1.25; }
.lede { font-size: clamp(18px, 1.6vw, 22px); line-height: 1.5; color: var(--ink-2); text-wrap: pretty; max-width: 56ch; }
p { text-wrap: pretty; }

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

/* ---------- Sektionen ---------- */
section { padding: calc(var(--density) * clamp(72px, 10vw, 140px)) 0; position: relative; }
.section-head { display: flex; flex-direction: column; gap: 16px; margin-bottom: calc(var(--density) * clamp(36px, 5vw, 64px)); }
.eyebrow { display: flex; align-items: center; gap: 12px; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-body); font-size: 16px; font-weight: 600;
  padding: 14px 28px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
  min-height: 48px;
}
:root[data-dir="technisch"] .btn { border-radius: var(--radius-s); }
:root[data-dir="editorial"] .btn { border-radius: var(--radius-s); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px color-mix(in oklab, var(--accent) 45%, transparent); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  height: var(--nav-h);
  display: flex; align-items: center;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  background: var(--nav-bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(20px, 4vw, 48px); display: flex; align-items: center; gap: 28px; }
.nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -0.02em; text-decoration: none; margin-right: auto; font-family: var(--font-display); }
.nav-brand img { width: 28px; height: auto; }
.nav-links { display: flex; gap: 24px; }
.nav-links a { font-size: 14px; color: var(--ink-2); text-decoration: none; transition: color 0.2s ease; }
.nav-links a:hover { color: var(--ink); }
.nav .btn { padding: 9px 18px; min-height: 38px; font-size: 14px; }

/* ---------- Loader ---------- */
#loader {
  position: fixed; inset: 0; z-index: 100;
  background: #0a0a0c;
  display: none;
  align-items: center; justify-content: center; flex-direction: column; gap: 28px;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
html.js #loader { display: flex; }
#loader.hide { opacity: 0; visibility: hidden; }
.loader-mark { position: relative; width: clamp(110px, 16vw, 170px); }
.loader-mark img { width: 100%; height: auto; }
.loader-base { opacity: 0.14; filter: grayscale(1) brightness(2); }
.loader-fill { position: absolute; inset: 0; clip-path: inset(0 100% 0 0); }
.loader-meta { display: flex; align-items: center; gap: 16px; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(245,245,247,0.5); }
.loader-bar { width: 160px; height: 2px; background: rgba(255,255,255,0.12); overflow: hidden; border-radius: 2px; }
.loader-bar i { display: block; height: 100%; width: 0%; background: #f5f5f7; }
.loader-pct { min-width: 48px; text-align: right; color: #f5f5f7; }

/* ---------- Reveals ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.8s cubic-bezier(0.2, 0.6, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.6, 0.2, 1); }
  .reveal.in { opacity: 1; transform: none; }
  .reveal-d1 { transition-delay: 0.08s; }
  .reveal-d2 { transition-delay: 0.16s; }
  .reveal-d3 { transition-delay: 0.24s; }
}

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); padding: 40px 0; }
.footer-inner { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-inner img { width: 22px; }
.footer-inner .spacer { flex: 1; }
.footer-inner span { font-size: 13px; color: var(--ink-3); }

@media (max-width: 760px) {
  .nav-links { display: none; }
}
