html { scroll-behavior: smooth; }

:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
  border-radius: 4px;
}

.blink_me {
  animation: blinker 1s linear infinite;
}

@keyframes blinker {
  50% { opacity: 0.70; }
}

/* ───────── ANIMATIONS ───────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translate3d(0, 24px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes bgDrift {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(-1%, 0.8%, 0); }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Hero entrance — runs once on load */
.hero h1            { animation: fadeUp .5s cubic-bezier(.2,.7,.2,1) both; }
.hero .tagline      { animation: fadeUp .5s cubic-bezier(.2,.7,.2,1) .06s both; }
.hero .contact-card { animation: fadeUp .5s cubic-bezier(.2,.7,.2,1) .12s both; }
.hero .badge-row    { animation: fadeUp .5s cubic-bezier(.2,.7,.2,1) .18s both; }
.hero .portrait-wrap{ animation: fadeUp .55s cubic-bezier(.2,.7,.2,1) .08s both; }

/* Scroll-reveal — JS toggles .in-view */
.reveal { opacity: 0; transform: translate3d(0, 18px, 0); transition: opacity .45s ease-out, transform .45s cubic-bezier(.2,.7,.2,1); will-change: opacity, transform; }
.reveal.in-view { opacity: 1; transform: translate3d(0, 0, 0); }
.reveal-stagger > * { opacity: 0; transform: translate3d(0, 12px, 0); transition: opacity .35s ease-out, transform .35s cubic-bezier(.2,.7,.2,1); }
.reveal-stagger.in-view > * { opacity: 1; transform: translate3d(0, 0, 0); }
.reveal-stagger.in-view > *:nth-child(1) { transition-delay: .02s; }
.reveal-stagger.in-view > *:nth-child(2) { transition-delay: .05s; }
.reveal-stagger.in-view > *:nth-child(3) { transition-delay: .08s; }
.reveal-stagger.in-view > *:nth-child(4) { transition-delay: .11s; }
.reveal-stagger.in-view > *:nth-child(5) { transition-delay: .14s; }
.reveal-stagger.in-view > *:nth-child(6) { transition-delay: .17s; }
.reveal-stagger.in-view > *:nth-child(7) { transition-delay: .20s; }
.reveal-stagger.in-view > *:nth-child(8) { transition-delay: .23s; }

/* Animated background — slow drift on the hero glow */
body::before { animation: bgDrift 18s ease-in-out infinite; }

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

