/* Startseite mounii.de — baut auf theme/mounii.css auf */

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--m-bg);
  color: var(--m-text);
  font-family: var(--m-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ---------- Hintergrund-Ebenen ------------------------------------ */
#field {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}
.grid-overlay {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 96px 96px;
  background-position: -1px -1px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000 30%, transparent 100%);
          mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000 30%, transparent 100%);
}
.vignette {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse 120% 90% at 50% 50%, transparent 55%, rgba(0,0,0,.65) 100%);
}

main { position: relative; z-index: 2; }

/* ---------- HUD --------------------------------------------------- */
.hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 max(24px, env(safe-area-inset-left));
  padding-right: max(24px, env(safe-area-inset-right));
  transition: background .4s var(--m-ease), border-color .4s var(--m-ease);
  border-bottom: 1px solid transparent;
}
.hud.scrolled {
  background: rgba(7, 8, 10, .72);
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
  border-bottom-color: var(--m-line);
}
.hud-mark { font-size: 17px; }
.hud-nav { display: flex; gap: 4px; }
.hud-nav a {
  font-family: var(--m-mono);
  font-size: 12px;
  text-decoration: none;
  color: var(--m-muted);
  padding: 8px 12px;
  border-radius: var(--m-radius);
  transition: color .25s, background .25s;
}
.hud-nav a span { color: var(--m-faint); margin-right: 8px; transition: color .25s; }
.hud-nav a:hover { color: var(--m-text); }
.hud-nav a.active { color: var(--m-text); background: rgba(255,255,255,.05); }
.hud-nav a.active span { color: var(--m-accent); }
.hud-current { display: none; font-family: var(--m-mono); font-size: 12px; color: var(--m-muted); }
.hud-current #hudIdx { color: var(--m-accent); }
.hud-progress {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
}
.hud-progress i {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--m-accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* ---------- Rail -------------------------------------------------- */
.rail {
  position: fixed;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  font-family: var(--m-mono);
  font-size: 10px;
  color: var(--m-faint);
}
.rail-num { color: var(--m-muted); }
.rail-track { width: 1px; height: 160px; background: var(--m-line-strong); position: relative; }
.rail-track i {
  position: absolute;
  left: -2px; top: 0;
  width: 5px; height: 12px;
  background: var(--m-accent);
}
.rail-coord { writing-mode: vertical-rl; transform: rotate(180deg); letter-spacing: .08em; }

/* ---------- Sections ---------------------------------------------- */
.sec {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 120px clamp(20px, 8vw, 140px);
}
.sec-inner { width: 100%; max-width: 560px; }
.sec-wide { max-width: 1100px; }
.sec-right .sec-inner { margin-right: auto; }
.sec-left { justify-content: flex-end; }
#werkstatt { justify-content: center; }
#werkstatt .sec-inner { margin: 0 auto; }

.sec-kicker { margin-bottom: 20px; }
.acc { color: var(--m-accent); }
.sec-title {
  font-size: clamp(44px, 7.5vw, 104px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: .95;
  margin-bottom: 24px;
}
.sec-lead { color: var(--m-muted); font-size: clamp(16px, 1.4vw, 19px); max-width: 46ch; margin-bottom: 36px; }

/* Hero */
.sec-hero { justify-content: center; text-align: center; flex-direction: column; }
.hero-inner { max-width: 100%; }
.hero-status { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.hero-title {
  font-size: clamp(56px, 13vw, 200px);
  font-weight: 750;
  letter-spacing: -0.06em;
  line-height: .9;
  margin-bottom: 32px;
}
.hero-sub { color: var(--m-muted); font-size: clamp(16px, 1.5vw, 20px); max-width: 44ch; margin: 0 auto; }

.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--m-accent);
  box-shadow: 0 0 0 0 rgba(var(--m-accent-rgb), .6);
  animation: pulse 2.4s infinite;
  display: inline-block;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(var(--m-accent-rgb), .55); }
  70%, 100% { box-shadow: 0 0 0 10px rgba(var(--m-accent-rgb), 0); }
}

