:root {
  --bg: #0f1420;
  /* leicht heller als vorher */
  --panel: #121a26;
  /* Panels etwas heller */
  --muted: #93a5b1;
  --text: #e6f1ff;
  --brand: #08e274;
  --brand-2: #00b3ff;
  --ring: rgba(8, 226, 116, 0.25);
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: radial-gradient(120% 120% at 20% -10%, rgba(8, 226, 116, .06), transparent 40%), radial-gradient(120% 120% at 120% 20%, rgba(0, 179, 255, .05), transparent 40%), var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
}

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

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

.bg-orbs {
  position: fixed;
  inset: -10vmax;
  z-index: -1;
  filter: blur(60px);
  opacity: .4;
  pointer-events: none;
}

.bg-orbs::before,
.bg-orbs::after {
  content: "";
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
}

.bg-orbs::before {
  background: radial-gradient(circle at 30% 30%, var(--brand), transparent 60%);
  left: 0;
  top: 0;
}

.bg-orbs::after {
  background: radial-gradient(circle at 70% 60%, var(--brand-2), transparent 60%);
  right: 0;
  bottom: 0;
}

header.nav {
  position: sticky;
  top: 0;
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  backdrop-filter: saturate(140%) blur(8px);
  background: linear-gradient(to right, rgba(15, 21, 32, .85), rgba(15, 21, 32, .65));
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  z-index: 10;
}

.container {
  width: min(1200px, 92vw);
  margin: 0 auto;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: .3px;
}

.brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 18px var(--brand);
}

nav a {
  padding: 8px 12px;
  margin: 0 4px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  position: relative;
}

/* Gradient-Unterstreichung vorbereiten */
nav a::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 4px;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .18s ease;
  pointer-events: none;
}

nav a:hover,
nav a:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

nav a:hover::after,
nav a:focus-visible::after {
  transform: scaleX(1);
}

.hero {
  position: relative;
  padding: 80px 0 40px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 28px;
  align-items: center;
}

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

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .025));
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero .intro {
  padding: 28px;
}

.eyebrow {
  font-family: "JetBrains Mono", monospace;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .25em;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(8, 226, 116, 0.6);
  padding: 6px 12px;
  background: rgba(8, 226, 116, 0.08);
  border: 1.5px solid var(--brand);
  border-radius: 6px;
  display: inline-block;
  box-shadow: 0 0 12px rgba(8, 226, 116, 0.15);
}

.title {
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1.05;
  margin: 12px 0 14px;
  font-weight: 800;
}

.subtitle {
  color: var(--muted);
  max-width: 60ch;
}

.badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0 8px;
}

.badge {
  border: 1px solid rgba(255, 255, 255, .12);
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 13px;
  color: #cfe9da;
  background: rgba(8, 226, 116, .06);
}

.cta-row {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, .14);
  background: #101826;
  transition: transform .15s, box-shadow .2s;
  cursor: pointer;
}

.btn.primary {
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  color: #07130b;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}

/* Contact actions row + spacer for coffee button */
.contact-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.contact-actions .flex-break {
  flex-basis: 100%;
  height: 0;
}

.contact-actions .buy-coffee {
  background: #ffd87a;
  color: #3a2a00;
}

.contact-actions .buy-coffee:hover {
  filter: brightness(0.95);
}

/* Kontakt: Buttons mit Gradient-Unterstrich und voller Farbfüllung bei Hover/Focus */
#contact .btn {
  position: relative;
  overflow: hidden;
}

#contact .btn::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 8px;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .18s ease;
  pointer-events: none;
}

#contact .btn:hover::after,
#contact .btn:focus-visible::after {
  transform: scaleX(1);
}

#contact .btn:hover,
#contact .btn:focus-visible {
  box-shadow: 0 10px 26px rgba(0, 0, 0, .38);
}

#contact .btn.primary {
  background: #101826;
  color: inherit;
}

.hero .photo {
  position: relative;
  padding: 28px;
  display: grid;
  place-items: center;
}

