/* ============================================
   Digital Solidarity — Design System (base.css)
   ============================================ */

/* 1. CSS Reset
   ------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-b);
  font-weight: 400;
  line-height: 1.65;
  color: var(--text-1);
  background: var(--bg-0);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, picture, video, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--cyan);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

a:hover {
  color: var(--text-1);
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
}

button {
  cursor: pointer;
}

ul, ol {
  list-style: none;
}

/* 2. CSS Custom Properties
   ------------------------------------------ */
:root {
  /* Hintergruende */
  --bg-0:        #020810;
  --bg-1:        #040d1a;
  --bg-2:        #071428;
  --bg-card:     rgba(5,16,40,0.88);
  --bg-glass:    rgba(0,212,255,0.04);

  /* Primaerfarben */
  --cyan:        #00d4ff;
  --cyan-soft:   rgba(0,212,255,0.15);
  --cyan-glow:   rgba(0,212,255,0.35);
  --purple:      #7c3aed;
  --purple-soft: rgba(124,58,237,0.18);
  --pink:        #ec4899;
  --gold:        #f59e0b;
  --green:       #10b981;

  /* Text */
  --text-1:      #f0f8ff;
  --text-2:      #94a3b8;
  --text-3:      #475569;

  /* Borders */
  --border:      rgba(0,212,255,0.10);
  --border-md:   rgba(0,212,255,0.22);
  --border-hi:   rgba(0,212,255,0.45);

  /* Radien */
  --r-xl:        24px;
  --r-lg:        18px;
  --r-md:        12px;
  --r-sm:        8px;

  /* Typografie */
  --font-h:      'Orbitron', monospace;
  --font-b:      'DM Sans', sans-serif;

  /* Transitions */
  --ease:        cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --nav-h:       72px;
  --max-w:       1200px;
  --section-py:  100px;

  /* Enhanced Design Tokens */
  --purple-glow: rgba(124,58,237,0.35);
  --pink-soft:   rgba(236,72,153,0.12);
  --gradient-primary: linear-gradient(135deg, var(--cyan), var(--purple));
  --gradient-accent:  linear-gradient(135deg, var(--purple), var(--pink));
}

/* 3. Typografie
   ------------------------------------------ */
h1, h2, h3 {
  font-family: var(--font-h);
  color: var(--text-1);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

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

h2 {
  font-weight: 700;
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  margin-bottom: 1rem;
}

h3 {
  font-weight: 600;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  margin-bottom: 0.75rem;
}

h4, h5, h6 {
  font-family: var(--font-b);
  color: var(--text-1);
  font-weight: 600;
}

p {
  color: var(--text-2);
  margin-bottom: 1rem;
  font-size: 1rem;
  line-height: 1.65;
}

p:last-child {
  margin-bottom: 0;
}

.text-large {
  font-size: 1.15rem;
  font-weight: 300;
  line-height: 1.7;
}

/* 4. Utility Classes
   ------------------------------------------ */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 40px;
}

.section {
  padding: var(--section-py) 0;
  position: relative;
  background: rgba(2, 8, 16, 0.85);
}

.text-cyan   { color: var(--cyan); }
.text-gold   { color: var(--gold); }
.text-green  { color: var(--green); }
.text-purple { color: var(--purple); }
.text-muted  { color: var(--text-2); }

.glow-cyan {
  text-shadow: 0 0 30px rgba(0,212,255,0.6), 0 0 60px rgba(0,212,255,0.3);
}

.badge {
  display: inline-block;
  font-family: var(--font-b);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
  background:
    linear-gradient(135deg, rgba(0,212,255,0.12), rgba(124,58,237,0.08)),
    rgba(0,212,255,0.06);
  border: 1px solid rgba(0,212,255,0.18);
  padding: 8px 20px;
  border-radius: 50px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 0 20px rgba(0,212,255,0.06);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.text-center { text-align: center; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* 5. Komponenten
   ------------------------------------------ */

/* Section Gradient Mesh Backgrounds */
.section-mesh {
  position: relative;
}

.section-mesh::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
}

/* Section divider glow */
.section-divider {
  height: 1px;
  border: none;
  background: linear-gradient(90deg, transparent 5%, rgba(0,212,255,0.4) 30%, rgba(124,58,237,0.4) 70%, transparent 95%);
  margin: 0;
  box-shadow: 0 0 20px rgba(0,212,255,0.15), 0 0 40px rgba(0,212,255,0.05);
}

/* Alternating section backgrounds */
.section:nth-child(even) {
  background: rgba(2, 8, 16, 0.88);
}

.section:nth-child(odd) {
  background: rgba(4, 13, 26, 0.85);
}

/* Glassmorphism Card — Enhanced */
.card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.01) 30%, rgba(0,212,255,0.03) 100%),
    rgba(5,16,40,0.85);
  border: 1px solid rgba(0,212,255,0.15);
  border-top: 1px solid rgba(0,212,255,0.25);
  border-radius: var(--r-lg);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  padding: 32px;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 8px 32px rgba(0,0,0,0.3),
    0 0 0 1px rgba(255,255,255,0.04) inset,
    inset 0 1px 0 rgba(255,255,255,0.08);
  transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease), transform 0.4s var(--ease);
}