.scroll-hint {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.scroll-line { width: 1px; height: 56px; background: var(--m-line-strong); overflow: hidden; position: relative; }
.scroll-line i {
  position: absolute; left: 0; top: 0;
  width: 1px; height: 40%;
  background: var(--m-accent);
  animation: drop 1.8s var(--m-ease) infinite;
}
@keyframes drop { from { transform: translateY(-100%); } to { transform: translateY(260%); } }

/* ---------- Kino: Terminal ---------------------------------------- */
.term {
  border: 1px solid var(--m-line-strong);
  border-radius: var(--m-radius-lg);
  background: rgba(12, 13, 16, .78);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  font-family: var(--m-mono);
  font-size: 13px;
  margin-bottom: 32px;
  overflow: hidden;
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--m-line);
  color: var(--m-faint);
  font-size: 11px;
}
.term-bar i { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--m-line-strong); }
.term-bar span { margin-left: auto; }
.term-body { padding: 16px 18px; display: grid; gap: 6px; color: var(--m-text); }
.term .pr { color: var(--m-accent); }
.term .ls { display: flex; flex-wrap: wrap; column-gap: 18px; row-gap: 2px; color: var(--m-muted); }
.caret {
  display: inline-block;
  width: .6em; height: 1.1em;
  vertical-align: -0.2em;
  background: var(--m-accent);
  margin-left: 2px;
  animation: m-blink 1s steps(1) infinite;
}

