/* ═══════════════════════════════════════════
   Portfolio — Markus Grimmer
   ═══════════════════════════════════════════ */

/* ── Tokens ───────────────────────────────── */
:root {
  --bg:        #ffffff;
  --bg-alt:    #f6f7fb;
  --surface:   #ffffff;
  --surface-2: #f1f3f9;
  --border:    #e3e6ef;
  --text:      #12141c;
  --text-2:    #5a6072;
  --text-3:    #878da0;
  --accent:    #5b5bf6;
  --accent-2:  #00c2b8;
  --accent-soft: rgba(91, 91, 246, .10);
  --shadow:    0 1px 2px rgba(16,20,40,.05), 0 12px 32px -12px rgba(16,20,40,.14);
  --shadow-lg: 0 2px 4px rgba(16,20,40,.05), 0 28px 60px -20px rgba(16,20,40,.22);
  --radius:    16px;
  --radius-sm: 10px;
  --maxw:      1160px;
}

[data-theme="dark"] {
  --bg:        #0a0b12;
  --bg-alt:    #0e1019;
  --surface:   #12141f;
  --surface-2: #191c2a;
  --border:    #23283a;
  --text:      #eef0f8;
  --text-2:    #a2a8bd;
  --text-3:    #6f7690;
  --accent:    #7c7cff;
  --accent-2:  #22e0d0;
  --accent-soft: rgba(124, 124, 255, .14);
  --shadow:    0 1px 2px rgba(0,0,0,.4), 0 12px 32px -12px rgba(0,0,0,.6);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.4), 0 28px 60px -20px rgba(0,0,0,.7);
}

/* ── Base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .3s ease, color .3s ease;
}

h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.7rem); }
h3 { font-size: 1.15rem; }
p  { margin: 0 0 1rem; color: var(--text-2); }
a  { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; }

.container { width: min(100% - 2.5rem, var(--maxw)); margin-inline: auto; }
.section { padding: clamp(4.5rem, 10vw, 8rem) 0; position: relative; }
.section.alt { background: var(--bg-alt); }
.muted { color: var(--text-3); }

/* ── Background decoration ────────────────── */
.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: .35;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
}
.bg-glow {
  position: fixed; z-index: -1; pointer-events: none;
  top: -18vh; left: 50%; transform: translateX(-50%);
  width: 90vw; height: 60vh; max-width: 1200px;
  background:
    radial-gradient(closest-side, var(--accent-soft), transparent 70%),
    radial-gradient(closest-side at 70% 40%, rgba(34,224,208,.10), transparent 70%);
  filter: blur(20px);
}

