/*
   © 2026 Spinplay. Alle Rechte vorbehalten.
*/
/* =====================================================================
   BASE — Tokens, Reset, Typografie, Hintergrund
   ===================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  /* Palette */
  --accent:   #00e5a5;
  --accent-2: #4d7cff;
  --accent-3: #ff4d8d;
  --grad: linear-gradient(115deg, var(--accent) 0%, var(--accent-2) 100%);

  /* Maße */
  --maxw: 1100px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius-xl: 16px;
  --radius-lg: 12px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --radius-pill: 6px;

  /* Typografie */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Chakra Petch", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;

  --fs-display: clamp(2.3rem, 6.4vw, 3.9rem);
  --fs-h2:      clamp(1.12rem, 2.2vw, 1.42rem);
  --fs-lead:    clamp(1rem, 1.5vw, 1.1rem);
  --fs-body:    0.95rem;
  --fs-sm:      0.84rem;
  --fs-xs:      0.72rem;

  /* Bewegung */
  --ease:    cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --dur:     .35s;

  color-scheme: dark;
}

/* ---------- 2. Themes ---------- */
[data-theme="dark"] {
  --bg:        #07090c;
  --bg-2:      #0b1014;
  --surface:   rgba(15, 21, 25, .82);
  --surface-2: rgba(21, 29, 34, .9);
  --surface-3: rgba(28, 38, 44, .95);
  --line:      rgba(255, 255, 255, .075);
  --line-2:    rgba(255, 255, 255, .17);
  --text:      #e6ebec;
  --text-2:    #96a3a8;
  --text-3:    #5e6b72;
  --glass:     blur(16px) saturate(140%);
  --shadow-sm: 0 2px 10px -4px rgba(0, 0, 0, .7);
  --shadow:    0 18px 40px -22px rgba(0, 0, 0, .9);
  --shadow-lg: 0 40px 80px -40px rgba(0, 0, 0, 1);
  --glow-a:    rgba(0, 229, 165, .16);
  --glow-b:    rgba(77, 124, 255, .14);
  --grain:     .04;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg:        #eef1f2;
  --bg-2:      #ffffff;
  --surface:   rgba(255, 255, 255, .88);
  --surface-2: #ffffff;
  --surface-3: #f4f7f8;
  --line:      rgba(8, 20, 24, .1);
  --line-2:    rgba(8, 20, 24, .22);
  --text:      #0b1418;
  --text-2:    #45555c;
  --text-3:    #6d7d84;
  --glass:     blur(14px) saturate(160%);
  --shadow-sm: 0 2px 10px -4px rgba(10, 30, 40, .18);
  --shadow:    0 18px 40px -24px rgba(10, 30, 40, .35);
  --shadow-lg: 0 40px 70px -40px rgba(10, 30, 40, .45);
  --glow-a:    rgba(0, 229, 165, .18);
  --glow-b:    rgba(77, 124, 255, .16);
  --grain:     .025;
  color-scheme: light;
}

/* ---------- 3. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

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

body {
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}

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

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.08;
  letter-spacing: .02em;
  text-wrap: balance;
}
p { text-wrap: pretty; }

::selection { background: color-mix(in oklab, var(--accent) 40%, transparent); color: #04120d; }

/* Kopierschutz — aktiviert protect.js über body.no-select.
   Eingabefelder und .allow-select bleiben auswählbar. */
body.no-select { -webkit-user-select: none; user-select: none; }
body.no-select :is(input, textarea, select, [contenteditable], .allow-select) {
  -webkit-user-select: text;
  user-select: text;
}
body.no-select img { -webkit-user-drag: none; pointer-events: none; }

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

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a343a; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3d4a51; }
* { scrollbar-width: thin; scrollbar-color: #2a343a transparent; }

/* ---------- 4. Layout ---------- */
.shell {
  width: min(100% - var(--gutter) * 2, var(--maxw));
  margin-inline: auto;
  padding-block: clamp(3rem, 7vw, 5.5rem) clamp(3rem, 6vw, 5rem);
  position: relative;
  z-index: 2;
}

.stack-gap > * + * { margin-top: clamp(3.5rem, 8vw, 6rem); }

/* ---------- 5. Typo-Utilities ---------- */
.lead  { font-size: var(--fs-lead); color: var(--text-2); max-width: 62ch; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.mono  { font-family: var(--font-mono); font-size: .86em; letter-spacing: 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .35rem .8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-2);
}

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.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; border: 0;
}

