@font-face {
  font-family: "Kode Mono";
  src: url("/assets/fonts/kode-mono.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --bg: #000;
  --text: #fff;
  --muted: rgba(255, 255, 255, .6);
  --faint: rgba(255, 255, 255, .4);
  --line: rgba(255, 255, 255, .08);
  --ray: #2d68c4;
  color-scheme: dark;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Kode Mono", ui-monospace, monospace;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 1px solid var(--text); outline-offset: 4px; }

/* Blaues Licht von oben, darüber ein Schleier */
.rays { position: fixed; inset: 0; pointer-events: none; }
.rays::before, .rays::after { content: ""; position: absolute; inset: 0; opacity: .6; }
.rays::before { background: radial-gradient(circle at 20% 15%, color-mix(in srgb, var(--ray) 45%, transparent), transparent 70%); }
.rays::after { background: radial-gradient(circle at 80% 10%, color-mix(in srgb, var(--ray) 35%, transparent), transparent 75%); }
.veil { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); pointer-events: none; }

/* Navigation links (Desktop) */
.side {
  position: fixed;
  left: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: none;
  flex-direction: column;
  gap: 1rem;
  font-size: 12px;
  font-weight: 300;
  letter-spacing: .05em;
}
.side .brand { display: flex; align-items: center; gap: .5rem; color: var(--muted); transition: color .2s; }
.side .brand:hover { color: var(--text); }
.side ul { display: flex; flex-direction: column; gap: .75rem; }
.side ul a { display: flex; align-items: center; gap: .5rem; color: var(--faint); transition: color .2s; }
.side ul a::before { content: ""; height: 1px; width: .5rem; background: currentColor; transition: width .2s; }
.side ul a:hover { color: rgba(255, 255, 255, .7); }
.side ul a:hover::before { width: .75rem; }
.side ul a[aria-current="page"] { color: var(--text); }
.side ul a[aria-current="page"]::before { width: 1rem; }

.me { display: block; flex: none; object-fit: contain; }
.me-xs { width: 20px; height: 20px; }
.me-sm { width: 26px; height: 26px; }
.me-lg { width: 160px; height: 160px; filter: drop-shadow(0 12px 30px rgba(45, 104, 196, .35)); }

/* Navigation unten (Handy) */
.bottom {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  border-top: 1px solid rgba(255, 255, 255, .05);
  background: rgba(0, 0, 0, .8);
  backdrop-filter: blur(12px);
}
.bottom ul { display: flex; align-items: center; justify-content: space-around; gap: .5rem; padding: .75rem .5rem; }
.bottom a { font-size: 10px; font-weight: 300; letter-spacing: .05em; color: var(--faint); transition: color .2s; }
.bottom a[aria-current="page"] { color: var(--text); }

@media (min-width: 768px) {
  .side { display: flex; }
  .bottom { display: none; }
}

/* Seite */
.page {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 4rem 0 6rem;
}
.page main {
  width: 100%;
  max-width: 56rem;
  position: relative;
  margin: auto 0;
  padding: 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
@media (min-width: 640px) {
  .page { padding: 4rem 6rem 6rem; }
  .page main { padding: 0 1.5rem; }
}

/* Start */
.hero { display: flex; flex-direction: column-reverse; align-items: center; gap: 1rem; text-align: center; }
.hero h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; }
.hero p { margin-top: .5rem; color: var(--muted); font-weight: 300; max-width: 40ch; }
.links { display: flex; gap: .9rem; margin-top: .9rem; justify-content: center; }
.links a { color: var(--faint); transition: color .2s; }
.links a:hover { color: var(--text); }
.links svg { width: 20px; height: 20px; fill: currentColor; display: block; }
@media (min-width: 640px) {
  .hero { flex-direction: row; justify-content: space-between; text-align: left; }
  .hero h1 { font-size: 2.25rem; }
  .me-lg { width: 200px; height: 200px; }
  .links { justify-content: flex-start; }
}

/* Unterseiten-Kopf */
.head .kicker { display: flex; align-items: center; gap: .5rem; font-size: 12px; font-weight: 300; color: var(--muted); letter-spacing: .05em; }
.head .kicker::before { content: ""; width: 1rem; height: 1px; background: rgba(255, 255, 255, .4); }
.head h1 { margin-top: .25rem; font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.head p { margin-top: .5rem; color: var(--muted); font-weight: 300; max-width: 60ch; }
@media (min-width: 640px) { .head h1 { font-size: 2.25rem; } }

h2.group { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: .03em; }

/* Projekte */
.list { display: flex; flex-direction: column; gap: .75rem; margin-top: .75rem; }
.item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .02);
  transition: border-color .2s, background-color .2s;
}
a.item:hover { border-color: rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .04); }
.item > img { width: 48px; height: 48px; border-radius: 10px; object-fit: contain; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); padding: 4px; }
.item-body { flex: 1; min-width: 0; }
.item-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; }
.item h3 { font-size: 15px; font-weight: 600; }
.item time, .item .when { font-size: 12px; font-weight: 300; color: var(--faint); }
.item p { margin-top: .35rem; font-size: 13px; font-weight: 300; color: var(--muted); }