.frame {
  width: min(340px, 88%);
  --img-scale: 0.68;
  /* noch etwas weiter raus */
  --img-pos-y: 24%;
  /* leicht höher für mehr Kopfbereich */
  aspect-ratio: 1/1;
  border-radius: 20px;
  /* Gradient oben, Bild darunter (über --mock) */
  background-image: radial-gradient(120% 120% at 30% 20%, rgba(8, 226, 116, .16), rgba(0, 0, 0, .3)), var(--mock, none);
  background-position: center, center;
  background-size: cover, cover;
  background-repeat: no-repeat, no-repeat;
}

/* Light Theme Vars */
:root[data-theme="light"] {
  --bg: #131a23;
  /* deutlich heller, aber noch modern */
  --panel: #1a2330;
  /* leicht angehoben für Kontrast */
  --muted: #7f93a3;
  --text: #f4fbff;
  --ring: rgba(0, 179, 255, 0.25);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* Smooth theme transition */
html,
body {
  transition: background .25s ease, color .25s ease;
}

/* Component tweaks in Light Theme */
:root[data-theme="light"] header.nav {
  background: linear-gradient(to right, rgba(26, 35, 48, .85), rgba(26, 35, 48, .65));
  border-bottom-color: rgba(255, 255, 255, .08);
}

:root[data-theme="light"] .card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .05));
}

:root[data-theme="light"] .bg-orbs {
  opacity: .5;
}

:root[data-theme="light"] .btn {
  background: #172231;
}

:root[data-theme="light"] .phone {
  background: linear-gradient(180deg, #152135, #0f1b2b);
  border-color: #1d2a3e;
  box-shadow: inset 0 0 0 6px #112035, 0 10px 28px rgba(0, 0, 0, .38);
}

:root[data-theme="light"] .laptop {
  background: linear-gradient(180deg, #152135, #0f1b2b);
  border-color: #20304a;
  box-shadow: inset 0 0 0 5px #112035, 0 10px 28px rgba(0, 0, 0, .38);
}

/* Frame inner elements */
.frame-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% var(--img-pos-y, 40%);
  display: block;
  transform: scale(var(--img-scale, 1));
  transform-origin: center;
  transition: transform .25s ease;
}

.frame::after {
  content: "Marco Grimme";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .6));
  padding: 10px 14px;
  font-weight: 700;
  letter-spacing: .4px;
}

section {
  padding: 48px 0;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
}

.section-title .bar {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  box-shadow: 0 0 18px var(--brand);
}

.section-title h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow: 0 0 20px rgba(8, 226, 116, 0.4);
  padding-bottom: 8px;
  border-bottom: 3px solid var(--brand);
  display: inline-block;
}

.muted {
  color: var(--muted);
}

.skills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

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

.skill {
  padding: 18px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .015));
  transition: transform .18s ease, box-shadow .2s ease, border-color .2s ease, background .25s ease;
}

.skill:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .35), 0 0 22px rgba(8, 226, 116, .18);
  border-color: rgba(255, 255, 255, .16);
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
}

.skill-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.skill-header strong {
  font-size: 16px;
  letter-spacing: .2px;
}

.skill .muted {
  font-size: 12px;
}

.skill-icon {
  width: 20px;
  height: 20px;
  opacity: .95;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .35));
}

.icon-emoji {
  font-size: 18px;
  line-height: 1;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .35));
}

/* Modern meter */
.meter {
  height: 10px;
  background: #0c1a14;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .08);
  margin: 10px 0 8px;
  position: relative;
}

.meter .fill {
  --p: 0%;
  width: var(--p);
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  box-shadow: 0 0 20px var(--ring) inset, 0 0 10px color-mix(in srgb, var(--brand) 40%, transparent);
  border-radius: 999px;
  /* round ends */
  transform-origin: left center;
  transition: width .9s cubic-bezier(.2, .9, .2, 1);
}

/* Badges inside skills */
.skill .badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.skill .badge {
  font-size: 11px;
  padding: 6px 10px;
  color: #cfe9da;
  background: rgba(8, 226, 116, .08);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
}

.projects {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-items: start;
}

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

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

/* Featured Website-Kachel (volle Breite) – verhindert "hängende" letzte Reihe */
.proj.website {
  grid-column: 1 / -1;
}

.proj.website .mock {
  padding: 12px;
}

