/* CSS: Modern, responsiv, zugänglich */

/* Design Tokens */
:root {
  --bg: #0b0c10;
  --panel: #111218;
  --text: #e7e9ee;
  --muted: #b7bcc6;
  --brand: #7c5cff;
  --brand-2: #2dd4bf;  
  --brand-2-mix: #e7e9ee;
  --line: #22232b;

  --radius: 14px;
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
  --container: 1100px;

  --step-0: clamp(0.88rem, 0.82rem + 0.25vw, 1rem);
  --step-1: clamp(1.00rem, 0.90rem + 0.50vw, 1.20rem);
  --step-2: clamp(1.20rem, 1.05rem + 0.80vw, 1.50rem);
  --step-3: clamp(1.50rem, 1.28rem + 1.20vw, 1.95rem);
  --step-4: clamp(1.90rem, 1.55rem + 1.80vw, 2.60rem);
}

[data-theme="light"] {
  --bg: #f7f8fb;
  --panel: #ffffff;
  --text: #0e0f14;
  --muted: #5b6270;
  --brand: #7c5cff;
  --brand-2: #2dd4bf;
  --brand-2-mix: #64acce;
  --line: #e7e8ee;
}

/* Base */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu,
    Cantarell, Noto Sans, Helvetica Neue, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  color: var(--text);
  background: radial-gradient(1200px 600px at 10% -10%, rgba(124,92,255,.18), transparent 60%),
              radial-gradient(1000px 500px at 90% -10%, rgba(45,212,191,.18), transparent 55%),
              var(--bg);
  line-height: 1.55;
  font-size: var(--step-1);
}

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

img { max-width: 100%; display: block; }
svg { vertical-align: middle; }

/* Accessibility */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  background: var(--panel);
  color: var(--text);
  padding: .6rem .9rem;
  border-radius: .5rem;
  outline: 2px solid var(--brand);
}

/* Header / Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in oklab, var(--bg), transparent 12%);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .9rem 0;
}
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: inherit; }
.brand-mark { color: var(--brand); font-size: 1.1rem; }
.brand-text { font-weight: 700; letter-spacing: .3px; }

.site-nav { position: relative; }
.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  border-radius: .6rem;
  border: 1px solid var(--line);
  background: var(--panel);
}
.nav-toggle-bar { display: block; width: 20px; height: 2px; margin: 5px auto; background: var(--text); }

.nav-list { display: flex; gap: 1rem; list-style: none; margin: 0; padding: 0; }
.nav-list a {
  text-decoration: none;
  color: var(--text);
  padding: .5rem .75rem;
  border-radius: .5rem;
}
.nav-list a.active, .nav-list a:hover { background: var(--panel); border: 1px solid var(--line); }

.theme-toggle {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: .6rem;
  width: 42px; height: 42px;
}
.theme-icon { display: inline-block; transform: translateY(1px); }

/* Sections */
.section { padding: min(12vh, 7rem) 0; min-height: 100vh;}
.section-head { margin-bottom: 2rem; }
.section-head h2 { font-size: var(--step-4); line-height: 1.1; margin: 0 0 .3rem; letter-spacing: -.5px; }
.section-head p { color: var(--muted); margin: 0; }

/* Projects section - sticky header and scroll behavior */
.section.projects {
  min-height: auto; /* Allow section to grow with content */
  scroll-snap-align: start;
  padding-bottom: 0;
}

.projects .section-head {
  position: sticky;
  top: 80px; /* Below main header */
  z-index: 10;
  background: color-mix(in oklab, var(--bg), transparent 8%);
  backdrop-filter: saturate(140%) blur(12px);
  padding: 1.5rem 0;
  margin-bottom: 0;
  border-bottom: 1px solid var(--line);
}

/* Hero */
.hero-inner { display: flex; flex-wrap: wrap; flex-direction: column; align-items: center; height: 100%; }
.hero h1 { font-size: clamp(2rem, 2vw + 2rem, 3rem); line-height: 1.05; margin: 0 0 1rem; letter-spacing: -.8px; width: 60vb;}
.lead { font-size: var(--step-2); color: var(--muted); }
.hero-cta { display: flex; gap: .8rem; margin: 1.2rem 0 1.2rem; }
.btn { display: inline-block; padding: .8rem 1rem; border-radius: .7rem; border: 1px solid var(--line); text-decoration: none; color: var(--text); background: var(--panel); }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border: none; color: white; box-shadow: var(--shadow); }

