/* =========================================================
   LOKALE SCHRIFTEN (@font-face)
   Dateien liegen im Ordner /fonts – kein externes CDN.
   ========================================================= */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/space-grotesk-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/space-grotesk-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/inter-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/inter-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/inter-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2");
}

/* =========================================================
   DESIGN-TOKENS (heller Modus = Standard)
   ========================================================= */
:root {
  --bg:      #fbfaf7;            /* warmes Papierweiß    */
  --ink:     #181a23;           /* fast schwarz         */
  --muted:   #5b5f6e;           /* gedämpfter Text      */
  --accent:  #ff6b4a;           /* Korallrot (Akzent)   */
  --plum:    #2d2a45;           /* dunkle Sektionen     */
  --line:    #e7e3da;           /* Haarlinien           */
  --card:    #ffffff;           /* Kartenhintergrund    */
  --nav-bg:  rgba(251,250,247,.85);
  --radius:  14px;
}

/* Dunkler Modus: gleiche Token-Namen, andere Werte */
html[data-theme="dark"] {
  --bg:      #14151c;
  --ink:     #f1efe9;
  --muted:   #a2a6b4;
  --accent:  #ff7a5c;
  --plum:    #211f33;
  --line:    #2a2c38;
  --card:    #1c1e28;
  --nav-bg:  rgba(20,21,28,.85);
}

/* =========================================================
   BASIS
   ========================================================= */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}

h1, h2, h3 {
  font-family: "Space Grotesk", sans-serif;
  line-height: 1.1;
  margin: 0 0 .5rem;
}

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

/* Monospace-„Pfad“-Label über jeder Sektion (Signature-Element) */
.eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: .8rem;
  letter-spacing: .04em;
  color: var(--accent);
  margin: 0 0 .75rem;
}
.eyebrow--light { color: var(--accent); opacity: .9; }

/* =========================================================
   NAVIGATION
   ========================================================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 5vw, 4rem);
  background: var(--nav-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

/* Name oben links */
.brand {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -.01em;
}
.brand:hover { color: var(--accent); }

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(.75rem, 2.5vw, 1.75rem);
}

.nav__links a {
  position: relative;
  color: var(--ink);
  text-decoration: none;
  font-size: .95rem;
  font-weight: 500;
}

/* Animierter Unterstrich: wächst bei Hover von links, bleibt beim aktiven Link */
.nav__links a:not(.home-icon)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.nav__links a:hover::after,
.nav__links a.is-active::after { transform: scaleX(1); }
.nav__links a.is-active { color: var(--accent); }

.home-icon {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
}
.home-icon:hover { color: var(--accent); text-decoration: none; }

/* Theme-Umschalter */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  background: none;
  border: none;
  padding: 4px;
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--accent); }
.icon-sun { display: none; }
.icon-moon { display: inline; }
html[data-theme="dark"] .icon-moon { display: none; }
html[data-theme="dark"] .icon-sun  { display: inline; }

/* =========================================================
   SEKTIONEN-LAYOUT
   ========================================================= */
.section {
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 5vw, 2rem);
  scroll-margin-top: 80px; /* damit Sprungziele nicht unter der Navbar liegen */
}

.section__title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 2rem;
}

/* Dunkle Variante (Skills) – volle Breite, themen-unabhängig hell beschriftet */
.section--dark {
  max-width: none;
  background: var(--plum);
  color: #f3f1ec;
}
.section--dark .section__title { color: #ffffff; }
.section--dark__inner { max-width: 1040px; margin: 0 auto; }

/* =========================================================
   ANIMATIONEN
   ========================================================= */

/* Hero-Einblendung beim Laden: Elemente steigen gestaffelt auf */
@keyframes heroIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-in { animation: heroIn .6s ease both; }
.hero-in--d1 { animation-delay: .08s; }
.hero-in--d2 { animation-delay: .16s; }
.hero-in--d3 { animation-delay: .24s; }
.hero-in--d4 { animation-delay: .32s; }
.hero-in--d5 { animation-delay: .40s; }

/* Scroll-Reveal: unsichtbar starten, per JS (.reveal--visible) einblenden.
   Greift nur, wenn JavaScript läuft (html.js wird im <head> gesetzt) –
   ohne JS bleibt alles sichtbar. Der Stagger-Versatz (transition-delay)
   wird in script.js gesetzt. */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .55s ease, transform .55s ease;
}
.js .reveal--visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================
   ABOUT ME
   ========================================================= */
.about__inner {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 5vw, 3rem);
  flex-wrap: wrap;
}

.about__photo {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--accent);
  flex-shrink: 0;
}

.about__text { flex: 1; min-width: 260px; }

