/* =============================================
   CSS-Variablen & Themes
   ============================================= */
:root {
  --bg: #313338;
  --bg-elev: rgba(255,255,255,0.04);
  --text: #f5f5f7;
  --muted: #a1a1a6;
  --accent: #0a84ff; /* macOS Blau */
  --ring: rgba(10,132,255,0.35);
  --card: rgba(255,255,255,0.05);
  --border: rgba(255,255,255,0.08);
  --shadow: 0 10px 30px rgba(0,0,0,.45);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --maxw: 1080px;
  --lead: #d7d7db;
  --tag-color: #cfcfd4;
}

/* Light Theme */
:root.light {
  --bg: #f5f5f7;
  --bg-elev: rgba(0,0,0,.04);
  --text: #1d1d1f;
  --muted: #4a4a4f;
  --accent: #0a84ff;
  --ring: rgba(0,122,255,0.35);
  --card: rgba(255,255,255,1);
  --border: rgba(0,0,0,.12);
  --shadow: 0 4px 16px rgba(0,0,0,.10);
  --lead: #3d3d3f;
  --tag-color: #3d3d3f;
}

/* =============================================
   Base / Reset
   ============================================= */
* { box-sizing: border-box }
html, body { height: 100% }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* =============================================
   Navigation
   ============================================= */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(18px);
  background: color-mix(in hsl, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; gap: 14px; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .2px }
.logo {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #34c759);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 6px 16px rgba(10,132,255,.35);
}
.logo-img {
  width: 36px; height: 36px;
  border-radius: 6px;
  object-fit: contain; display: block;
}
.nav a {
  color: var(--text); text-decoration: none; opacity: .9; padding: 8px 12px; border-radius: 10px;
}
.nav a:hover { background: var(--bg-elev) }

/* =============================================
   Layout
   ============================================= */
main { max-width: var(--maxw); margin: 0 auto; padding: 40px 20px 80px }
section { margin: 42px 0 }
.grid { display: grid; gap: 20px }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)) }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)) }
@media (max-width: 900px) { .grid.cols-3 { grid-template-columns: 1fr 1fr } }
@media (max-width: 680px) { .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr } }

/* =============================================
   Hero
   ============================================= */
.hero {
  margin-top: 22px; padding: 36px;
  border-radius: calc(var(--radius-lg) + 6px);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden; position: relative; isolation: isolate;
}
.hero::after {
  content: ""; position: absolute; inset: -20%; z-index: -1;
  background:
    radial-gradient(600px 220px at 20% -10%, rgba(10,132,255,.18), transparent 60%),
    radial-gradient(500px 200px at 110% 40%, rgba(255,69,58,.14), transparent 60%);
  filter: blur(24px); pointer-events: none;
}
h1 { margin: 0 0 8px; font-size: clamp(28px, 5vw, 46px); letter-spacing: -.02em }
.kicker { color: var(--muted); font-size: clamp(14px, 2vw, 16px); margin-bottom: 6px }
.lead { font-size: clamp(16px, 2.2vw, 20px); color: var(--lead); max-width: 60ch }
.cta { margin-top: 22px; display: flex; gap: 12px; flex-wrap: wrap }

/* =============================================
   Buttons
   ============================================= */
.btn {
  appearance: none; border: 1px solid var(--border); background: var(--card);
  color: var(--text); padding: 10px 14px; border-radius: 12px; font-weight: 600;
  transition: transform .18s ease, background .2s ease, border-color .2s;
  cursor: pointer;
}
.btn:hover { transform: translateY(-1.5px); background: rgba(255,255,255,.09); border-color: color-mix(in hsl, var(--accent) 35%, var(--border)) }
.btn.primary { background: linear-gradient(180deg, color-mix(in hsl, var(--accent) 55%, #fff 0%), color-mix(in hsl, var(--accent) 45%, #000 0%)); border-color: transparent }
.btn.primary:hover { filter: saturate(1.1) brightness(1.05) }

/* =============================================
   Cards
   ============================================= */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 8px; font-size: 20px }
.muted { color: var(--muted) }
figure figcaption .muted { display: block; margin-top: 2px; }
.list { margin: 0; padding: 0; list-style: none }
.list li { padding: 8px 0; border-bottom: 1px dashed var(--border) }
.list li:last-child { border-bottom: none }

/* Contact Pills */
.pill-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px }
.pill { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-elev); text-decoration: none; color: var(--text); font-weight: 600 }
.pill:hover { background: rgba(255,255,255,.08) }

/* =============================================
   Anime Gallery
   ============================================= */
.gallery { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) }
figure {
  margin: 0; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden;
  display: flex; flex-direction: column; min-height: 260px;
  transition: transform .18s ease, box-shadow .18s ease;
  position: relative;
}
figure:hover { transform: translateY(-2px) }

