/* ============================================================================
   EffizienzBerater — Base Styles
   Stand: 2026-04-26 · Phase A (Foundation)
   ----------------------------------------------------------------------------
   Modern Reset + Body-Defaults + @font-face (Inter Variable, self-hosted) +
   Focus-Ring + prefers-reduced-motion.

   Setzt voraus, dass tokens.css bereits geladen wurde.
   ============================================================================ */

/* ---------- @font-face: Inter Variable (self-hosted, Schrems-II-clean) -- */

@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/InterVariable.woff2') format('woff2-variations');
}

@font-face {
  font-family: 'Inter Variable';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/InterVariable-Italic.woff2') format('woff2-variations');
}

/* ---------- Modern Reset ------------------------------------------------ */

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  letter-spacing: var(--tracking-snug);
  color: var(--ink-primary);
  background: var(--bg-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11', 'ss01';
  min-height: 100vh;
}

/* ---------- Typography Defaults ----------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  color: var(--ink-primary);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

small {
  font-size: var(--text-xs);
  color: var(--ink-tertiary);
}

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

/* ---------- Media + Form Elements -------------------------------------- */

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

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

button {
  cursor: pointer;
  background: none;
  border: 0;
}

textarea {
  resize: vertical;
}

ul, ol {
  list-style: none;
}

/* ---------- Links ------------------------------------------------------- */

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--motion-fast) var(--ease-out);
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Focus Ring (für Keyboard-Navigation) ----------------------- */

:focus { outline: none; }

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

button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  box-shadow: var(--shadow-focus);
  outline-color: var(--accent);
}

/* ---------- Selection -------------------------------------------------- */

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

/* ---------- Skip Link (Accessibility) ---------------------------------- */

.skip-link {
  position: absolute;
  top: -48px;
  left: var(--space-2);
  z-index: var(--z-tooltip);
  padding: var(--space-2) var(--space-4);
  background: var(--accent);
  color: var(--ink-on-accent);
  border-radius: var(--radius-md);
  font-weight: var(--fw-semibold);
  font-size: var(--text-sm);
  transition: top var(--motion-fast) var(--ease-out);
}

.skip-link:focus,
.skip-link:focus-visible {
  top: var(--space-2);
  text-decoration: none;
  color: var(--ink-on-accent);
}

/* ---------- Visually-Hidden Utility ------------------------------------ */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Button System (3 variants × 3 sizes) ----------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-sans);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-snug);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition:
    background var(--motion-fast) var(--ease-out),
    border-color var(--motion-fast) var(--ease-out),
    color var(--motion-fast) var(--ease-out),
    transform var(--motion-fast) var(--ease-out),
    box-shadow var(--motion-fast) var(--ease-out);
}

.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Sizes — height 32 / 40 / 48 */
.btn-sm  { height: 32px; padding: 0 var(--space-3); font-size: var(--text-sm); }
.btn-md  { height: 40px; padding: 0 var(--space-4); font-size: var(--text-sm); }
.btn-lg  { height: 48px; padding: 0 var(--space-5); font-size: var(--text-base); }

/* Variants */
.btn-primary {
  background: var(--accent);
  color: var(--ink-on-accent);
  box-shadow: var(--shadow-xs);
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--ink-on-accent);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.btn-primary:active {
  background: var(--accent-active);
  transform: translateY(0);
  box-shadow: var(--shadow-xs);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--ink-primary);
  border-color: var(--border-default);
}
.btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--ink-primary);
  border-color: var(--border-strong);
  text-decoration: none;
}
.btn-secondary:active {
  background: var(--bg-active);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-primary);
}
.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--ink-primary);
  text-decoration: none;
}
.btn-ghost:active {
  background: var(--bg-active);
}

.btn-danger {
  background: var(--danger);
  color: var(--ink-on-danger);
  box-shadow: var(--shadow-xs);
}
.btn-danger:hover {
  filter: brightness(1.08);
  color: var(--ink-on-danger);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.btn-danger:active {
  filter: brightness(0.95);
  transform: translateY(0);
  box-shadow: var(--shadow-xs);
}

.btn-success {
  background: var(--success);
  color: var(--ink-on-success);
  box-shadow: var(--shadow-xs);
}
.btn-success:hover {
  filter: brightness(1.08);
  color: var(--ink-on-success);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.btn-success:active {
  filter: brightness(0.95);
  transform: translateY(0);
  box-shadow: var(--shadow-xs);
}

/* ---------- Container -------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

@media (max-width: 768px) {
  .container { padding: 0 var(--space-4); }
}

/* ---------- Forced-Colors-Mode (Windows-High-Contrast) ----------------- */

@media (forced-colors: active) {
  :focus-visible { outline: 2px solid CanvasText; }
  button, .btn { border: 1px solid CanvasText; }
}
