/* Terminal-Stil, nur Systemschriften (keine externen Fonts, keine Cookies) */
:root {
  --bg: #121214;
  --panel: #1a1a1d;
  --panel-2: #222226;
  --line: #34343a;
  --fg: #e8e6df;
  --muted: #9a978e;
  --accent: #d08a62;
  --link: #e3ad8d;
  --ok: #7fbf98;
  --yellow: #d9b56a;
  --red: #e08a80;
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Sprache: nur die aktive Sprache zeigen */
html[data-lang="de"] body [lang="en"],
html[data-lang="en"] body [lang="de"] { display: none !important; }

.c-green { color: var(--accent); }
.c-blue { color: var(--link); }
.c-muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Kopfzeile ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px;
  padding: 14px max(16px, calc((100% - 1080px) / 2));
  background: rgba(18, 18, 20, .88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 14px;
}
.brand { color: var(--fg); font-weight: 700; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.topbar nav { display: flex; gap: 18px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.topbar nav::-webkit-scrollbar { display: none; }
.topbar nav a { color: var(--muted); white-space: nowrap; }
.topbar nav a::before { content: "./"; color: var(--line); }
.topbar nav a:hover { color: var(--fg); text-decoration: none; }
.lang { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.lang button {
  font: inherit; font-size: 12px; padding: 4px 10px; cursor: pointer;
  background: transparent; color: var(--muted); border: 0;
}
.lang button[aria-pressed="true"] { background: var(--accent); color: #121214; font-weight: 700; }

/* ---------- Abschnitte ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.block { padding: 72px 0 8px; }
h1, h2, h3 { font-family: var(--mono); line-height: 1.25; }
h2 { font-size: 22px; margin: 0 0 28px; }
h3 { font-size: 16px; margin: 0 0 8px; }
.intro { max-width: 70ch; margin: -12px 0 28px; color: var(--fg); }
.intro.small { margin-top: -18px; }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; align-items: center;
  padding: 72px 0 32px;
}
.hero-text h1 { font-size: clamp(34px, 5vw, 52px); margin: 0 0 10px; letter-spacing: -.5px; }
.role { font-family: var(--mono); color: var(--accent); margin: 0 0 18px; font-size: 15px; }
.lead { font-size: 18px; margin: 0 0 24px; max-width: 46ch; }
.stats { list-style: none; padding: 0; margin: 0 0 28px; display: flex; gap: 28px; flex-wrap: wrap; }
.stats li { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); }
.stats b { font-family: var(--mono); font-size: 28px; color: var(--fg); line-height: 1.1; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  font-family: var(--mono); font-size: 14px; padding: 10px 18px; border-radius: 6px;
  border: 1px solid var(--line); color: var(--fg); background: var(--panel);
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #121214; font-weight: 700; }
.btn.primary:hover { filter: brightness(1.1); }

/* ---------- Terminal-Fenster ---------- */
.term {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45); overflow: hidden;
  font-family: var(--mono); font-size: 14px;
}
.term-bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--red); }
.term-bar i:nth-child(2) { background: var(--yellow); }
.term-bar i:nth-child(3) { background: var(--ok); }
.term-bar > span { margin-left: 8px; font-size: 12px; color: var(--muted); }
.term-body { padding: 18px 20px 20px; }
.term-body p { margin: 0 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.term .line { display: flex; gap: 8px; align-items: baseline; }
.dots { flex: 1; border-bottom: 1px dotted var(--line); transform: translateY(-4px); min-width: 16px; }
.pass { color: var(--ok); }
.cursor { display: inline-block; width: 8px; height: 16px; background: var(--accent); margin-left: 6px; vertical-align: -3px; animation: blink 1s steps(2, start) infinite; }

/* Zeilen erscheinen nacheinander wie ein laufender Test */
.term .line { opacity: 0; animation: show .01s forwards; }
.l1 { animation-delay: .2s !important; }
.l2 { animation-delay: .7s !important; }
.l3 { animation-delay: 1.2s !important; }
.l4 { animation-delay: 1.55s !important; }
.l5 { animation-delay: 1.9s !important; }
.l6 { animation-delay: 2.25s !important; }
.l7 { animation-delay: 2.8s !important; }
@keyframes show { to { opacity: 1; } }
@keyframes blink { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) {
  .term .line { opacity: 1; animation: none; }
  .cursor { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Profil ---------- */
.cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.cols p { margin: 0 0 16px; max-width: 65ch; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px; }
.card > p.small { font-family: var(--mono); margin: 0 0 10px; }
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { padding-left: 26px; position: relative; margin: 0 0 10px; }
.checks li::before { content: "✔"; position: absolute; left: 0; color: var(--accent); font-family: var(--mono); }

/* ---------- Skills ---------- */
.skills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.skill-group { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; }
.skill-group.wide { grid-column: 1 / -1; }
.skill-group h3 { color: var(--accent); }
.skill-group h3::before { content: "describe('"; color: var(--muted); font-weight: 400; }
.skill-group h3::after { content: "')"; color: var(--muted); font-weight: 400; }
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  font-family: var(--mono); font-size: 13px; padding: 3px 10px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line); color: var(--fg);
}
.tags.accent li { border-color: rgba(208, 138, 98, .5); color: #efc6ad; }
.tags.small li { font-size: 12px; padding: 2px 8px; }

/* ---------- eigene Projekte ---------- */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.cards .card h3 { font-size: 18px; }
.cards .card p { margin: 0 0 14px; }

/* ---------- Werdegang ---------- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 26px; border-left: 1px solid var(--line); }
.job { position: relative; padding: 0 0 36px; }
.job::before {
  content: ""; position: absolute; left: -32px; top: 6px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.job .date { font-family: var(--mono); font-size: 13px; color: var(--muted); margin: 0 0 4px; }
.job h3 { font-size: 17px; margin: 0 0 4px; }
.job .client { margin: 0 0 2px; font-weight: 600; }
.job .roles { font-family: var(--mono); font-size: 13px; color: var(--accent); margin: 0 0 10px; }
.job p { max-width: 75ch; margin: 0 0 12px; }

/* ---------- Kontakt & Fuß ---------- */
.small-term { max-width: 720px; }
.small-term .term-body p { white-space: normal; }
.footer {
  max-width: 1080px; margin: 72px auto 0; padding: 24px 16px 40px; border-top: 1px solid var(--line);
  display: flex; gap: 20px; justify-content: space-between; flex-wrap: wrap; font-family: var(--mono); font-size: 13px;
}

/* ---------- Unterseite ---------- */
.legal { max-width: 760px; padding: 48px 16px; margin: 0 auto; }
.legal h1 { font-size: 26px; }
.legal h2 { font-size: 18px; margin: 32px 0 10px; }
.legal .todo { color: var(--yellow); font-family: var(--mono); }

/* ---------- Schmale Bildschirme ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 40px; }
  .hero-text { order: -1; }
  .cols, .skills, .cards { grid-template-columns: 1fr; }
  .topbar { gap: 14px; }
}
@media (max-width: 520px) {
  .term { font-size: 12px; }
  .term-body { padding: 14px; }
  .topbar nav { display: none; }
  .topbar .brand { flex: 1; }
}

/* Zusammenfassung darf umbrechen und braucht keine Flex-Abstände */
.term .line.l7 { display: block; white-space: normal; margin-top: 12px; }

/* ---------- Workshop-Angebot ---------- */
.offer {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 40px; align-items: center;
  padding: 32px; border-radius: 14px; border: 1px solid rgba(208, 138, 98, .4);
  background: linear-gradient(160deg, rgba(208, 138, 98, .09), transparent 55%), var(--panel);
}
.kicker { font-family: var(--mono); font-size: 13px; color: var(--accent); margin: 0 0 8px; }
.offer-title { font-size: clamp(24px, 3.2vw, 32px); margin: 0 0 18px; }
.offer-text p { max-width: 62ch; margin: 0 0 14px; }
.offer .checks { margin: 18px 0 24px; }
.chat .term-body p { white-space: normal; }
.chat .who { font-size: 12px; margin: 12px 0 2px; }
.chat .who:first-child { margin-top: 0; }
.chat .who.you { color: var(--link); }
.chat .who.bot { color: var(--accent); }
.chat .msg { padding: 8px 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); }
.chat .judge { margin-top: 14px; font-size: 13px; }
.chat .hint { font-size: 13px; margin-top: 8px; }
.cards.single { grid-template-columns: minmax(0, 1fr); max-width: 720px; }
@media (max-width: 860px) {
  .offer { grid-template-columns: 1fr; padding: 22px 18px; gap: 28px; }
}

/* Kopfbild im Workshop-Kasten: 8-Bit-Sonnenuntergang über die volle Breite */
.offer { overflow: hidden; }
.offer-sky {
  grid-column: 1 / -1; display: block; width: calc(100% + 64px); height: auto; 
  margin: -32px -32px 0; image-rendering: pixelated; image-rendering: crisp-edges;
  border-bottom: 3px solid #000;
}
@media (max-width: 860px) {
  .offer-sky { width: calc(100% + 36px); margin: -22px -18px 0; }
}
.cta-note { font-family: var(--mono); margin: 12px 0 0; }
.warn { color: var(--yellow); }

/* Reifegrad-Balken im Terminal */
.chat .bar { display: grid; grid-template-columns: 11ch 1fr; gap: 12px; align-items: center; }
.chat .bar b { display: block; height: 8px; background:
  linear-gradient(90deg, var(--ok) calc(var(--v) * 100%), var(--line) 0) ; border-radius: 1px; }
.chat .bar b.low { background: linear-gradient(90deg, var(--yellow) calc(var(--v) * 100%), var(--line) 0); }

/* Projekte ein- und ausklappbar */
.job summary { list-style: none; cursor: pointer; position: relative; padding-right: 32px; border-radius: 6px; }
.job summary::-webkit-details-marker { display: none; }
.job summary::after {
  content: "+"; position: absolute; right: 4px; top: 2px; width: 22px; height: 22px; line-height: 20px; text-align: center;
  font-family: var(--mono); color: var(--accent); border: 1px solid var(--line); border-radius: 4px;
}
.job details[open] summary::after { content: "−"; }
.job summary:hover h3 { color: var(--accent); }
.job summary .roles { margin-bottom: 0; }
.job .job-body { padding-top: 12px; }
.job { padding-bottom: 28px; }
.timeline-tools { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin: -18px 0 28px; }
.timeline-tools .intro { margin: 0; color: var(--muted); font-family: var(--mono); }
.link-btn { font: inherit; font-family: var(--mono); font-size: 13px; background: none; border: 0; padding: 0; color: var(--link); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Aktuelles ---------- */
.news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.news-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.news-card.draft { border-style: dashed; }
.news-media { position: relative; display: block; padding: 0; border: 0; background: var(--bg); cursor: zoom-in; aspect-ratio: 16 / 9; overflow: hidden; }
.news-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.news-media:hover img { transform: scale(1.03); }
.news-count { position: absolute; right: 8px; bottom: 8px; font-family: var(--mono); font-size: 12px; padding: 2px 8px; border-radius: 4px; background: rgba(18, 18, 20, .8); color: var(--fg); }
.news-body { padding: 16px 18px 18px; }
.news-date { font-family: var(--mono); font-size: 12px; color: var(--muted); margin: 0 0 6px; }
.news-draft { margin-left: 8px; color: var(--yellow); }
.news-body h3 { font-size: 16px; margin: 0 0 8px; }
.news-text { margin: 0 0 10px; font-size: 15px; }
.news-link { font-family: var(--mono); font-size: 13px; }
.news-empty { font-family: var(--mono); color: var(--muted); }
.news-more { font-family: var(--mono); font-size: 14px; margin: 20px 0 0; }
@media (max-width: 860px) { .news-grid { grid-template-columns: 1fr; } }

/* Galerie */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; margin: 0; overflow: hidden; }
.lightbox::backdrop { background: rgba(8, 8, 10, .9); }
.lightbox[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.lightbox img { max-width: min(1200px, 92vw); max-height: 80vh; object-fit: contain; border-radius: 6px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); background: var(--panel); }
.lb-caption { font-family: var(--mono); font-size: 13px; color: var(--fg); margin: 0; padding: 0 16px; text-align: center; }
.lb-nav, .lb-close {
  position: fixed; font: 24px/1 var(--mono); color: var(--fg); background: rgba(26, 26, 29, .85);
  border: 1px solid var(--line); border-radius: 6px; width: 44px; height: 44px; cursor: pointer;
}
.lb-nav:hover, .lb-close:hover { border-color: var(--accent); color: var(--accent); }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-close { right: 16px; top: 16px; font-size: 18px; }
.lb-nav[hidden] { display: none; }
body.lb-open { overflow: hidden; }

/* Profil mit Foto links */
.cols.with-photo { grid-template-columns: 220px minmax(0, 1.4fr) minmax(0, 1fr); gap: 36px; }
.portrait { margin: 0; }
.portrait img {
  display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--line); background: var(--panel);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .4);
}
.portrait figcaption { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 8px; }
@media (max-width: 1020px) {
  .cols.with-photo { grid-template-columns: 200px minmax(0, 1fr); }
  .cols.with-photo .card { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .cols.with-photo { grid-template-columns: 1fr; }
  .portrait { max-width: 200px; }
}

/* Foto so hoch wie die Box "was ich mitbringe" (nur wenn beide nebeneinander stehen) */
@media (min-width: 1021px) {
  .cols.with-photo { align-items: stretch; }
  .cols.with-photo .portrait { height: 100%; }
  .cols.with-photo .portrait img { height: 100%; aspect-ratio: auto; object-position: 50% 35%; }
}
