/* ==========================================================================
   Dawico Labs — dawico.dev
   Design-Sprache: dawico.de (helles Schema, Pill-Buttons, dunkle Akzent-
   Sections) mit dezenten Labs-Akzenten (Partikel, Terminal, Mini-Game).
   ========================================================================== */

:root {
  --primary: #0077b6;
  --primary-dark: #005f94;
  --primary-light: #e0f4ff;
  --sky: #38bdf8;
  --sky-light: #7dd3fc;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --dark: #0a0a0a;
  --dark-section: #0f172a;
  --gray-bg: #f8fafc;
  --gray-card: #f9fafb;
  --gray-border: #e2e8f0;
  --text: #1e293b;
  --text-light: #64748b;
  --white: #ffffff;
  --font-sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", Consolas, "SF Mono", monospace;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  background: var(--white);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}

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

img {
  max-width: 100%;
}

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

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
  transition: background-color 0.3s, box-shadow 0.3s, backdrop-filter 0.3s;
}

.site-header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.header-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: height 0.3s;
}

.site-header.scrolled .header-inner {
  height: 4.5rem;
}

.logo {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  transition: color 0.3s;
}

.logo .logo-labs {
  color: var(--sky);
  font-weight: 600;
}

.site-header.scrolled .logo {
  color: var(--dark);
}

.site-header.scrolled .logo .logo-labs {
  color: var(--primary);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.main-nav a {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.2s;
}

.main-nav a:hover {
  color: var(--sky);
}

.site-header.scrolled .main-nav a {
  color: var(--text);
}

.site-header.scrolled .main-nav a:hover {
  color: var(--primary);
}

@media (max-width: 720px) {
  .main-nav {
    gap: 1.25rem;
  }
}

/* --------------------------------------------------------------------------
   Hero (dunkel, wie dawico.de Startseite)
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--dark-section);
  padding: 11rem 0 9rem;
}

#particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Driftende Farb-Blobs — Hintergrund-Effekt der alten app-365.de */
.ambient-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  will-change: transform;
  animation: drift 18s ease-in-out infinite alternate;
}

.ambient-blob:nth-of-type(1) {
  width: 600px;
  height: 600px;
  background: rgba(108, 245, 194, 0.09);
  top: -15%;
  left: -10%;
}

.ambient-blob:nth-of-type(2) {
  width: 500px;
  height: 500px;
  background: rgba(91, 140, 255, 0.09);
  bottom: -10%;
  right: -5%;
  animation-delay: -6s;
  animation-duration: 22s;
}

.ambient-blob:nth-of-type(3) {
  width: 350px;
  height: 350px;
  background: rgba(255, 107, 157, 0.06);
  top: 50%;
  left: 50%;
  animation-delay: -12s;
  animation-duration: 26s;
}

@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(60px, -40px) scale(1.15); }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  pointer-events: none;
}

.hero-content a {
  pointer-events: auto;
}

.hero-eyebrow {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sky);
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: #fff;
  max-width: 48rem;
}