/* Hero icons (diagonale Anordnung) */
.hero-copy { display: flex; flex-direction: column; justify-content: space-around; gap: 5rem; width: 100%; flex: 1;}
.hero-text{display: flex; flex-direction:column; align-items: start; padding-top: 5%;}
.hero-action{display: flex; flex-direction:column; align-items: end; margin-right: 10%;}
.hero-icons {
  display: grid;
  grid-template-columns: repeat(3, minmax(80px, 1fr));
  grid-auto-rows: auto;
  gap: 1.2rem 1.5rem;
  pointer-events: auto;
  width: min(100%, 460px);
  justify-items: center;
  cursor: pointer;
}
.hero-icon { display: grid; place-items: center; border-radius: .9rem; background: none; color: var(--text); }
.hero-icon i { font-size: 80px; line-height: 1; filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3)); }
.hero-icon-gear { transform: rotate(-6deg); color: var(--brand); }
.hero-icon-factory { transform: rotate(2deg); color: color-mix(in oklab, var(--brand-2), var(--brand-2-mix) 10%); }
.hero-icon-code { transform: rotate(-3deg); }

.hero-path {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .8rem;
  font-size: var(--step-0);
  color: var(--muted);
  width: 100%;
}
.hero-step {
  padding: .25rem .65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--panel), transparent 20%);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}
.hero-step--plc { color: var(--brand-2); border-color: color-mix(in oklab, var(--brand-2), var(--line) 40%); }
.hero-step--software { color: var(--brand); border-color: color-mix(in oklab, var(--brand), var(--line) 40%); }
.hero-path-track {
  position: relative;
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--line), transparent 35%);
  overflow: hidden;
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 .8rem;
}
.hero-path-progress {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--brand-2), var(--brand));
  border-radius: inherit;
  transform-origin: left center;
  transform: scaleX(0);
}
.hero-path-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0;
  z-index: 1;
}
.hero-path-track .hero-path-dot:nth-of-type(1) { color: var(--brand-2); }
.hero-path-track .hero-path-dot:nth-of-type(2) { color: color-mix(in oklab, var(--brand-2), var(--brand) 50%); }
.hero-path-track .hero-path-dot:nth-of-type(3) { color: var(--brand); }
.hero-animation-caption {
  max-width: 36ch;
  color: var(--muted);
  margin: .5rem 0 0;
}

/* Hero icons - hidden state for domino animation */
.hero-icon.hidden {
  opacity: 1;
  transform: none;
}

