/* ==========================================================================
   LAIZY DESIGN SYSTEM v1.0
   ==========================================================================
   Self-contained Design Tokens + Base-Komponenten der LaizyNote-Marke.
   Geeignet für die Dachmarke und alle Sub-Brands.

   Verwendung:
     1. Diese Datei als erstes CSS-File einbinden (vor Component-Styles)
        <link rel="stylesheet" href="laizy-design-system.css" />
     2. Tokens via var(--token-name) referenzieren
     3. Sub-Brands überschreiben EINZELNE Tokens in :root nach dem Import:
        <style>
          :root {
            --color-primary: #3B82F6;        // z.B. blaue Sub-Brand
            --color-primary-hover: #2563EB;
            --color-primary-light: #DBEAFE;
            --color-primary-dark: #1E40AF;
          }
        </style>

   Architektur-Prinzipien:
     - Tokens > Magic Values: KEINE Pixel/Hex direkt in Component-CSS
     - Single Source of Truth: jeder Wert wird genau einmal definiert
     - Semantik > Wert: Tokens heißen nach Bedeutung (--color-text,
       --color-border), nicht nach Farbwert (--gray-500). Macht Sub-Brand-
       Override mit einem einzigen Wert möglich.
     - Mobile-First: Responsive Token-Overrides verkleinern bei kleineren
       Viewports automatisch die Schriftgrößen + Container-Padding.
     - Accessibility-Default: 44px Touch-Targets, prefers-reduced-motion
       respektiert, WCAG-AA-Kontrast für Default-Tokens
   ========================================================================== */

   :root {
    /* ============================================================
       1. FARB-TOKENS
       ============================================================ */
  
    /* --- Primärfarbe (Brand-Akzent) --------------------------------
       Wird genutzt für: Links, CTAs, Akzent-Elemente, Highlights.
       Vier Stufen geben gestalterische Flexibilität:
         primary          - Default-Hintergrund / Text-Akzent
         primary-hover    - Button-Hover-State (eine Stufe dunkler)
         primary-dark     - WCAG-AA-Kombination mit weißer Schrift
         primary-light    - Background-Tints, Badge-BG, Highlight-Underline
       Sub-Brands ersetzen NUR diese vier Werte für Re-Branding. */
    --color-primary: #10B981;        /* Emerald-500 */
    --color-primary-hover: #059669;  /* Emerald-600 */
    --color-primary-dark: #047857;   /* Emerald-700 (AA-safe mit white) */
    --color-primary-light: #D1FAE5;  /* Emerald-100 */
  
    /* --- Sekundärfarbe (dunkle Bühne) ----------------------------------
       Wird genutzt für: Footer, dunkle Hero-Sections, Code-Blöcke.
       Bietet Kontrast-Bühne für die Primärfarbe. */
    --color-secondary: #1E293B;       /* Slate-800 */
    --color-secondary-light: #334155; /* Slate-700 */
    --color-secondary-dark: #0F172A;  /* Slate-900 */
  
    /* --- Neutrale Hintergründe & Oberflächen ------------------------- */
    --color-background: #FFFFFF;       /* Hauptseitenhintergrund */
    --color-background-alt: #F8FAFC;   /* Section-Background-Alternativ */
    --color-surface: #FFFFFF;          /* Card-Background */
  
    /* --- Text-Hierarchie -------------------------------------------- */
    --color-text: #1E293B;             /* Default-Text (4.5+ AA contrast) */
    --color-text-secondary: #64748B;   /* Lead, Beschreibungen */
    --color-text-muted: #94A3B8;       /* Captions, Footer-Text */
    --color-text-inverse: #FFFFFF;     /* Text auf dunklem Hintergrund */
  
    /* --- Borders ---------------------------------------------------- */
    --color-border: #E2E8F0;           /* Default-Border (Cards, Inputs) */
    --color-border-light: #F1F5F9;     /* Subtile Trennlinien */
  
    /* --- Status-Farben (Feedback, Forms) ---------------------------- */
    --color-success: #10B981;          /* Same as primary by default */
    --color-warning: #F59E0B;
    --color-error: #EF4444;
  
    /* --- Akzent-Farben (für Highlights, Charts, Tags) --------------- */
    --color-accent-purple: #8B5CF6;
    --color-accent-blue: #3B82F6;
  
    /* ============================================================
       2. TYPOGRAPHIE
       ============================================================ */
  
    /* Inter ist die Default-Schrift. Self-host empfohlen (Performance +
       Privacy). Bei Sub-Brands gerne überschreiben. */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  
    /* Schriftgrößen (Modular Scale 1.25, base = 1rem = 16px).
       Werden auf kleineren Viewports automatisch verkleinert (siehe Media
       Queries am Ende). */
    --text-xs: 0.75rem;     /* 12px – Captions, Labels */
    --text-sm: 0.875rem;    /* 14px – Sekundär-Text */
    --text-base: 1rem;      /* 16px – Body-Default; ≥16 verhindert iOS-Zoom */
    --text-lg: 1.125rem;    /* 18px – Lead, Subtitle */
    --text-xl: 1.25rem;     /* 20px – Card-Titles, Footer-Headings */
    --text-2xl: 1.5rem;     /* 24px – Section-Subheadings, Article H2 */
    --text-3xl: 1.875rem;   /* 30px – Inline-H1 auf Mobile */
    --text-4xl: 2.25rem;    /* 36px – Page-Titles */
    --text-5xl: 3rem;       /* 48px – Hero-Headlines */
    --text-6xl: 3.75rem;    /* 60px – Display, Spezial-Hero */
  
    /* Line-Height pro Use-Case */
    --leading-tight: 1.25;   /* Headings */
    --leading-normal: 1.5;   /* Body */
    --leading-relaxed: 1.625;/* Long-form Editorial */
  
    /* Font-Weights — von Inter unterstützt */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;
  
    /* ============================================================
       3. SPACING (Vielfaches von 0.25rem = 4px)
       ============================================================ */
    --spacing-1: 0.25rem;   /*  4px */
    --spacing-2: 0.5rem;    /*  8px */
    --spacing-3: 0.75rem;   /* 12px */
    --spacing-4: 1rem;      /* 16px – Standard-Gap */
    --spacing-5: 1.25rem;   /* 20px */
    --spacing-6: 1.5rem;    /* 24px – Card-Padding */
    --spacing-8: 2rem;      /* 32px */
    --spacing-10: 2.5rem;   /* 40px */
    --spacing-12: 3rem;     /* 48px – Section-Innenabstand */
    --spacing-16: 4rem;     /* 64px */
    --spacing-20: 5rem;     /* 80px – Section-Padding-Y */
    --spacing-24: 6rem;     /* 96px */
  
    /* ============================================================
       4. LAYOUT-MASSE
       ============================================================ */
    --container-max: 1200px;
    --container-padding: 1.5rem;     /* 24px – verkleinert auf Mobile */
    --header-height: 72px;           /* Sticky-Header-Offset für Anker */
  
    /* ============================================================
       5. RADIEN & SCHATTEN
       ============================================================ */
    --border-radius-sm: 0.375rem;    /*  6px – Inputs, kleine Buttons */
    --border-radius-md: 0.5rem;      /*  8px – Default-Buttons */
    --border-radius-lg: 0.75rem;     /* 12px – Cards, große CTAs */
    --border-radius-xl: 1rem;        /* 16px – Hero-Cards */
    --border-radius-full: 9999px;    /* Pills, runde Buttons */
  
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
    /* ============================================================
       6. TRANSITIONS
       ============================================================ */
    --transition-fast: 150ms ease;    /* Hover-States */
    --transition-normal: 200ms ease;  /* Default */
    --transition-slow: 300ms ease;    /* Größere Layout-Shifts */
  
    /* ============================================================
       7. TOUCH-TARGETS (WCAG AAA / iOS HIG / Android Material)
       ============================================================ */
    --touch-target-min: 44px;
  }
  
  /* ==========================================================================
     RESET & BASIC TYPOGRAPHY
     Minimale Reset-Schicht. Bewusst NICHT Tailwind-Preflight oder Eric Meyer —
     wir kollidieren sonst mit User-Agent-Defaults für Forms.
     ========================================================================== */
  
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }
  
  body, h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote, dl, dd {
    margin: 0;
  }
  
  ul, ol {
    padding: 0;
    list-style: none;
  }
  
  img,
  picture,
  video,
  canvas,
  svg {
    display: block;
    max-width: 100%;
  }
  
  input,
  button,
  textarea,
  select {
    font: inherit;
  }
  
  a {
    color: inherit;
    text-decoration: none;
  }
  
  button {
    cursor: pointer;
    border: none;
    background: none;
  }
  
  html {
    scroll-behavior: smooth;
  }
  
  body {
    font-family: var(--font-family);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--color-text);
    background-color: var(--color-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  
  h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
  }
  
  h1 {
    letter-spacing: -0.02em;
  }
  
  h2, h3 {
    letter-spacing: -0.01em;
  }
  
  /* prefers-reduced-motion respektieren — globale Regel */
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
  }
  
  /* ==========================================================================
     UTILITY CLASSES
     ========================================================================== */
  
  /* Container — zentriert + responsive Padding. */
  .container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
  }
  
  /* Screen-Reader-Only — visuell versteckt, für a11y-Texte. */
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
  }
  
  /* ==========================================================================
     BUTTONS
     Verwendung: <a class="btn btn--primary">Text</a>
                <button class="btn btn--secondary btn--lg">Text</button>
     ========================================================================== */
  
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2);
    padding: var(--spacing-3) var(--spacing-6);
    /* Touch-Target ≥ 44 px */
    min-height: var(--touch-target-min);
    font-weight: var(--font-semibold);
    font-size: var(--text-base);
    border-radius: var(--border-radius-md);
    transition: all var(--transition-normal);
    text-decoration: none;
  }
  
  .btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
  }
  
  @media (prefers-reduced-motion: reduce) {
    .btn { transition: none; }
  }
  
  .btn--primary {
    background-color: var(--color-primary);
    color: var(--color-text-inverse);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
  }
  
  .btn--primary:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
  }
  
  @media (prefers-reduced-motion: reduce) {
    .btn--primary:hover { transform: none; }
  }
  
  .btn--secondary {
    background-color: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border);
  }
  
  .btn--secondary:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
  }
  
  .btn--outline-primary {
    background-color: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
  }
  
  .btn--outline-primary:hover {
    background-color: var(--color-primary);
    color: var(--color-text-inverse);
  }
  
  /* Auf dunklem Background (z.B. .section--dark) */
  .btn--white {
    background-color: var(--color-background);
    color: var(--color-primary);
  }
  
  .btn--white:hover {
    background-color: var(--color-background-alt);
    transform: translateY(-1px);
  }
  
  .btn--outline-white {
    background-color: transparent;
    color: var(--color-text-inverse);
    border: 2px solid var(--color-text-inverse);
  }
  
  .btn--outline-white:hover {
    background-color: rgba(255, 255, 255, 0.1);
  }
  
  /* Größen-Modifier */
  .btn--lg {
    padding: var(--spacing-4) var(--spacing-8);
    font-size: var(--text-lg);
  }
  
  .btn:disabled,
  .btn[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
  }
  
  /* ==========================================================================
     SECTIONS
     Verwendung: <section class="section section--alt">
                  <div class="container">
                    <div class="section__header">
                      <h2 class="section__title">Title</h2>
                      <p class="section__subtitle">Subtitle</p>
                    </div>
                    ... Inhalt ...
                  </div>
                </section>
     ========================================================================== */
  
  .section {
    padding: var(--spacing-20) 0;
  }
  
  .section--alt {
    background-color: var(--color-background-alt);
  }
  
  .section--dark {
    background-color: var(--color-secondary);
    color: var(--color-text-inverse);
  }
  
  .section__header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto var(--spacing-12);
  }
  
  .section__title {
    font-size: var(--text-4xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--spacing-4);
  }
  
  .section__subtitle {
    font-size: var(--text-lg);
    color: var(--color-text-secondary);
  }
  
  .section--dark .section__subtitle {
    color: var(--color-text-muted);
  }
  
  /* ==========================================================================
     CARDS
     Verwendung: <article class="card">...</article>
     ========================================================================== */
  
  .card {
    background-color: var(--color-surface);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-8);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border-light);
    transition: all var(--transition-normal);
  }
  
  .card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: transparent;
  }
  
  @media (prefers-reduced-motion: reduce) {
    .card { transition: none; }
    .card:hover { transform: none; }
  }
  
  /* ==========================================================================
     FORM-INPUTS
     ========================================================================== */
  
  .input {
    width: 100%;
    padding: var(--spacing-3) var(--spacing-4);
    /* iOS-Zoom-Prevention: ≥ 16 px */
    font-size: var(--text-base);
    /* Touch-Target ≥ 44 px */
    min-height: var(--touch-target-min);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    background: var(--color-background);
    color: var(--color-text);
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
  }
  
  .input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
  }
  
  .input::placeholder {
    color: var(--color-text-muted);
  }
  
  /* ==========================================================================
     BADGES
     Verwendung: <span class="badge">Label</span>
     ========================================================================== */
  
  .badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2);
    padding: var(--spacing-1) var(--spacing-3);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    border-radius: var(--border-radius-full);
    background-color: var(--color-primary-light);
    color: var(--color-primary-dark);
  }
  
  /* ==========================================================================
     SKIP-LINK (a11y)
     Sichtbar nur bei Tab-Fokus. <a href="#main" class="skip-link">Zum Inhalt</a>
     ========================================================================== */
  
  .skip-link {
    position: absolute;
    top: 0;
    left: 0;
    padding: var(--spacing-3) var(--spacing-4);
    background: var(--color-primary);
    color: var(--color-text-inverse);
    font-weight: var(--font-semibold);
    z-index: 9999;
    transform: translateY(-100%);
    transition: transform var(--transition-fast);
  }
  
  .skip-link:focus {
    transform: translateY(0);
  }
  
  /* ==========================================================================
     ANIMATIONEN
     Scroll-Triggered: Klasse `fade-in` setzen, IntersectionObserver fügt
     `.visible` hinzu wenn Element in den Viewport kommt.
     ========================================================================== */
  
  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .animate-fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
  }
  
  .fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }
  
  .fade-in.visible {
    opacity: 1;
    transform: translateY(0);
  }
  
  /* Stagger-Delays für Listen mit mehreren .fade-in Children */
  .stagger-children > *:nth-child(1) { transition-delay: 0.1s; }
  .stagger-children > *:nth-child(2) { transition-delay: 0.2s; }
  .stagger-children > *:nth-child(3) { transition-delay: 0.3s; }
  .stagger-children > *:nth-child(4) { transition-delay: 0.4s; }
  .stagger-children > *:nth-child(5) { transition-delay: 0.5s; }
  .stagger-children > *:nth-child(6) { transition-delay: 0.6s; }
  
  @media (prefers-reduced-motion: reduce) {
    .fade-in,
    .animate-fade-in-up {
      opacity: 1;
      transform: none;
      transition: none;
      animation: none;
    }
  }
  
  /* ==========================================================================
     RESPONSIVE TOKEN-OVERRIDES
     Verkleinert Schriftgrößen + Padding auf kleineren Viewports.
     Funktioniert automatisch für alle Komponenten, die var(--text-X) nutzen.
     ========================================================================== */
  
  @media (max-width: 1024px) {
    :root {
      --text-5xl: 2.5rem;
      --text-6xl: 3rem;
    }
  }
  
  @media (max-width: 768px) {
    :root {
      --text-4xl: 1.875rem;
      --text-5xl: 2.25rem;
      --text-6xl: 2.5rem;
      --container-padding: 1rem;
    }
  
    .section {
      padding: var(--spacing-16) 0;
    }
  
    .section__title {
      font-size: var(--text-3xl);
    }
  }
  
  @media (max-width: 640px) {
    :root {
      --text-3xl: 1.5rem;
      --text-4xl: 1.75rem;
    }
  }
  
  /* ==========================================================================
     DARK-MODE-VORBEREITUNG (DEAKTIVIERT — bei Bedarf einkommentieren)
     ==========================================================================
     Schaltet alle Hintergrund-/Text-Tokens basierend auf dem System-Setting
     um. Markenfarbe (--color-primary) bleibt unverändert; nur die neutralen
     Tokens werden invertiert.
  
     ACHTUNG: Vor Aktivierung jede Komponente einmal in Dark Mode
     sichtprüfen — Schatten, Borders und Hover-States brauchen oft
     explizite Anpassungen.
     --------------------------------------------------------------------------
  @media (prefers-color-scheme: dark) {
    :root {
      --color-background: #0F172A;
      --color-background-alt: #1E293B;
      --color-surface: #1E293B;
  
      --color-text: #F1F5F9;
      --color-text-secondary: #CBD5E1;
      --color-text-muted: #94A3B8;
      --color-text-inverse: #0F172A;
  
      --color-border: #334155;
      --color-border-light: #1E293B;
  
      --color-primary-light: #064E3B;
    }
  }
     ========================================================================== */
  