.proj.website .laptop {
  max-width: min(92%, 900px);
  margin: 0 auto;
}

@media (max-width: 1100px) {
  .proj.website {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .proj.website .laptop {
    max-width: 100%;
  }
}

.proj {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .02));
}

.proj-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 0;
}

.tag {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .14);
  color: #b7ffd7;
  background: rgba(8, 226, 116, .08);
}

/* About: modern, luftiger, mit klaren Schlagwörtern (nutzt bestehende Tokens/Styles) */
#about .about-lead {
  margin: 0 0 14px;
  max-width: 72ch;
}

#about .about-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

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

#about .about-block {
  padding: 14px 14px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--text) 4%, transparent),
    transparent
  );
}

#about .about-block .eyebrow {
  margin-bottom: 10px;
}

#about .about-block .muted {
  margin: 0;
  line-height: 1.6;
}

/* Schlagwörter in About: dezentes Highlight, gut lesbar */
#about strong {
  font-weight: 750;
  color: var(--text);
}

.mock {
  padding: 10px;
}

.phone {
  position: relative;
  width: 100%;
  aspect-ratio: 9/19.5;
  margin: 0 auto;
  border-radius: 28px;
  border: 2px solid #171f2c;
  background: linear-gradient(180deg, #0d1522, #0a121b);
  box-shadow: inset 0 0 0 6px #0b1320, 0 10px 30px rgba(0, 0, 0, .45);
}

.phone::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 22px;
  background: var(--mock, linear-gradient(135deg, #223047, #162132));
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  border: 1px solid rgba(255, 255, 255, .08);
}

.laptop {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: 12px;
  border: 2px solid #182233;
  background: linear-gradient(180deg, #0d1522, #0a121b);
  box-shadow: inset 0 0 0 5px #0b1320, 0 10px 30px rgba(0, 0, 0, .45);
}

.laptop::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 6px;
  background: var(--mock, linear-gradient(135deg, #24324a, #111a26));
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  border: 1px solid rgba(255, 255, 255, .08);
}

.proj .info {
  padding: 0 12px 14px;
  color: var(--muted);
  font-size: 13px;
}

.proj h3 {
  margin: 6px 12px;
  font-size: 17px;
}

.proj:hover {
  transform: translateY(-2px);
  transition: transform .15s;
}

/* Einheitliche Laptop-Projekte (n8n, KiForKids, Monster Run) */
.proj.laptop-proj {
  display: flex;
  flex-direction: column;
}

.proj.laptop-proj .mock {
  padding: 12px;
}

.proj.laptop-proj .proj-head {
  min-height: 48px;
}

.proj.laptop-proj .info {
  min-height: 60px;
}

/* Quadratische Projektkacheln (z.B. n8n, KiForKids, Monster Run) */
.proj.is-square .laptop {
  aspect-ratio: 1 / 1;
}

.proj.is-square .laptop::before {
  background-size: cover;
  /* füllt den Rahmen, keine Balken */
  background-position: center;
  inset: 6px;
  /* etwas mehr sichtbare Fläche */
}

/* Zoom-out für n8n Workflow - zeigt mehr vom Bild */
.proj.zoom-out .laptop::before {
  background-size: contain;
  background-color: #0a0e15;
}

/* Modal Styles */
.modal[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .75);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  width: min(700px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 32px 28px;
  border-radius: 18px;
  background: #121a26;
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  z-index: 2;
}

.modal-content h3 {
  margin: 0 0 12px;
  font-size: 24px;
  text-align: center;
}

.modal-content h4 {
  margin: 24px 0 10px;
  font-size: 18px;
  color: var(--neon, #08e274);
}

.modal-content p {
  line-height: 1.6;
  margin-bottom: 12px;
}

.modal-content ul {
  margin: 0 0 16px;
  padding-left: 20px;
}

.modal-content li {
  margin-bottom: 8px;
  line-height: 1.6;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 10px;
  background: #101826;
  color: var(--text);
  font-weight: 700;
  width: 36px;
  height: 36px;
  cursor: pointer;
  transition: all .2s;
}

.modal-close:hover {
  background: #1a2332;
  border-color: rgba(255, 255, 255, .25);
}

.modal-image {
  margin: 0 auto 24px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .15);
  max-width: 350px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}

.modal-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Clickable project hint */
.proj[data-modal-target] {
  cursor: pointer;
}

/* Education: klickbare Einträge + Bildraster im Modal */
.click-preview {
  cursor: pointer;
}

.click-preview:hover,
.click-preview:focus-visible {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.image-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

@media (min-width: 780px) {
  .image-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.image-grid img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
}

.timeline {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.tl-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 18px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .01));
}

@media (max-width: 720px) {
  .tl-item {
    grid-template-columns: 1fr;
  }
}

.tl-date {
  font-family: "JetBrains Mono", monospace;
  color: #bdeacf;
  font-size: 12px;
}

/* Experience Blur Effect */
.experience-blur-wrapper {
  position: relative;
  margin-top: 12px;
}

.tl-item.blurred {
  filter: blur(4px);
  opacity: 0.4;
  pointer-events: none;
  user-select: none;
  transition: filter 0.3s ease, opacity 0.3s ease;
}

/* CTA Overlay */
.experience-cta {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  text-align: center;
  width: 85%;
  max-width: 380px;
}

.experience-cta-content {
  background: linear-gradient(135deg, rgba(18, 26, 38, 0.92), rgba(15, 20, 32, 0.95));
  border: 1px solid rgba(8, 226, 116, 0.25);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(8, 226, 116, 0.1),
    inset 0 0 20px rgba(8, 226, 116, 0.03);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.experience-cta-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 14px;
  line-height: 1.4;
  letter-spacing: 0.2px;
}

.experience-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 10px 18px;
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.35),
    0 0 14px rgba(8, 226, 116, 0.2);
}

.experience-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(8, 226, 116, 0.3);
}

