:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f4f2ec;
  --text: #23221e;
  --muted: #6b6a63;
  --border: #e7e4da;
  --accent: #6b5bd2;
  --accent-purple: #6b5bd2;
  --accent-teal: #15926e;
  --accent-coral: #d8582f;
  --tint-purple: #efedfd;
  --tint-teal: #e2f4ee;
  --tint-coral: #fbeae2;
  --shadow: 0 1px 2px rgba(30, 28, 20, .04), 0 8px 24px rgba(30, 28, 20, .06);
  --radius: 16px;
  --maxw: 1040px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
}

[data-theme="dark"] {
  --bg: #131318;
  --surface: #1d1d24;
  --surface-2: #24242e;
  --text: #ececf0;
  --muted: #a2a2ad;
  --border: #2e2e39;
  --accent: #9b8ef0;
  --accent-purple: #a99cf5;
  --accent-teal: #4fc9a3;
  --accent-coral: #f08a63;
  --tint-purple: #241f3d;
  --tint-teal: #12352c;
  --tint-coral: #3a2018;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

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

h1, h2, h3 { line-height: 1.2; font-weight: 600; letter-spacing: -.01em; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(140%) blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { font-weight: 600; font-size: 1.15rem; letter-spacing: -.02em; color: var(--text); }
.brand .dot { color: var(--accent); }
.nav-links { margin-left: auto; display: flex; gap: 22px; align-items: center; }
.nav-links a { color: var(--muted); font-weight: 500; font-size: .95rem; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

.lang-toggle {
  height: 40px; min-width: 44px; padding: 0 12px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer; font-weight: 600; font-size: .9rem; transition: background .15s, transform .1s;
}
.lang-toggle:hover { background: var(--surface-2); }
.lang-toggle:active { transform: scale(.94); }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); cursor: pointer; transition: background .15s, transform .1s;
}
.theme-toggle:hover { background: var(--surface-2); }
.theme-toggle:active { transform: scale(.94); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }

/* ---------- Hero ---------- */
.hero { padding-top: 84px; padding-bottom: 40px; }
.hero-inner { display: flex; align-items: center; gap: 44px; }
.hero-text { flex: 1 1 auto; min-width: 0; }
.hero-photo { flex: 0 0 auto; width: 210px; height: 210px; border-radius: 50%; object-fit: cover; border: 4px solid var(--surface); box-shadow: var(--shadow); }
@media (max-width: 720px) {
  .hero-inner { flex-direction: column-reverse; align-items: flex-start; gap: 22px; }
  .hero-photo { width: 128px; height: 128px; }
}
.hero .eyebrow {
  display: inline-block; font-weight: 600; font-size: .85rem; letter-spacing: .04em;
  text-transform: uppercase; color: var(--accent);
  background: var(--tint-purple); padding: 6px 14px; border-radius: 999px;
}
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); margin: 20px 0 6px; }
.hero-sub { font-size: clamp(1.2rem, 3vw, 1.7rem); font-weight: 500; color: var(--muted); margin: 0 0 18px; }
.hero .lead { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--muted); max-width: 640px; margin: 0 0 26px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 12px; font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer; transition: transform .1s, background .15s, box-shadow .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 40%, transparent); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn svg { width: 18px; height: 18px; }

/* ---------- Sections ---------- */
section { padding: 88px 0 32px; }
/* .wrap setzt padding:0 24px (hoehere Spezifitaet) -> vertikalen Abstand hier gezielt setzen */
main > section:not(.hero) { padding-top: 72px; padding-bottom: 24px; }
.section-head { margin-bottom: 28px; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 6px; }
.section-head p { color: var(--muted); margin: 0; max-width: 620px; }