.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.btn-big { padding: 16px 24px; font-size: 16px; }
.devices { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Social ------------------------------------------------ */
.me { display: flex; align-items: center; gap: 20px; margin-bottom: 36px; }
.avatar { position: relative; width: 88px; height: 88px; flex-shrink: 0; border-radius: 50%; }
.avatar img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  filter: grayscale(.35) contrast(1.05);
  transition: filter .4s, transform .5s var(--m-ease);
}
.avatar:hover img { filter: none; transform: scale(1.04) rotate(-2deg); }
.avatar-ring {
  position: absolute;
  top: -6px; right: -6px; bottom: -6px; left: -6px;
  border-radius: 50%;
  border: 1px dashed rgba(var(--m-accent-rgb), .55);
  animation: spin 22s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.me-name { font-size: 26px; font-weight: 650; letter-spacing: -0.03em; }
.me-status { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.me-status .dot { background: var(--m-ok); animation: none; }

.links { display: grid; gap: 0; border-top: 1px solid var(--m-line-strong); }
.link-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 4px;
  border-bottom: 1px solid var(--m-line-strong);
  text-decoration: none;
  position: relative;
}
.link-row::before {
  content: '';
  position: absolute;
  left: 0; top: -1px; bottom: -1px;
  width: 100%;
  background: rgba(var(--m-accent-rgb), .06);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .45s var(--m-ease);
  pointer-events: none;
}
.link-row:hover::before, .link-row:focus-within::before { transform: scaleX(1); }
.link-idx { font-family: var(--m-mono); font-size: 11px; color: var(--m-faint); width: 34px; flex-shrink: 0; }
.link-ico { width: 22px; height: 22px; flex-shrink: 0; color: var(--m-muted); transition: color .25s; }
.link-ico svg { width: 100%; height: 100%; }
.link-row:hover .link-ico { color: var(--m-accent); }
.link-main { display: flex; flex-direction: column; flex: 1; min-width: 0; text-decoration: none; }
.link-main b { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.link-main small { font-family: var(--m-mono); font-size: 12px; color: var(--m-muted); overflow: hidden; text-overflow: ellipsis; }
.link-go { font-size: 20px; color: var(--m-faint); transition: transform .35s var(--m-ease), color .25s; }
.link-row:hover .link-go, .proj:hover .link-go { color: var(--m-accent); transform: translate(3px, -3px); }
.copy-btn {
  position: relative;
  font-family: var(--m-mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 8px 12px;
  border: 1px solid var(--m-line-strong);
  border-radius: var(--m-radius);
  color: var(--m-muted);
  transition: color .2s, border-color .2s;
}
.copy-btn:hover { color: var(--m-text); border-color: var(--m-text); }
.copy-btn.done { color: var(--m-on-accent); background: var(--m-accent); border-color: var(--m-accent); }

/* ---------- Werkstatt --------------------------------------------- */
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.proj {
  position: relative;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  border: 1px solid var(--m-line-strong);
  border-radius: var(--m-radius-lg);
  background: rgba(12, 13, 16, .82);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  overflow: hidden;
  transition: border-color .3s, transform .45s var(--m-ease);
}
.proj:hover { border-color: rgba(var(--m-accent-rgb), .6); transform: translateY(-4px); }
.proj .link-go { position: absolute; top: 14px; right: 16px; }
.proj-viz {
  height: 150px;
  border-bottom: 1px solid var(--m-line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 16px 16px;
}
.proj-meta { padding: 20px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.proj-meta h3 { font-size: 22px; font-weight: 650; letter-spacing: -0.025em; }
.proj-meta p { color: var(--m-muted); font-size: 14px; flex: 1; }
.proj-tags { display: flex; gap: 6px; margin-top: 6px; }

/* Mini-Visualisierungen */
.viz-pixel { display: grid; grid-template-columns: repeat(12, 10px); grid-auto-rows: 10px; gap: 1px; align-content: center; justify-content: center; }
.viz-pixel i { background: rgba(255,255,255,.06); transition: background .5s; }
.viz-pixel i.on { background: var(--m-text); }
.viz-pixel i.acc { background: var(--m-accent); }
.viz-net svg { width: 88%; height: auto; }
.viz-net .edges path { stroke: var(--m-line-strong); stroke-width: 1.2; fill: none; }
.viz-net .crit path {
  stroke: var(--m-accent); stroke-width: 1.6; fill: none;
  stroke-dasharray: 300; stroke-dashoffset: 300;
  transition: stroke-dashoffset 1.4s var(--m-ease);
}
.proj:hover .viz-net .crit path, .proj.in .viz-net .crit path { stroke-dashoffset: 0; }
.viz-net .nodes rect { fill: var(--m-bg-2); stroke: var(--m-muted); stroke-width: 1; rx: 2; }
.viz-md { flex-direction: column; align-items: stretch; justify-content: center; gap: 9px; padding: 0 22%; font-family: var(--m-mono); font-size: 11px; }
.md-l { display: flex; align-items: center; gap: 6px; height: 8px; }
.md-l b { color: var(--m-accent); font-weight: 500; }
.md-l i { display: block; height: 6px; background: rgba(255,255,255,.14); border-radius: 1px; transform-origin: 0 50%; transition: transform .6s var(--m-ease); }
.md-l:first-child i { background: var(--m-text); height: 8px; }
.proj:hover .md-l i { transform: scaleX(.8); }
.proj:hover .md-l:nth-child(odd) i { transform: scaleX(1.08); }

/* ---------- Footer ------------------------------------------------ */
.foot {
  position: relative;
  padding: 120px 24px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}
.foot-mark { font-size: clamp(40px, 9vw, 120px); letter-spacing: -0.05em; }
.foot a { text-decoration: none; }
.foot p a:hover { color: var(--m-accent); }

/* ---------- Toast ------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  z-index: 20;
  font-family: var(--m-mono);
  font-size: 12px;
  padding: 10px 16px;
  border: 1px solid var(--m-line-strong);
  border-radius: var(--m-radius);
  background: var(--m-surface);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .4s var(--m-ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast b { color: var(--m-accent); font-weight: 500; }

/* ---------- Reveal ------------------------------------------------ */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--m-ease), transform .9s var(--m-ease); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Responsive -------------------------------------------- */
@media (max-width: 1100px) {
  .rail { display: none; }
}
@media (max-width: 900px) {
  .projects { grid-template-columns: 1fr; }
  .proj { flex-direction: row; }
  .proj-viz { width: 38%; height: auto; min-height: 150px; border-bottom: 0; border-right: 1px solid var(--m-line); flex-shrink: 0; }
  .viz-pixel { grid-template-columns: repeat(12, 7px); grid-auto-rows: 7px; }
  .viz-md { padding: 0 14%; }
}
@media (max-width: 720px) {
  .hud { height: 56px; }
  .hud-nav { display: none; }
  .hud-current { display: block; }
  .sec { padding: 96px 20px 88px; align-items: flex-end; }
  .sec-hero { align-items: center; }
  .sec-left { justify-content: flex-start; }
  /* Text auf dem Handy etwas abheben, Partikel laufen dahinter */
  .sec-inner { text-shadow: 0 1px 18px rgba(7,8,10,.9); }
  .term { font-size: 12px; }
  .btn-big { width: 100%; justify-content: center; }
  .link-idx { display: none; }
  .link-main b { font-size: 18px; }
  .proj { flex-direction: column; }
  .proj-viz { width: auto; min-height: 0; height: 110px; border-right: 0; border-bottom: 1px solid var(--m-line); }
  .viz-pixel { grid-template-columns: repeat(12, 7px); grid-auto-rows: 7px; }
}

/* ---------- Live-Status (Uptime Kuma über /api/status) ------------ */
.st { display: grid; gap: 6px; }
.st-row { display: flex; gap: 18px; color: var(--m-muted); }
.st-row > span:first-child { min-width: 7ch; }
.st-state { display: inline-flex; align-items: center; gap: 8px; }
.st-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--m-ok); }
.st-state b { font-weight: 500; color: var(--m-ok); }
.st-row.down .st-state i { background: var(--m-err); }
.st-row.down .st-state b { color: var(--m-err); }
#svcStatus b { color: var(--m-accent); font-weight: 500; }