@media (max-width: 720px) {
  .experience-cta {
    max-width: 320px;
  }

  .experience-cta-content {
    padding: 16px 18px;
  }

  .experience-cta-text {
    font-size: 13px;
    margin: 0 0 12px;
  }

  .experience-cta-btn {
    font-size: 12px;
    padding: 9px 16px;
  }
}


footer {
  padding: 40px 0 80px;
  color: var(--muted);
  text-align: center;
}

.foot-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: .6s ease;
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* Staggered entrance for skills */
.skills .skill {
  opacity: 0;
  transform: translateY(8px);
}

.reveal.is-in .skills .skill {
  opacity: 1;
  transform: none;
  transition: transform .4s ease, opacity .4s ease, box-shadow .2s ease;
}

.reveal.is-in .skills .skill:nth-child(1) {
  transition-delay: .02s;
}

.reveal.is-in .skills .skill:nth-child(2) {
  transition-delay: .06s;
}

.reveal.is-in .skills .skill:nth-child(3) {
  transition-delay: .10s;
}

.reveal.is-in .skills .skill:nth-child(4) {
  transition-delay: .14s;
}

.reveal.is-in .skills .skill:nth-child(5) {
  transition-delay: .18s;
}

.reveal.is-in .skills .skill:nth-child(6) {
  transition-delay: .22s;
}

