/* ==========================================================================
   ENERSON – base.css
   CSS Reset · Design Tokens · Typography · Global Foundations
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. GOOGLE FONTS IMPORT
   -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
   2. CSS CUSTOM PROPERTIES – DESIGN TOKENS
   -------------------------------------------------------------------------- */

:root {

  /* Backgrounds */
  --bg-master:        #05070f;   /* Master – ALLE Animationsframes nutzen diesen Wert */
  --bg-primary:       #0b0a25;
  --bg-secondary:     #16214c;

  /* Accent */
  --accent:           #2670ed;
  --accent-dark:      #113769;
  --accent-glow:      #3a8cff;
  /* Akzent als TEXT-Farbe: --accent (#2670ed) erreicht nur 4.43:1 und fällt
     damit durch WCAG AA. Für Flächen/Rahmen/Icons bleibt --accent korrekt. */
  --accent-text:      #3a8cff;

  /* Text */
  --text-primary:     #e6e9f2;
  --text-secondary:   #9aa3b2;
  --text-muted:       #828b9d;   /* WCAG AA: 5.87:1 auf --bg-master (vorher #6b7385 = 4.23:1) */

  /* Glassmorphism */
  --glass-bg:         rgba(255, 255, 255, 0.04);
  --glass-border:     rgba(255, 255, 255, 0.08);
  --glass-blur:       12px;

  /* Fonts */
  --font-heading:     'Fira Sans', sans-serif;
  --font-body:        'Manrope', sans-serif;

  /* Spacing */
  --section-padding-y: clamp(60px, 10vw, 120px);
  --section-padding-x: clamp(20px, 5vw, 80px);
  --container-max:     1280px;

  /* Z-Index Scale */
  --z-base:    0;
  --z-content: 10;
  --z-canvas:  20;
  --z-overlay: 40;
  --z-nav:     100;
  --z-modal:   200;
  --z-toast:   300;

  /* Animation Durations */
  --duration-micro:   150ms;  /* Hover micro-interactions */
  --duration-enter:   800ms;  /* Element enter */
  --duration-exit:    500ms;  /* Element exit (~62% of enter) */

  /* Easing */
  --ease-out: cubic-bezier(0.215, 0.610, 0.355, 1.000);  /* power2.out equivalent */
  --ease-in:  cubic-bezier(0.550, 0.055, 0.675, 0.190);  /* power2.in  equivalent */
}


/* --------------------------------------------------------------------------
   3. CSS RESET – Modern, Minimal
   -------------------------------------------------------------------------- */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* clip prevents horizontal scroll without creating a scroll container
     (unlike hidden, which breaks position:sticky on children) */
  overflow-x: clip;
}

body {
  background-color: var(--bg-master);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  min-height: 100dvh;
}

/* Lists */
ul,
ol {
  list-style: none;
}

/* Links */
a {
  color: inherit;
  text-decoration: none;
}

/* Images & media */
img,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

/* Buttons & inputs */
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

button {
  cursor: pointer;
}

/* Tables */
table {
  border-collapse: collapse;
}

/* Headings – no default margin/weight from reset */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.15;
}


/* --------------------------------------------------------------------------
   3b. SKIP LINK – keyboard accessibility
   -------------------------------------------------------------------------- */

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  padding: 0.75rem 1.25rem;
  background-color: var(--accent);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0 0 6px 6px;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
}


/* --------------------------------------------------------------------------
   4. GLOBAL INTERACTION HELPERS
   -------------------------------------------------------------------------- */

/* Minimum touch target – all interactive elements */
a,
button,
[role="button"],
input,
select,
textarea,
label {
  touch-action: manipulation;
}

/* Pointer cursor on all interactive elements */
a,
button,
[role="button"],
label[for] {
  cursor: pointer;
}

/* Focus-visible ring – accessibility, never outline:none without replacement */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}


/* --------------------------------------------------------------------------
   5. TYPOGRAPHY – Base Scale
   -------------------------------------------------------------------------- */

/* Headings use Fira Sans */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-primary);
}

h1 {
  font-size: clamp(2.25rem, 5vw, 4rem);  /* 36px → 64px */
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.75rem); /* 28px → 44px */
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem); /* 20px → 28px */
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

h4 {
  font-size: clamp(1.05rem, 1.8vw, 1.375rem); /* 17px → 22px */
  font-weight: 500;
  line-height: 1.3;
}

/* Body text uses Manrope */
p {
  font-family: var(--font-body);
  font-size: clamp(0.9375rem, 1.1vw, 1.0625rem); /* 15px → 17px */
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* Inline elements */
strong, b {
  font-weight: 600;
  color: var(--text-primary);
}

em, i {
  font-style: italic;
}

small {
  font-size: 0.8125rem; /* 13px */
  color: var(--text-muted);
}

/* Lead / intro paragraph */
.lead {
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem); /* 17px → 20px */
  color: var(--text-secondary);
  line-height: 1.65;
}

/* Label / UI text */
.label {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Accent text – highlighted in brand blue */
.text-accent {
  color: var(--accent-text);
}

.text-muted {
  color: var(--text-muted);
}

.text-secondary {
  color: var(--text-secondary);
}


/* --------------------------------------------------------------------------
   6. LAYOUT HELPERS
   -------------------------------------------------------------------------- */

/* Section wrapper */
.section {
  padding-top: var(--section-padding-y);
  padding-bottom: var(--section-padding-y);
  padding-left: var(--section-padding-x);
  padding-right: var(--section-padding-x);
}

/* Container – max-width centered */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--section-padding-x);
  padding-right: var(--section-padding-x);
}

/* Full-bleed section with inner container */
.section-full {
  padding-top: var(--section-padding-y);
  padding-bottom: var(--section-padding-y);
}

/* Visually hidden – accessible screen-reader text */
.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;
}


/* --------------------------------------------------------------------------
   7. GLASSMORPHISM UTILITY
   -------------------------------------------------------------------------- */

.glass {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09),
              0 8px 32px rgba(5, 7, 15, 0.45);
  transition: border-color 200ms ease-out, box-shadow 200ms ease-out, transform 200ms ease-out;
}

.glass:hover {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18),
              inset 0 0 0 1px rgba(255, 255, 255, 0.06),
              0 12px 40px rgba(5, 7, 15, 0.55);
  transform: translateY(-2px);
}


/* --------------------------------------------------------------------------
   8. SELECTION STYLING
   -------------------------------------------------------------------------- */

::selection {
  background-color: var(--accent);
  color: var(--text-primary);
}

::-moz-selection {
  background-color: var(--accent);
  color: var(--text-primary);
}


/* --------------------------------------------------------------------------
   9. SCROLLBAR STYLING (Webkit)
   -------------------------------------------------------------------------- */

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-master);
}

::-webkit-scrollbar-thumb {
  background: var(--accent-dark);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}


/* --------------------------------------------------------------------------
   10. PREFERS-REDUCED-MOTION
   Override: disable all transitions and animations
   -------------------------------------------------------------------------- */

@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;
  }
}