/* ---------- Project cards ---------- */
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 22px; }
.projects > .card { min-width: 0; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 10px 34px rgba(30,28,20,.10); }
[data-theme="dark"] .card:hover { box-shadow: 0 10px 34px rgba(0,0,0,.45); }
.card .icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 18px;
}
.card .icon svg { width: 28px; height: 28px; }
.card h3 { font-size: 1.3rem; margin: 0 0 8px; }
.card .tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.tag { font-size: .78rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.card p.desc { color: var(--muted); margin: 0 0 20px; flex: 1; }
.card-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Mehr-Info-Aufklapper */
.more { margin: 0 0 18px; border-top: 1px solid var(--border); padding-top: 12px; }
.more > summary { cursor: pointer; font-weight: 600; color: var(--accent); list-style: none; display: inline-flex; align-items: center; gap: 7px; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary::before { content: "+"; font-weight: 700; width: 14px; text-align: center; }
.more[open] > summary::before { content: "\2013"; }
.more-body { margin-top: 12px; font-size: .95rem; }
.more-body p { margin: 0 0 10px; color: var(--muted); }
.more-body h4 { margin: 24px 0 6px; font-size: .95rem; color: var(--text); }
.more-body h4:first-of-type { margin-top: 18px; }
.more-body ul { margin: 4px 0 0; padding-left: 20px; }
.more-body li { margin: 4px 0; color: var(--muted); }
.more-body .readme-link { display: inline-block; margin-top: 12px; font-weight: 600; }

.c-purple .icon { background: var(--tint-purple); color: var(--accent-purple); }
.c-teal   .icon { background: var(--tint-teal);   color: var(--accent-teal); }
.c-coral  .icon { background: var(--tint-coral);  color: var(--accent-coral); }
.c-purple .tag.hl { background: var(--tint-purple); color: var(--accent-purple); }
.c-teal   .tag.hl { background: var(--tint-teal);   color: var(--accent-teal); }
.c-coral  .tag.hl { background: var(--tint-coral);  color: var(--accent-coral); }

.btn-sm { padding: 9px 15px; font-size: .88rem; }

/* Kennzahlen-Band */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat { background: var(--surface-2); border-radius: 12px; padding: 20px; }
.stat .num { font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 500; color: var(--accent); line-height: 1; }
.stat .label { margin-top: 8px; font-size: .92rem; color: var(--muted); }

/* Projekt-Highlight (Ein-Zeilen-Nutzen) */
.card .highlight { font-weight: 500; color: var(--text); margin: 0 0 12px; }
.card .highlight .k { color: var(--accent); font-weight: 500; }

/* Tech-Stack: zwei gleichwertige Spalten */
.tech-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; align-items: start; }
.col-head { margin: 0 0 6px; font-size: 1.15rem; }
.col-tag { display: inline-block; font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; margin-bottom: 12px; }
.col-tag.work { background: var(--tint-teal); color: var(--accent-teal); }
.col-tag.private { background: var(--tint-purple); color: var(--accent-purple); }
.tech-cols .chips { margin-bottom: 16px; }
.tech-intro { margin: 0 0 14px; color: var(--muted); }
.tech-note { margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--border); font-size: .92rem; color: var(--muted); }

/* Screenshot strip */
.shots { display: flex; gap: 10px; margin: 4px 0 20px; overflow-x: auto; padding-bottom: 4px; }
.shots picture { flex: 0 0 auto; display: block; }
.preview { margin: 4px 0 18px; }
.preview img { width: 100%; height: auto; display: block; border-radius: 10px; border: 1px solid var(--border); cursor: zoom-in; transition: transform .15s; }
.preview img:hover { transform: scale(1.01); }
.shots img {
  height: 190px; width: auto; border-radius: 10px; border: 1px solid var(--border);
  cursor: zoom-in; transition: transform .15s; display: block;
}
.shots img:hover { transform: scale(1.03); }