/* Back-to-top Button */
.back-to-top {
  position: fixed;
  right: 20px;
  /* über dem n8n Chat Toggle (Defaultgröße 64px) bleiben */
  bottom: calc(24px + env(safe-area-inset-bottom) + var(--chat--toggle--size, 64px) + 8px);
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--neon, #08e274) 28%, rgba(255, 255, 255, .14));
  background: linear-gradient(180deg, color-mix(in srgb, var(--neon, #08e274) 6%, rgba(255, 255, 255, .06)), rgba(255, 255, 255, .03));
  color: #e8ffee;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(0, 0, 0, .34), 0 0 8px rgba(8, 226, 116, .18);
  opacity: 0;
  transform: translateY(6px) scale(.92);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, box-shadow .18s ease;
  z-index: 50;
}

.back-to-top svg {
  width: 22px;
  height: 22px;
  fill: #e8ffee;
  transition: transform .18s ease, filter .18s ease;
  filter: drop-shadow(0 0 4px rgba(8, 226, 116, .25));
}

.back-to-top::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: inherit;
  background: radial-gradient(60% 60% at 50% 50%, color-mix(in srgb, var(--neon, #08e274) 18%, rgba(255, 255, 255, .08)), transparent 70%);
  filter: blur(10px);
  opacity: .0;
  transition: opacity .2s ease;
  z-index: -1;
}

.back-to-top:hover {
  transform: translateY(2px) scale(1.02);
  box-shadow: 0 12px 24px rgba(0, 0, 0, .38), 0 0 12px rgba(8, 226, 116, .26);
}

.back-to-top:hover svg {
  transform: translateY(-1px);
  filter: drop-shadow(0 0 6px rgba(8, 226, 116, .45));
}

.back-to-top:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring), 0 10px 24px rgba(0, 0, 0, .35);
}

.back-to-top.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.back-to-top.is-visible::before {
  opacity: .2;
  box-shadow: 0 0 16px rgba(8, 226, 116, .22);
}

/* If the ElevenLabs voice widget is present, add extra space to avoid overlap */
body[data-has-voice] .back-to-top {
  /* gleiche kleine Lücke wie im Normalfall */
  bottom: calc(24px + env(safe-area-inset-bottom) + var(--chat--toggle--size, 64px) + 8px);
}

/* Tools section */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

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

.tool.card {
  padding: 16px;
}

/* Minimal Icons Bar */
.tools-icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px 24px;
  margin-top: 10px;
}

.tools-icons figure {
  width: 82px;
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.tools-icons img {
  width: 36px;
  height: 36px;
  margin: 0 auto 6px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .35));
  opacity: .95;
}

.tools-icons figcaption {
  line-height: 1.2;
}

/* textual tools list removed */

/* Terminal demo */
.terminal {
  margin-top: 18px;
  overflow: hidden;
  position: relative;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: rgba(0, 0, 0, .25);
  position: relative;
}

.terminal-header .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.terminal-header .dot.red {
  background: #ff5f56;
}

.terminal-header .dot.yellow {
  background: #ffbd2e;
}

.terminal-header .dot.green {
  background: #27c93f;
}

.terminal-header .title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: #9fb3c8;
  font-size: 12px;
  font-family: "JetBrains Mono", monospace;
}

.terminal-body {
  position: relative;
  padding: 14px;
  min-height: 120px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .02), rgba(255, 255, 255, .01));
}

.terminal-output {
  margin: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
  color: #cfe9da;
}

.terminal-output .caret {
  display: inline-block;
  width: 8px;
  height: 1.2em;
  background: #cfe9da;
  margin-left: 2px;
  animation: blink 1s step-end infinite;
  vertical-align: bottom;
}

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

/* Coffee‑Button in der Actions‑Leiste */
#terminal-coffee {
  margin-left: auto;
}

.terminal-actions {
  display: flex;
  justify-content: flex-end;
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  background: rgba(0, 0, 0, .15);
}

.btn.small {
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 10px;
}

.btn.small:disabled {
  opacity: .6;
  cursor: not-allowed;
}

/* Terminal Start Button: weißer Text */
#terminal-start {
  color: #fff;
}

/* Buy-me-a-coffee Button moved to Contact section; terminal styles removed */

/* Neon Glow: Yellow for Buy-me-a-coffee (contact + terminal) */
.buy-coffee,
#terminal-coffee {
  /* keep yellow base */
  background: #ffd87a;
  color: #3a2a00;
  border-color: color-mix(in srgb, #ffd87a 40%, transparent);
  /* neon aura */
  box-shadow:
    0 10px 30px rgba(0, 0, 0, .35),
    0 0 16px rgba(255, 216, 122, .35),
    0 0 34px rgba(255, 216, 122, .22);
  position: relative;
  /* for steam positioning */
  overflow: visible;
  z-index: 1;
  /* ensure on top of card backgrounds */
  /* Steam anchor near the cup emoji */
  --steam-x: 28px;
}

.buy-coffee:hover,
#terminal-coffee:hover {
  box-shadow:
    0 12px 34px rgba(0, 0, 0, .38),
    0 0 22px rgba(255, 216, 122, .50),
    0 0 40px rgba(255, 216, 122, .28);
}

.buy-coffee:focus-visible,
#terminal-coffee:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px var(--ring),
    0 10px 26px rgba(0, 0, 0, .38),
    0 0 24px rgba(255, 216, 122, .55);
}

