/* Self-hosted fonts (SIL Open Font License), kein Abruf bei Google */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #fafafc;
  --bg-elev: #ffffff;
  --text: #14141f;
  --muted: #5d5d73;
  --border: #e6e6ef;
  --accent: #6d5efc;
  --accent-2: #00c2a8;
  --glow: rgba(109, 94, 252, 0.18);
  --shadow: 0 10px 40px rgba(20, 20, 50, 0.08);
  --radius: 20px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b12;
    --bg-elev: #14141e;
    --text: #f1f1f7;
    --muted: #a0a0b8;
    --border: #262635;
    --glow: rgba(109, 94, 252, 0.25);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  }
}
:root[data-theme="dark"] {
  --bg: #0b0b12;
  --bg-elev: #14141e;
  --text: #f1f1f7;
  --muted: #a0a0b8;
  --border: #262635;
  --glow: rgba(109, 94, 252, 0.25);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  transition: background .3s, color .3s;
}
a { color: inherit; }
.i { width: 1.15em; height: 1.15em; flex-shrink: 0; vertical-align: -.2em; }
.brand-link { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color .2s; }
.brand-link:hover { color: var(--accent-2); }

/* Cursor glow */
.glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(500px circle at var(--x, 50%) var(--y, 30%), var(--glow), transparent 60%);
}

/* Nav */
.nav {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  width: min(960px, calc(100% - 32px));
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 14px 10px 22px;
  background: color-mix(in srgb, var(--bg-elev) 75%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: 999px;
  z-index: 50; box-shadow: var(--shadow);
}
.logo { font-weight: 800; font-size: 1.2rem; text-decoration: none; }
.logo span { color: var(--accent); }
.nav nav { display: flex; gap: 24px; }
.nav nav a { text-decoration: none; color: var(--muted); font-weight: 500; font-size: .95rem; transition: color .2s; }
.nav nav a:hover { color: var(--text); }
.theme-toggle {
  background: none; border: 1px solid var(--border); color: var(--text);
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; transition: transform .3s;
}
.theme-toggle:hover { transform: rotate(20deg); }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}

main, footer { position: relative; z-index: 1; }

/* Hero */
.hero {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  width: min(960px, calc(100% - 32px)); margin: 0 auto; padding: 120px 0 80px;
  position: relative;
}
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px; font-size: .85rem; font-weight: 500;
  background: var(--bg-elev); border: 1px solid var(--border); color: var(--muted);
  margin-bottom: 28px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 0 var(--accent-2); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

h1 { font-size: clamp(2.6rem, 7vw, 5rem); line-height: 1.05; letter-spacing: -0.03em; font-weight: 800; }
.gradient {
  background: linear-gradient(120deg, var(--accent), var(--accent-2), var(--accent));
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 6s linear infinite;
}
@keyframes shine { to { background-position: 200% center; } }
.hero-sub { font-size: clamp(1.25rem, 3vw, 1.75rem); font-weight: 600; margin-top: 18px; color: var(--muted); }
.typed { color: var(--text); }
.caret { color: var(--accent); animation: blink 1s steps(1) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }
.hero-text { max-width: 560px; margin-top: 18px; color: var(--muted); font-size: 1.1rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }

.scroll-hint {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 42px; border: 2px solid var(--border); border-radius: 14px;
}
.scroll-hint span {
  position: absolute; top: 8px; left: 50%; width: 4px; height: 8px; margin-left: -2px;
  background: var(--accent); border-radius: 2px; animation: scroll 1.8s infinite;
}
@keyframes scroll { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(14px); } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px; border-radius: 999px; font-weight: 600; font-size: 1rem;
  text-decoration: none; border: none; cursor: pointer; font-family: inherit;
  transition: transform .2s ease, box-shadow .2s ease, background .2s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff; box-shadow: 0 8px 24px rgba(109, 94, 252, .35);
}
.btn-primary:hover { box-shadow: 0 12px 32px rgba(109, 94, 252, .5); }
/* Hero CTA: periodic glow + shine sweep */
.cta-glow { position: relative; overflow: hidden; isolation: isolate; animation: cta-pulse 4s ease-in-out infinite; }
.cta-glow::after {
  content: ""; position: absolute; top: 0; left: -75%; width: 50%; height: 100%; z-index: -1;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-20deg); animation: cta-shine 4s ease-in-out infinite;
}
@keyframes cta-pulse {
  0%, 60%, 100% { box-shadow: 0 8px 24px rgba(109, 94, 252, .35), 0 0 0 0 rgba(109, 94, 252, .5); }
  75% { box-shadow: 0 10px 40px rgba(109, 94, 252, .7), 0 0 0 10px rgba(109, 94, 252, 0); }
}
@keyframes cta-shine { 0%, 60% { left: -75%; } 85%, 100% { left: 130%; } }
.btn-ghost { background: var(--bg-elev); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); }
.btn:active { transform: scale(.97); }

/* Sections */
.section { width: min(960px, calc(100% - 32px)); margin: 0 auto; padding: 100px 0; }
h2 { font-size: clamp(2rem, 4.5vw, 3rem); letter-spacing: -0.02em; margin-bottom: 40px; font-weight: 800; }

.about-grid { display: grid; grid-template-columns: 280px 1fr; gap: 56px; align-items: center; }
.avatar {
  aspect-ratio: 1; border-radius: 32px; padding: 3px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: var(--shadow);
}
.avatar-inner {
  width: 100%; height: 100%; border-radius: 29px; background: var(--bg-elev);
  display: grid; place-items: center; font-size: 5rem; font-weight: 800; color: var(--accent);
}
.avatar-inner { position: relative; overflow: hidden; }
.avatar-inner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.about-text p { color: var(--muted); font-size: 1.1rem; margin-bottom: 16px; }
.stats { display: flex; gap: 36px; margin-top: 28px; flex-wrap: wrap; }
.stat strong { display: block; font-size: 2.4rem; font-weight: 800; color: var(--text); line-height: 1.1; }
.about-text p strong { color: var(--text); }
.stat { max-width: 220px; }
.stat strong { color: var(--accent); }
.stat span { color: var(--muted); font-size: .9rem; line-height: 1.4; display: block; }

/* Timeline */
.timeline { list-style: none; position: relative; padding-left: 32px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(var(--accent), var(--accent-2), var(--border));
}
.timeline li { position: relative; padding: 0 0 36px 16px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -32px; top: 6px; width: 16px; height: 16px; border-radius: 50%; box-sizing: border-box;
  background: var(--bg); border: 3px solid var(--accent); transition: transform .3s, background .3s;
}
.timeline li:hover::before { transform: scale(1.3); background: var(--accent); }
.timeline h3 { font-size: 1.2rem; margin: 6px 0 4px; }
.timeline p { color: var(--muted); max-width: 640px; }
.tl-tag {
  display: inline-block; font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px; background: var(--bg-elev); border: 1px solid var(--border); color: var(--muted);
}
.tl-tag.now { color: var(--accent-2); border-color: color-mix(in srgb, var(--accent-2) 40%, transparent); }

/* Stack */
#focus { padding-bottom: 20px; }
.stack-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.stack-group {
  position: relative; overflow: hidden;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
}
.stack-group.reveal { transition: opacity .7s ease, transform .7s ease, border-color .3s; }
.stack-group:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.spotlight::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), var(--glow), transparent 70%);
}
.spotlight:hover::before { opacity: 1; }
.stack-group > * { position: relative; }
.group-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.group-icon {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 22px; line-height: 1; color: var(--accent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, transparent), color-mix(in srgb, var(--accent-2) 18%, transparent));
}
.group-head h4 { font-size: 1.1rem; font-weight: 700; }
.tools { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }
.tools li {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .95rem; font-weight: 500; line-height: 1;
  padding: 6px 14px 6px 6px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border);
  transition: transform .2s, border-color .2s, color .2s, box-shadow .2s; cursor: default;
}
.tools .ti {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-elev); font-size: 17px; line-height: 1;
}
.tools .ti .i { width: 18px; height: 18px; }
.tools .ti img { width: 20px; height: 20px; object-fit: contain; display: block; }
.tools li:hover { transform: translateY(-3px); border-color: var(--accent); color: var(--accent); box-shadow: 0 6px 18px var(--glow); }
.tools li:hover .ti { animation: wiggle .5s ease; }
@keyframes wiggle { 30% { transform: rotate(-12deg) scale(1.12); } 60% { transform: rotate(8deg) scale(1.06); } }
.stack-note { color: var(--muted); margin-top: 24px; max-width: 640px; }
@media (max-width: 760px) { .stack-grid { grid-template-columns: 1fr; } .stack-group { padding: 22px; } }