/* Scroll-Reveal */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; align-items: start; }
.about-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow);
}
.about-card h3 { font-size: 1.1rem; margin: 0 0 14px; }
.about-card p { margin: 0 0 14px; }
.about-card p:last-child { margin-bottom: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: .88rem; font-weight: 600; padding: 7px 14px; border-radius: 999px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.chip.main { background: var(--accent); color: #fff; border-color: var(--accent); padding-right: 16px; }
.chip.main::before { content: "★"; margin-right: 6px; font-size: .8em; }
.colophon { margin: 18px 0 0; color: var(--muted); }

.about-facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; padding-top: 22px; }
.about-facts dt { color: var(--muted); font-weight: 600; font-size: .9rem; }
.about-facts dd { margin: 0; }

.timeline { list-style: none; margin: 4px 0 0; padding: 0; }
.timeline li {
  position: relative; display: grid; grid-template-columns: 104px 1fr; gap: 16px;
  align-items: baseline; padding: 0 0 18px 22px; border-left: 2px solid var(--border);
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--accent); border: 2px solid var(--surface);
}
.timeline .years { font-weight: 600; font-size: .9rem; color: var(--accent); white-space: nowrap; }
.timeline .what { color: var(--text); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 36px 0; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-links a { color: var(--muted); font-weight: 500; }
.footer-links a:hover { color: var(--text); text-decoration: none; }
.footer-copy { margin-left: auto; font-size: .9rem; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: rgba(10, 9, 6, .82); align-items: center; justify-content: center; padding: 30px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lightbox .lb-close {
  position: absolute; top: 20px; right: 24px; width: 44px; height: 44px; border-radius: 12px;
  border: none; background: rgba(255,255,255,.14); color: #fff; font-size: 1.5rem; cursor: pointer;
}
.lightbox .lb-close:hover { background: rgba(255,255,255,.26); }

/* ---------- Verstecktes Terminal (Easter-Egg) ---------- */
/* Trigger-Wörter im Fließtext: sehen ganz normal aus, nur der Mauszeiger
   verrät beim Darüberfahren, dass es ein Link ist. */
.mf-word { cursor: pointer; }

/* Popup-Fenster mit dem Terminal (als iframe) */
.mf-modal {
  position: fixed; inset: 0; z-index: 200; display: none;
  background: rgba(0, 0, 0, .74);
  align-items: center; justify-content: center; padding: 24px;
}
.mf-modal.open { display: flex; }
.mf-window {
  position: relative; display: flex; flex-direction: column;
  width: min(94vw, 920px); height: min(88vh, 640px);
  background: #050a06; border-radius: 12px; overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(51,255,102,.25);
  animation: mf-pop .18s ease-out;
}
@keyframes mf-pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.mf-titlebar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; background: #0c140e;
  border-bottom: 1px solid rgba(51,255,102,.22);
  color: #33ff66; font-family: "Consolas","DejaVu Sans Mono","Courier New",monospace;
  font-size: .78rem; letter-spacing: .05em;
}
.mf-dots { display: flex; gap: 6px; }
.mf-dots span { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.mf-dots .r { background: #ff5f57; } .mf-dots .y { background: #febc2e; } .mf-dots .g { background: #28c840; }
.mf-title { flex: 1; text-align: center; }
.mf-close2 {
  border: 0; background: transparent; color: #33ff66; cursor: pointer;
  font-size: 1.25rem; line-height: 1; width: 28px; height: 28px; border-radius: 6px;
}
.mf-close2:hover { background: rgba(51,255,102,.18); }
.mf-frame { flex: 1; width: 100%; border: 0; background: #000; display: block; }

/* ---------- Legal pages ---------- */
.legal { padding: 60px 0 20px; max-width: 760px; }
.legal h1 { font-size: 2.2rem; margin: 0 0 8px; }
.legal .updated { color: var(--muted); margin: 0 0 32px; }
.legal h2 { font-size: 1.25rem; margin: 34px 0 10px; }
.legal p, .legal li { color: var(--text); }
.legal .placeholder { background: var(--tint-coral); color: var(--accent-coral); padding: 1px 7px; border-radius: 6px; font-weight: 600; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px; color: var(--muted); font-weight: 500; }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 6px; }

/* Tablet: zweispaltige Kartensektionen frueher auf eine Spalte umbrechen
   (Projekte ausgenommen – die brechen selbststaendig frueher um) */
@media (max-width: 900px) {
  .about-grid, .tech-cols { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .nav-links { gap: 14px; }
  .nav-links a.hide-sm { display: none; }
  .hero { padding-top: 56px; padding-bottom: 24px; }
  /* Hero-Inhalt auf dem Handy wie die Kartentexte einrücken
     (transparenter Container, nur zusätzlicher Innenabstand) */
  .hero-inner { padding-left: 26px; padding-right: 26px; }
  .footer-copy { margin-left: 0; width: 100%; }
}
