/* ============================================
   PRECISION Design System
   gh-pages-template by Michael Blaess
   Apache License 2.0
   ============================================ */

/* ── SELF-HOSTED FONTS (DSGVO-konform) ──── */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url(../fonts/manrope-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url(../fonts/manrope-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(../fonts/jetbrainsmono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(../fonts/jetbrainsmono-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --font-display: 'Manrope', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1080px;
}

/* ── DARK THEME (default) ─────────────────── */
[data-theme="dark"] {
  --bg-primary: #0f1114;
  --bg-secondary: #171a1f;
  --bg-tertiary: #1e2228;
  --bg-elevated: #242930;
  --border: #2a2f38;
  --border-hover: #3d4450;
  --text-primary: #e8ecf1;
  --text-secondary: #9ba3b0;
  --text-tertiary: #6b7280;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-subtle: rgba(59, 130, 246, 0.1);
  --accent-muted: rgba(59, 130, 246, 0.06);
  --green: #34d399;
  --orange: #fbbf24;
  --red: #f87171;
  --purple: #a78bfa;
  --terminal-bg: #0a0c0f;
  --dot-color: rgba(255,255,255,0.04);
  --logo-filter: brightness(0) invert(1);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-elevated: 0 8px 32px rgba(0,0,0,0.4);
}

/* ── LIGHT THEME ──────────────────────────── */
[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fb;
  --bg-tertiary: #f1f3f6;
  --bg-elevated: #ffffff;
  --border: #e2e5ea;
  --border-hover: #c8cdd5;
  --text-primary: #111318;
  --text-secondary: #5f6775;
  --text-tertiary: #8b929e;
  --accent: #2563eb;
  --accent-hover: #3b82f6;
  --accent-subtle: rgba(37, 99, 235, 0.08);
  --accent-muted: rgba(37, 99, 235, 0.04);
  --green: #059669;
  --orange: #d97706;
  --red: #dc2626;
  --purple: #7c3aed;
  --terminal-bg: #1a1d23;
  --dot-color: rgba(0,0,0,0.04);
  --logo-filter: none;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-elevated: 0 8px 32px rgba(0,0,0,0.08);
}

/* ── RESET & BASE ─────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-display);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Dot grid background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, var(--dot-color) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}

body > * { position: relative; z-index: 1; }

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

/* ── HEADER ───────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg-primary) 85%, transparent);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-logo {
  height: 28px;
  filter: var(--logo-filter);
  transition: filter var(--transition);
}

.header-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
}

.header-repo {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.header-link:hover {
  color: var(--text-primary);
  background: var(--accent-subtle);
}

/* ── THEME TOGGLE ─────────────────────────── */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.theme-toggle:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}
.theme-toggle svg { width: 18px; height: 18px; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: none; }

/* ── HERO ─────────────────────────────────── */
.hero {
  padding: 80px 32px 64px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 28px;
  background: var(--bg-secondary);
}
.hero-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin-bottom: 20px;
}
.hero h1 .accent { color: var(--accent); }

.hero-description {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 36px;
  font-weight: 400;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── BUTTONS ──────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  letter-spacing: -0.01em;
}
.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

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

/* ── TERMINAL ─────────────────────────────── */
.terminal-section {
  padding: 0 32px 80px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.terminal {
  background: var(--terminal-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-elevated);
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.terminal-dot { width: 12px; height: 12px; border-radius: 50%; }
.terminal-dot.r { background: #ff5f57; }
.terminal-dot.y { background: #febc2e; }
.terminal-dot.g { background: #28c840; }

.terminal-title {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}

.terminal-body {
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.8;
  color: #e8ecf1;
  overflow-x: auto;
}
.terminal-body .prompt { color: #34d399; }
.terminal-body .cmd { color: #e8ecf1; }
.terminal-body .flag { color: #a78bfa; }
.terminal-body .url { color: #60a5fa; }
.terminal-body .dim { color: #3d4450; }
.terminal-body .ok { color: #34d399; }
.terminal-body .warn { color: #fbbf24; }
.terminal-body .err { color: #f87171; }
.terminal-body .info { color: #60a5fa; }

/* ── SECTIONS ─────────────────────────────── */
.section {
  padding: 80px 32px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 8px;
}

.section-description {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin-bottom: 48px;
}

/* ── FEATURE GRID ─────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.feature-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  transition: all var(--transition);
}
.feature-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 18px;
  background: var(--accent-subtle);
}

.feature-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

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

/* ── TECH STACK ───────────────────────────── */
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tech-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.tech-badge:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.tech-badge img,
.tech-badge svg {
  width: 18px;
  height: 18px;
}

.tech-badge a {
  color: inherit;
  text-decoration: none;
}
.tech-badge a:hover {
  color: inherit;
}

/* ── INSTALL ──────────────────────────────── */
.install-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.install-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
}

.install-card h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

.install-cmd {
  background: var(--terminal-bg);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--green);
  user-select: all;
  border: 1px solid rgba(255,255,255,0.04);
}

.platforms {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

.platform {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-tertiary);
  font-weight: 500;
}
.platform svg { width: 18px; height: 18px; fill: var(--text-tertiary); }

/* ── DIVIDER ──────────────────────────────── */
.divider {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
}
.divider-line {
  height: 1px;
  background: var(--border);
}

/* ── FOOTER ───────────────────────────────── */
.footer {
  padding: 40px 32px;
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

.footer-logo {
  height: 20px;
  filter: var(--logo-filter);
  opacity: 0.5;
}

.footer-links {
  display: flex;
  gap: 20px;
}
.footer-links a {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  font-weight: 500;
}
.footer-links a:hover { color: var(--text-primary); }

/* ── RESPONSIVE ───────────────────────────── */
@media (max-width: 640px) {
  .header { padding: 12px 16px; }
  .header-link { display: none; }
  .hero { padding: 48px 16px 40px; }
  .terminal-section { padding: 0 16px 48px; }
  .section { padding: 48px 16px; }
  .feature-grid { grid-template-columns: 1fr; }
  .footer { padding: 24px 16px; flex-direction: column; text-align: center; }
}

/* ── ANIMATIONS ───────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .hero-badge, .hero h1, .hero-description, .hero-actions,
  .terminal, .feature-card, .install-card {
    animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) backwards;
  }
  .hero h1 { animation-delay: 0.05s; }
  .hero-description { animation-delay: 0.1s; }
  .hero-actions { animation-delay: 0.15s; }
  .terminal { animation-delay: 0.2s; }
  .feature-card:nth-child(1) { animation-delay: 0.05s; }
  .feature-card:nth-child(2) { animation-delay: 0.1s; }
  .feature-card:nth-child(3) { animation-delay: 0.15s; }
  .feature-card:nth-child(4) { animation-delay: 0.2s; }
  .feature-card:nth-child(5) { animation-delay: 0.25s; }
  .feature-card:nth-child(6) { animation-delay: 0.3s; }

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