/* ── Nav ──────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, background .25s;
}
.nav.scrolled { border-bottom-color: var(--border); }
.nav-inner { display: flex; align-items: center; gap: 1rem; height: 70px; }

.logo { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; letter-spacing: -.03em; }
.logo-mark {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: .82rem; letter-spacing: .02em;
}
.logo-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); }

.nav-links { margin-left: auto; display: flex; gap: .35rem; }
.nav-links a {
  padding: .45rem .8rem; border-radius: 999px;
  font-size: .9rem; font-weight: 500; color: var(--text-2);
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a.active { color: var(--accent); background: var(--accent-soft); }

.nav-actions { display: flex; align-items: center; gap: .4rem; margin-left: .6rem; }
.icon-btn {
  display: grid; place-items: center;
  width: 38px; height: 38px; padding: 0;
  border: 1px solid var(--border); border-radius: 11px;
  background: var(--surface); color: var(--text-2);
  cursor: pointer; transition: .2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }
[data-theme="dark"] .i-moon, [data-theme="light"] .i-sun { display: none; }

.burger { display: none; flex-direction: column; gap: 4px; }
.burger span { width: 16px; height: 2px; border-radius: 2px; background: currentColor; transition: .25s; }
.burger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ── Buttons ──────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.4rem; border: 1px solid transparent; border-radius: 12px;
  font-size: .94rem; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s, border-color .2s;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 65%, var(--accent-2)));
  color: #fff; box-shadow: 0 8px 24px -10px var(--accent);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -10px var(--accent); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn.full { width: 100%; }

.pill {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .35rem .85rem .35rem .6rem; margin-bottom: 1.4rem;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); font-size: .8rem; font-weight: 500; color: var(--text-2);
}
.pill .dot {
  width: 7px; height: 7px; border-radius: 50%; background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: pulse 2.2s infinite;
}
@keyframes pulse {
  70%  { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

/* ── Hero ─────────────────────────────────── */
.hero { position: relative; padding: clamp(3rem, 8vw, 6rem) 0 clamp(4rem, 9vw, 7rem); }
.hero-inner {
  display: grid; grid-template-columns: 1.05fr .95fr;
  gap: clamp(2rem, 5vw, 4rem); align-items: center;
}
.grad {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { font-size: 1.08rem; max-width: 52ch; margin-bottom: 2rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; }

.hero-stats { display: flex; gap: 2.5rem; margin-top: 3rem; flex-wrap: wrap; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.9rem; letter-spacing: -.03em; line-height: 1; }
.hero-stats span { font-size: .82rem; color: var(--text-3); margin-top: .35rem; }

.code-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-lg); overflow: hidden;
  transform: perspective(1200px) rotateY(-6deg) rotateX(2deg);
  transition: transform .5s cubic-bezier(.22,1,.36,1);
}
.code-card:hover { transform: perspective(1200px) rotateY(0) rotateX(0) translateY(-4px); }
.code-bar {
  display: flex; align-items: center; gap: 6px;
  padding: .7rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.code-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.code-bar i:nth-child(1) { background: #ff5f57; }
.code-bar i:nth-child(2) { background: #febc2e; }
.code-bar i:nth-child(3) { background: #28c840; }
.code-bar span { margin-left: auto; font-size: .75rem; color: var(--text-3); font-family: 'JetBrains Mono', monospace; }
.code {
  margin: 0; padding: 1.3rem 1.4rem; overflow-x: auto;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .82rem; line-height: 1.75; color: var(--text-2);
}
.code .k { color: #c084fc; } .code .v { color: var(--accent-2); }
.code .p { color: #60a5fa; } .code .s { color: #34d399; }
.code .n { color: #fbbf24; } .code .f { color: #f472b6; }

.scroll-hint {
  display: grid; place-items: start center; margin: 3.5rem auto 0;
  width: 24px; height: 38px; border: 1px solid var(--border); border-radius: 999px; padding-top: 7px;
}
.scroll-hint span { width: 3px; height: 7px; border-radius: 2px; background: var(--accent); animation: sc 1.8s ease-in-out infinite; }
@keyframes sc { 0%,100% { transform: translateY(0); opacity: 1; } 50% { transform: translateY(10px); opacity: .2; } }

/* ── Section head ─────────────────────────── */
.sec-head { max-width: 640px; margin-bottom: 3rem; }
.sec-tag {
  display: inline-block; margin-bottom: .9rem;
  font-family: 'JetBrains Mono', monospace; font-size: .76rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--accent);
}
.sec-sub { font-size: 1.02rem; }

/* ── About ────────────────────────────────── */
.about-grid { display: grid; grid-template-columns: 1.4fr .85fr; gap: 3rem; align-items: start; }
.big { font-size: 1.15rem; color: var(--text); }
.check { list-style: none; padding: 0; margin: 1.8rem 0 0; display: grid; gap: .7rem; }
.check li { position: relative; padding-left: 1.9rem; color: var(--text-2); font-size: .96rem; }
.check li::before {
  content: '✓'; position: absolute; left: 0; top: 1px;
  display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent); font-size: .72rem; font-weight: 700;
}

.about-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 2rem; box-shadow: var(--shadow); text-align: center;
}
.avatar {
  display: grid; place-items: center; width: 76px; height: 76px; margin: 0 auto 1.1rem;
  border-radius: 22px; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em;
}
.about-card h3 { margin-bottom: .15rem; }
.facts { margin: 1.6rem 0; display: grid; gap: .7rem; text-align: left; }
.facts div { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: .7rem; border-bottom: 1px solid var(--border); }
.facts div:last-child { border-bottom: 0; padding-bottom: 0; }
.facts dt { font-size: .85rem; color: var(--text-3); }
.facts dd { margin: 0; font-size: .88rem; font-weight: 500; }
.ok { color: #22c55e; }

/* ── Skills ───────────────────────────────── */
.skill-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.2rem; }
.skill {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 1.6rem; box-shadow: var(--shadow);
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.skill:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow-lg); }
.skill-ico {
  display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 1rem;
  border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-size: 1.1rem;
}
.skill p { font-size: .92rem; margin-bottom: 1.1rem; }

.tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.tags span {
  padding: .26rem .6rem; border: 1px solid var(--border); border-radius: 7px;
  background: var(--surface-2); font-size: .76rem; color: var(--text-2);
  font-family: 'JetBrains Mono', monospace;
}

.bars { margin-top: 3rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.3rem 2.5rem; }
.bar label { display: flex; justify-content: space-between; font-size: .87rem; color: var(--text-2); margin-bottom: .45rem; }
.bar label b { color: var(--text); font-variant-numeric: tabular-nums; }
.track { height: 6px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.track i {
  display: block; height: 100%; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 1.1s cubic-bezier(.22,1,.36,1);
}
.bars.in-view .track i { width: var(--w); }

/* ── Projects ─────────────────────────────── */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.chip {
  padding: .45rem 1rem; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text-2);
  font-family: inherit; font-size: .86rem; font-weight: 500; cursor: pointer; transition: .2s;
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.2rem; }
.proj {
  position: relative; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 1.7rem; box-shadow: var(--shadow);
  transition: transform .25s, border-color .25s, box-shadow .25s, opacity .3s;
}
.proj::after {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0); transform-origin: left; transition: transform .35s;
}
.proj:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: var(--shadow-lg); }
.proj:hover::after { transform: scaleX(1); }
.proj.hidden { display: none; }
.proj-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.proj-ico {
  display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 11px; background: var(--accent-soft); color: var(--accent); font-size: 1rem;
}
.proj-year { font-family: 'JetBrains Mono', monospace; font-size: .76rem; color: var(--text-3); }
.proj p { font-size: .92rem; margin-bottom: 1.1rem; }

/* ── Timeline ─────────────────────────────── */
.timeline { list-style: none; margin: 0; padding: 0 0 0 2rem; position: relative; }
.timeline::before {
  content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(var(--accent), var(--accent-2), transparent);
}
.timeline li { position: relative; padding-bottom: 2.5rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ''; position: absolute; left: -2rem; top: 7px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg-alt); border: 2px solid var(--accent);
}
.when { font-family: 'JetBrains Mono', monospace; font-size: .76rem; color: var(--accent); }
.timeline h3 { margin: .35rem 0 .5rem; font-size: 1.25rem; }
.timeline p { max-width: 62ch; font-size: .96rem; margin-bottom: .9rem; }

