/* ============================================
   TwoHandz – Design System
   Farbpalette: Lila / Türkis, harmonisch abgestimmt
   ============================================ */

:root {
  /* Hauptfarben */
  --purple-900: #2b1055;
  --purple-700: #5b2a8c;
  --purple-500: #7c3aed;
  --teal-500:   #14b8a6;
  --teal-400:   #2dd4bf;
  --teal-300:   #5eead4;

  /* Neutrale, abgestimmte Töne */
  --bg:          #0f0a1e;
  --bg-soft:     #171128;
  --surface:     #1d1535;
  --surface-2:   #251b42;
  --border:      #34284f;
  --text:        #ECE9F5;
  --text-muted:  #A99FC4;

  /* Verläufe */
  --grad-main:   linear-gradient(135deg, #7c3aed 0%, #14b8a6 100%);
  --grad-soft:   linear-gradient(135deg, rgba(124,58,237,0.18) 0%, rgba(20,184,166,0.18) 100%);
  --grad-text:   linear-gradient(120deg, #c4b5fd 0%, #5eead4 100%);

  /* Radius – leicht abgerundet, nicht zu rund */
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;

  /* Schatten */
  --shadow:    0 10px 30px rgba(0,0,0,0.35);
  --shadow-lg: 0 20px 50px rgba(124,58,237,0.25);

  --maxw: 1140px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image:
    radial-gradient(900px circle at 10% -10%, rgba(124,58,237,0.20), transparent 45%),
    radial-gradient(900px circle at 100% 0%, rgba(20,184,166,0.16), transparent 45%);
}

a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15,10,30,0.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links {
  display: flex;
  gap: 8px;
  list-style: none;
  align-items: center;
}

.nav-links a {
  display: inline-block;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: color .2s ease, background .2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: var(--grad-soft);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1.3rem;
  padding: 4px 12px;
  cursor: pointer;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.4px;
  cursor: pointer;
  border: none;
  transition: transform .15s ease, box-shadow .2s ease, opacity .2s ease;
}

.btn-primary {
  background: var(--grad-main);
  color: #fff;
  box-shadow: 0 6px 18px rgba(124,58,237,0.35);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover { background: var(--surface-2); border-color: var(--purple-500); }

/* ============================================
   HERO
   ============================================ */
.hero {
  padding: 90px 0 40px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 18px;
}

.hero h1 .grad {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 28px;
  font-size: 1.08rem;
}

.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ============================================
   SECTION HEADINGS
   ============================================ */
.section { padding: 60px 0; }

.section-title {
  text-align: center;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.section-sub {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 44px;
}

.title-underline {
  width: 72px;
  height: 4px;
  margin: 14px auto 0;
  border-radius: 4px;
  background: var(--grad-main);
}

/* ============================================
   PROJECT GRID + CARDS
   ============================================ */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, box-shadow .25s ease, border-color .2s ease;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--purple-500);
}

.card-img {
  aspect-ratio: 16 / 10;
  width: 100%;
  object-fit: cover;
  display: block;
  background: var(--grad-soft);
}

.card-body { padding: 22px; display: flex; flex-direction: column; gap: 12px; flex: 1; }

.card-title { font-size: 1.25rem; font-weight: 600; }

.card-desc { color: var(--text-muted); font-size: 0.95rem; flex: 1; }

.card .btn { align-self: flex-start; margin-top: 6px; }

/* ============================================
   ABOUT / CONTENT PAGES
   ============================================ */
.page-head {
  padding: 70px 0 30px;
  text-align: center;
}

.page-head h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
}

.page-head h1 .grad {
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.content {
  max-width: 820px;
  margin: 0 auto;
  padding: 20px 0 70px;
}

.content h2 { margin: 32px 0 12px; font-size: 1.4rem; }
.content p  { color: var(--text-muted); margin-bottom: 14px; }

.prose-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 34px;
}

/* ============================================
   PAGE TRANSITIONS (Seiten-Übergänge)
   ============================================ */
main.page {
  animation: pageIn .4s cubic-bezier(.22,.61,.36,1) both;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

body.is-leaving main.page {
  animation: pageOut .22s ease forwards;
}

@keyframes pageOut {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(-10px); }
}

@media (prefers-reduced-motion: reduce) {
  main.page,
  body.is-leaving main.page { animation: none; }
}

/* ============================================
   PROJEKT-DETAIL: GALERIE MIT HOVER-ZOOM
   ============================================ */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 6px 0 38px;
}