/* Coffee Steam Effect (CSS-only) */
.buy-coffee::before,
.buy-coffee::after,
#terminal-coffee::before,
#terminal-coffee::after {
  content: "";
  position: absolute;
  left: var(--steam-x, 50%);
  bottom: calc(100% + 6px);
  width: 22px;
  height: 22px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0));
  filter: blur(3px) brightness(1.06);
  opacity: 0;
  /* animated in */
  pointer-events: none;
  will-change: transform, opacity;
  z-index: 2;
  /* above the button */
  mix-blend-mode: screen;
  animation: coffee-steam 3s ease-in-out infinite;
}

.buy-coffee::after,
#terminal-coffee::after {
  left: calc(var(--steam-x, 50%) + 10px);
  width: 28px;
  height: 28px;
  filter: blur(5px) brightness(1.08);
  animation: coffee-steam 3.6s ease-in-out infinite .35s;
  /* offset */
}

@keyframes coffee-steam {
  0% {
    transform: translate(-50%, 6px) scale(.7);
    opacity: 0;
  }

  12% {
    transform: translate(-49%, 0) scale(.95);
    opacity: .45;
  }

  38% {
    transform: translate(-48%, -22px) scale(1.25);
    opacity: .75;
  }

  68% {
    transform: translate(-47%, -46px) scale(1.6);
    opacity: .55;
  }

  100% {
    transform: translate(-52%, -72px) scale(2);
    opacity: 0;
  }
}

/* Hover: etwas kräftiger und schneller */
.buy-coffee:hover::before,
.buy-coffee:hover::after,
#terminal-coffee:hover::before,
#terminal-coffee:hover::after {
  animation-duration: 2.2s;
  filter: blur(3px) brightness(1.15);
}

@media (prefers-reduced-motion: reduce) {

  .buy-coffee::before,
  .buy-coffee::after,
  #terminal-coffee::before,
  #terminal-coffee::after {
    display: none;
  }
}

/* Neon Button Styles (Green) */
.neon-green {
  --neon: #08e274;
}