/* About */
.about-grid { display: flex; gap: 2rem; align-items: center; }
.about-img { flex: 0 0 40%; }
.about-content { flex: 1 1 60%; min-width: 0; }
.about-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.about-list li { background: var(--panel); border: 1px solid var(--line); padding: .7rem .9rem; border-radius: .7rem; }
.portrait {display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.portrait img { width: clamp(140px, 28vw, 220px); height: auto; aspect-ratio: 1 / 1; object-fit:scale-down; border-radius: 999px; border: 2px solid var(--line); box-shadow: var(--shadow); background-color: #DCD1CB;}


/* Projects */
.project-grid { display: flex; flex-wrap: wrap; gap: 1rem; }
.project-grid > .project, .project-grid > .card { flex: 1 1 clamp(240px, 32%, 360px); }
.tag { font-size: var(--step-0); color: var(--muted); border: 1px dashed var(--line); padding: .25rem .5rem; border-radius: .5rem; }
.project-links { display: flex; gap: .8rem; margin-top: .8rem; }
.project-links a { color: var(--text); text-decoration: none; border-bottom: 1px dashed var(--line); }

/* Feature Projects (volle Breite, thematischer Hintergrund) */
.feature-projects {
  position: relative;
  /* Height = number of projects × viewport height for scroll length */
  height: calc(300vh); /* 3 projects × 100vh each */
  margin-bottom: 1.5rem;
}

.feature-projects-container {
  position: sticky;
  top: 160px; /* Below header and section-head */
  height: calc(100vh - 200px);
  overflow: hidden;
}

.feature {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  min-height: clamp(400px, 80vh, 600px);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: translateX(100%); /* Start off-screen right */
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

/* Animation states for horizontal sliding */
.feature.project-prev {
  transform: translateX(-100%); /* Exited to left */
}

.feature.project-active {
  transform: translateX(0); /* On screen */
}

.feature.project-next {
  transform: translateX(100%); /* Waiting off-screen right */
}
.feature::after { content: ""; position: absolute; inset: 0;  pointer-events: none; }
.feature-block {display: flex; height: 100%; flex-direction: row; justify-content: center; padding: clamp(1rem, 4vw, 3rem);border-radius: var(--radius); background: linear-gradient(90deg, rgba(0,0,0,.55), rgba(0,0,0,.25)); color: #fff;}
.feature-content{ display: flex; flex-direction: column; justify-content: center; z-index: 1; height: 100%; gap: .8rem; padding: clamp(1rem, 4vw, 3rem); color: #fff; }
.feature-imagesection{display: flex; flex-direction: column; justify-content: center;}
.feature h3 { margin: 0; font-size: clamp(1.2rem, 1.2rem + 1vw, 2rem); }
.feature .muted { color: #d9dbe1; }
.feature .btn { border-color: rgba(255,255,255,.35); background: rgba(0,0,0,.2); }
.feature .btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); }

/* Hintergrundbilder je Thema */
/*.project--home { background: url('https://images.unsplash.com/photo-1518770660439-4636190af475?q=80&w=1600&auto=format&fit=crop') center/cover no-repeat; }*/
.project--camper { background: url('https://images.unsplash.com/photo-1469474968028-56623f02e42e?q=80&w=1600&auto=format&fit=crop') center/cover no-repeat; }
.project--route { background: url('https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?q=80&w=1600&auto=format&fit=crop') center/cover no-repeat; }

/* Statements */
.statement-grid { display: flex; flex-wrap: wrap; gap: 1rem; }
.statement-card { flex: 1 1 clamp(260px, 32%, 420px); }
.statement-card { padding: 0; }
.statement-card h3 { margin: .9rem 1rem .4rem; }
.statement-card p { margin: 0 1rem 1rem; color: var(--muted); }
.statement-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; border-bottom: 1px solid var(--line); }

/* GitHub Showcase */
.section-sub { margin: 2rem 0 .5rem; font-size: var(--step-2); }
.muted { color: var(--muted); }

.github-showcase {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

.github-featured-card {
  position: relative;
  max-width: 800px;
  width: 100%;
  padding: 2rem;
  background: linear-gradient(135deg,
    color-mix(in oklab, var(--brand), transparent 85%) 0%,
    color-mix(in oklab, var(--brand-2), transparent 90%) 100%);
  border: 1px solid color-mix(in oklab, var(--brand), var(--line) 70%);
  border-radius: calc(var(--radius) * 1.2);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12),
              0 0 0 1px color-mix(in oklab, var(--brand), transparent 80%);
  transition: all 0.3s ease;
  overflow: hidden;
}

.github-featured-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.github-featured-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 48px rgba(0,0,0,0.18),
              0 0 0 1px color-mix(in oklab, var(--brand), transparent 60%);
}

.github-featured-card .repo-head {
  font-size: var(--step-2);
  font-weight: 700;
  margin-bottom: 1rem;
}

.github-featured-card .repo-head a {
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.github-featured-card .repo-head a:hover {
  color: var(--brand);
}

.github-featured-card .repo-desc {
  color: var(--text);
  font-size: var(--step-1);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  min-height: auto;
}

.github-featured-card .repo-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  color: var(--muted);
  font-size: var(--step-0);
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.repo-lang {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 500;
}

.repo-dot {
  width: .8rem;
  height: .8rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--brand), transparent 70%);
}

.repo-stars {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-weight: 500;
}

.repo-stars .star {
  color: var(--brand-2);
  font-size: 1.1em;
}

.github-featured-card .repo-stats a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  color: var(--text);
  text-decoration: none;
  font-size: var(--step-0);
  transition: all 0.2s ease;
}

.github-featured-card .repo-stats a:hover {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
  border-color: transparent;
}

/* Skeleton loading */
.skeleton .repo-head, .skeleton .repo-desc, .skeleton .repo-stats {
  background: linear-gradient(90deg,
    color-mix(in oklab, var(--panel), var(--bg) 20%),
    color-mix(in oklab, var(--panel), var(--bg) 40%),
    color-mix(in oklab, var(--panel), var(--bg) 20%));
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: .5rem;
}