/* ---------- 6. Hintergrund ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(120% 70% at 50% -10%, var(--bg-2), transparent 60%),
    var(--bg);
}

.bg__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}
.bg__glow--1 {
  width: 40rem; height: 40rem;
  top: -20rem; left: 50%;
  margin-left: -20rem;
  background: radial-gradient(circle, var(--glow-a), transparent 65%);
  animation: glowDrift 28s var(--ease-io) infinite alternate;
}
.bg__glow--2 {
  width: 34rem; height: 34rem;
  bottom: -18rem; right: -8rem;
  background: radial-gradient(circle, var(--glow-b), transparent 65%);
  animation: glowDrift 34s var(--ease-io) infinite alternate-reverse;
}

.bg__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .028) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 95% 72% at 50% 0%, #000 38%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 95% 72% at 50% 0%, #000 38%, transparent 100%);
  will-change: transform;
}

/* Geometrische Würfel-Deko */
.bg__cube {
  position: absolute;
  border: 1px solid color-mix(in oklab, var(--accent) 30%, transparent);
  animation: cubeDrift 22s var(--ease-io) infinite alternate;
}
.bg__cube::before,
.bg__cube::after {
  content: "";
  position: absolute;
  border: 1px solid color-mix(in oklab, var(--accent) 15%, transparent);
}
.bg__cube::before { inset: 5px; }
.bg__cube::after  { inset: -5px; }
.bg__cube--1 { width: 46px; height: 46px; left: 7%;  top: 22%; }
.bg__cube--2 { width: 26px; height: 26px; right: 13%; top: 15%; border-color: color-mix(in oklab, var(--accent-2) 36%, transparent); animation-duration: 28s; }
.bg__cube--2::before, .bg__cube--2::after { border-color: color-mix(in oklab, var(--accent-2) 17%, transparent); }
.bg__cube--3 { width: 60px; height: 60px; right: 8%;  bottom: 18%; animation-duration: 34s; }
.bg__cube--4 { width: 30px; height: 30px; left: 14%; bottom: 24%; border-color: color-mix(in oklab, var(--accent-3) 34%, transparent); animation-duration: 26s; }
.bg__cube--4::before, .bg__cube--4::after { border-color: color-mix(in oklab, var(--accent-3) 16%, transparent); }
.bg__cube--spin { animation-name: cubeSpin; }
.bg__cube--spin2 { animation-name: cubeSpin2; }

/* Scanline */
.bg__scan {
  position: absolute;
  left: 0; right: 0;
  height: 34vh;
  top: -40vh;
  background: linear-gradient(180deg,
    transparent,
    color-mix(in oklab, var(--accent) 6%, transparent) 45%,
    color-mix(in oklab, var(--accent) 11%, transparent) 50%,
    transparent);
  opacity: .8;
  animation: scanDown 11s linear infinite;
}

.bg__grain {
  position: absolute;
  inset: -30%;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  animation: grainShift 6s steps(6) infinite;
}
.no-grain-anim .bg__grain { animation: none; }

.bg__fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, var(--bg) 96%);
}

/* ---------- 7. Utilities ---------- */
.hide { display: none !important; }
.no-scroll { overflow: hidden; }

@media (max-width: 640px) {
  :root { --radius-xl: 12px; --radius-lg: 10px; }
  .bg__cube { display: none; }
}

@media print {
  .bg, .theme-toggle, .palette-trigger, .to-top, .cursor-glow, .cursor-dot,
  .cursor-ring, .scroll-progress, .preloader { display: none !important; }
  body { background: #fff; color: #000; }
}