/* Skills */
.skill-group h2.group { margin-bottom: .6rem; font-size: 13px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.chips { display: flex; flex-wrap: wrap; gap: .6rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .4rem .7rem;
  border: 1px solid #27272a;
  border-radius: 8px;
  background: rgba(24, 24, 27, .5);
  font-size: 12px;
  color: #d4d4d8;
  transition: background-color .2s, border-color .2s, color .2s;
}
.chip svg { width: 14px; height: 14px; fill: currentColor; flex: none; }
.chip:hover { background: rgba(39, 39, 42, .65); border-color: #3f3f46; color: #fff; }

/* Einblenden beim Laden */
.in { animation: in .6s cubic-bezier(.2, .7, .2, 1) both; }
.d1 { animation-delay: .1s; }
.d2 { animation-delay: .2s; }
.d3 { animation-delay: .3s; }
@keyframes in { from { opacity: 0; filter: blur(6px); transform: translateY(-6px); } }

@media (prefers-reduced-motion: reduce) { .in { animation: none; } }

/* Name im Titel unterstrichen */
.hero h1 .name { position: relative; display: inline-block; }
/* Keyframes für rough-notation (die Bibliothek darf wegen der CSP kein eigenes <style> einfügen) */
@keyframes rough-notation-dash { to { stroke-dashoffset: 0; } }

/* Schreibmaschine unter dem Titel */
.typed .caret {
  display: inline-block;
  width: .55em;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -.18em;
  background: rgba(255, 255, 255, .75);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .typed .caret { animation: none; } }

/* ---------- Handy ---------- */
html { -webkit-tap-highlight-color: transparent; }
.page { min-height: 100dvh; }

/* Menü unten: schwebende Leiste mit großen Tippflächen */
.bottom {
  left: 12px;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 16px;
  background: rgba(12, 12, 14, .82);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .8);
}
.bottom ul { gap: 4px; padding: 5px; justify-content: stretch; }
.bottom li { flex: 1; }
.bottom a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 400;
  color: rgba(255, 255, 255, .55);
  transition: background-color .2s, color .2s;
}
.bottom a[aria-current="page"] { color: var(--text); background: rgba(255, 255, 255, .09); }
.bottom a:active { background: rgba(255, 255, 255, .14); }

/* GitHub/Discord am Handy als Knöpfe mit Text */
.links a span { display: none; }
@media (max-width: 639px) {
  .page { padding-bottom: calc(6.5rem + env(safe-area-inset-bottom)); }
  .page main { gap: 1.75rem; }
  .hero { gap: .5rem; }
  .me-lg { width: 150px; height: 150px; }
  .hero h1 { font-size: 1.75rem; }
  .hero p { font-size: 14px; }
  .links { gap: .6rem; margin-top: 1.25rem; }
  .links a {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-height: 44px;
    padding: 0 1rem;
    border: 1px solid #27272a;
    border-radius: 10px;
    background: rgba(24, 24, 27, .5);
    color: #d4d4d8;
    font-size: 13px;
  }
  .links a:active { background: rgba(39, 39, 42, .8); }
  .links a span { display: inline; }
  .links svg { width: 18px; height: 18px; }

  /* Projekte: Logo neben dem Titel, Text über die volle Breite */
  .item { display: grid; grid-template-columns: 40px 1fr; column-gap: .85rem; row-gap: .6rem; padding: .9rem; }
  .item > img { width: 40px; height: 40px; border-radius: 9px; }
  .item-body { display: contents; }
  .item-top { grid-column: 2; align-self: center; flex-direction: column; align-items: flex-start; gap: 0; }
  .item h3 { font-size: 15px; line-height: 1.3; }
  .item p { grid-column: 1 / -1; margin-top: 0; font-size: 13px; line-height: 1.65; }
  a.item:active { background: rgba(255, 255, 255, .05); }

  /* Skills: etwas größere Chips zum Tippen */
  .chips { gap: .5rem; }
  .chip { min-height: 38px; padding: .45rem .8rem; font-size: 12.5px; }
  .chip:active { background: rgba(39, 39, 42, .8); }
}

