/* ==========================================================================
   Wartungsseite · Stylesheet
   Responsive Breakpoints:
     - Mobile:   bis 640px
     - Tablet:   641px – 1024px
     - Desktop:  ab 1025px
   ========================================================================== */

/* ----- Design Tokens ----- */
:root {
  /* Farben */
  --bg: #0a0e1a;
  --bg-soft: #111827;
  --fg: #f0f4ff;
  --fg-dim: #8b94a8;
  --accent: #ffb84d;
  --accent-glow: rgba(255, 184, 77, 0.25);
  --success: #4ade80;
  --grid: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --surface: rgba(255, 255, 255, 0.02);

  /* Typografie */
  --font-display: 'Fraunces', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Abstände (Mobile-First) */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;

  /* Größen */
  --gear-size: 160px;
  --grid-size: 40px;
  --glow-size: 500px;
  --max-width: 640px;
}

/* ----- Reset ----- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-display);
  font-feature-settings: 'ss01', 'ss02';
  position: relative;
  display: grid;
  place-items: center;
  padding: var(--space-md);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ----- Hintergrund-Effekte ----- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  pointer-events: none;
  animation: gridDrift 60s linear infinite;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  width: var(--glow-size);
  height: var(--glow-size);
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: pulse 6s ease-in-out infinite;
  z-index: 0;
}

/* ----- Stage / Hauptcontainer ----- */
.stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: var(--max-width);
  width: 100%;
}

/* ----- Brand / Logo ----- */
.brand {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: var(--space-lg);
  opacity: 0;
  animation: fadeInUp 0.8s ease-out 0.2s forwards;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent);
  animation: blink 2s ease-in-out infinite;
  flex-shrink: 0;
}

/* ----- Zahnräder ----- */
.gears {
  position: relative;
  width: var(--gear-size);
  height: var(--gear-size);
  margin-bottom: var(--space-lg);
  opacity: 0;
  animation: fadeInScale 1s ease-out 0.4s forwards;
}

.gear {
  position: absolute;
  fill: none;
  stroke: var(--fg);
  stroke-width: 1.5;
}

.gear-1 {
  width: 65%;
  height: 65%;
  top: 0;
  left: 0;
  animation: spin 8s linear infinite;
  stroke: var(--accent);
}

.gear-2 {
  width: 45%;
  height: 45%;
  bottom: 5%;
  right: 5%;
  animation: spinReverse 6s linear infinite;
  opacity: 0.6;
}

.gear-3 {
  width: 30%;
  height: 30%;
  top: 35%;
  right: 25%;
  animation: spin 4s linear infinite;
  opacity: 0.4;
}

/* ----- Headline ----- */
h1 {
  font-size: clamp(2rem, 7vw, 4.5rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-md);
  opacity: 0;
  animation: fadeInUp 0.8s ease-out 0.6s forwards;
}

h1 strong {
  /* font-style: italic; */
  font-weight: 500;
  color: var(--accent);
  position: relative;
  display: inline-block;
}

h1 em::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  animation: underline 1.2s ease-out 1.4s forwards;
}

/* ----- Subline ----- */
.subline {
  font-size: 1rem;
  color: var(--fg-dim);
  line-height: 1.65;
  max-width: 480px;
  margin-bottom: var(--space-xl);
  opacity: 0;
  animation: fadeInUp 0.8s ease-out 0.8s forwards;
  padding: 0 var(--space-sm);
}

/* ----- Status-Block ----- */
.status {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  animation: fadeInUp 0.8s ease-out 1s forwards;
  width: 100%;
  max-width: 100%;
}

.status-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: left;
}

.status-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.status-value {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.live-indicator {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
  animation: blink 1.5s ease-in-out infinite;
  flex-shrink: 0;
}

/* ----- Kontakt-Footer ----- */
.contact {
  position: fixed;
  bottom: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--fg-dim);
  z-index: 2;
  opacity: 0;
  animation: fadeIn 1s ease-out 1.4s forwards;
  text-align: center;
  padding: 0 var(--space-sm);
  white-space: nowrap;
}

