/* ===== OPTIMIZED INDEX.CSS v3.1 ===== */

/* Import Components */
@import './components/card.css';
@import '../components/particles/three-earth.css';

/* ===== ACCESSIBILITY & UTILITIES ===== */

/* Screen Reader Only / Visually Hidden */
.sr-only,
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Skip-to-main-content link (visible on focus for keyboard users) */
.skip-link:focus {
  position: fixed !important;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100000;
  width: auto !important;
  height: auto !important;
  padding: 0.75rem 1.5rem;
  margin: 0 !important;
  clip-path: none !important;
  white-space: normal !important;
  background: var(--primary-color, #0077ff);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Utility: Hide element completely */
.hidden {
  display: none !important;
}

/* Focus Indicators for all interactive elements */
button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
  box-shadow: 0 0 0 4px
    color-mix(in srgb, var(--primary-color) 55%, transparent);
  background: rgb(0 119 255 / 12%);
  border-radius: 6px;
  transition:
    box-shadow 0.15s,
    outline-color 0.15s;
}

/* ===== END ACCESSIBILITY & UTILITIES ===== */

/* ===== BUTTON STYLES (with CSS Nesting) ===== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base),
    background-color var(--transition-base);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  min-width: 160px;
  text-align: center;

  /* Primary variant */
  &.btn-primary {
    background: linear-gradient(
      135deg,
      var(--primary-color),
      var(--primary-dark)
    );
    color: #fff;
    box-shadow: 0 0 12px rgb(9 139 255 / 30%);

    &:hover {
      box-shadow: 0 0 18px rgb(9 139 255 / 55%);
      transform: var(--transform-lift-sm);

      &::before {
        left: 100%;
      }
    }

    &::before {
      content: '';
      position: absolute;
      top: 0;
      left: -100%;
      width: 100%;
      height: 100%;
      background: rgb(255 255 255 / 20%);
      transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      pointer-events: none;
    }
  }

  /* Secondary variant */
  &.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--primary-color);

    &:hover {
      border-color: var(--primary-color);
      color: var(--primary-color);
    }
  }

  /* Mobile adjustments */
  @media (width <= 480px) {
    min-width: 120px;
  }
}

/* ===== END BUTTON STYLES ===== */

/* ===== LAYOUT & SECTIONS ===== */

main {
  margin-top: 0 !important;
  padding: 0 !important;
  /* Inhalt zwischen Menü und Footer */
  min-height: calc(
    100vh - var(--content-top-offset) - var(--content-bottom-offset)
  );
}

.section {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  min-height: calc(
    100vh - var(--content-top-offset) - var(--content-bottom-offset)
  );
  height: calc(
    100vh - var(--content-top-offset) - var(--content-bottom-offset)
  );
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Optimierung: content-visibility nur wenn unterstützt */
@supports (content-visibility: auto) {
  .section {
    /* OPTIMIZATION: content-visibility allows browser to skip rendering work for off-screen sections */
    content-visibility: auto;
    /* Fallback size estimation to prevent scrollbar jumping */
    contain-intrinsic-size: auto 100vh;
  }
}

@media (width <= 768px) {
  .section.features,
  .section.about {
    padding-block: clamp(2.5rem, 8vw, 3.5rem);
  }
}

/* ===== END LAYOUT & SECTIONS ===== */

/* ===== BASE STYLES ===== */

/* Base Styles */
html {
  height: 100%;
  overflow-y: scroll;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scroll-padding-top: var(--content-top-offset);
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  overflow: visible; /* Ensure body is not a scroll container */
  touch-action: pan-y;
  transition: padding-bottom var(--transition-base);
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures contextual;
  font-feature-settings:
    'kern' 1,
    'liga' 1,
    'calt' 1;
  font-family: var(--font-inter);
  background: var(--bg-primary);
  color: var(--text-primary);
  margin: 0;
  text-rendering: optimizelegibility;
  /* Safe-Area: Dynamischer Abstand für Menü und Footer */
  padding-top: var(--content-top-offset);
  padding-bottom: var(--content-bottom-offset);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

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

/* Container System */
.container {
  width: min(100%, var(--container-width));
  margin-inline: auto;
  padding-inline: max(clamp(0.5rem, 4vw, 1.5rem), var(--safe-left));
  box-sizing: border-box;
}

/* ===== END BASE STYLES ===== */

/* ===== TYPOGRAPHY ===== */

/* Section Headers */
.section-header {
  text-align: center;
  margin-bottom: clamp(1.75rem, 3vw, 2.5rem);
  margin-top: 0;
  padding: 0;
  position: relative;
  z-index: 2;
}

.section-title {
  position: relative;
  display: inline-block;
  font-size: clamp(1.5rem, 4.5vw, 2.5rem);
  margin-bottom: clamp(1rem, 2vw, 1.25rem);
  padding: 0;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, rgb(255 255 255 / 90%) 100%);
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(50px, 8vw, 70px);
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--primary-color) 0%,
    var(--primary-light) 50%,
    var(--primary-color) 100%
  );
  border-radius: var(--radius-full);
  box-shadow: 0 0 15px rgb(7 161 255 / 50%);
}