/* Hover nur mit Maus, damit am Handy nichts „hängen“ bleibt */
@media (hover: none) {
  a.item:hover { border-color: var(--line); background: rgba(255, 255, 255, .02); }
  .chip:hover { background: rgba(24, 24, 27, .5); border-color: #27272a; color: #d4d4d8; }
}

/* Discord-Profilbild mit Avatar-Deko (Deko ist 1,2× so groß wie das Bild, wie in Discord) */
.dc-pfp { position: relative; display: block; flex: none; width: 168px; height: 168px; }
.dc-avatar {
  position: absolute;
  inset: 8.33%;
  width: 83.34%;
  height: 83.34%;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 12px 34px -8px rgba(45, 104, 196, .45);
}
.dc-deco { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
@media (min-width: 640px) { .dc-pfp { width: 210px; height: 210px; } }

/* GitHub: Zahlen, Sprachen, Aktivität */
.head .handle { color: var(--text); border-bottom: 1px solid rgba(255, 255, 255, .25); transition: border-color .2s; }
.head .handle:hover { border-color: var(--text); }
section > h2.group { margin-bottom: .75rem; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.stats li {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .85rem .5rem;
  border: 1px solid #27272a;
  border-radius: 10px;
  background: rgba(24, 24, 27, .5);
}
.stats b { font-size: 15px; font-weight: 700; line-height: 1.3; }
.stats span { font-size: 11px; font-weight: 300; color: var(--faint); letter-spacing: .04em; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, 1fr); } }

.lang-bar { height: 6px; overflow: hidden; border-radius: 99px; background: rgba(255, 255, 255, .06); }
.lang-bar svg { display: block; width: 100%; height: 100%; }
.lang-list { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-top: .75rem; font-size: 12px; color: #d4d4d8; }
.lang-list li { display: inline-flex; align-items: center; gap: .4rem; }
.lang-list svg { width: 8px; height: 8px; }
.lang-list span { color: var(--faint); font-weight: 300; }

.cal-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-bottom: .75rem; }
.cal-head h2.group { margin: 0; }
.years { display: flex; gap: .25rem; }
.year {
  min-height: 28px;
  padding: .1rem .55rem;
  border: 0;
  border-radius: 6px;
  background: none;
  font: inherit;
  font-size: 12px;
  font-weight: 300;
  color: var(--faint);
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
.year:hover { color: var(--text); }
.year[aria-pressed="true"] { background: rgba(255, 255, 255, .1); color: var(--text); font-weight: 500; }
.cal-box { padding: 1rem; border: 1px solid #27272a; border-radius: 12px; background: rgba(9, 9, 11, .6); }
.cal-scroll { overflow-x: auto; scrollbar-width: none; }
.cal-scroll::-webkit-scrollbar { display: none; }
.cal-svg { display: block; width: 100%; min-width: 620px; height: auto; }
.cal-svg text { fill: #d4d4d8; font-family: inherit; font-size: 10px; }
.cal-svg rect { transition: stroke .15s; }
.cal-svg rect:hover { stroke: rgba(255, 255, 255, .6); stroke-width: 1; }
.l0 { fill: rgba(255, 255, 255, .05); background: rgba(255, 255, 255, .05); }
.l1 { fill: #16305a; background: #16305a; }
.l2 { fill: #1f4b8f; background: #1f4b8f; }
.l3 { fill: #2d68c4; background: #2d68c4; }
.l4 { fill: #6a9ff0; background: #6a9ff0; }
.cal-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; margin-top: .75rem; font-size: 12px; color: #d4d4d8; }
.legend { display: inline-flex; align-items: center; gap: 3px; color: var(--faint); font-weight: 300; }
.legend i { width: 10px; height: 10px; border-radius: 2px; }
.legend i:first-of-type { margin-left: .35rem; }
.legend i:last-of-type { margin-right: .35rem; }
@media (max-width: 639px) {
  .cal-box { padding: .85rem; }
  .year { min-height: 36px; padding: .1rem .7rem; }
}