.contact a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed var(--accent);
  padding-bottom: 1px;
  transition: opacity 0.2s ease;
}

.contact a:hover,
.contact a:focus {
  opacity: 0.7;
}

/* ==========================================================================
   Animationen
   ========================================================================== */

@keyframes gridDrift {
  to { background-position: var(--grid-size) var(--grid-size); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.7; transform: translate(-50%, -50%) scale(1.15); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes spinReverse {
  to { transform: rotate(-360deg); }
}

@keyframes underline {
  to { transform: scaleX(1); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

/* ==========================================================================
   Responsive · Tablet (ab 641px)
   ========================================================================== */

@media (min-width: 641px) {
  :root {
    --gear-size: 180px;
    --grid-size: 50px;
    --glow-size: 650px;
    --space-md: 2rem;
    --space-lg: 2.5rem;
    --space-xl: 3.5rem;
  }

  body {
    padding: var(--space-lg);
  }

  .brand {
    font-size: 0.75rem;
    letter-spacing: 0.32em;
  }

  .subline {
    font-size: 1.0625rem;
    padding: 0;
  }

  .status {
    flex-direction: row;
    justify-content: center;
    gap: var(--space-lg);
    padding: 1.125rem 1.75rem;
    width: auto;
  }

  .status-value {
    font-size: 0.95rem;
  }

  .contact {
    font-size: 0.75rem;
  }
}

/* ==========================================================================
   Responsive · Desktop (ab 1025px)
   ========================================================================== */

@media (min-width: 1025px) {
  :root {
    --gear-size: 200px;
    --grid-size: 60px;
    --glow-size: 800px;
    --max-width: 720px;
  }

  .brand {
    font-size: 0.75rem;
    letter-spacing: 0.35em;
    margin-bottom: 3rem;
  }

  .subline {
    font-size: 1.125rem;
    max-width: 520px;
  }

  .status {
    gap: 2.5rem;
    padding: 1.25rem 2rem;
  }

  .status-value {
    font-size: 0.95rem;
  }

  .contact {
    bottom: 2rem;
  }
}

/* ==========================================================================
   Responsive · Große Bildschirme (ab 1440px)
   ========================================================================== */

@media (min-width: 1440px) {
  :root {
    --gear-size: 220px;
    --max-width: 780px;
  }
}

/* ==========================================================================
   Sonderfälle
   ========================================================================== */

/* Querformat auf Smartphones: Layout kompakter */
@media (max-height: 600px) and (orientation: landscape) {
  :root {
    --gear-size: 110px;
    --space-lg: 1rem;
    --space-xl: 1.5rem;
  }

  html, body {
    overflow: auto;
  }

  body {
    align-items: flex-start;
    padding-top: var(--space-md);
  }

  .gears {
    margin-bottom: var(--space-md);
  }

  h1 {
    font-size: clamp(1.75rem, 5vw, 3rem);
    margin-bottom: var(--space-sm);
  }

  .subline {
    margin-bottom: var(--space-md);
  }

  .contact {
    position: static;
    transform: none;
    margin-top: var(--space-md);
  }
}

/* Reduzierte Bewegung respektieren (Accessibility) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .gear-1,
  .gear-2,
  .gear-3,
  .brand-dot,
  .live-indicator {
    animation: none !important;
  }

  body::before,
  body::after {
    animation: none !important;
  }
}

/* Optional: Light Mode (falls Browser/OS hell eingestellt) */
@media (prefers-color-scheme: light) {
  :root {
    /* Auskommentiert: Wartungsseite bleibt dark by design.
       Bei Bedarf einkommentieren:
    --bg: #f8f9fc;
    --bg-soft: #ffffff;
    --fg: #0a0e1a;
    --fg-dim: #6b7280;
    --grid: rgba(0, 0, 0, 0.04);
    --border: rgba(0, 0, 0, 0.08);
    --surface: rgba(0, 0, 0, 0.02);
    */
  }
}

/* Hochauflösende Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .gear {
    stroke-width: 1.25;
  }
}
