/* =========================================================
   CBCoding.de — style.css
   Globales Stylesheet: Variablen, Reset, Layout, Komponenten
   ========================================================= */

/* ---------- Design Tokens ---------- */
:root {
  /* Farben */
  --bg: #050608;
  --bg-alt: #0a0c12;
  --panel: rgba(16, 19, 28, 0.55);
  --panel-solid: #0d0f18;
  --border: rgba(255, 255, 255, 0.08);

  --blue: #2fd7ff;
  --blue-dim: #1a8fb8;
  --red: #ff2d55;
  --red-dim: #b81c3d;
  --orange: #ff8a2b;

  --text: #e9edf5;
  --muted: #93a0b4;
  --muted-2: #5f6b7d;

  /* Typografie */
  --font-display: "Chakra Petch", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Layout */
  --maxw: 1180px;
  --radius: 14px;
  --radius-sm: 8px;
  --gap: clamp(1.25rem, 2vw, 2.5rem);

  /* Schatten / Glow */
  --glow-blue: 0 0 8px rgba(47, 215, 255, 0.55), 0 0 28px rgba(47, 215, 255, 0.25);
  --glow-red: 0 0 8px rgba(255, 45, 85, 0.55), 0 0 28px rgba(255, 45, 85, 0.25);
  --glow-orange: 0 0 8px rgba(255, 138, 43, 0.5), 0 0 24px rgba(255, 138, 43, 0.2);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.6em;
  letter-spacing: 0.01em;
}

h1 { font-size: clamp(2.3rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; color: var(--muted); }

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(1.2rem, 4vw, 2.5rem);
}

.section {
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
  position: relative;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 1em;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, var(--blue), transparent);
}

.section-head {
  max-width: 640px;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

/* ---------- Ambient background glow (fixed, behind everything) ---------- */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(600px 400px at 12% 8%, rgba(47, 215, 255, 0.14), transparent 65%),
    radial-gradient(700px 500px at 90% 15%, rgba(255, 45, 85, 0.12), transparent 60%),
    radial-gradient(600px 450px at 50% 100%, rgba(255, 138, 43, 0.08), transparent 65%),
    var(--bg);
}

/* ---------- Header / Navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: rgba(5, 6, 8, 0.55);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

.site-header.is-scrolled {
  background: rgba(5, 6, 8, 0.85);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 0.9rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand img {
  height: 34px;
  width: auto;
}

.brand .brand-accent { color: var(--blue); }

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

.nav-links a {
  position: relative;
  font-size: 0.93rem;
  color: var(--muted);
  padding: 0.3rem 0;
  transition: color 0.25s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--red));
  transition: width 0.3s ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
}

.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after {
  width: 100%;
}

.nav-cta {
  display: inline-flex;
}

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.burger span {
  display: block;
  height: 2px;
  margin-inline: 8px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.burger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.burger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Buttons ---------- */
.btn {
  --btn-color: var(--blue);
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--btn-color);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}

.btn:hover {
  box-shadow: 0 0 14px var(--btn-color), inset 0 0 12px rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
}

.btn-primary { --btn-color: var(--blue); }
.btn-secondary { --btn-color: var(--red); }
.btn-ghost {
  --btn-color: var(--muted-2);
  border-color: var(--border);
}
.btn-ghost:hover { --btn-color: var(--orange); }

.btn-block { width: 100%; justify-content: center; }

/* ---------- Cards (Glassmorphism) ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--blue), transparent 40%, var(--red) 100%);
  opacity: 0;
  transition: opacity 0.35s ease;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

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

.card .icon {
  width: 44px;
  height: 44px;
  margin-bottom: 1rem;
  color: var(--blue);
  filter: drop-shadow(0 0 6px rgba(47, 215, 255, 0.6));
}

/* ---------- Grid helpers ---------- */
.grid {
  display: grid;
  gap: var(--gap);
}

.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

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

/* ---------- Hero ---------- */
.hero {
  padding-top: clamp(4rem, 10vw, 7rem);
  padding-bottom: clamp(3rem, 8vw, 5rem);
  position: relative;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 3rem;
}

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

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

.hero-logo-wrap img {
  width: min(360px, 80%);
  filter: drop-shadow(0 0 40px rgba(47, 215, 255, 0.25)) drop-shadow(0 0 70px rgba(255, 45, 85, 0.15));
}