.skeleton .repo-head { height: 1.8rem; width: 60%; margin-bottom: 1rem; }
.skeleton .repo-desc { height: 4rem; width: 100%; margin-bottom: 1.5rem; }
.skeleton .repo-stats { height: 1.2rem; width: 80%; }

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

/* Domino/Kick Effect Keyframes */

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1rem; position: relative; }
.timeline:before { content: ""; position: absolute; left: 10px; top: .2rem; bottom: .2rem; width: 2px; background: var(--line); }
.timeline-item { display: flex; gap: 1rem; padding-left: 1.5rem; position: relative; }
.timeline-item:before { content: ""; position: absolute; left: 4px; top: .6rem; width: 14px; height: 14px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-radius: 999px; box-shadow: 0 0 0 3px color-mix(in oklab, var(--panel), transparent 30%); }
.timeline .time { color: var(--muted); font-weight: 600; width: 120px; flex: 0 0 120px; }
.timeline .content { background: var(--panel); border: 1px solid var(--line); border-radius: .9rem; padding: 1rem; flex: 1 1 auto; }
.timeline .content h3 { margin: 0 0 .3rem; }
.timeline .content p { margin: 0; color: var(--muted); }

/* Contact (entfernt) */

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: color-mix(in oklab, var(--bg), transparent 8%); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.2rem 0; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; gap: .9rem; }
.footer-links a { color: var(--muted); text-decoration: none; }

/* Responsive: entfernt – Flex‑Basis sorgt für natürliches Umbrechen */
/* Skills */
.skills-grid { display: flex; flex-wrap: wrap; gap: 1rem; }
.skills-grid > .card { flex: 1 1 clamp(260px, 30%, 360px); }


@media (max-width: 960px) {
  .hero-copy { display: flex; flex-direction: column; justify-content: space-around; align-items: center; gap: 2rem; }
  .hero-action { margin-right: 0; }
  .hero-icons { width: 100%; grid-template-columns: repeat(3, minmax(60px, 1fr)); }
  .about-grid { display: flex; flex-direction: column; gap: 2rem; align-items: center; }
  .statement-grid { display: flex; flex-direction: column; gap: 1rem; }
}

/* ========================================
   Scroll Animations
   ======================================== */

@media (prefers-reduced-motion: no-preference) {
  /* Hidden state - initial state before animation */
  .hidden {
    opacity: 0;
    /* filter: blur(5px); */
    transform: translateX(-100px);
    transition: all 0.6s ease-out;
  }

  /* Show state - animate in */
  .show {
    opacity: 1;
    filter: blur(0);
    transform: translateX(0);
  }

  /* Variations for different animation directions */
  .hidden.slide-right {
    /* transform: translateX(100px); */
  }

  .hidden.slide-up {
    transform: translateY(50px);
    /* filter: blur(3px); */
  }

  .hero-icon.hidden.slide-up {
    transform: none;
  }

  .hidden.slide-down {
    transform: translateY(-50px);
  }

  .hidden.fade-only {
    transform: none;
    filter: none;
  }

  /* Stagger delays for statement cards */
  .statement-card:nth-child(1) { transition-delay: 0ms; }
  .statement-card:nth-child(2) { transition-delay: 150ms; }
  .statement-card:nth-child(3) { transition-delay: 300ms; }

  /* Stagger delays for feature projects */
  .feature:nth-child(1) { transition-delay: 0ms; }
  .feature:nth-child(2) { transition-delay: 200ms; }
  .feature:nth-child(3) { transition-delay: 400ms; }

  /* Stagger delays for timeline items */
  .timeline-item:nth-child(1) { transition-delay: 0ms; }
  .timeline-item:nth-child(2) { transition-delay: 100ms; }
  .timeline-item:nth-child(3) { transition-delay: 200ms; }
  .timeline-item:nth-child(4) { transition-delay: 300ms; }
  .timeline-item:nth-child(5) { transition-delay: 400ms; }
  .timeline-item:nth-child(6) { transition-delay: 500ms; }
}

/* Fallback for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hidden {
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .show {
    opacity: 1;
  }

  /* Simplified hero icons for reduced motion */
  .hero-path .hero-path-progress {
    transform: scaleX(1);
  }

  .hero-path .hero-path-dot {
    opacity: 1;
  }
}

/* ========================================
   Smooth Scroll Snap
   ======================================== */

html {
  scroll-snap-type: y proximity;
  scroll-behavior: smooth;
}

.section {
  scroll-snap-align: start;
  scroll-snap-stop: normal;
}