/* Ranking Badges */
.badge {
  position: absolute; top: 10px; left: 10px;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px;
  color: #fff; border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 8px 18px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.22);
  backdrop-filter: saturate(160%) blur(6px);
  line-height: 1;
}
.badge.gold   { background: linear-gradient(180deg, #f5d26b, #d9a429) }
.badge.silver { background: linear-gradient(180deg, #e8ecf1, #b9c0c8); color: #1d1d1f }
.badge.bronze { background: linear-gradient(180deg, #d9a273, #a86b3f) }

figure img { width: 100%; height: 180px; object-fit: cover; display: block; background: #111; aspect-ratio: 16/9 }
figure figcaption { padding: 12px 14px 14px; min-height: clamp(110px, 16vw, 140px) }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px }
.tag {
  font-size: 12px; padding: 4px 8px; border-radius: 999px;
  border: 1px solid var(--border); background: rgba(255,255,255,.04); color: var(--tag-color);
}

/* Video */
video { width: 100%; height: auto; display: block; background: #000; border-top: 1px solid var(--border) }
.media-controls { display: flex; gap: 10px; padding: 10px; align-items: center; border-top: 1px solid var(--border) }
.media-btn { font-size: 13px; padding: 6px 10px; border-radius: 10px; background: var(--bg-elev); border: 1px solid var(--border); cursor: pointer }
.media-btn:hover { background: rgba(255,255,255,.1) }

.video-wrapper {
  position: relative; padding-bottom: 56.25%;
  height: 0; overflow: hidden; border-radius: 12px;
}
.video-wrapper iframe {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
}

/* =============================================
   Rechtliches / Accordion
   ============================================= */
.legal { white-space: pre-wrap }
.accordion details { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card) }
.accordion summary {
  list-style: none; cursor: pointer; user-select: none;
  padding: 16px 18px; font-weight: 700; display: flex; align-items: center; justify-content: space-between;
}
.accordion summary::-webkit-details-marker { display: none }
.accordion .chev { transition: transform .2s ease }
.accordion details[open] .chev { transform: rotate(90deg) }
.accordion .content { padding: 0 18px 16px }
.accordion h4 { margin: 14px 0 6px; font-size: 16px }
.accordion .muted-note { color: var(--muted); font-size: 13px; margin: 8px 0 0 }

/* =============================================
   Footer
   ============================================= */
footer { margin: 60px 0 20px; color: var(--muted); text-align: center; font-size: 13px }

/* =============================================
   Projekte & Builds
   ============================================= */
#projekte-grid { display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0,1fr)) }
@media (max-width: 900px) { #projekte-grid { grid-template-columns: repeat(2, minmax(0,1fr)) } }
@media (max-width: 640px) { #projekte-grid { grid-template-columns: 1fr } }

.proj-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px;
  transition: transform .18s ease, border-color .2s, box-shadow .2s;
}
.proj-card:hover {
  transform: translateY(-2px);
  border-color: rgba(10,132,255,.4);
  box-shadow: 0 0 0 1px rgba(10,132,255,.1), var(--shadow);
}
.proj-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px }
.proj-name { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.2 }
.proj-type-label { font-size: 11px; padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.05); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; flex-shrink: 0 }
.proj-desc { font-size: 13.5px; color: var(--muted); margin: 0; line-height: 1.5; flex: 1 }
.proj-stack { display: flex; flex-wrap: wrap; gap: 5px }
.s-tag { font-size: 11px; padding: 3px 8px; border-radius: 999px; font-weight: 600; border: 1px solid transparent }
.proj-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 2px }
.status-badge { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px }
.s-finished      { background: rgba(52,199,89,.15);  color: #34c759; border: 1px solid rgba(52,199,89,.3) }
.s-in-development{ background: rgba(255,159,10,.15); color: #ff9f0a; border: 1px solid rgba(255,159,10,.3) }
.s-active        { background: rgba(10,132,255,.15);  color: #3b8bff; border: 1px solid rgba(10,132,255,.3) }
.s-idea          { background: rgba(255,255,255,.05); color: var(--muted); border: 1px solid var(--border) }
.proj-highlights { display: flex; flex-wrap: wrap; gap: 5px }
.hl-badge { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,.04); border: 1px solid var(--border); color: var(--tag-color) }
.proj-links { display: flex; gap: 6px }
.proj-link { font-size: 12px; padding: 5px 10px; border-radius: 8px; text-decoration: none; background: var(--bg-elev); border: 1px solid var(--border); color: var(--text); font-weight: 600; transition: background .18s }
.proj-link:hover { background: rgba(255,255,255,.1) }

/* =============================================
   Tech-Stack
   ============================================= */
.ts-categories { display: flex; flex-direction: column; gap: 24px }
.ts-cat-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border) }
.ts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px }
.ts-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; border-radius: var(--radius-md); background: var(--card); border: 1px solid var(--border); transition: transform .18s, box-shadow .18s, border-color .18s; cursor: default; text-align: center }
.ts-item:hover { transform: scale(1.08); box-shadow: 0 0 14px rgba(10,132,255,.2); border-color: rgba(10,132,255,.3) }
.ts-item img { width: 28px; height: 28px; object-fit: contain; display: block }
.ts-fallback { width: 28px; height: 28px; border-radius: 6px; background: linear-gradient(135deg, rgba(10,132,255,.2), rgba(10,132,255,.06)); border: 1px solid rgba(10,132,255,.18); display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: var(--accent); text-align: center; line-height: 1.1 }
.ts-name { font-size: 11px; color: var(--muted); font-weight: 500; line-height: 1.2 }

/* =============================================
   Music & Vibe
   ============================================= */
.music-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px }
@media (max-width: 900px) { .music-grid { grid-template-columns: 1fr 1fr } }
@media (max-width: 600px) { .music-grid { grid-template-columns: 1fr } }
.music-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow) }
.music-card iframe { display: block; width: 100%; border: none; border-radius: 0 0 var(--radius-md) var(--radius-md) }
.music-label { padding: 10px 14px; font-size: 13px; color: var(--muted); font-weight: 500; margin: 0 }