:root {
    --bg: #000000;
    --surface: #141414;
    --surface-2: #1c1c1c;
    --surface-3: #242424;
    --border: rgba(255,255,255,0.08);
    --border-strong: rgba(255,255,255,0.16);
    --fg: #f5f5f5;
    --fg-muted: #a0a0a0;
    --fg-dim: #6b6b6b;
    --accent: #ffffff;
    --glow: rgba(255,255,255,0.06);
    --max: 1280px;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  html, body {
    background: var(--bg);
    color: var(--fg);
    font-family: 'Manrope', system-ui, sans-serif;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
    overflow-x: hidden;
  }
  body::before {
    content: "";
    position: fixed;
    inset: -8%;
    background:
      radial-gradient(900px 700px at 8% 0%, rgba(255,255,255,0.10), transparent 60%),
      radial-gradient(1200px 800px at 100% 90%, rgba(255,255,255,0.03), transparent 60%),
      var(--bg);
    pointer-events: none;
    z-index: 0;
    will-change: transform;
  }
  .page { position: relative; z-index: 1; max-width: var(--max); margin: 0 auto; padding: 56px 64px 80px; }

  /* ───────── HERO ───────── */
  /* Porträt (Spalte 2) endet bündig mit der Kontakt-Box: die Badges liegen
     in einer eigenen Grid-Zeile, das Bild streckt sich auf die Zeilenhöhe. */
  .hero { display: grid; grid-template-columns: 1fr 280px; column-gap: 48px; row-gap: 0; }
  .hero .badge-row { grid-column: 1; }
  .hero-left { padding-top: 8px; }
  .hero h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(40px, 5.2vw, 76px);
    letter-spacing: -0.02em;
    line-height: 1;
    color: #ffffff;
  }
  .hero .tagline {
    margin-top: 14px;
    font-size: 19px;
    color: var(--fg-muted);
    font-weight: 400;
  }

  .contact-card {
    margin-top: 36px;
    background: linear-gradient(180deg, rgba(38,38,38,0.9), rgba(24,24,24,0.9));
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px 26px;
    box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 12px 40px rgba(0,0,0,0.4);
  }
  .contact-card .contact-title,
  .contact-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 17px;
    margin-bottom: 10px;
    letter-spacing: 0.01em;
  }
  .contact-card ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
  .contact-card li { font-size: 15.5px; color: var(--fg); display: flex; align-items: center; gap: 10px; }
  .contact-card li .lbl { color: var(--fg); font-weight: 600; }
  .contact-card a { color: var(--fg); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .2s; }
  .contact-card a:hover { border-color: var(--fg-muted); }
  .contact-card li.link::before {
    content: "";
    width: 6px; height: 6px;
    background: var(--fg-muted);
    border-radius: 50%;
    flex-shrink: 0;
  }

  .badge-row { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; max-width: 520px; }
  .badge {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--fg-muted);
    display: inline-flex; align-items: center; gap: 8px;
    transition: background .15s ease-out, border-color .15s ease-out, transform .18s cubic-bezier(.2,.9,.3,1);
  }
  .badge:hover { background: rgba(255,255,255,0.08); border-color: var(--border-strong); transform: translateY(-1px); }
  .badge .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 8px #4ade80;
    animation: pulseDot 2s ease-in-out infinite;
  }
  @keyframes pulseDot {
    0%, 100% { box-shadow: 0 0 8px #4ade80; transform: scale(1); }
    50%      { box-shadow: 0 0 14px #4ade80, 0 0 22px rgba(74,222,128,0.4); transform: scale(1.15); }
  }

  .portrait-wrap {
    width: 100%;
    align-self: stretch;
    min-height: 360px;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface-2);
    position: relative;
  }
  .portrait-wrap .portrait,
  .portrait-wrap img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center; transition: transform .4s cubic-bezier(.2,.9,.3,1), filter .25s ease-out; }
  .portrait-wrap:hover img { transform: scale(1.04); filter: brightness(1.05); }
  .portrait-wrap::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.35));
    opacity: 0;
    transition: opacity .2s ease-out;
    pointer-events: none;
  }
  .portrait-wrap:hover::after { opacity: 1; }

  /* ───────── DIVIDER ───────── */
  .divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
    margin: 72px 0;
  }

  /* ───────── ABOUT ───────── */
  .about { max-width: 880px; margin: 0 auto; }
  .about p { font-size: 16.5px; color: #d4d4d4; line-height: 1.75; }
  .about p + p { margin-top: 18px; }
  .about em { font-style: italic; color: var(--fg); }

  /* ───────── SECTIONS ───────── */
  .section-head {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 14px;
  }
  .section-head h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 22px;
    letter-spacing: 0.01em;
  }
  .section-head .count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--fg-dim);
    letter-spacing: 0.1em;
  }

  /* ───────── TECH ───────── */
  .tech-block {
    background: linear-gradient(180deg, rgba(38,38,38,0.7), rgba(20,20,20,0.7));
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 32px 40px;
  }
  .tech-pills {
    list-style: none;
    display: flex; flex-wrap: wrap; gap: 12px;
    justify-content: center;
  }
  .pill {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 10px 22px;
    font-size: 14px;
    color: var(--fg);
    font-weight: 500;
    transition: background .15s ease-out, border-color .15s ease-out, transform .18s cubic-bezier(.2,.9,.3,1), box-shadow .18s ease-out;
    cursor: default;
  }
  .pill:hover {
    background: rgba(255,255,255,0.10);
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.35);
  }

  /* ───────── PROJECTS ───────── */
  .projects-wrap { position: relative; }
  .projects-rail {
    display: flex;
    gap: 22px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding: 4px 2px 18px;
  }
  .projects-rail::-webkit-scrollbar { display: none; }
  .projects-rail > .project-card {
    flex: 0 0 calc((100% - 44px) / 3);
    scroll-snap-align: start;
    min-width: 280px;
  }
  .rail-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    gap: 12px;
  }
  .rail-nav .projects-note { margin: 0; text-align: left; }
  .rail-controls { display: flex; align-items: center; }
  .rail-arrows { display: flex; gap: 10px; margin-left: 12px; }
  .rail-btn {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    color: var(--fg);
    font-size: 18px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s, border-color .2s, transform .15s;
    font-family: 'Space Grotesk', sans-serif;
  }
  .rail-btn:hover { background: rgba(255,255,255,0.10); border-color: var(--border-strong); }
  .rail-btn:active { transform: scale(0.94); }
  .rail-btn:disabled { opacity: 0.35; cursor: not-allowed; }
  .rail-progress {
    flex: 1; max-width: 140px;
    height: 2px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 16px;
  }
  .rail-progress > span {
    display: block;
    height: 100%;
    background: var(--fg);
    width: 33%;
    transition: width .25s, transform .25s;
  }
  .rail-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--fg-muted);
    letter-spacing: 0.06em;
    min-width: 60px;
    text-align: right;
  }
  .project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
    display: flex; flex-direction: column;
    transition: transform .2s cubic-bezier(.2,.9,.3,1), border-color .15s ease-out, box-shadow .2s ease-out;
  }
  .project-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-strong);
    box-shadow: 0 18px 50px rgba(0,0,0,0.5);
  }
  .project-shot {
    width: 100%;
    aspect-ratio: 16 / 11;
    border-radius: 10px;
    background: #0c0c0c;
    overflow: hidden;
    border: 1px solid var(--border);
  }
  .project-shot img { transition: transform .35s cubic-bezier(.2,.9,.3,1); }
  .project-card:hover .project-shot img { transform: scale(1.06); }
  .project-shot .project-img,
  .project-shot img { width: 100%; height: 100%; display: block; object-fit: cover; }
  .project-meta {
    margin-top: 16px;
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 12px;
  }
  .project-meta h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: var(--fg);
  }
  .project-meta .sub { font-size: 13px; color: var(--fg-muted); margin-top: 2px; }
  .project-meta .date {
    font-size: 12px;
    color: var(--fg-muted);
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .project-desc {
    font-size: 13.5px;
    color: var(--fg-muted);
    margin-top: 14px;
    line-height: 1.55;
    flex: 1;
  }
  .project-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
  .project-tags span,
  .project-tags li {
    font-size: 11px;
    color: var(--fg-muted);
    background: rgba(255,255,255,0.04);
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.04em;
  }
  .project-cta {
    position: relative;
    overflow: hidden;
    margin-top: 18px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    color: var(--fg);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: block;
    transition: background .15s ease-out, border-color .15s ease-out, letter-spacing .15s ease-out;
  }
  .project-cta::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.18) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform .45s cubic-bezier(.2,.9,.3,1);
    pointer-events: none;
  }
  .project-cta:hover {
    background: rgba(255,255,255,0.14);
    border-color: var(--border-strong);
    letter-spacing: 0.02em;
  }
  .project-cta:hover::after { transform: translateX(100%); }

  .project-card.empty {
    border: 1px dashed var(--border-strong);
    background: transparent;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px 24px;
    color: var(--fg-muted);
  }
  .project-card.empty .glyph {
    width: 56px; height: 56px;
    border-radius: 50%;
    border: 1px dashed var(--border-strong);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
    color: var(--fg-muted);
    margin-bottom: 14px;
  }
  .project-card.empty h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px;
    color: var(--fg);
    margin-bottom: 6px;
  }
  .project-card.empty p { font-size: 13px; line-height: 1.5; }

  .projects-note {
    margin-top: 22px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--fg-dim);
    letter-spacing: 0.04em;
  }

  /* ───────── TIMELINE ───────── */
  .timeline { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 36px; }
  .tl-item { list-style: none; transition: transform .3s ease; }
  .tl-item:hover .company { color: #fff; }
  .tl-head .company { transition: color .25s ease; }
  .tl-head .line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border-strong), transparent);
  }
  .tl-item:hover .tl-head .line { background: linear-gradient(90deg, #fff, transparent); }
  .tl-head {
    display: flex; align-items: baseline; gap: 16px;
    padding-bottom: 6px;
  }
  .tl-head .company {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 20px;
    color: var(--fg);
    white-space: nowrap;
  }
  .tl-head .date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12.5px;
    color: var(--fg-muted);
    white-space: nowrap;
    letter-spacing: 0.04em;
  }
  .tl-head .date strong { color: var(--fg); font-weight: 500; }
  .tl-role {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 0.04em;
    margin-top: 8px;
    margin-bottom: 10px;
    color: var(--fg);
  }
  .tl-bullets { list-style: none; padding-left: 24px; display: flex; flex-direction: column; gap: 4px; }
  .tl-bullets li {
    color: var(--fg-muted);
    font-size: 14.5px;
    position: relative;
  }
  .tl-bullets li::before {
    content: "";
    position: absolute;
    left: -16px; top: 9px;
    width: 5px; height: 5px;
    background: var(--fg-dim);
    border-radius: 50%;
  }

  /* ───────── DOCUMENTS ───────── */
  .docs-block {
    background: linear-gradient(180deg, rgba(50,50,50,0.5), rgba(20,20,20,0.5));
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 24px 28px 28px;
  }
  .docs-block .label {
    text-align: center;
    color: var(--fg-muted);
    font-size: 15px;
    margin-bottom: 18px;
  }
  .docs-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
  }
  .doc-btn {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 36px 16px;
    text-align: center;
    color: var(--fg);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 26px;
    letter-spacing: 0.01em;
    cursor: pointer;
    text-decoration: none;
    display: flex; align-items: center; justify-content: center; gap: 12px;
    transition: background .15s ease-out, border-color .15s ease-out, transform .18s cubic-bezier(.2,.9,.3,1), box-shadow .18s ease-out;
  }
  .doc-btn:hover { background: rgba(255,255,255,0.08); border-color: var(--border-strong); transform: translateY(-3px); box-shadow: 0 14px 36px rgba(0,0,0,0.45); }
  .doc-btn::before {
    content: "";
    width: 22px; height: 28px;
    background:
      linear-gradient(135deg, transparent 50%, rgba(255,255,255,0.15) 50%) top right / 8px 8px no-repeat,
      rgba(255,255,255,0.06);
    border: 1px solid var(--border-strong);
    border-radius: 2px;
    flex-shrink: 0;
  }

  /* ───────── FOOTER ───────── */
  .footer {
    margin-top: 90px;
    text-align: center;
    color: var(--fg-muted);
    font-size: 15px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
  }
  .footer .tag { font-size: 13px; color: var(--fg-dim); margin-top: 8px; font-family: 'JetBrains Mono', monospace; }


  /* ───────── MOBILE ───────── */
  @media (max-width: 945px) {
    .page { padding: 28px 20px 60px; }
    .hero { grid-template-columns: 1fr; gap: 24px; }
    .hero-left { order: 2; }
    .portrait-wrap { order: 1; max-width: 240px; margin: 0 auto; align-self: center; min-height: 0; aspect-ratio: 3 / 4; }
    .hero .badge-row { order: 3; margin-top: 0; }
    .hero h1 { font-size: 44px; }
    .hero .tagline { font-size: 16px; }
    .contact-card { margin-top: 24px; padding: 20px; max-width: none;}
    .contact-card li { font-size: 14.5px; }
    .badge-row { margin-top: 14px; }
    .badge { font-size: 12px; padding: 7px 14px; }
    .divider { margin: 48px 0; }
    .about p { font-size: 15px; }
    .tech-block { padding: 22px 18px; }
    .tech-pills { gap: 8px; }
    .pill { padding: 8px 16px; font-size: 13px; }
    .projects-rail > .project-card { flex: 0 0 86%; min-width: 0; }
    .rail-nav { flex-direction: column; align-items: stretch; gap: 14px; }
    .rail-nav > div:last-child { justify-content: space-between; }
    .rail-progress { max-width: none; flex: 1; }
    .section-head h2 { font-size: 19px; }
    .tl-head { flex-wrap: nowrap; gap: 10px; }
    .tl-head .company { font-size: 16px; }
    .tl-head .date { font-size: 10.5px; }
    .tl-role { font-size: 15px; }
    .tl-bullets li { font-size: 14px; }
    .docs-grid { grid-template-columns: 1fr; gap: 12px; }
    .doc-btn { font-size: 20px; padding: 26px 16px; }
    .footer { margin-top: 60px; }
  }

  @media (max-width: 480px) {
    .page { padding: 20px 16px 48px; }
    .hero h1 { font-size: 38px; }
    .contact-card { padding: 18px; }
    .docs-block { padding: 20px; }
  }