/* Gradient shimmer line at top of cards — skip form-cards with own ::after */
.card:not(.form-card)::after {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,212,255,0.5), rgba(124,58,237,0.5), transparent);
  pointer-events: none;
}

.card:not(.form-card):not(.info-card):not(.agent-cta-box):hover {
  border-color: rgba(0,212,255,0.35);
  box-shadow:
    0 24px 80px rgba(0,0,0,0.5),
    0 0 60px rgba(0,212,255,0.1),
    inset 0 1px 0 rgba(255,255,255,0.1);
  transform: translateY(-6px);
}

.card:not(.form-card):hover::after {
  background: linear-gradient(90deg, transparent, rgba(0,212,255,0.8), rgba(124,58,237,0.8), transparent);
}

.glow-card {
  box-shadow: 0 0 40px rgba(0,212,255,0.08), 0 1px 0 var(--border-md) inset;
}

.glow-border:hover {
  border-color: var(--border-hi);
  box-shadow: 0 0 30px rgba(0,212,255,0.15);
}

/* Primary CTA Button */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  border: none;
  padding: 14px 32px;
  border-radius: 50px;
  font-family: var(--font-b);
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
  box-shadow: 0 4px 20px rgba(0,212,255,0.25), 0 0 40px rgba(0,212,255,0.15);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  cursor: pointer;
  text-decoration: none;
  position: relative;
}

.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,212,255,0.35), 0 0 60px rgba(0,212,255,0.2);
  color: #fff;
}

/* Ghost Button */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--border-md);
  padding: 13px 30px;
  border-radius: 50px;
  font-family: var(--font-b);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-1);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
  cursor: pointer;
  text-decoration: none;
}

.btn-ghost:hover {
  border-color: var(--cyan);
  background: var(--cyan-soft);
  color: var(--text-1);
  box-shadow: 0 0 20px rgba(0,212,255,0.08);
}

/* Price Display */
.price {
  font-family: var(--font-h);
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--gold);
}

/* 6. Keyframe-Animationen
   ------------------------------------------ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes glow {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

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

/* Scroll Reveal */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* 7. Scrollbar Styling
   ------------------------------------------ */
::-webkit-scrollbar {
  width: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--cyan-soft);
  border-radius: 4px;
}

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

/* 8. Selection Styling
   ------------------------------------------ */
::selection {
  background: var(--cyan);
  color: var(--bg-0);
}

::-moz-selection {
  background: var(--cyan);
  color: var(--bg-0);
}

/* ---- Reception Background (Startseite) ---- */
body.bg-reception {
  background: linear-gradient(rgba(2, 8, 16, 0.45), rgba(2, 8, 16, 0.45)),
    url('../img/hero-reception.jpg') center / cover no-repeat var(--bg-0);
  background-attachment: fixed;
}

/* ---- Lobby Background (Unterseiten) ---- */
body.bg-lobby {
  background: linear-gradient(rgba(2, 8, 16, 0.58), rgba(2, 8, 16, 0.58)),
    url('../img/bg-lobby.jpg') center / cover no-repeat var(--bg-0);
  background-attachment: fixed;
}

/* Mobile: fixed background breaks on iOS/Android — use scroll */
@media (max-width: 768px) {
  body.bg-reception {
    background-attachment: scroll;
    background-position: 65% center;
  }

  body.bg-lobby {
    background-attachment: scroll;
    background-position: center top;
  }
}

/* 9. Responsive Breakpoints
   ------------------------------------------ */
@media (max-width: 1024px) {
  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }

  :root {
    --section-py: 80px;
  }
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 0 20px;
  }

  :root {
    --section-py: 60px;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }

  .btn-primary,
  .btn-ghost {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  /* Prevent horizontal overflow on mobile */
  body {
    overflow-x: hidden;
  }

  img {
    max-width: 100%;
    height: auto;
  }

  /* Ensure touch targets are min 44px */
  a, button {
    min-height: 44px;
  }

  /* Readable text on mobile */
  p, li {
    font-size: 0.95rem;
  }

  .badge {
    font-size: 0.72rem;
  }

  .price {
    font-size: 2rem;
  }
}

/* ---- 480px Smartphone Breakpoint (NEU) ---- */
@media (max-width: 480px) {
  :root {
    --section-py: 48px;
  }

  .container {
    padding: 0 18px;
  }

  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.4rem; }
  h3 { font-size: 1.1rem; }

  p, li {
    font-size: 0.9rem;
  }

  .price {
    font-size: 1.8rem;
  }
}

/* Small mobile (320px) */
@media (max-width: 375px) {
  .container {
    padding: 0 14px;
  }

  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1rem; }
}

/* ---- iOS Modal-Lock ---- */
html.modal-open,
body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}
