:root{
    --bg: #0D1113;
    --bg-elevated: #12181B;
    --surface: #1A2226;
    --surface-2: #202A2E;
    --border: #2B363B;
    --text: #E7EDEF;
    --text-muted: #8FA0A6;
    --text-faint: #5C6A6F;
    --accent: #488ACB;
    --accent-soft: rgba(72,138,203,0.12);
    --accent-dim: #1E65AA;
    --ok: #6FCF97;
    --mono: 'IBM Plex Mono', ui-monospace, monospace;
    --sans: 'IBM Plex Sans', system-ui, sans-serif;
    --radius: 3px;
    --shadow-term: 0 20px 60px -20px rgba(0,0,0,0.6);
    --shadow-chat: 0 20px 50px -14px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,0,0,0.35);
    --shadow-banner: 0 20px 50px -14px rgba(0,0,0,0.7);
  }

  *{ box-sizing: border-box; }
  html{ scroll-behavior: smooth; }
  @media (prefers-reduced-motion: reduce){
    html{ scroll-behavior: auto; }
    *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  }

  body{
    margin:0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
  }

  a{ color: inherit; }
  h1,h2,h3{ font-family: var(--sans); margin: 0; }
  p{ margin: 0; }

  .container{
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 28px;
  }

  .eyebrow{
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: 0.02em;
    color: var(--accent);
  }
  .eyebrow::before{ content: "// "; color: var(--text-faint); }

  /* ---------- NAV ---------- */
  header.nav{
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(13,17,19,0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
  }
  .nav-inner{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding: 14px 28px;
    max-width: 1080px;
    margin: 0 auto;
  }
  .prompt{
    font-family: var(--mono);
    font-size: 14px;
    color: var(--text-muted);
    white-space: nowrap;
  }
  .prompt strong{ color: var(--text); font-weight: 500; }
  .prompt .path{ color: var(--accent); }
  .typed-text{
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
    width: 0;
    animation: type-welcome 1s steps(8, end) 5s 1 normal both;
  }
  @keyframes type-welcome{ to{ width: 8ch; } }
  .cursor-blink{
    display:inline-block;
    width: 7px;
    height: 14px;
    background: var(--accent);
    margin-left: 2px;
    animation: blink 1s steps(1) infinite;
    vertical-align: -2px;
  }
  @keyframes blink{ 50%{ opacity: 0; } }

  nav.links{ display:flex; gap: 4px; align-items:center; }
  nav.links a{
    font-family: var(--mono);
    font-size: 13.5px;
    text-decoration: none;
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: var(--radius);
    transition: color .15s ease, background .15s ease;
  }
  nav.links a::before{ content: "~/"; color: var(--text-faint); }
  nav.links a:hover, nav.links a.active{
    color: var(--accent);
    background: var(--accent-soft);
  }
  .nav-toggle{ display:none; background:none; border:1px solid var(--border); color: var(--text); font-family: var(--mono); padding: 6px 10px; border-radius: var(--radius); cursor:pointer; }

  /* ---------- HERO ---------- */
  .hero{
    padding: 88px 0 64px;
  }
  .hero-grid{
    display:grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 56px;
    align-items:center;
  }
  .hero-logo{ display:block; width: 80px; height: auto; margin-bottom: 18px; }
  .hero h1{
    font-size: 44px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 14px 0 18px;
  }
  .hero h1 span{ color: var(--accent); }
  .hero p.lead{
    color: var(--text-muted);
    font-size: 17px;
    max-width: 46ch;
    margin-bottom: 30px;
    text-align: justify;
  }
  .cta-row{ display:flex; gap: 12px; flex-wrap: wrap; }
  .btn{
    font-family: var(--mono);
    font-size: 14px;
    padding: 12px 20px;
    border-radius: var(--radius);
    text-decoration: none;
    display:inline-flex;
    align-items:center;
    gap: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .12s ease, border-color .15s ease, background .15s ease;
  }
  .btn-primary{ background: var(--accent); color: var(--bg); font-weight: 600; }
  .btn-primary:hover{ transform: translateY(-1px); }
  .btn-ghost{ border-color: var(--border); color: var(--text); background: transparent; }
  .btn-ghost:hover{ border-color: var(--accent); color: var(--accent); }

  /* terminal window */
  .term{
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: var(--shadow-term);
  }
  .term-bar{
    display:flex; align-items:center; gap:8px;
    padding: 10px 14px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
  }
  .term-dot{ width:10px; height:10px; border-radius:50%; background: #3A4448; }
  .term-title{
    font-family: var(--mono); font-size: 12px; color: var(--text-faint);
    margin-left: 6px;
  }
  .term-body{
    padding: 22px 20px;
    font-family: var(--mono);
    font-size: 14px;
    min-height: 230px;
  }
  .term-line{ margin-bottom: 10px; opacity: 0; animation: reveal .3s ease forwards; }
  .term-line .p1{ color: var(--ok); }
  .term-line .p2{ color: var(--accent); }
  .term-out{ color: var(--text-muted); padding-left: 0; }
  @keyframes reveal{ to{ opacity: 1; } }

  /* ---------- SECTION SHELL ---------- */
  section{ padding: 84px 0; border-top: 1px solid var(--border); }
  .section-head{ margin-bottom: 40px; }
  .section-head h2{ font-size: 28px; font-weight: 700; margin-top: 8px; }

  /* ---------- SELBSTVORSTELLUNG ---------- */
  .about-grid{
    margin-bottom: 32px;
    color: var(--text-muted);
    font-size: 16.5px;
    line-height: 1.7;
    max-width: 62ch;
    border-left: 2px solid var(--accent);
    padding-left: 20px;
    text-align: justify;
  }
  .about-grid strong{ color: var(--text); font-weight: 600; }
  .about-grid-after{ margin-top: 24px; }

  .config-box{
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 20px 22px;
    font-family: var(--mono);
    font-size: 13.5px;
    max-width: 640px;
  }
  .config-box .fname{ color: var(--text-faint); margin-bottom: 12px; font-size: 12px; }
  .config-row{ display:flex; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--border); }
  .config-row:last-child{ border-bottom: none; }
  .config-key{ color: var(--accent); min-width: 118px; }
  .config-val{ color: var(--text-muted); text-transform: lowercase; }

  .about-row{ display:flex; align-items:flex-start; gap: 44px; flex-wrap: wrap; }
  .about-row .config-box{ flex: 1 1 520px; }

  .stats-box{
    flex: 0 0 270px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: var(--mono);
    font-size: 13px;
  }
  .stats-box > summary{
    list-style: none;
    cursor: pointer;
    padding: 20px 22px;
    font-size: 12px;
    color: var(--text-faint);
    display:flex; align-items:center; gap: 8px;
  }
  .stats-box > summary::-webkit-details-marker{ display:none; }
  .stats-box > summary:hover{ color: var(--accent); }
  .stats-caret{ display:inline-block; transition: transform .2s ease; }
  .stats-box[open] > summary{ color: var(--text-muted); }
  .stats-box[open] .stats-caret{ transform: rotate(90deg); }
  .stats-body{ padding: 0 22px 20px; }
  .stats-row{
    display:flex; justify-content:space-between; gap: 12px;
    padding: 6px 0;
    border-bottom: 1px dashed var(--border);
  }
  .stats-row:last-child{ border-bottom: none; }
  .stats-key{ color: var(--text-muted); }
  .stats-val{ color: var(--accent); text-align: right; }

  /* ---------- LEBENSLAUF / GIT LOG ---------- */
  .gitlog{ position: relative; padding-left: 6px; }
  .commit{
    position: relative;
    display:grid;
    grid-template-columns: 56px 1fr;
    gap: 20px;
    padding-bottom: 34px;
  }
  .commit:last-child{ padding-bottom: 0; }
  .commit:not(:last-child)::before{
    content:"";
    position:absolute;
    left: 28px; top: 56px; bottom: -28px;
    width: 1px;
    background: var(--border);
  }
  .commit-hash{
    font-family: var(--mono);
    font-size: 12px;
    color: var(--bg);
    background: var(--accent);
    width: 56px; height: 56px;
    border-radius: 50%;
    display:flex; align-items:center; justify-content:center;
    z-index: 1;
    font-weight: 600;
  }
  .commit-hash.is-white{ background: #FFFFFF; }
  .commit-logo{ width: 38px; height: 38px; object-fit: contain; border-radius: 6px; }
  .commit-body{ padding-top: 6px; }
  .commit-meta{ display:flex; gap: 10px; align-items:baseline; flex-wrap:wrap; margin-bottom: 4px; }
  .commit-date{ font-family: var(--mono); font-size: 12.5px; color: var(--accent); }
  .commit-title{ font-weight: 600; font-size: 16.5px; }
  .commit-org{ color: var(--text-faint); font-size: 14px; }
  .commit-desc{ color: var(--text-muted); font-size: 14.5px; max-width: 60ch; margin-top: 6px; text-align: justify; }
  .tag{
    display:inline-block;
    font-family: var(--mono);
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 20px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    margin: 8px 6px 0 0;
  }

  .cert-row{ display:flex; gap: 14px; flex-wrap: wrap; margin-top: 44px; }
  .cert{
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    background: var(--surface);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-family: var(--mono);
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
    transition: border-color .15s ease, background .15s ease, transform .15s ease;
  }
  .cert:hover{ border-color: var(--accent-dim); background: var(--accent-soft); transform: translateY(-2px); }
  .cert strong{ color: var(--text); display:block; font-family: var(--sans); font-size: 14px; margin-bottom: 2px; }

  /* ---------- PROJEKTE / REPO CARDS ---------- */
  .project-grid{
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
  }
  .project-card{
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 22px;
    transition: border-color .15s ease, transform .15s ease;
  }
  .project-card:hover{ border-color: var(--accent-dim); transform: translateY(-2px); }
  .project-top{ display:flex; justify-content:space-between; align-items:flex-start; gap: 10px; margin-bottom: 10px; }
  .project-name{ font-family: var(--mono); font-weight: 600; font-size: 16px; color: var(--text); }
  .project-name::before{ content: "▹ "; color: var(--accent); }
  .status{
    font-family: var(--mono);
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
  }
  .status.live{ color: var(--ok); border: 1px solid rgba(111,207,151,0.35); background: rgba(111,207,151,0.08); }
  .project-desc{ color: var(--text-muted); font-size: 14.5px; margin-bottom: 16px; min-height: 66px; text-align: justify; }
  .skill-stack{ display:flex; gap: 8px; flex-wrap: wrap; }
  .chip{
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 3px 9px;
    border-radius: 4px;
  }

  /* ---------- KONTAKT ---------- */
  .contact-grid{
    display:grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 48px;
  }
  .contact-list{ display:flex; flex-direction: column; gap: 16px; }
  .contact-item{ display:flex; flex-direction:column; gap: 2px; }
  .contact-label{ font-family: var(--mono); font-size: 12px; color: var(--text-faint); }
  .contact-value{ font-size: 15.5px; }
  .contact-value a{ text-decoration: none; color: var(--text); border-bottom: 1px solid var(--border); }
  .contact-value a:hover{ color: var(--accent); border-color: var(--accent); }
  .contact-value-copy{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
  .copy-btn{
    background:none; border:1px solid var(--border); color: var(--text-faint);
    font-family: var(--mono); font-size: 11px; padding: 3px 8px; border-radius: var(--radius);
    cursor:pointer;
  }
  .copy-btn:hover{ border-color: var(--accent); color: var(--accent); }
  .copy-btn.copied{ border-color: var(--ok); color: var(--ok); }

  /* telegram-style chat window */
  .contact-form-slot{ display:flex; align-items:center; justify-content:center; }
  .chat-window{
    width: 100%;
    max-width: 440px;
    border-radius: 14px;
    overflow: hidden;
    background: var(--surface-2);
    box-shadow: var(--shadow-chat);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  }
  .chat-titlebar{
    display:flex;
    align-items:center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-elevated);
    color: var(--text);
    border-bottom: 1px solid var(--border);
  }
  .chat-avatar-wrap{ position: relative; flex-shrink: 0; }
  .chat-avatar{
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--accent-dim);
    display:flex; align-items:center; justify-content:center;
    overflow: hidden;
    font-weight: 700; font-size: 14px;
  }
  .chat-avatar img{ width: 100%; height: 100%; object-fit: cover; }
  .status-dot{
    position: absolute;
    right: -1px; bottom: -1px;
    width: 11px; height: 11px;
    border-radius: 50%;
    background: var(--ok);
    border: 2px solid var(--bg-elevated);
  }
  .chat-title-text{ flex:1; line-height: 1.35; min-width: 0; }
  .chat-name{ display:block; font-weight: 600; font-size: 15.5px; color: var(--text); }
  .chat-status{ font-size: 12.5px; color: var(--accent); }
  .chat-header-icons{ display:flex; gap: 16px; font-size: 16px; color: var(--text-muted); }
  .chat-body{
    min-height: 160px;
    padding: 18px 16px;
    background: var(--surface);
  }
  .chat-date-chip{
    width: fit-content;
    margin: 0 auto 4px;
    background: rgba(255,255,255,0.08);
    color: var(--text-muted);
    font-size: 11.5px;
    padding: 4px 12px;
    border-radius: 10px;
  }
  .chat-composer-wrap{ background: var(--bg-elevated); padding: 10px 12px 12px; border-top: 1px solid var(--border); }
  .chat-composer{
    display:flex;
    align-items:center;
    gap: 10px;
  }
  .chat-input{
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 10px 16px;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--text);
  }
  .typing-caret{
    display:inline-block;
    width: 2px; height: 13px;
    background: var(--accent);
    margin-left: 1px;
    vertical-align: -2px;
    animation: blink 1s steps(1) infinite;
  }
  .chat-send-btn{
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dim));
    color: #fff;
    display:flex; align-items:center; justify-content:center;
    font-size: 15px;
    flex-shrink: 0;
  }
  .chat-send-btn span{ display:inline-block; font-size: 19px; }

  form.dummy-form{ display:flex; flex-direction:column; gap: 14px; }
  .field{ display:flex; flex-direction:column; gap: 6px; }
  .field label{ font-family: var(--mono); font-size: 12.5px; color: var(--text-muted); }
  .field input, .field textarea{
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: 11px 12px;
    font-family: var(--sans);
    font-size: 14.5px;
    resize: vertical;
  }
  .field input:focus, .field textarea:focus{ outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
  .consent{ display:flex; align-items:flex-start; gap: 10px; font-size: 13px; color: var(--text-muted); margin-top: 4px; }
  .consent input{ margin-top: 4px; }
  .consent a{ color: var(--accent); text-decoration: underline; }
  .form-note{ font-family: var(--mono); font-size: 12px; color: var(--text-faint); margin-top: 8px; }

  /* ---------- DATENSCHUTZ (formal legal look) ---------- */
  .legal{
    background: var(--bg-elevated);
  }
  .legal .container{ max-width: 820px; }
  .legal h2{ font-size: 24px; }
  .legal h3{ font-size: 16px; margin: 28px 0 8px; color: var(--text); }
  .legal p, .legal li{ color: var(--text-muted); font-size: 15px; }
  .legal p{ text-align: justify; }
  .legal ul{ padding-left: 20px; margin: 8px 0; }
  .legal li{ margin-bottom: 6px; }

  /* ---------- FOOTER ---------- */
  footer{
    border-top: 1px solid var(--border);
    padding: 32px 0;
  }
  .footer-row{
    display:flex; justify-content:space-between; align-items:center; flex-wrap: wrap; gap: 12px;
  }
  .footer-links{ display:flex; gap: 18px; flex-wrap: wrap; }
  .footer-links a{ font-family: var(--mono); font-size: 13px; color: var(--text-muted); text-decoration:none; }
  .footer-links a:hover{ color: var(--accent); }
  .footer-mark{ font-family: var(--mono); font-size: 12.5px; color: var(--text-faint); }

  /* ---------- COOKIE / DSGVO BANNER ---------- */
  .cookie-banner{
    position: fixed;
    left: 20px; right: 20px; bottom: 20px;
    max-width: 620px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px 20px;
    box-shadow: var(--shadow-banner);
    z-index: 200;
    transform: translateY(140%);
    transition: transform .35s ease;
  }
  .cookie-banner.show{ transform: translateY(0); }
  .cookie-banner p{ font-size: 13.5px; color: var(--text-muted); margin-bottom: 14px; text-align: justify; }
  .cookie-banner p a{ color: var(--accent); text-decoration: underline; }
  .cookie-actions{ display:flex; gap: 10px; flex-wrap: wrap; }
  .cookie-actions .btn{ padding: 9px 16px; font-size: 13px; }

  /* ---------- SNAKE EASTER EGG ---------- */
  .snake-overlay{
    position: fixed; inset: 0;
    background: rgba(6,9,10,0.82);
    display: flex; align-items: center; justify-content: center;
    z-index: 500;
    padding: 20px;
  }
  .snake-overlay[hidden]{ display: none; }
  .snake-modal{
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-banner);
    padding: 16px;
    width: min(440px, 100%);
  }
  .snake-head{
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px;
  }
  .snake-title{ font-family: var(--mono); font-size: 13px; color: var(--text-faint); }
  .snake-close{
    background: none; border: 1px solid var(--border); color: var(--text);
    font-family: var(--mono); width: 26px; height: 26px; border-radius: var(--radius);
    cursor: pointer; line-height: 1;
  }
  .snake-close:hover{ border-color: var(--accent); color: var(--accent); }
  .snake-stats{
    display: flex; gap: 18px;
    font-family: var(--mono); font-size: 13px; color: var(--text-muted);
    margin-bottom: 10px;
  }
  .snake-stats strong{ color: var(--text); }
  .snake-canvas-wrap{
    position: relative;
    width: 100%; aspect-ratio: 1 / 1;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
  }
  .snake-canvas-wrap canvas{ display: block; width: 100%; height: 100%; }
  .snake-msg{
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px;
    background: rgba(13,17,19,0.75);
    text-align: center;
    font-family: var(--mono);
  }
  .snake-msg[hidden]{ display: none; }
  .snake-msg-title{ color: var(--accent); font-size: 20px; font-weight: 600; letter-spacing: 0.04em; }
  .snake-msg-hint{ color: var(--text-muted); font-size: 13px; line-height: 1.5; }

  /* ---------- RESPONSIVE ---------- */
  @media (max-width: 860px){
    .hero-grid{ grid-template-columns: 1fr; }
    .contact-grid{ grid-template-columns: 1fr; }
    .project-grid{ grid-template-columns: 1fr; }
    .stats-box{ flex: 1 1 100%; }
    nav.links{ display:none; flex-direction:column; position:absolute; top:100%; left:0; right:0; background: var(--bg-elevated); border-bottom:1px solid var(--border); padding: 8px; }
    nav.links.open{ display:flex; }
    .nav-toggle{ display:inline-block; }
    .hero h1{ font-size: 34px; }
  }
