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

:root {
  --bg: #0a0e17;
  --bg-surface: #111827;
  --bg-card: #1a2235;
  --bg-card-hover: #1f2a40;
  --border: #2a3550;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent: #38bdf8;
  --accent-glow: rgba(56, 189, 248, 0.15);
  --green: #4ade80;
  --green-glow: rgba(74, 222, 128, 0.15);
  --cyan: #22d3ee;
  --yellow: #fbbf24;
  --red: #f87171;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1200px;
  --nav-height: 64px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

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

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

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: rgba(56, 189, 248, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}

/* ===== Navigation ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-logo:hover { color: var(--accent); }

.nav-logo-icon {
  font-size: 1.4em;
  color: var(--accent);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 32px;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

.lang-switch {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: color 0.2s, border-color 0.2s;
}
.lang-switch:hover {
  color: var(--text);
  border-color: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: calc(var(--nav-height) + 80px) 0 80px;
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 20%, rgba(56, 189, 248, 0.08), transparent),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(74, 222, 128, 0.05), transparent);
}

.hero-content {
  position: relative;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 50%, var(--green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 48px;
  line-height: 1.6;
}

/* Terminal */
.hero-terminal {
  max-width: 720px;
  margin: 0 auto 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-align: left;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #1a1e2e;
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.terminal-dot.red { background: #f87171; }
.terminal-dot.yellow { background: #fbbf24; }
.terminal-dot.green { background: #4ade80; }

.terminal-title {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.terminal-body {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  padding: 20px;
  background: #0d1117;
  color: var(--text-muted);
  overflow-x: auto;
}

.t-white { color: #e2e8f0; }
.t-green { color: #4ade80; }
.t-cyan { color: #22d3ee; }
.t-keyword { color: #c084fc; }
.t-comment { color: #64748b; }

.cursor {
  display: inline-block;
  width: 8px;
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}

/* Hero Stats */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ===== Sections ===== */
.section {
  padding: 96px 0;
}

.section-dark {
  background: var(--bg-surface);
}

.section-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.section-intro {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 800px;
  margin-bottom: 48px;
  line-height: 1.8;
}

.subsection-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 32px 0 16px;
  color: var(--text);
}

/* ===== Features Grid ===== */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.feature-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ===== Architecture Diagram ===== */
.arch-diagram {
  max-width: 800px;
  margin: 0 auto 48px;
}

.arch-layer {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.arch-label {
  min-width: 140px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  padding-top: 16px;
  text-align: right;
}

.arch-boxes {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  flex: 1;
}

.arch-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 140px;
}

.arch-box.accent {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.arch-box.green {
  border-color: var(--green);
  background: var(--green-glow);
}

.arch-detail {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-dim);
}

.arch-arrow {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  padding: 8px 0;
  padding-left: 156px;
  font-family: var(--font-mono);
}

/* ===== Flow Steps ===== */
.flow-steps {
  max-width: 700px;
}

.flow-step {
  display: flex;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.flow-step:last-child { border-bottom: none; }

.flow-num {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
}

.flow-step strong {
  display: block;
  margin-bottom: 4px;
}

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

/* ===== Two Column Layout ===== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

/* ===== Code Blocks ===== */
.code-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}

.code-block.compact {
  margin-bottom: 16px;
}

.code-header {
  background: #1a1e2e;
  padding: 8px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
}

.code-block pre {
  background: #0d1117;
  padding: 16px;
  overflow-x: auto;
}

.code-block code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--text-muted);
}

/* ===== Package Grid ===== */
.package-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.package {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.package-name {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

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

/* ===== Info Table ===== */
.info-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}

.info-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.info-table td:first-child {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  width: 40%;
}

.info-table td:last-child {
  color: var(--text-muted);
}

/* ===== Kernel Groups ===== */
.kernel-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 24px;
}

.kernel-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.kernel-group h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--accent);
}

.kernel-group > p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.note {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 8px;
  padding-left: 12px;
  border-left: 2px solid var(--accent);
}

/* ===== Agent Components ===== */
.agent-component {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

.agent-component h4 {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 8px;
  font-family: var(--font-mono);
}

.agent-component p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.agent-component ul {
  list-style: none;
  padding: 0;
}

.agent-component li {
  position: relative;
  padding-left: 20px;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.agent-component li::before {
  content: "\2192";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ===== Boot Timeline ===== */
.boot-timeline {
  max-width: 700px;
  margin: 0 auto 48px;
  position: relative;
  padding-left: 100px;
}

.boot-timeline::before {
  content: '';
  position: absolute;
  left: 80px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--green));
}

.boot-step {
  position: relative;
  padding: 16px 0 16px 32px;
}

.boot-step::before {
  content: '';
  position: absolute;
  left: -9px;
  top: 24px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-surface);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.boot-time {
  position: absolute;
  left: -100px;
  top: 18px;
  width: 70px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
}

.boot-content h4 {
  font-size: 1rem;
  margin-bottom: 4px;
}

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

/* ===== SD Image Diagram ===== */
.sd-image {
  display: flex;
  max-width: 700px;
  margin: 0 auto 8px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--border);
}

.sd-partition {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sd-partition.boot {
  background: rgba(251, 191, 36, 0.1);
  border-right: 2px solid var(--border);
  flex: 0 0 30%;
}

.sd-partition.rootfs {
  background: rgba(56, 189, 248, 0.08);
  flex: 1;
}

.sd-label {
  font-weight: 700;
  font-size: 0.85rem;
}

.sd-size {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}

.sd-files {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.sd-note {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ===== Impressum ===== */
.impressum-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.impressum-content h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 24px;
  margin-bottom: 8px;
}

.impressum-content h3:first-child {
  margin-top: 0;
}

.impressum-content p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.footer .nav-logo-icon {
  font-size: 1.1em;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(10, 14, 23, 0.98);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 16px 24px 24px;
    gap: 12px;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .hero {
    min-height: auto;
    padding-top: calc(var(--nav-height) + 48px);
    padding-bottom: 48px;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero-stats {
    gap: 24px;
  }

  .section {
    padding: 64px 0;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .two-col,
  .impressum-content {
    grid-template-columns: 1fr;
    gap: 24px;
  }

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

  .kernel-groups {
    grid-template-columns: 1fr;
  }

  .arch-layer {
    flex-direction: column;
  }

  .arch-label {
    text-align: left;
    min-width: unset;
    padding-top: 0;
  }

  .arch-arrow {
    padding-left: 0;
  }

  .boot-timeline {
    padding-left: 60px;
  }

  .boot-timeline::before {
    left: 44px;
  }

  .boot-time {
    left: -60px;
    width: 40px;
    font-size: 0.7rem;
  }

  .sd-image {
    flex-direction: column;
  }

  .sd-partition.boot {
    border-right: none;
    border-bottom: 2px solid var(--border);
  }

  .terminal-body {
    font-size: 0.7rem;
    padding: 12px;
  }
}

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

  .hero-subtitle {
    font-size: 1rem;
  }

  .stat-value {
    font-size: 1.25rem;
  }
}