/* =============================================
   Statusboard
   ============================================= */
.status-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 18px;
}
@media (max-width: 700px) { .status-grid { grid-template-columns: 1fr } }

.status-focus-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 4px;
}
.status-prog-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.status-bar {
  background: rgba(255,255,255,.08);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}
.status-bar-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #34c759);
  transition: width 1.2s cubic-bezier(.4,0,.2,1);
}
.status-mood-emoji { font-size: 28px; line-height: 1 }
.status-right { display: flex; flex-direction: column; gap: 16px }
.status-timeline { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px }
.status-timeline li { display: flex; align-items: flex-start; gap: 10px }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0; margin-top: 4px;
}

/* =============================================
   Achievements – Toast & Modal
   ============================================= */
.ach-nav-btn { padding: 8px 10px; font-size: 16px; line-height: 1 }

/* Toast */
.ach-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 200;
  display: flex; align-items: flex-start; gap: 13px;
  background: color-mix(in hsl, var(--bg) 92%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 18px;
  box-shadow: 0 20px 50px rgba(0,0,0,.5); backdrop-filter: blur(20px) saturate(180%);
  transform: translateY(16px); opacity: 0;
  transition: transform .38s cubic-bezier(.34,1.56,.64,1), opacity .3s ease;
  max-width: 300px; pointer-events: none;
}
.ach-toast.show { transform: translateY(0); opacity: 1 }
.ach-toast-icon { font-size: 28px; flex-shrink: 0; line-height: 1; margin-top: 2px }
.ach-toast-title {
  font-size: 10px; color: var(--accent); font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; margin-bottom: 3px;
}
.ach-toast-name { font-size: 15px; font-weight: 700; margin-bottom: 2px }
.ach-toast-desc { font-size: 12px; color: var(--muted); line-height: 1.4 }

/* Modal Overlay */
.ach-modal-overlay {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(0,0,0,.65); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.ach-modal-overlay.show { opacity: 1; pointer-events: all }
.ach-modal {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: calc(var(--radius-lg) + 4px); padding: 24px;
  width: min(520px, 95vw); max-height: 85vh; overflow-y: auto;
  box-shadow: 0 40px 100px rgba(0,0,0,.6);
  transform: scale(.95) translateY(10px);
  transition: transform .28s cubic-bezier(.34,1.3,.64,1);
}
.ach-modal-overlay.show .ach-modal { transform: scale(1) translateY(0) }
.ach-modal-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; font-size: 20px; font-weight: 700;
}
.ach-close { padding: 6px 10px; font-size: 14px }
.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px; margin-bottom: 16px;
}
.ach-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 8px; border-radius: var(--radius-md);
  background: var(--card); border: 1px solid var(--border);
  text-align: center; cursor: default;
  transition: transform .18s, box-shadow .18s;
}
.ach-item.unlocked {
  border-color: rgba(10,132,255,.3);
  background: rgba(10,132,255,.06);
}
.ach-item.unlocked:hover {
  transform: scale(1.07);
  box-shadow: 0 0 16px rgba(10,132,255,.2);
}
.ach-item.locked { opacity: .5 }
.ach-icon { font-size: 26px; line-height: 1 }
.ach-name { font-size: 11px; color: var(--muted); font-weight: 500; line-height: 1.25 }
.ach-item.unlocked .ach-name { color: var(--text); font-weight: 600 }
.ach-count {
  text-align: center; font-size: 13px; color: var(--muted);
  padding-top: 12px; border-top: 1px solid var(--border);
}

/* =============================================
   Utilities
   ============================================= */
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 10px }
.reveal { opacity: 0; transform: translateY(8px); transition: opacity .6s ease, transform .6s ease }
.reveal.show { opacity: 1; transform: translateY(0) }