.gallery figure {
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: zoom-in;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}

.gallery figure:hover {
  transform: scale(1.35);
  z-index: 5;
  position: relative;
  box-shadow: var(--shadow-lg);
  border-color: var(--purple-500);
}

.gallery img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.detail-actions {
  text-align: center;
  margin-top: 34px;
}

@media (max-width: 640px) {
  .gallery { grid-template-columns: 1fr; max-width: 380px; margin: 0 auto 30px; }
  .gallery figure:hover { transform: scale(1.05); }
}

/* ============================================
   SERVICES / STATUS-SEITE
   ============================================ */
.services-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.legend {
  display: flex;
  gap: 20px;
  list-style: none;
  flex-wrap: wrap;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.services-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.last-checked { color: var(--text-muted); font-size: 0.85rem; }

.service-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }

.service-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: border-color .2s ease, transform .15s ease;
}

.service-item:hover { border-color: var(--purple-500); transform: translateX(2px); }

.service-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }

.service-name { font-weight: 600; font-size: 1.05rem; }

.service-address { font-size: 0.9rem; color: var(--text-muted); word-break: break-all; }
.service-address a { color: var(--teal-300); }
.service-address a:hover { text-decoration: underline; }

.service-type {
  font-size: 0.75rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

.service-status {
  font-size: 0.85rem;
  font-weight: 500;
  min-width: 150px;
  text-align: right;
  color: var(--text-muted);
}

.service-status.online      { color: #34d399; }
.service-status.offline     { color: #f87171; }
.service-status.maintenance { color: #fbbf24; }

.service-empty {
  color: var(--text-muted);
  text-align: center;
  padding: 30px 0;
}

/* Statuspunkt */
.status-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #6b7280;
  flex-shrink: 0;
  display: inline-block;
}

/* Innerer Kreis (Farbe) + statischer äußerer Ring (--ring) je Status */
.status-dot.online      { background: #22c55e; --ring: rgba(34,197,94,0.55);  box-shadow: 0 0 0 3px var(--ring); }
.status-dot.maintenance { background: #f59e0b; --ring: rgba(245,158,11,0.60); box-shadow: 0 0 0 3px var(--ring); }
.status-dot.offline     { background: #ef4444; --ring: rgba(239,68,68,0.55);  box-shadow: 0 0 0 3px var(--ring); }
.status-dot.checking    { background: #9ca3af; animation: dotPulse 1s ease-in-out infinite; }

/* Nur in der LISTE: äußerer Ring faded im 2-Sekunden-Takt raus und rein
   (Legende bleibt statisch). */
.service-item .status-dot.online,
.service-item .status-dot.maintenance,
.service-item .status-dot.offline {
  animation: ringFade 2s ease-in-out infinite;
}

@keyframes ringFade {
  0%, 100% { box-shadow: 0 0 0 3px var(--ring); }
  50%      { box-shadow: 0 0 0 3px transparent; }
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* Reduzierte Bewegung: kein Faden, Ring bleibt ruhig stehen */
@media (prefers-reduced-motion: reduce) {
  .service-item .status-dot.online,
  .service-item .status-dot.maintenance,
  .service-item .status-dot.offline,
  .status-dot.checking { animation: none; }
}

@media (max-width: 600px) {
  .service-item { flex-wrap: wrap; }
  .service-type { order: 3; }
  .service-status { min-width: 0; text-align: left; flex: 1; }
}

/* ============================================
   AUTH (Login / Dashboard)
   ============================================ */
.auth-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 60px 0 40px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 34px;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  font-size: 1.7rem;
  text-align: center;
  margin-bottom: 4px;
}

.auth-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.field input:focus {
  outline: none;
  border-color: var(--purple-500);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.25);
}

.auth-card .btn { width: 100%; margin-top: 6px; }

.auth-error {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.40);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 18px;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 30px 0;
}

.footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links { display: flex; gap: 22px; list-style: none; }

.footer-links a { color: var(--text-muted); font-size: 0.92rem; transition: color .2s; }
.footer-links a:hover { color: var(--teal-300); }

.copyright { color: var(--text-muted); font-size: 0.9rem; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 860px) {
  .project-grid { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }
}

@media (max-width: 680px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 72px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(15,10,30,0.97);
    border-bottom: 1px solid var(--border);
    padding: 8px 16px 16px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; border-radius: var(--radius-sm); }
  .footer .container { flex-direction: column; text-align: center; }
}
