/* ==========================================================================
   base.css — Reset, Grundtypografie und App-Rahmen (Header, Main, Nav)
   Enthält bewusst keine Komponenten-Styles (siehe components.css).
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: light;
  max-width: 100%;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: var(--lh-normal);
  /* Verhindert das "Gummiband"-Scrollen über die App-Ränder hinaus. */
  overscroll-behavior-y: none;
  max-width: 100%;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-tight);
  margin: 0;
}

p {
  margin: 0;
}

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

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

.icon {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
}

[hidden] {
  display: none !important;
}

/* Sichtbarer Fokus für Tastatur- und Switch-Control-Nutzung. */
:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* --- App-Gerüst ---------------------------------------------------------- */

.app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: var(--w-content);
  width: 100%;
  min-width: 0;
  margin-inline: auto;
  background: var(--c-bg);
}

.app__main {
  flex: 1;
  min-width: 0;
  padding: var(--sp-4) var(--sp-4) var(--sp-7);
  /* Platz für die fixierte Navigation am unteren Rand. */
  padding-bottom: calc(var(--sp-7) + 4.5rem + env(safe-area-inset-bottom, 0px));
}

.app__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: calc(var(--sp-4) + env(safe-area-inset-top, 0px)) var(--sp-4)
    var(--sp-2);
}

.app__brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  letter-spacing: 0.02em;
}

/* Signature-Element: der Lichtpunkt neben dem Namen. */
.app__spark {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: var(--r-pill);
  background: var(--c-honey);
  box-shadow: var(--glow);
}

/* --- Hilfsklassen -------------------------------------------------------- */

/* Für Screenreader sichtbar, visuell versteckt. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.text-soft {
  color: var(--c-text-soft);
}

.text-faint {
  color: var(--c-text-faint);
  font-size: var(--fs-sm);
}

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

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