/* ── Contact ──────────────────────────────── */
.contact-card {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem);
  border: 1px solid var(--border); border-radius: 24px;
  background: var(--surface); padding: clamp(1.8rem, 4vw, 3.2rem);
  box-shadow: var(--shadow-lg);
}
.contact-copy h2 { margin-bottom: .6rem; }
.contact-list { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 1rem; }
.contact-list li { display: flex; align-items: center; gap: .8rem; font-size: .93rem; color: var(--text-2); }
.contact-list svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--accent); }
.contact-list a:hover { color: var(--accent); }

.contact-form { display: grid; gap: 1rem; align-content: start; }
.field { display: grid; gap: .35rem; }
.field label { font-size: .84rem; font-weight: 500; color: var(--text-2); }
.field input, .field textarea {
  width: 100%; padding: .75rem .9rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-alt); color: var(--text);
  font-family: inherit; font-size: .93rem; resize: vertical;
  transition: border-color .2s, box-shadow .2s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field.invalid input, .field.invalid textarea { border-color: #ef4444; }
.err { min-height: 0; font-size: .78rem; color: #ef4444; }
.form-note { margin: .3rem 0 0; font-size: .86rem; min-height: 1.2em; }
.form-note.ok { color: #22c55e; }

/* ── Footer ───────────────────────────────── */
.footer { border-top: 1px solid var(--border); padding: 2rem 0; background: var(--bg-alt); }
.footer-inner { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.footer p { margin: 0; font-size: .86rem; color: var(--text-3); }
.to-top { margin-left: auto; font-size: .86rem; color: var(--text-2); }
.to-top:hover { color: var(--accent); }

/* ── Reveal animation ─────────────────────── */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.22,1,.36,1), transform .7s cubic-bezier(.22,1,.36,1); }
.reveal.in-view { opacity: 1; transform: none; }

/* ── Responsive ───────────────────────────── */
@media (max-width: 940px) {
  .hero-inner, .about-grid, .contact-card { grid-template-columns: 1fr; }
  .code-card { transform: none; }
  .about-card { max-width: 420px; }
}

@media (max-width: 760px) {
  .burger { display: flex; }
  .nav-links {
    position: fixed; inset: 70px 0 auto 0;
    flex-direction: column; gap: 0; padding: .6rem 1.25rem 1.25rem;
    background: var(--bg); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateY(-130%); transition: transform .3s cubic-bezier(.22,1,.36,1);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: .8rem .6rem; border-radius: var(--radius-sm); }
  .hero-stats { gap: 1.75rem; }
  .hero-stats strong { font-size: 1.6rem; }
  .footer-inner { justify-content: center; text-align: center; }
  .to-top { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ── Hinweis unter der Projekt-Grid ─────────── */
.grid-note { margin-top: 1.5rem; font-size: .93rem; color: var(--text-3); }
.grid-note[hidden] { display: none; }

/* ── Sprungziele: kein Fokusring nach dem Scrollen ── */
[tabindex="-1"]:focus { outline: none; }

/* ── Rechtliche Seiten ─────────────────────── */
.container.narrow { width: min(100% - 2.5rem, 760px); }
.legal-page { padding-top: clamp(3rem, 7vw, 5rem); }
.legal-page h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: .4rem; }
.legal-page .lead { margin-bottom: 3rem; }
.legal-block { margin-bottom: 2.6rem; }
.legal-block h2 { font-size: 1.25rem; margin-bottom: .7rem; }
.legal-block p { font-size: .97rem; }
.legal-block a { color: var(--accent); }
.legal-block a:hover { text-decoration: underline; }
.legal-block .facts { margin: 1rem 0 0; }
.legal-block .check { margin-top: .5rem; }

.provider {
  font-style: normal; padding: 1.1rem 1.3rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); line-height: 1.8;
}

.domain-list { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .5rem; }
.domain-list li {
  padding: .7rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); font-size: .95rem;
}
.domain-list strong { font-family: 'JetBrains Mono', monospace; font-size: .9rem; }
.small { font-size: .88rem; }
.hint { margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid var(--border); font-size: .85rem; color: var(--text-3); }

/* ── Footer-Links ──────────────────────────── */
.footer-links { margin-left: auto; display: flex; align-items: center; gap: 1.2rem; }
.footer-links a { font-size: .86rem; color: var(--text-2); }
.footer-links a:hover { color: var(--accent); }
.footer-links .to-top { margin-left: 0; }

@media (max-width: 760px) {
  .footer-links { margin-left: 0; justify-content: center; flex-wrap: wrap; }
}

/* ── Projekt-Status ────────────────────────── */
.proj-meta { display: flex; align-items: center; gap: .6rem; }
.state-badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .2rem .6rem; border-radius: 999px;
  border: 1px solid color-mix(in srgb, #22c55e 40%, transparent);
  background: color-mix(in srgb, #22c55e 12%, transparent);
  color: #22c55e; font-size: .72rem; font-weight: 600; letter-spacing: .01em;
}
.state-badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}
.state-badge.off {
  border-color: var(--border); background: var(--surface-2); color: var(--text-3);
}
.proj.is-inactive .proj-ico { background: var(--surface-2); color: var(--text-3); }
.proj.is-inactive h3 { color: var(--text-2); }

/* Auswahlfelder wie Textfelder gestalten */
.field select {
  width: 100%; padding: .75rem .9rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-alt); color: var(--text);
  font-family: inherit; font-size: .93rem; cursor: pointer;
}
.field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Honigtopf gegen Formular-Bots — für Menschen nicht sichtbar */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