/* Circular neon icon button – ideal für Play/Action */
.neon-icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: rgba(7, 19, 11, .75);
  border: 1px solid color-mix(in srgb, var(--neon, #08e274) 34%, transparent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--neon, #08e274) 28%, transparent), inset 0 0 6px color-mix(in srgb, var(--neon, #08e274) 16%, transparent), 0 0 12px rgba(8, 226, 116, .22);
  color: #fff;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}

.neon-icon-btn::before {
  content: "";
  position: absolute;
  inset: -16px;
  border-radius: inherit;
  background: radial-gradient(50% 50% at 50% 50%, color-mix(in srgb, var(--neon, #08e274) 18%, transparent), transparent 60%);
  filter: blur(14px);
  opacity: .5;
  z-index: -1;
  box-shadow: 0 0 16px rgba(8, 226, 116, .22);
}

.neon-icon-btn:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 0 16px color-mix(in srgb, var(--neon, #08e274) 40%, transparent), inset 0 0 8px color-mix(in srgb, var(--neon, #08e274) 20%, transparent);
}

.neon-icon-btn:active {
  transform: translateY(0) scale(.99);
}

.neon-icon-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring), 0 0 16px color-mix(in srgb, var(--neon, #08e274) 40%, transparent);
}

/* Built-in play triangle for icon button */
.neon-icon-btn.play::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 16px solid #fff;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--neon, #08e274) 50%, transparent)) drop-shadow(0 0 8px rgba(8, 226, 116, .28));
  transform: translateX(2px);
}

/* Pill-shaped neon text button */
.neon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--neon, #08e274) 30%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--neon, #08e274) 8%, transparent), rgba(255, 255, 255, .02));
  color: #ecfff5;
  text-shadow: 0 0 6px color-mix(in srgb, var(--neon, #08e274) 28%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--neon, #08e274) 6%, transparent) inset, 0 0 14px color-mix(in srgb, var(--neon, #08e274) 28%, transparent), 0 0 14px rgba(8, 226, 116, .22);
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}

.neon-btn::before {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: inherit;
  background: radial-gradient(45% 45% at 50% 50%, color-mix(in srgb, var(--neon, #08e274) 18%, transparent), transparent 60%);
  filter: blur(16px);
  opacity: .45;
  z-index: -1;
  box-shadow: 0 0 16px rgba(8, 226, 116, .22);
}

.neon-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--neon, #08e274) 8%, transparent) inset, 0 0 16px color-mix(in srgb, var(--neon, #08e274) 38%, transparent);
}

.neon-btn:active {
  transform: translateY(0);
}

.neon-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring), 0 0 16px color-mix(in srgb, var(--neon, #08e274) 38%, transparent);
}

/* Confetti overlay inside terminal */
#confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
}

.terminal-output {
  position: relative;
  z-index: 1;
}

.confetti-piece {
  position: absolute;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  opacity: 0.95;
  will-change: transform, opacity;
}

/* ensure canvas-based celebration fills the overlay */
#confetti canvas {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* AI HUD Title overlay (above canvas) */
#confetti .ai-hud-title {
  position: absolute;
  top: var(--hud-title-top, 120px);
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 8px;
  color: #eaffff;
  font: 700 12px "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.08em;
  text-shadow: 0 0 8px rgba(0, 255, 234, .35), 0 0 12px rgba(0, 255, 234, .2);
  filter: drop-shadow(0 0 4px rgba(0, 255, 234, .15));
  opacity: 0.85;
  user-select: none;
  z-index: 6;
  /* above canvas */
}

/* n8n Chat – nur Toggle-Button anpassen */
#n8n-chat {
  /* solide Farben für bessere Kompatibilität (Safari) */
  --chat--toggle--background: var(--brand);
  --chat--toggle--hover--background: #06cb67;
  --chat--toggle--active--background: #05b359;
  --chat--toggle--color: #07130b;
  /* dunkles Icon wie bei deinen Primärbuttons */
  --chat--toggle--size: 64px;
  /* Standardgröße lassen (wir nutzen sie für den Back-to-top-Abstand) */
}

/* ElevenLabs ConvAI responsive guards */
elevenlabs-convai {
  /* sichere Ränder je nach Viewport, zusätzlich zur JS‑Anpassung */
  --el-overlay-padding: 12px;
  /* Dark theme for widget surfaces (sheets/modals/banners) */
  --el-base: #0b0f14;
  /* Grundfläche dunkel */
  --el-base-hover: #111821;
  /* Hover-Zustand */
  --el-base-active: #0a1118;
  /* Active-Zustand */
  --el-base-border: rgba(255, 255, 255, .12);
  /* dezente Rahmenfarbe */
  --el-base-primary: #ffffff;
  /* Primärtext hell */
  --el-base-subtle: #9fb3c8;
  /* Sekundärtext */
  z-index: 60;
  /* über Karten, unter Modals */
}

/* Wenn oben rechts platziert: etwas nach unten schieben, um Header nicht zu überlappen */
elevenlabs-convai[placement="top-right"] {
  /* leicht mehr allgemeiner Abstand, sodass Top-Placement sichtbar tiefer sitzt */
  --el-overlay-padding: 24px;
}

@media (max-width: 900px) {
  elevenlabs-convai {
    --el-overlay-padding: 8px;
    /* Mobil kompakt */
  }

  /* Mobil trotzdem etwas Luft bei top-right */
  elevenlabs-convai[placement="top-right"] {
    --el-overlay-padding: 16px;
  }

  elevenlabs-convai[placement="bottom-left"] {
    --el-overlay-padding: 16px;
  }
}

@supports (padding: max(0px)) {

  /* Safe‑Area auf iOS mit berücksichtigen */
  elevenlabs-convai {
    padding-right: max(12px, env(safe-area-inset-right));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    padding-left: max(12px, env(safe-area-inset-left));
  }
}

/* Kleine Überschneidungen vermeiden: Abstand zu Back‑to‑top erhöhen falls nah */
@media (max-width: 600px) {
  body[data-has-voice] .back-to-top {
    right: 18px;
    bottom: calc(18px + env(safe-area-inset-bottom) + var(--chat--toggle--size, 64px) + 10px);
  }
}