/* CSS-PUNKT: Name in der Profil-Sektion gestylt */
.about__name {
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  letter-spacing: -.02em;
  background: linear-gradient(90deg, var(--ink), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.about__role {
  font-family: "JetBrains Mono", monospace;
  color: var(--accent);
  margin: 0 0 1rem;
  min-height: 1.6em; /* verhindert Layout-Springen während des Tippens */
}

/* Blinkender Cursor der Tipp-Animation */
.cursor {
  color: var(--accent);
  font-weight: 400;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

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

/* Call-to-Action-Buttons im Hero */
.about__cta {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}
.btn {
  display: inline-block;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
  padding: .7rem 1.4rem;
  border-radius: 10px;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary {
  color: #fff;
  background: var(--accent);
}
.btn--primary:hover { box-shadow: 0 10px 24px rgba(255, 107, 74, .35); }
.btn--ghost {
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* =========================================================
   GRID + KARTEN (Projekte & Empfehlungen)
   ========================================================= */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(24, 26, 35, .08);
}

/* Projekte */
.project__tag {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
  background: rgba(255, 107, 74, .12);
  padding: .25rem .6rem;
  border-radius: 999px;
  margin-bottom: .75rem;
}
.project h3 { font-size: 1.2rem; }
.project p { color: var(--muted); font-size: .95rem; }
.project__stack {
  font-family: "JetBrains Mono", monospace;
  font-size: .8rem;
  color: var(--ink);
  margin-top: 1rem;
}

/* "Projekt ansehen"-Button */
.project__btn {
  margin-top: 1rem;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: .85rem;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.project__btn:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Kontakt */
.contact__lead { color: var(--muted); max-width: 55ch; margin-bottom: 2rem; }
.contact__links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}
.contact__card {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--ink);
  text-decoration: none;
}
.contact__card svg { color: var(--accent); flex-shrink: 0; }
.contact__card strong {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.05rem;
}
.contact__card span {
  color: var(--muted);
  font-size: .88rem;
  word-break: break-all;
}
.contact__card:hover { border-color: var(--accent); }

/* =========================================================
   SKILLS
   ========================================================= */
.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.skill {
  display: flex;
  align-items: center;
  gap: .7rem;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius);
  padding: .9rem 1.2rem;
  font-weight: 500;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.skill:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  background: rgba(255, 255, 255, .11);
}
.skill img { width: 34px; height: 34px; transition: transform .18s ease; }
.skill:hover img { transform: scale(1.12); }

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
  font-size: .85rem;
  border-top: 1px solid var(--line);
}
.footer__links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: .75rem;
}
.footer__links a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}
.footer__links a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* =========================================================
   RECHTSTEXTE (Impressum / Datenschutz)
   ========================================================= */
.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 5rem) clamp(1rem, 5vw, 2rem);
}
.legal h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 1.5rem; }
.legal h2 { font-size: 1.2rem; margin: 2rem 0 .5rem; }
.legal p, .legal li { color: var(--muted); }
.legal a { color: var(--accent); }
.legal .back {
  display: inline-block;
  margin-top: 2.5rem;
  font-family: "JetBrains Mono", monospace;
  font-size: .9rem;
  color: var(--accent);
  text-decoration: none;
}
.legal .back:hover { text-decoration: underline; }
/* Hinweis-Box für Platzhalter im Vorlagentext */
.legal .todo-note {
  background: rgba(255, 107, 74, .1);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  color: var(--ink);
  font-size: .9rem;
}

/* =========================================================
   PROJEKT-MODAL
   ========================================================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal[hidden] { display: none; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 11, 16, .6);
  backdrop-filter: blur(2px);
}
.modal__panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
  animation: modalIn .2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.modal__panel h3 { font-size: 1.4rem; margin-bottom: .75rem; }
.modal__panel p  { color: var(--muted); }
.modal__close {
  position: absolute;
  top: .6rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}
.modal__close:hover { color: var(--accent); }
.modal__demo {
  display: inline-block;
  margin-top: 1.25rem;
  font-family: "JetBrains Mono", monospace;
  font-size: .9rem;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--accent);
  padding: .5rem 1rem;
  border-radius: 8px;
}
.modal__demo:hover { background: var(--accent); color: #fff; }
.modal__demo[hidden] { display: none; }
.modal__actions { display: flex; gap: .75rem; flex-wrap: wrap; }

/* =========================================================
   RESPONSIVE & ACCESSIBILITY
   ========================================================= */
@media (max-width: 600px) {
  .about__inner { flex-direction: column; text-align: center; }
  .about__summary { margin-inline: auto; }
  .about__cta { justify-content: center; }
}

/* Schmale Displays: Navigation darf umbrechen statt überzulaufen */
@media (max-width: 680px) {
  .nav { flex-wrap: wrap; justify-content: center; row-gap: .25rem; }
  .nav__links { flex-wrap: wrap; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * {
    transition: none !important;
    animation: none !important;
  }
  /* Ohne Animation muss alles sofort sichtbar sein */
  .hero-in { opacity: 1; transform: none; }
  .js .reveal { opacity: 1; transform: none; }
}
