/* =============================================================================
   AI Groove – Reset & Grundlagen
   ========================================================================== */

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

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

body {
  font-family: var(--font-ui);
  font-size: var(--fs-md);
  line-height: 1.45;
  color: var(--c-text);
  background: var(--c-bg);
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Hintergrund mit Tiefenwirkung – rein dekorativ, kein Layout-Einfluss. */
body::before {
  content: '';
  position: fixed;
  inset: -20%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(52vw 48vw at 12% -8%, color-mix(in srgb, var(--c-accent) 26%, transparent), transparent 62%),
    radial-gradient(44vw 40vw at 92% 4%, color-mix(in srgb, var(--c-mint) 16%, transparent), transparent 60%),
    radial-gradient(60vw 50vw at 60% 108%, color-mix(in srgb, var(--c-blue) 14%, transparent), transparent 64%);
  opacity: 0.55;
  filter: blur(20px);
}

:root[data-theme='light'] body::before {
  opacity: 0.4;
}

h1,
h2,
h3,
h4,
p,
figure {
  margin: 0;
}

/* Ohne diese Regel wuerde display:flex das hidden-Attribut aushebeln. */
[hidden] {
  display: none !important;
}

h1,
h2,
h3,
h4 {
  font-weight: 640;
  letter-spacing: -0.02em;
  line-height: 1.14;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: var(--c-accent-soft);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--c-accent-soft);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* Bildschirmleser-Text */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* --- App-Rahmen ------------------------------------------------------------ */

.app {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
}

.app[hidden] {
  display: none;
}

.noscript {
  padding: 20vh var(--s-5);
  text-align: center;
}

/* --- Startbildschirm ------------------------------------------------------- */

.boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--s-4);
  background: var(--c-bg);
  z-index: 9000;
  transition: opacity var(--d-slow) var(--e-out);
}

.boot--done {
  opacity: 0;
  pointer-events: none;
}

.boot__mark {
  width: 74px;
  height: 74px;
  border-radius: 22px;
  background: linear-gradient(150deg, var(--c-accent), var(--c-mint));
  box-shadow: var(--sh-glow);
  animation: boot-pulse 1.5s var(--e-in-out) infinite;
  position: relative;
}

.boot__mark::after {
  content: '';
  position: absolute;
  inset: 22px;
  border-radius: 6px;
  background: var(--c-bg);
  clip-path: polygon(0 40%, 22% 40%, 22% 8%, 45% 8%, 45% 92%, 68% 92%, 68% 30%, 100% 30%, 100% 62%, 0 62%);
}

.boot__text {
  color: var(--c-text-dim);
  font-size: var(--fs-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@keyframes boot-pulse {
  0%,
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.06);
    filter: brightness(1.15);
  }
}

/* --- Scrollbars ------------------------------------------------------------ */

.scroll-y {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--c-surface-3) transparent;
}

.scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--c-surface-3) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--c-surface-3);
  border-radius: var(--r-pill);
  border: 3px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--c-border-strong);
  background-clip: content-box;
}

/* --- Bewegung reduzieren --------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

:root[data-motion='reduced'] *,
:root[data-motion='reduced'] *::before,
:root[data-motion='reduced'] *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}

:root[data-motion='reduced'] body::before {
  filter: none;
}