.section-subtitle {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  color: var(--text-secondary);
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
  font-weight: 400;
  line-height: 1.5;
  opacity: 0.9;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--spacing-md);
}

h1,
h2,
h3 {
  letter-spacing: -0.012em;
}

h4,
h5,
h6 {
  letter-spacing: -0.006em;
}

@supports (text-wrap: balance) {
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  .section-title {
    text-wrap: balance;
  }
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

h4 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
}

h5 {
  font-size: 1.125rem;
}

h6 {
  font-size: 1rem;
}

p {
  margin-bottom: var(--spacing-md);
  color: var(--text-secondary);
  line-height: 1.6;
  letter-spacing: 0.003em;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-light);
}

/* ===== END TYPOGRAPHY ===== */

/* ===== UTILITIES ===== */

/* Utilities */

.u-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-xs);
}

.u-inline-center {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-xs);
}

.u-stack {
  display: flex;
  flex-direction: column;
  gap: var(--gap-xs);
}

.u-row {
  display: flex;
  align-items: center;
  gap: var(--gap-xs);
}

.u-wrap {
  flex-wrap: wrap;
}

.u-between {
  justify-content: space-between;
}

.u-start {
  align-items: flex-start;
}

/* Responsive u-* utilities (lg breakpoint) */
@media (min-width: 1024px) {
  .lg\:u-row {
    display: flex;
    flex-direction: row;
    align-items: center;
  }

  .lg\:u-stack {
    display: flex;
    flex-direction: column;
  }

  .lg\:u-wrap {
    flex-wrap: wrap;
  }
}

/* ===== END UTILITIES ===== */

/* ===== GLOBAL COMPONENTS ===== */

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

/* ===== END GLOBAL COMPONENTS ===== */

/* ===== RESPONSIVE: MOBILE & TABLET ===== */

/* Tablet & Mobile: 768px and below */
@media (width <= 768px) {
  html {
    font-size: 15px;
  }

  .section {
    min-height: calc(
      100svh - var(--content-top-offset) - var(--content-bottom-offset)
    );
    height: calc(
      100svh - var(--content-top-offset) - var(--content-bottom-offset)
    );
    padding: var(--spacing-xl) 0;
  }

  @supports (min-height: 100dvh) {
    .section {
      min-height: calc(
        100dvh - var(--content-top-offset) - var(--content-bottom-offset)
      );
      height: calc(
        100dvh - var(--content-top-offset) - var(--content-bottom-offset)
      );
    }
  }
}

/* Mobile: 600px and below */
@media (width <= 600px) {
  .about-page main.container {
    padding-top: calc(48px + 20px);
  }

  h1 {
    font-size: 2.5rem;
  }

  .card {
    padding: 1.5rem;
  }
}

/* Mobile: 480px and below */
@media (width <= 480px) {
  .container {
    max-width: 100%;
    padding-inline: max(0.5rem, var(--safe-left));
  }

  .container p,
  .container h1,
  .container h2,
  .container h3,
  .container h4,
  .container h5,
  .container h6 {
    overflow-wrap: break-word;
    overflow-wrap: anywhere;
  }
}

/* Mobile: 375px and below */
@media (width <= 375px) {
  html {
    font-size: 14px;
  }

  .container {
    padding-inline: max(0.25rem, var(--safe-left));
  }

  .section {
    padding: var(--spacing-lg) 0;
    min-height: calc(100vh - 72px);
    height: calc(100vh - 72px);
  }
}

/* ===== END RESPONSIVE ===== */

/* ===== PRINT STYLES ===== */

@media print {
  body {
    color: black;
    background: white;
    font-size: 12pt;
  }

  .container {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
  }

  a {
    color: black;
    text-decoration: underline;
  }

  button,
  .btn {
    display: none;
  }

  * {
    animation: none;
    transition: none;
  }
}

/* ===== END PRINT STYLES ===== */
/**
 * Premium Loader Styles v2.1
 * Elegant, modern and performant
 * @last-modified 2026-02-05
 */
