/* Schriften liegen lokal, damit beim Laden keine Daten an Google gehen */
@font-face { font-family: "Schibsted Grotesk"; font-weight: 400; font-display: swap; src: url("assets/fonts/schibsted-grotesk-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-weight: 600; font-display: swap; src: url("assets/fonts/schibsted-grotesk-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-weight: 700; font-display: swap; src: url("assets/fonts/schibsted-grotesk-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Martian Mono"; font-weight: 400; font-display: swap; src: url("assets/fonts/martian-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Martian Mono"; font-weight: 700; font-display: swap; src: url("assets/fonts/martian-mono-latin-700-normal.woff2") format("woff2"); }

:root,
.terminal {
  --bg: #111010;
  --surface: #1a1817;
  --surface-raised: #221f1d;
  --surface-muted: #2c2826;
  --icon-tile: #2e2717;
  --text: #f4efe8;
  --text-muted: #a8a099;
  --accent-text: #d9b26a;
  --nav-bg: rgba(17, 16, 16, 0.82);
}

:root {
  color-scheme: dark;
  --accent: #d9b26a;
  --accent-hover: #e3c285;
  --on-accent: #1a1408;
  --ok: #28c840;

  --font: "Schibsted Grotesk", system-ui, sans-serif;
  --mono: "Martian Mono", ui-monospace, monospace;

  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --gutter: 120px;
  --max: 1440px;
}

/* Light Mode: per Umschalter oder, ohne gespeicherte Wahl, nach Systemeinstellung */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f1ec;
  --surface: #ebe8e2;
  --surface-raised: #e5e1da;
  --surface-muted: #d9d4cc;
  --icon-tile: #efe5cc;
  --text: #2b2825;
  --text-muted: #625c56;
  --accent: #86661c;
  --accent-hover: #725717;
  --accent-text: #7a5c16;
  --on-accent: #ffffff;
  --nav-bg: rgba(243, 241, 236, 0.85);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg: #f3f1ec;
    --surface: #ebe8e2;
    --surface-raised: #e5e1da;
    --surface-muted: #d9d4cc;
    --icon-tile: #efe5cc;
    --text: #2b2825;
    --text-muted: #625c56;
    --accent: #86661c;
    --accent-hover: #725717;
    --accent-text: #7a5c16;
    --on-accent: #ffffff;
    --nav-bg: rgba(243, 241, 236, 0.85);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s, color 0.2s;
}

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

/* Bis content.json geladen ist, nichts aufblitzen lassen */
main { transition: opacity 0.25s; }
html.c-wait main { opacity: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, dl, dd { margin: 0; padding: 0; }
ul { list-style: none; }

::selection { background: var(--accent); color: var(--on-accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.mono { font-family: var(--mono); }

/* Icons */
[data-lucide], .lucide { width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; }
/* Marken-Logos (Simple Icons). Das Sprite nimmt keinen Platz ein, <use> greift trotzdem darauf zu. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.si { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }

/* Navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.nav.is-scrolled { border-bottom-color: var(--surface-raised); }

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 20px;
}

.logo { font: 700 18px/1 var(--mono); }

.nav__links { display: flex; align-items: center; gap: 32px; }
.nav__links a:not(.btn) {
  font-size: 15px;
  color: var(--text-muted);
  transition: color 0.15s;
}
.nav__links a:not(.btn):hover { color: var(--text); }

.nav__right { display: flex; align-items: center; gap: 16px; }

.nav__toggle,
.theme-toggle {
  display: none;
  background: none;
  border: 0;
  color: var(--text);
  padding: 8px;
  cursor: pointer;
}
.nav__toggle { margin-right: -8px; }
.nav__toggle .lucide { width: 24px; height: 24px; }

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 39px;
  height: 39px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  transition: background-color 0.15s;
}
.theme-toggle:hover { background: var(--surface-muted); }
.theme-toggle .lucide { width: 18px; height: 18px; }
/* Zeigt das Ziel: im Dark Mode die Sonne, im Light Mode den Mond */
.theme-toggle .icon-moon,
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  font: 600 16px/20px var(--font);
  border: 1px solid transparent;
  transition: background-color 0.15s, transform 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--sm { padding: 10px 20px; font-size: 15px; line-height: 19px; }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--dark { background: var(--surface-raised); color: var(--text); }
.btn--dark:hover { background: var(--surface-muted); }
.btn--outline { border-color: var(--surface-muted); color: var(--text); }
.btn--outline:hover { border-color: var(--text-muted); }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Hero */
.hero {
  display: flex;
  align-items: center;
  gap: 80px;
  padding-block: 96px;
}
.hero__text { flex: 1; display: flex; flex-direction: column; gap: 24px; min-width: 0; }

.prompt { font: 400 16px/1.2 var(--mono); color: var(--accent-text); }
.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  margin-left: 4px;
  vertical-align: -0.2em;
  background: var(--accent-text);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

h1 {
  font-weight: 700;
  font-size: clamp(44px, 6.5vw, 76px);
  line-height: 1.05;
  letter-spacing: -2px;
}
.hero__intro { max-width: 560px; font-size: 18px; line-height: 1.55; color: var(--text-muted); }

.hero__photo {
  flex: 0 0 auto;
  width: 420px;
  aspect-ratio: 1;
  border-radius: 50%;
  outline: 2px solid var(--accent);
  overflow: hidden;
}
.hero__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; }

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 40px;
}
.card--raised { background: var(--surface-raised); }
.card--sm { padding: 24px; }

h2 { font-weight: 700; font-size: 36px; line-height: 1.2; letter-spacing: -1px; }
.h-xl { font-size: clamp(40px, 4.5vw, 56px); letter-spacing: -2px; line-height: 1.2; }
h3 { font-weight: 600; font-size: 18px; line-height: 1.2; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

.section { padding-bottom: 96px; }
.section > h2 { margin-bottom: 32px; }

/* About */
.about { padding-top: 40px; padding-bottom: 96px; }
.about .card { display: flex; flex-direction: column; gap: 16px; }
.about .card p { color: var(--text-muted); }

.facts { gap: 20px !important; }
.facts dt { font-size: 14px; color: var(--text-muted); line-height: 1.2; margin-bottom: 4px; }
.facts dd { font-weight: 600; font-size: 18px; line-height: 1.25; }

/* Skills */
.skills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.skills > li { display: flex; flex-direction: column; gap: 16px; }

.icon-tile {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--icon-tile);
  color: var(--accent-text);
}
.icon-tile .lucide { width: 22px; height: 22px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 10px;
  border-radius: 100px;
  background: var(--surface-raised);
  font-size: 14px;
  line-height: 17px;
}
.chips .lucide, .chips .si { width: 14px; height: 14px; color: var(--accent-text); }

/* Logos in Originalfarben (Werte von Simple Icons). Schwarze Marken nehmen die Textfarbe,
   damit sie im Dark Mode sichtbar bleiben. */
.si use[href="#si-proxmox"]         { fill: #e57000; }
.si use[href="#si-homeassistant"]   { fill: #18bcf2; }
.si use[href="#si-debian"]          { fill: #d7385a; } /* Original #a81d33, auf dunklem Grund aufgehellt */
:root[data-theme="light"] .si use[href="#si-debian"] { fill: #a81d33; }
.si use[href="#si-docker"]          { fill: #2496ed; }
.si use[href="#si-swift"]           { fill: #f05138; }
.si use[href="#si-git"]             { fill: #f03c2e; }
.si use[href="#si-html5"]           { fill: #e34f26; }
.si use[href="#si-javascript"]      { fill: #f7df1e; }
.si use[href="#si-spotify"]         { fill: #1ed760; }
.si use[href="#si-bambulab"]        { fill: #00ae42; }
.si use[href="#si-github"],
.si use[href="#si-apple"],
.si use[href="#si-linuxcontainers"] { fill: var(--text); }

/* Projects */
.project { display: flex; flex-direction: column; gap: 20px; }
.project p { color: var(--text-muted); }
.project__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.project__head h3 { font-weight: 700; font-size: 36px; letter-spacing: -1px; }

.project__media {
  margin: 0 0 4px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 0 1px var(--surface-muted);
}
.project__media img { width: 100%; height: auto; transition: transform 0.6s var(--ease); }
@media (hover: hover) {
  .project:hover .project__media img { transform: scale(1.03); }
}

.badge {
  padding: 6px 14px;
  border-radius: 100px;
  background: var(--surface-muted);
  font: 600 14px/17px var(--font);
  white-space: nowrap;
}
.badge--accent { background: var(--accent); color: var(--on-accent); }

.tags { display: flex; flex-wrap: wrap; gap: 4px 8px; font: 400 13px/16px var(--mono); color: var(--accent-text); }

.link-arrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; align-self: flex-start; }
.link-arrow .lucide { color: var(--accent-text); transition: transform 0.15s; }
.link-arrow:hover .lucide { transform: translateX(4px); }

/* Homelab */
.homelab { display: flex; align-items: center; gap: 64px; }
.homelab__text { flex: 0 0 400px; display: flex; flex-direction: column; gap: 16px; }
.homelab__text p { font-size: 18px; color: var(--text-muted); }

.terminal {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  font: 400 13px/16px var(--mono);
  color: var(--text);
}
.terminal__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  background: var(--surface-raised);
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot--r { background: #ff5f57; }
.dot--y { background: #febc2e; }
.dot--g { background: #28c840; }
.terminal__title { color: var(--text-muted); }

.terminal__body { padding: 28px; overflow-x: auto; }
.terminal__cmd { font-size: 14px; line-height: 17px; margin-bottom: 14px; min-height: 17px; }
.terminal__list { display: flex; flex-direction: column; gap: 14px; }
.terminal__list li { display: flex; gap: 16px; white-space: nowrap; }
.terminal__list .ok { color: var(--ok); }
.terminal__list b { font-weight: 700; }
.terminal__list span:last-child { color: var(--text-muted); }

.terminal:focus-within { box-shadow: 0 0 0 2px var(--accent); }
.terminal__body { max-height: 520px; overflow-y: auto; }

.terminal__out { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.terminal__out:empty { display: none; }
.terminal__out p { white-space: pre-wrap; word-break: break-word; }
.terminal__out .ok { color: var(--ok); }
.terminal__out .acc { color: var(--accent-text); }
.terminal__out .mut { color: var(--text-muted); }
.terminal__out .b { font-weight: 700; }
.terminal__out .err { color: #ff6b63; }

.terminal__prompt { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 14px; cursor: text; }
.terminal__prompt span { flex-shrink: 0; }
.terminal__prompt input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: none;
  color: var(--text);
  font: inherit;
  caret-color: var(--accent-text);
}
.is-hidden { display: none !important; }

.homelab__hint { display: flex; align-items: center; gap: 8px; font-size: 15px !important; }
.homelab__hint .lucide { color: var(--accent-text); }
.homelab__hint code { font: 400 14px var(--mono); color: var(--accent-text); }

.terminal.is-animated .terminal__list li { opacity: 0; transform: translateY(4px); transition: opacity 0.25s, transform 0.25s; }
.terminal.is-animated .terminal__list li.is-visible { opacity: 1; transform: none; }

/* Contact */
.contact-wrap { padding-bottom: 64px; }
.contact {
  display: flex;
  align-items: center;
  gap: 48px;
  padding: 64px;
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  border: 1px solid var(--surface-muted);
}
.contact__text { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.contact__text p { max-width: 520px; font-size: 18px; line-height: 1.55; color: var(--text-muted); }

/* Footer */
.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 40px;
  font-size: 14px;
  color: var(--text-muted);
}

.footer__links { display: flex; align-items: center; gap: 24px; }
.footer__links a { transition: color 0.15s; }
.footer__links a:hover, .footer__links a[aria-current] { color: var(--text); }

/* Impressum */
.legal {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding-block: 72px 96px;
}
.legal > * { max-width: 760px; }
.legal .h-xl { margin-top: -24px; }
.legal section { display: flex; flex-direction: column; gap: 10px; }
.legal h2 { font-size: 22px; letter-spacing: -0.3px; }
.legal p:not(.prompt) { color: var(--text-muted); }
.legal p a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }

/* 404 */
.notfound {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 64px;
  padding-block: 96px;
  min-height: calc(100vh - 200px);
}
.notfound .terminal__body { display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.5; }
.notfound .terminal__cmd { margin: 0; }
.nf-err { color: #ff6b63; overflow-wrap: anywhere; }
.nf-mut { color: var(--text); }
.notfound__text { display: flex; flex-direction: column; gap: 20px; }
.notfound__text h1 { font-size: clamp(88px, 12vw, 160px); line-height: 1; letter-spacing: -6px; color: var(--accent-text); }
.notfound__text p { max-width: 460px; font-size: 18px; color: var(--text-muted); }

/* Snake */
.snake {
  display: block;
  margin: 4px 0;
  border-radius: 4px;
  touch-action: none;
  user-select: none;
}

/* Bildschirmschoner */
.saver {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.97);
  opacity: 0;
  transition: opacity 0.6s;
  cursor: none;
  overflow: hidden;
}
.saver.is-on { opacity: 1; }
.saver__logo {
  position: absolute;
  top: 0;
  left: 0;
  font: 700 clamp(28px, 5vw, 56px)/1 var(--mono);
  color: #d9b26a;
  will-change: transform;
  white-space: nowrap;
}
.saver__count { position: absolute; top: 16px; right: 20px; font: 13px var(--mono); color: #888; }
.saver__hint {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  font: 12px var(--mono);
  color: #555;
  white-space: nowrap;
}
.saver__corner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 700 clamp(48px, 12vw, 140px)/1 var(--font);
  letter-spacing: -3px;
  color: #fff;
  opacity: 0;
  pointer-events: none;
}
.saver__corner.pop { animation: corner-pop 1.8s ease-out; }
@keyframes corner-pop {
  0%   { opacity: 0; transform: scale(0.5) rotate(-6deg); }
  15%  { opacity: 1; transform: scale(1.12) rotate(2deg); }
  30%  { transform: scale(1) rotate(0); }
  75%  { opacity: 1; }
  100% { opacity: 0; }
}

/* Reboot-Sequenz */
body.is-booting { overflow: hidden; }

.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  color: #c8c8c8;
  font: 400 14px/1.55 var(--mono);
  outline: 0;
  transition: opacity 0.5s;
}
.boot.is-done { opacity: 0; }
.boot::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 3px);
}
.boot__screen {
  position: absolute;
  inset: 0;
  padding: 32px;
  overflow: hidden;
  transform-origin: center;
}
.boot__log p { white-space: pre-wrap; word-break: break-word; margin: 0; min-height: 1.55em; }
.boot .ok { color: #28c840; }
.boot .warn { color: #febc2e; }
.boot .acc { color: #d9b26a; }
.boot .dim { color: #7a7a7a; }
.boot .b { font-weight: 700; color: #f0f0f0; }
.boot .acc.b { color: #d9b26a; }
.boot__skip {
  position: absolute;
  right: 16px;
  bottom: 12px;
  z-index: 1;
  padding: 8px;
  border: 0;
  background: none;
  color: #666;
  font: 12px var(--mono);
  cursor: pointer;
}
.boot__skip:hover { color: #c8c8c8; }

.crt-off { animation: crt-off 0.6s ease-in forwards; }
@keyframes crt-off {
  0%   { transform: scale(1, 1); filter: brightness(1); }
  60%  { transform: scale(1, 0.004); filter: brightness(3); }
  100% { transform: scale(0, 0.004); filter: brightness(5); }
}

.grub {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: min(680px, 100%);
  margin: 8vh auto 0;
}
.grub__title { text-align: center; }
.grub__menu { border: 1px solid #c8c8c8; padding: 8px 0; min-height: 180px; }
.grub__menu li { padding: 2px 12px; white-space: pre; cursor: pointer; }
.grub__menu li.sel { background: #c8c8c8; color: #000; }
.grub__help, .grub__count { color: #7a7a7a; font-size: 13px; }

body.boot-in > header,
body.boot-in > main,
body.boot-in > footer { animation: boot-in 0.7s ease-out both; }
@keyframes boot-in {
  from { opacity: 0; filter: blur(6px); }
  to   { opacity: 1; filter: none; }
}

/* Animationen */
:root { --ease: cubic-bezier(0.2, 0.7, 0.2, 1); }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
@keyframes photo-in {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: none; }
}

/* Hero: startet, sobald der Inhalt eingeblendet wird */
html:not(.c-wait) .hero__text > * { animation: rise 0.8s var(--ease) both; }
.hero__text > :nth-child(2) { animation-delay: 0.08s !important; }
.hero__text > :nth-child(3) { animation-delay: 0.16s !important; }
.hero__text > :nth-child(4) { animation-delay: 0.24s !important; }
html:not(.c-wait) .hero__photo { animation: photo-in 1s var(--ease) 0.15s both; }

/* Überschrift wird getippt (main.js). Wie eine Shell-Autovervollständigung steht der Text
   erst blass da und wird dann in voller Farbe übertippt. */
html.hero-typing .hero h1:not(.is-typing),
.hero h1 .typing-rest { color: color-mix(in srgb, var(--text) 16%, transparent); }
.hero h1 .caret {
  display: inline-block;
  width: 0.08em;
  height: 0.9em;
  margin-right: -0.08em;
  vertical-align: -0.08em;
  background: var(--accent-text);
}

.hero__photo { transition: outline-offset 0.4s var(--ease); }
.hero__photo img { transition: transform 0.6s var(--ease); }
.hero__photo:hover { outline-offset: 8px; }
.hero__photo:hover img { transform: scale(1.05); }

/* Beim Scrollen einblenden (Klassen setzt main.js) */
:root .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: var(--d, 0ms);
}
:root .reveal.is-in { opacity: 1; transform: none; }
.reveal .chips li { opacity: 0; transform: scale(0.85); }
.reveal.is-in .chips li {
  opacity: 1;
  transform: none;
  transition: opacity 0.4s, transform 0.4s var(--ease);
  transition-delay: calc(var(--d, 0ms) + 250ms + var(--i, 0) * 45ms);
}

/* Scroll-Fortschritt unter der Navigation */
.progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}
@supports (animation-timeline: scroll()) {
  .progress { animation: progress linear both; animation-timeline: scroll(root); }
}
@keyframes progress { to { transform: scaleX(1); } }

/* Navigation: Unterstrich bei Hover und für den aktuellen Bereich */
.nav__links a:not(.btn) { position: relative; }
.nav__links a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s var(--ease);
}
.nav__links a:not(.btn):hover::after,
.nav__links a.is-active::after { transform: scaleX(1); transform-origin: left; }
.nav__links a.is-active { color: var(--text); }

/* Buttons */
.btn { transition: background-color 0.15s, transform 0.2s var(--ease), border-color 0.15s, box-shadow 0.2s; }
.btn:hover { transform: translateY(-2px); }
.btn--primary:hover { box-shadow: 0 10px 24px -10px var(--accent); }
.btn:active { transform: translateY(0); box-shadow: none; }

/* Karten: anheben und Lichtkegel, der dem Mauszeiger folgt */
.skills > li, .project, .contact { position: relative; }
.skills > li > *, .project > *, .contact > * { position: relative; }
.skills > li, .project { transition: transform 0.3s var(--ease), box-shadow 0.3s; }
.icon-tile { transition: transform 0.35s var(--ease); }

@media (hover: hover) {
  .skills > li:hover, .project:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.55); }
  .skills > li:hover .icon-tile { transform: rotate(-8deg) scale(1.08); }

  .skills > li::before, .project::before, .contact::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 13%, transparent), transparent 70%);
  }
  .skills > li:hover::before, .project:hover::before, .contact:hover::before { opacity: 1; }
}

/* Theme-Schalter: Icon dreht sich beim Wechsel ein */
.theme-toggle.is-spin .lucide { animation: spin-in 0.5s var(--ease); }
@keyframes spin-in {
  from { opacity: 0; transform: rotate(-120deg) scale(0.4); }
  to   { opacity: 1; transform: none; }
}

/* Responsive */
@media (max-width: 1200px) {
  :root { --gutter: 64px; }
  .skills { grid-template-columns: repeat(2, 1fr); }
  .hero__photo { width: 340px; }
}

@media (max-width: 960px) {
  :root { --gutter: 40px; }
  .hero { flex-direction: column-reverse; align-items: flex-start; gap: 48px; padding-block: 56px 72px; }
  .hero__photo { width: 240px; }
  .grid-2 { grid-template-columns: 1fr; }
  .homelab { flex-direction: column; align-items: stretch; gap: 32px; }
  .homelab__text { flex-basis: auto; }
  .contact { flex-direction: column; align-items: flex-start; padding: 48px; gap: 32px; }
  .notfound { grid-template-columns: 1fr; gap: 40px; padding-block: 56px 72px; min-height: 0; }
  .notfound__text { order: -1; }
}

@media (max-width: 720px) {
  :root { --gutter: 16px; }
  html { scroll-padding-top: 72px; }

  .nav__inner { padding-block: 14px; }
  .nav__toggle { display: inline-flex; }
  .nav__links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 8px 16px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--surface-raised);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s, transform 0.25s var(--ease), visibility 0s 0.25s;
  }
  .nav.is-open .nav__links { opacity: 1; visibility: visible; transform: none; transition: opacity 0.2s, transform 0.25s var(--ease); }
  .nav__links a:not(.btn) { padding: 12px 0; font-size: 17px; }
  .nav__links a:not(.btn)::after { display: none; }
  .nav__links .btn { justify-content: center; margin-top: 8px; padding-block: 14px; }

  .hero__photo { width: 180px; }
  .skills { grid-template-columns: 1fr; }
  .card { padding: 28px 24px; }
  .card--sm { padding: 24px; }
  h2 { font-size: 30px; }
  .project__head h3 { font-size: 30px; }
  .section { padding-bottom: 72px; }
  .about { padding-top: 0; padding-bottom: 72px; }
  .terminal__body { padding: 20px; max-height: 440px; }
  .terminal__prompt input { font-size: 16px; } /* verhindert Auto-Zoom auf iOS */
  .contact { padding: 32px 24px; border-radius: var(--radius); }
  .contact .btn-row { width: 100%; }
  .contact .btn { flex: 1; justify-content: center; }
  .footer { flex-direction: column-reverse; gap: 12px; }
  .footer__links { flex-wrap: wrap; gap: 8px 20px; }
}

/* Drucken: alles sichtbar, auch was noch nicht eingeblendet wurde */
@media print {
  .reveal, .reveal .chips li, .terminal.is-animated .terminal__list li { opacity: 1 !important; transform: none !important; }
  .nav, .progress, .saver { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
