/* ============================================
   SCHACHTSANIERUNG – Modern Dark Technical Design
   ============================================ */

/* --- Local Font Files --- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-v20-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/inter-v20-latin-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter-v20-latin-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/inter-v20-latin-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/inter-v20-latin-800.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-v24-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-v24-latin-500.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-v24-latin-600.woff2') format('woff2');
}

/* --- CSS Custom Properties --- */
:root {
  /* Dark Theme */
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1a2236;
  --bg-card-hover: #1f2a42;
  --bg-nav: rgba(10, 14, 23, 0.92);

  /* Accent Colors – Amber/Mining */
  --accent-primary: #f59e0b;
  --accent-secondary: #d97706;
  --accent-glow: rgba(245, 158, 11, 0.15);
  --accent-glow-strong: rgba(245, 158, 11, 0.3);

  /* Technical Blue */
  --tech-blue: #3b82f6;
  --tech-cyan: #06b6d4;

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Borders */
  --border-subtle: rgba(148, 163, 184, 0.1);
  --border-accent: rgba(245, 158, 11, 0.3);

  /* Spacing */
  --nav-height: 72px;
  --section-padding: 100px;
  --container-max: 1200px;

  /* Typography */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
}

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

a:hover {
  color: var(--accent-secondary);
}

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

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

.lang-de, .lang-en {
  /* controlled by JS */
}

body.lang-en .lang-de { display: none !important; }
body.lang-de .lang-en { display: none !important; }
body:not(.lang-en):not(.lang-de) .lang-en { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* --- Animated Grid Background --- */
.grid-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(245, 158, 11, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 158, 11, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
  0% { transform: translate(0, 0); }
  100% { transform: translate(60px, 60px); }
}

/* --- Navigation --- */
.navbar {
  position: fixed;
  top: 8px;
  left: 12px;
  right: 12px;
  height: var(--nav-height);
  background: var(--bg-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  z-index: 1000;
  transition: all var(--transition-smooth);
}

.navbar.scrolled {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 clamp(24px, 3vw, 48px);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-brand .brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--bg-primary);
  font-weight: 800;
}

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

.nav-links a {
  padding: 8px 16px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: var(--accent-glow);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--accent-primary);
  border-radius: 1px;
}

/* Language Switcher */
.lang-switch {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  margin-left: 16px;
}

.lang-switch button {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-main);
}

.lang-switch button.active {
  background: var(--accent-primary);
  color: var(--bg-primary);
}

.lang-switch button:hover:not(.active) {
  color: var(--text-primary);
}

/* Logout Button */
.logout-btn {
  background: none;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  font-family: var(--font-main);
  margin-left: 12px;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 5px;
}

.logout-btn:hover {
  color: var(--text-primary);
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.08);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-height);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  border-radius: 50%;
  animation: heroGlow 8s ease-in-out infinite alternate;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  animation: heroGlow 10s ease-in-out infinite alternate-reverse;
}

@keyframes heroGlow {
  0% { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.2) translate(30px, -20px); }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--accent-glow);
  border: 1px solid var(--border-accent);
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent-primary);
  margin-bottom: 24px;
  animation: fadeInUp 0.8s ease-out;
}

.hero-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--accent-primary);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 24px;
  animation: fadeInUp 0.8s ease-out 0.1s both;
  letter-spacing: -0.02em;
}

.hero h1 .highlight {
  background: linear-gradient(135deg, var(--accent-primary), var(--tech-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin-bottom: 40px;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-actions {
  display: flex;
  gap: 16px;
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

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

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  font-family: var(--font-main);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: var(--bg-primary);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(245, 158, 11, 0.4);
  color: var(--bg-primary);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  transform: translateY(-2px);
  color: var(--text-primary);
}

/* --- Section Styles --- */
.section {
  position: relative;
  z-index: 1;
  padding: var(--section-padding) 0;
}

.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent-primary);
  margin-bottom: 16px;
  font-family: var(--font-mono);
}

.section-header h2 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.section-header p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* --- Topic Cards --- */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
}

.topic-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 40px 32px;
  transition: all var(--transition-smooth);
  overflow: hidden;
  text-decoration: none;
  display: block;
}