/* Terminal */
.terminal-section { padding-top: 40px; }
.terminal {
  background: #0d0d14; color: #d6d6e7; border-radius: 16px; overflow: hidden;
  border: 1px solid #262635; box-shadow: var(--shadow);
  font-family: "JetBrains Mono", monospace; font-size: .9rem;
}
.term-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: #181822; }
.term-bar span { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.term-bar span:nth-child(2) { background: #febc2e; }
.term-bar span:nth-child(3) { background: #28c840; }
.term-bar em { font-style: normal; color: #8a8aa3; margin-left: 8px; font-size: .8rem; }
.term-body { padding: 16px; height: 280px; overflow-y: auto; cursor: text; }
.term-output div { white-space: pre-wrap; word-break: break-word; }
.term-output .cmd { color: #fff; }
.term-output .accent { color: #8b7dff; }
.term-output .ok { color: #3ee0c4; }
.term-line { display: flex; gap: 8px; }
.prompt { color: #3ee0c4; white-space: nowrap; }
.term-line input {
  flex: 1; min-width: 0; background: none; border: none; outline: none;
  color: #fff; font: inherit; caret-color: #8b7dff;
}
.term-hint { text-align: center; color: var(--muted); margin-top: 14px; font-size: .95rem; }
.term-hint code { font-family: "JetBrains Mono", monospace; color: var(--accent); }

.footer-note { margin-top: 6px; font-size: .85rem; opacity: .8; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px 28px; box-shadow: var(--shadow); transition: border-color .3s;
}
.card:hover { border-color: var(--accent); }
.card .icon { font-size: 2rem; line-height: 1; margin-bottom: 16px; color: var(--accent); }
.card h3 { font-size: 1.25rem; margin-bottom: 8px; }
.card p { color: var(--muted); }
.tilt { transition: transform .15s ease-out, border-color .3s; will-change: transform; }

/* Contact */
.contact-box {
  position: relative; overflow: hidden;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 32px;
  padding: clamp(28px, 6vw, 64px); box-shadow: var(--shadow); text-align: center;
}
.contact-box::before {
  content: ""; position: absolute; inset: -40% -20% auto; height: 300px;
  background: radial-gradient(closest-side, var(--glow), transparent);
  pointer-events: none;
}
.contact-box > * { position: relative; }
.contact-box h2 { margin-bottom: 16px; }
.contact-box > p { color: var(--muted); max-width: 560px; margin: 0 auto 36px; font-size: 1.1rem; }

.contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 640px; margin: 0 auto; text-align: left; }
.full { grid-column: 1 / -1; }
.field { position: relative; }
.field input, .field textarea {
  width: 100%; padding: 22px 16px 10px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font: inherit; resize: vertical; transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow); }
.field label {
  position: absolute; left: 16px; top: 16px; color: var(--muted); pointer-events: none;
  transition: all .2s ease; font-size: 1rem;
}
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label {
  top: 6px; font-size: .75rem; color: var(--accent);
}
.field.invalid input, .field.invalid textarea { border-color: #e5484d; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.altcha-wrap altcha-widget { display: block; }
altcha-widget {
  --altcha-color-base: var(--bg);
  --altcha-color-base-content: var(--text);
  --altcha-color-primary: var(--accent);
  --altcha-color-primary-content: #fff;
  --altcha-border-color: var(--border);
  --altcha-border-radius: 14px;
  --altcha-max-width: 100%;
}
.btn:disabled { opacity: .6; cursor: wait; }
.form-status { grid-column: 1 / -1; text-align: center; min-height: 1.5em; color: var(--muted); font-size: .95rem; }

.contact-alt { margin-top: 28px; display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; color: var(--muted); }
.copy-mail {
  font: inherit; font-weight: 600; color: var(--text); cursor: pointer;
  background: var(--bg); border: 1px dashed var(--border); border-radius: 999px; padding: 8px 16px;
  transition: border-color .2s;
}
.copy-mail small { color: var(--accent); margin-left: 6px; font-weight: 500; }
.copy-mail:hover { border-color: var(--accent); }

.socials { display: flex; gap: 12px; justify-content: center; margin-top: 24px; }
.socials a {
  width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--border); color: var(--muted); transition: all .2s;
}
.socials a:hover { color: #fff; background: var(--accent); border-color: var(--accent); transform: translateY(-3px); }

footer { text-align: center; padding: 40px 16px 100px; color: var(--muted); font-size: .9rem; }
footer a { color: var(--muted); }

/* Modals */
.modal {
  width: min(720px, calc(100% - 32px)); max-height: min(85vh, 900px);
  margin: auto; padding: 0; border: 1px solid var(--border); border-radius: 24px;
  background: var(--bg-elev); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
  overflow: hidden;
}
.modal:focus, .modal:focus-visible { outline: none; }
.modal[open] { display: flex; flex-direction: column; animation: modal-in .3s ease; }
.modal::backdrop { background: rgba(10, 10, 20, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
@keyframes modal-in { from { opacity: 0; transform: translateY(20px) scale(.98); } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px 28px; border-bottom: 1px solid var(--border);
}
.modal-head h2 { font-size: 1.5rem; margin: 0; }
.modal-close {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); flex-shrink: 0;
  background: var(--bg); color: var(--text); cursor: pointer; font-size: 1rem; transition: all .2s;
  display: grid; place-items: center;
}
.modal-close:hover { border-color: var(--accent); color: var(--accent); transform: rotate(90deg); }
.modal-body { padding: 8px 28px 28px; overflow-y: auto; overscroll-behavior: contain; }
.modal-body h3 { font-size: 1.05rem; margin: 24px 0 8px; }
.modal-body p, .modal-body li { color: var(--muted); font-size: .95rem; }
.modal-body p + p { margin-top: 10px; }
.modal-body ul { padding-left: 20px; margin: 6px 0 10px; }
.modal-body a { color: var(--accent); word-break: break-word; }
.modal-body strong { color: var(--text); }
.modal-body mark { background: color-mix(in srgb, #febc2e 35%, transparent); color: var(--text); padding: 0 4px; border-radius: 4px; }
.modal-meta { margin-top: 24px; font-size: .85rem !important; }
body.modal-open { overflow: hidden; }
@media (max-width: 760px) { .modal-head, .modal-body { padding-left: 20px; padding-right: 20px; } }

/* Floating CTA */
.floating-cta {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  padding: 12px 20px; border-radius: 999px; font-weight: 600; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--text); color: var(--bg); box-shadow: var(--shadow);
  opacity: 0; transform: translateY(20px); pointer-events: none; transition: all .3s;
}
.floating-cta.show { opacity: 1; transform: none; pointer-events: auto; }
.floating-cta:hover { transform: translateY(-3px); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 40px); z-index: 60;
  background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: 12px;
  font-weight: 500; opacity: 0; transition: all .3s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }
.reveal.visible.tilt { transition: transform .15s ease-out, border-color .3s, opacity .7s ease; }

/* Responsive */
@media (max-width: 760px) {
  .nav nav { display: none; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .avatar { max-width: 200px; }
  .cards { grid-template-columns: 1fr; }
  .contact-form { grid-template-columns: 1fr; }
  .section { padding: 70px 0; }
}

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