.text-shimmer {
  background: linear-gradient(90deg, #38bdf8 0%, #7dd3fc 25%, #bae6fd 50%, #7dd3fc 75%, #38bdf8 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-terminal-line {
  margin-top: 1.6rem;
  font-family: var(--font-mono);
  font-size: clamp(0.82rem, 2vw, 0.98rem);
  color: var(--green);
  min-height: 1.6em;
}

.hero-terminal-line .prompt {
  color: #64748b;
}

.terminal-cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  background: var(--green);
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero-sub {
  margin-top: 1.5rem;
  font-size: 1.125rem;
  line-height: 1.7;
  color: #d1d5db;
  max-width: 42rem;
}

.hero-ctas {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Buttons — Pill-Stil wie dawico.de */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
  padding: 0.875rem 2rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background-color 0.3s, box-shadow 0.3s, transform 0.3s, border-color 0.3s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 10px 15px -3px rgba(0, 119, 182, 0.25);
  transform: translateY(-2px);
}

.btn-outline-light {
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn .cta-arrow {
  transition: transform 0.2s ease;
}

.btn:hover .cta-arrow {
  transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   Stats (weiße Karten, überlappen den Hero — wie dawico.de StatsBar)
   -------------------------------------------------------------------------- */
.stats {
  position: relative;
  z-index: 3;
  margin-top: -2.5rem;
}

.stats-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 1024px) {
  .stats-inner {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--primary);
  border-radius: 1rem;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 183, 255, 0.15), 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.3s, transform 0.3s;
}

.stat-card:hover {
  box-shadow: 0 8px 30px rgba(0, 183, 255, 0.25), 0 4px 8px rgba(0, 0, 0, 0.08);
  transform: translateY(-4px);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  margin-top: 0.25rem;
  font-size: 0.95rem;
  color: var(--text-light);
}

/* --------------------------------------------------------------------------
   Sections allgemein
   -------------------------------------------------------------------------- */
.section {
  padding: 6rem 0;
}

.section-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-eyebrow {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: clamp(1.875rem, 4vw, 2.25rem);
  font-weight: 700;
  color: var(--dark);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.section-intro {
  margin-top: 1rem;
  color: var(--text-light);
  font-size: 1.125rem;
  max-width: 42rem;
}

.section-head.center {
  text-align: center;
  margin-bottom: 4rem;
}

.section-head.center .section-intro {
  margin-left: auto;
  margin-right: auto;
}

/* Dunkle Sections: Eyebrow/Titel/Intro invertiert */
.section-dark .section-eyebrow {
  color: var(--sky);
}

.section-dark .section-title {
  color: #fff;
}

.section-dark .section-intro {
  color: #9ca3af;
}

/* --------------------------------------------------------------------------
   Fokus-Karten (wie dawico.de Card)
   -------------------------------------------------------------------------- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.5rem;
}

.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--gray-card);
  border: 1px solid var(--gray-border);
  border-radius: 1rem;
  padding: 1.5rem;
  transition: box-shadow 0.3s, border-color 0.3s, transform 0.3s;
}

.card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 119, 182, 0.1), 0 4px 6px -4px rgba(0, 119, 182, 0.1);
  border-color: rgba(0, 119, 182, 0.3);
  transform: translateY(-4px);
}

.card-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  background: rgba(0, 119, 182, 0.1);
  color: var(--primary);
  transition: background-color 0.3s;
}

.card:hover .card-icon {
  background: rgba(0, 119, 182, 0.2);
}

.card-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.card h3 {
  color: var(--dark);
  font-size: 1.125rem;
  font-weight: 600;
  transition: color 0.2s;
}

.card:hover h3 {
  color: var(--primary);
}

.card p {
  margin-top: 0.5rem;
  color: var(--text-light);
  font-size: 1rem;
  line-height: 1.65;
}

/* --------------------------------------------------------------------------
   Lab Notes (dunkle Section mit Terminal)
   -------------------------------------------------------------------------- */
.section-dark {
  background: var(--dark-section);
}

.lab-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 4rem;
  align-items: center;
}

@media (max-width: 900px) {
  .lab-grid {
    grid-template-columns: 1fr;
  }
}

.terminal {
  background: #0a1120;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
  font-family: var(--font-mono);
  font-size: 0.86rem;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.8rem 1rem;
  background: rgba(148, 163, 184, 0.06);
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.terminal-bar .tb-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  flex-shrink: 0;
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s;
}

.terminal-bar .tb-dot:hover {
  filter: brightness(1.3);
  transform: scale(1.2);
}

.tb-red { background: #f87171; }
.tb-yellow { background: #fbbf24; }
.tb-green { background: #34d399; }

/* Fensterzustände (Ampel-Buttons):
   Rot = zugeklappt (nur Titelleiste), Gelb = Mini-Ansicht, Grün = maximiert */
.terminal,
.game-frame {
  transition: max-width 0.35s ease;
}

.win-closed .terminal-body {
  display: none;
}

.win-closed .terminal-bar .tb-title {
  color: #f87171;
}

.win-closed .terminal-bar {
  cursor: pointer;
}

.terminal.win-min {
  max-width: 68%;
  margin-left: auto;
  margin-right: auto;
}

.terminal.win-min .terminal-body {
  min-height: 0;
  max-height: 150px;
  font-size: 0.72rem;
}

.terminal.win-max .terminal-body {
  max-height: 70vh;
}

.game-frame.win-min {
  max-width: 28rem;
}

.game-frame.win-min .game-hud {
  font-size: 0.68rem;
  gap: 0.3rem;
}

.game-frame.win-closed #game-canvas,
.game-frame.win-closed .game-hud {
  display: none;
}

.game-frame:fullscreen {
  border-radius: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #070d1a;
}

.game-frame:fullscreen #game-canvas {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 110px);
  margin: 0 auto;
  aspect-ratio: 16 / 10;
}

.terminal-bar .tb-title {
  margin-left: 0.6rem;
  color: #94a3b8;
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.terminal-bar .tb-hs {
  margin-left: auto;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #94a3b8;
}

.terminal-bar .tb-hs span {
  color: var(--sky);
  font-weight: 700;
}

.terminal-body {
  padding: 1.2rem 1.3rem 1.5rem;
  min-height: 320px;
  max-height: 420px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
}

.term-input-line {
  display: flex;
  align-items: baseline;
  gap: 0.6ch;
}

.term-input {
  flex: 1;
  min-width: 2ch;
  background: transparent;
  border: 0;
  outline: 0;
  padding: 0;
  font: inherit;
  color: var(--green);
  caret-color: var(--green);
}

.terminal-body .line {
  white-space: pre-wrap;
  word-break: break-word;
  color: #e2e8f0;
  line-height: 1.75;
}

.terminal-body .line .t-prompt { color: var(--sky); }
.terminal-body .line .t-ok { color: var(--green); }
.terminal-body .line .t-warn { color: var(--amber); }
.terminal-body .line .t-err { color: var(--red); }
.terminal-body .line .t-dim { color: #64748b; }

.lab-points {
  margin-top: 2.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  list-style: none;
}

.lab-points li {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  color: #9ca3af;
}

.lab-points .check {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.15);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

.lab-points strong {
  color: #e5e7eb;
}

/* --------------------------------------------------------------------------
   Game (helle Section, dunkles App-Fenster)
   -------------------------------------------------------------------------- */
.section-game {
  background: var(--gray-bg);
  border-top: 1px solid var(--gray-border);
  border-bottom: 1px solid var(--gray-border);
}

.game-frame {
  background: #0a1120;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.4);
  max-width: 56rem;
  margin: 0 auto;
}

.game-frame .terminal-bar {
  user-select: none;
}

#game-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: radial-gradient(ellipse at 50% 0%, #0e1930 0%, #070d1a 70%);
  touch-action: none;
}

.game-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.8rem 1.2rem;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #94a3b8;
}

.game-hud .hud-uptime {
  color: var(--green);
}

.game-hud .hud-score {
  color: var(--sky);
}

.game-hint {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-light);
}

kbd {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--gray-border);
  border-bottom-width: 2px;
  border-radius: 0.35rem;
  background: var(--white);
  font-family: var(--font-mono);
  font-size: 0.8em;
  color: var(--text);
}

/* --------------------------------------------------------------------------
   Rechtsseiten (Impressum etc.)
   -------------------------------------------------------------------------- */
.legal-page {
  padding: 10rem 0 6rem;
}

.legal-inner {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.legal-block {
  margin-top: 2.8rem;
}

.legal-block h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.6rem;
}

.legal-block p {
  color: var(--text);
  line-height: 1.75;
}

.legal-block a {
  color: var(--primary);
}

.legal-block a:hover {
  color: var(--primary-dark);
}

.legal-card {
  background: var(--gray-card);
  border: 1px solid var(--gray-border);
  border-radius: 1rem;
  padding: 1.5rem 1.75rem;
}

.legal-back {
  margin-top: 3.5rem;
}

/* --------------------------------------------------------------------------
   Scroll-to-Top (wie dawico.de)
   -------------------------------------------------------------------------- */
.scroll-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 15px -3px rgba(0, 119, 182, 0.25);
  opacity: 0;
  transform: translateY(1rem);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s, background-color 0.3s;
}

.scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.scroll-top:hover {
  background: var(--primary-dark);
}

/* --------------------------------------------------------------------------
   Footer (dunkel, wie dawico.de)
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--dark-section);
  color: #fff;
  padding: 4rem 0 2.5rem;
}

.footer-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.footer-brand .brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.footer-brand .brand-name .logo-labs {
  color: var(--sky);
  font-weight: 600;
}

.footer-brand .tagline {
  margin-top: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--sky);
  letter-spacing: 0.05em;
  text-transform: lowercase;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.8rem;
  font-size: 0.9rem;
  padding-top: 0.4rem;
}

.footer-links a {
  color: #d1d5db;
  transition: color 0.2s;
}

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

.footer-note {
  margin-top: 2rem;
  color: #9ca3af;
  font-size: 0.85rem;
}

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

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

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 90ms; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 180ms; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 270ms; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 360ms; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 450ms; }

/* --------------------------------------------------------------------------
   Party-Mode (Konami-Code, verstecktes Easteregg)
   -------------------------------------------------------------------------- */
body.party {
  animation: party-hue 3s linear infinite;
}

@keyframes party-hue {
  from { filter: hue-rotate(0deg); }
  to { filter: hue-rotate(360deg); }
}

.party-emoji {
  position: fixed;
  top: -50px;
  z-index: 9998;
  font-size: 1.8rem;
  pointer-events: none;
  animation: emoji-fall linear forwards;
}

@keyframes emoji-fall {
  to {
    transform: translateY(110vh) rotate(540deg);
  }
}

/* --------------------------------------------------------------------------
   Reduced Motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html:not(.force-motion) *,
  html:not(.force-motion) *::before,
  html:not(.force-motion) *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html:not(.force-motion) {
    scroll-behavior: auto;
  }
  html:not(.force-motion) .reveal,
  html:not(.force-motion) .reveal-stagger > * {
    opacity: 1;
    transform: none;
  }
}