.topic-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--tech-cyan));
  opacity: 0;
  transition: opacity var(--transition-smooth);
}

.topic-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-accent);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  background: var(--bg-card-hover);
}

.topic-card:hover::before {
  opacity: 1;
}

.topic-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 24px;
  background: var(--accent-glow);
  border: 1px solid var(--border-accent);
}

.topic-card h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.topic-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 20px;
}

.topic-card .card-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-primary);
  font-weight: 600;
  font-size: 0.9rem;
  transition: gap var(--transition-fast);
}

.topic-card:hover .card-link {
  gap: 12px;
}

/* --- Stats Section --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-top: 60px;
}

.stat-item {
  text-align: center;
  padding: 32px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent-primary);
  font-family: var(--font-mono);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* --- About Section --- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.about-text h2 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.about-text p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 16px;
}

.about-visual {
  position: relative;
  padding: 40px;
}

.about-visual .tech-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 32px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 2;
}

.about-visual .tech-box .code-line {
  display: block;
}

.about-visual .tech-box .code-key {
  color: var(--tech-cyan);
}

.about-visual .tech-box .code-value {
  color: var(--accent-primary);
}

/* --- Content Page Styles --- */
.page-hero {
  padding: calc(var(--nav-height) + 80px) 0 60px;
  position: relative;
  z-index: 1;
}

.page-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.page-hero p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 700px;
}

.page-content {
  position: relative;
  z-index: 1;
  padding: 40px 0 var(--section-padding);
}

.content-body {
  max-width: 800px;
}

.content-body h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-top: 48px;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.content-body h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.content-body p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 1.05rem;
}

.content-body ul, .content-body ol {
  color: var(--text-secondary);
  margin-bottom: 16px;
  padding-left: 24px;
}

.content-body li {
  margin-bottom: 8px;
}

.content-body strong {
  color: var(--text-primary);
}

/* Info Box */
.info-box {
  background: var(--bg-card);
  border-left: 4px solid var(--accent-primary);
  border-radius: 0 12px 12px 0;
  padding: 24px 28px;
  margin: 32px 0;
}

.info-box h4 {
  color: var(--accent-primary);
  font-size: 1rem;
  margin-bottom: 8px;
}

.info-box p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* Coming Soon */
.coming-soon {
  text-align: center;
  padding: 80px 40px;
  background: var(--bg-card);
  border: 1px dashed var(--border-accent);
  border-radius: 20px;
  margin-top: 40px;
}

.coming-soon h3 {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 12px;
}

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

/* --- Legal Pages --- */
.legal-content {
  max-width: 800px;
}

.legal-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 40px;
  margin-bottom: 12px;
  color: var(--text-primary);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.legal-content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.legal-content p {
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.legal-content ul {
  color: var(--text-secondary);
  margin-bottom: 12px;
  padding-left: 24px;
  font-size: 0.95rem;
}

.legal-content li {
  margin-bottom: 6px;
}

.legal-content address {
  font-style: normal;
  line-height: 1.8;
}

/* --- Footer --- */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border-subtle);
  padding: 60px 0 30px;
  background: var(--bg-secondary);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-weight: 700;
  font-size: 1.1rem;
}

.footer-brand .brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--bg-primary);
  font-weight: 800;
}

.footer-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 400px;
}

.footer h4 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--accent-primary);
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --- Scroll Reveal Animation --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* --- Responsive --- */
@media (max-width: 968px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 60px;
    --nav-height: 64px;
  }

  .menu-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 360px;
    height: 100vh;
    background: var(--bg-secondary);
    padding: 100px 32px 32px;
    transition: right var(--transition-smooth);
    border-left: 1px solid var(--border-subtle);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
  }

  .nav-menu.open {
    right: 0;
  }

  .nav-links {
    flex-direction: column;
    gap: 4px;
  }

  .nav-links a {
    display: block;
    padding: 14px 16px;
    font-size: 1rem;
  }

  .lang-switch {
    margin-left: 0;
    margin-top: 24px;
    align-self: flex-start;
  }

  .hero-actions {
    flex-direction: column;
  }

  .topics-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2rem;
  }

  .topic-card {
    padding: 28px 24px;
  }

  .section-header h2 {
    font-size: 1.8rem;
  }
}