.hero h1 {
  margin-bottom: 0.4em;
}

.hero .claim {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: var(--blue);
  margin-bottom: 1.3em;
  min-height: 1.6em;
}

.hero .claim .cursor {
  display: inline-block;
  width: 0.55em;
  background: var(--red);
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}

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

/* ---------- Page hero (subpages) ---------- */
.page-hero {
  padding-top: clamp(3.5rem, 8vw, 5.5rem);
  padding-bottom: clamp(2rem, 5vw, 3rem);
  border-bottom: 1px solid var(--border);
}

.breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted-2);
  margin-bottom: 1.2rem;
}

.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--blue); }

/* ---------- Tags / Tech stack chips ---------- */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

.tag.tag-blue { border-color: var(--blue-dim); color: var(--blue); }
.tag.tag-red { border-color: var(--red-dim); color: var(--red); }
.tag.tag-orange { border-color: var(--orange); color: var(--orange); }

/* ---------- Forms ---------- */
.form-field {
  margin-bottom: 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-field label {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
}

.form-field input,
.form-field textarea {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  color: var(--text);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--blue);
  box-shadow: var(--glow-blue);
  outline: none;
}

.form-field .error {
  font-size: 0.78rem;
  color: var(--red);
  display: none;
}

.form-field.has-error input,
.form-field.has-error textarea {
  border-color: var(--red);
}

.form-field.has-error .error { display: block; }

.form-note {
  font-size: 0.82rem;
  color: var(--muted-2);
  margin-top: 1rem;
}

.form-success {
  display: none;
  border: 1px solid var(--blue-dim);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  margin-bottom: 1.5rem;
}

.form-success.is-visible { display: block; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 3rem 2rem;
  margin-top: clamp(4rem, 8vw, 6rem);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

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

.footer-grid h4 {
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

.footer-grid ul li { margin-bottom: 0.6rem; }
.footer-grid a { color: var(--muted-2); font-size: 0.9rem; transition: color 0.2s ease; }
.footer-grid a:hover { color: var(--blue); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted-2);
  font-family: var(--font-mono);
}

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.gradient-text {
  background: linear-gradient(90deg, var(--blue), var(--red));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Pagination (Blog) ---------- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 3rem;
  font-family: var(--font-mono);
}

.pagination a,
.pagination span {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--muted);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.pagination a:hover { border-color: var(--blue); color: var(--blue); }
.pagination .is-active { border-color: var(--red); color: var(--red); }

/* ---------- Utility classes (ersetzen Inline-Styles) ---------- */
.lede { max-width: 640px; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.card-cta { padding: clamp(2.5rem, 6vw, 4rem); }
.list-plain {
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.order-1 { order: 1; }
.order-2 { order: 2; }

/* ================================================================
   GEÄNDERT: .thumb Klasse für einheitliche, schöne Projekt-/Blogbilder
   ================================================================ */
.thumb {
  border-radius: var(--radius-sm);
  margin-bottom: 1.2rem;
  width: 100%;            /* Bild füllt die Breite der Karte */
  height: auto;           /* Höhe passt sich automatisch an */
  object-fit: cover;      /* Verhindert Verzerrungen, schneidet Bild passend zu */
  aspect-ratio: 16 / 9;   /* Zwingt alle Bilder ins gleiche Kino-Format */
}

.thumb-sm { margin-bottom: 1rem; }
.footer-desc { margin-top: 1rem; }
.link-accent { color: var(--blue); }
.checkbox-field {
  flex-direction: row;
  align-items: flex-start;
  gap: 0.6rem;
  display: flex;
  font-size: 0.85rem;
  color: var(--muted);
}
.checkbox-field input[type="checkbox"] {
  width: auto;
  margin-top: 0.2rem;
}
.contact-email {
  font-family: var(--font-mono);
  color: var(--blue);
}
.mt-lg { margin-top: 2.5rem; }
.avatar-wrap {
  display: flex;
  justify-content: center;
}
.avatar-img {
  border-radius: var(--radius);
  max-width: 340px;
}

/* ---------- Blog card ---------- */
.blog-card .meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted-2);
  margin-bottom: 0.6rem;
}

.blog-card h3 a:hover { color: var(--blue); }