/* =================================================================
   mxblabs · Maximilian Bauer
   Minimal, modern, ruhig — mit dezenter taktiler Tiefe (kein Gadget-
   Overload). Ein Akzent (Amber), viel Weißraum, Hell-/Dunkel-Theme.
   ================================================================= */

/* ----------------------------- THEME ---------------------------- */
:root,
[data-theme="dark"] {
  --bg:        #0e0f12;
  --bg-2:      #121419;
  --surface:   #16181d;
  --surface-2: #1b1e24;
  --text:      #e9ecf1;
  --muted:     #8b919c;
  --faint:     #5b616b;
  --line:        rgba(255,255,255,.09);
  --line-strong: rgba(255,255,255,.17);
  --accent:     #ff8a3d;
  --accent-2:   #ffb072;
  --accent-ink: #1b1206;
  --nm-dark:  rgba(0,0,0,.55);
  --nm-light: rgba(255,255,255,.045);
  --shadow:   0 22px 60px rgba(0,0,0,.55);
  --grain-op: .04;
  --spot-op:  .5;
}
[data-theme="light"] {
  --bg:        #eceef2;
  --bg-2:      #e6e9ef;
  --surface:   #eef1f5;
  --surface-2: #e6e9ef;
  --text:      #14171c;
  --muted:     #565d68;
  --faint:     #8b919c;
  --line:        rgba(20,23,28,.11);
  --line-strong: rgba(20,23,28,.2);
  --accent:     #d65a06;
  --accent-2:   #b94c00;
  --accent-ink: #fff;
  --nm-dark:  rgba(167,176,190,.55);
  --nm-light: rgba(255,255,255,.9);
  --shadow:   0 22px 55px rgba(70,80,100,.16);
  --grain-op: .05;
  --spot-op:  .35;
}

:root {
  --maxw: 1060px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

/* ----------------------------- RESET ---------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.62;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .4s var(--ease), color .4s var(--ease);
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
svg { display: block; }
::selection { background: var(--accent); color: var(--accent-ink); }

kbd {
  font-family: var(--mono); font-size: .72em; line-height: 1;
  padding: 3px 6px; border-radius: 6px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 var(--line);
}

.skip-link {
  position: fixed; left: 14px; top: -60px; z-index: 200;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: 10px; font-weight: 600;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 14px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.nowrap { white-space: nowrap; }

/* ---------------------- Hintergrund-Texturen -------------------- */
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: var(--grain-op); mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.spotlight {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(420px 420px at var(--mx, 50%) var(--my, 18%),
              color-mix(in oklab, var(--accent) 100%, transparent) 0%, transparent 70%);
  opacity: calc(var(--spot-op) * .14);
  transition: opacity .5s var(--ease);
}

/* Inhalt über die Texturen heben */
.bar, main, .foot, .palette { position: relative; z-index: 2; }

/* =============================== BAR ============================= */
.bar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 22px;
  padding: 14px clamp(18px, 5vw, 40px);
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.bar.scrolled { border-bottom-color: var(--line); background: var(--bg); }

.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 1.16rem; letter-spacing: -.02em;
}
.brand__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent) 60%, transparent);
  animation: pulse 3s var(--ease) infinite;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent) 55%, transparent); }
  50%     { box-shadow: 0 0 0 5px color-mix(in oklab, var(--accent) 0%, transparent); }
}
.brand__b { color: var(--accent); }

.bar__nav { display: flex; gap: 4px; margin-left: 8px; }
.bar__nav a {
  padding: 8px 13px; border-radius: 9px; color: var(--muted);
  font-size: .94rem; font-weight: 500;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.bar__nav a:hover { color: var(--text); background: var(--surface); }

.bar__tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.seg {
  display: inline-flex; padding: 3px; border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.seg__btn {
  font-family: var(--mono); font-size: .72rem; font-weight: 500;
  padding: 6px 9px; border-radius: 8px; color: var(--faint);
  transition: color .2s var(--ease), background .2s var(--ease);
}
.seg__btn.is-on {
  color: var(--accent-ink); background: var(--accent);
}
[data-theme="light"] .seg__btn.is-on { color: #fff; }

.tool {
  display: inline-flex; align-items: center; justify-content: center;
  height: 38px; min-width: 38px; padding: 0 10px; border-radius: 11px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--nm-light);
  transition: color .2s var(--ease), transform .12s var(--ease), border-color .2s var(--ease);
}
.tool:hover { color: var(--text); border-color: var(--line-strong); }
.tool:active { transform: translateY(1px); }
.tool .ic { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.tool .ic--moon { fill: currentColor; stroke: none; }
[data-theme="dark"]  .ic--moon { display: none; }
[data-theme="light"] .ic--sun  { display: none; }
.tool--k kbd { background: transparent; border: none; box-shadow: none; color: var(--muted); font-size: .8rem; }

/* ============================== HERO ============================ */
main { display: block; }

.hero {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(60px, 13vh, 150px) clamp(18px, 5vw, 40px) clamp(50px, 8vw, 90px);
}
.eyebrow {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 26px;
}
.hero__title {
  font-size: clamp(2.5rem, 7.5vw, 5rem);
  font-weight: 600; line-height: 1.04; letter-spacing: -.035em;
  max-width: 16ch;
}
.accent {
  color: var(--accent);
  text-shadow: 0 0 38px color-mix(in oklab, var(--accent) 35%, transparent);
}
.hero__lead {
  margin-top: 26px; max-width: 50ch;
  font-size: clamp(1.05rem, 2vw, 1.28rem); color: var(--muted);
}
.hero__cta { margin-top: 38px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px; border-radius: 13px; font-weight: 600; font-size: 1rem;
  transition: transform .14s var(--ease), background .2s var(--ease),
              border-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease);
}
.btn--primary {
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 8px 22px color-mix(in oklab, var(--accent) 32%, transparent),
              inset 0 1px 0 rgba(255,255,255,.35);
}
.btn--primary:hover { background: var(--accent-2); }
.btn--primary:active { transform: translateY(2px); box-shadow: 0 3px 12px color-mix(in oklab, var(--accent) 28%, transparent); }
.btn--ghost {
  color: var(--text); background: var(--surface);
  border: 1px solid var(--line); box-shadow: inset 0 1px 0 var(--nm-light);
}
.btn--ghost:hover { border-color: var(--line-strong); }
.btn--ghost:active { transform: translateY(2px); }
.kbd-inline { background: var(--bg-2); }

/* LED-Lichtstrich (subtiler Hardware-Nod) */
.lightline {
  position: relative; height: 1px; margin: 48px 0 0;
  background: var(--line); overflow: visible; border-radius: 1px;
}
.lightline span {
  position: absolute; top: 50%; left: 0; width: 90px; height: 2px;
  transform: translateY(-50%); border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 14px 2px color-mix(in oklab, var(--accent) 55%, transparent);
  animation: sweep 5.5s var(--ease) infinite;
}
@keyframes sweep {
  0%   { left: -90px; opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

.tags {
  list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px;
}
.tags li {
  font-family: var(--mono); font-size: .76rem; color: var(--muted);
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
}

/* ============================= BLOCKS =========================== */
.block {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(50px, 9vw, 110px) clamp(18px, 5vw, 40px) 0;
}
.block__head { margin-bottom: 34px; }
.block__head h2 {
  font-size: clamp(1.7rem, 4vw, 2.5rem); font-weight: 600; letter-spacing: -.025em;
  display: flex; align-items: center; gap: 14px;
}
.block__head h2::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px color-mix(in oklab, var(--accent) 60%, transparent);
}
.block__head p { margin-top: 10px; color: var(--muted); font-size: 1.05rem; }

/* ----------------------------- LABS ----------------------------- */
.live {
  list-style: none; display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
}
.live__item {
  display: flex; flex-direction: column; gap: 7px; height: 100%;
  padding: 20px; border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--nm-light);
  transition: transform .22s var(--ease), border-color .22s var(--ease), box-shadow .22s var(--ease);
}
.live__item:hover {
  transform: translateY(-3px);
  border-color: color-mix(in oklab, var(--accent) 45%, var(--line));
  box-shadow: var(--shadow);
}
.live__head { display: flex; align-items: center; justify-content: space-between; }
.live__led {
  width: 9px; height: 9px; border-radius: 50%;
  background: #54e08a; box-shadow: 0 0 9px #54e08a; animation: pulse2 2.6s var(--ease) infinite;
}
@keyframes pulse2 { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
.live__arrow { color: var(--accent); font-size: 1.1rem; transition: transform .22s var(--ease); }
.live__item:hover .live__arrow { transform: translate(3px, -3px); }
.live__name { font-weight: 600; font-size: 1.1rem; margin-top: 2px; }
.live__desc { color: var(--muted); font-size: .92rem; flex: 1; }
.live__host { font-family: var(--mono); font-size: .78rem; color: var(--faint); }

/* ---------------------------- KONTAKT --------------------------- */
.contact { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.mail {
  display: inline-flex; align-items: baseline; gap: 16px;
  padding: 18px 26px; border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--nm-light), 0 1px 0 var(--nm-dark);
  transition: transform .14s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.mail:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.mail:active { transform: translateY(2px); }
.mail__addr { font-size: clamp(1.1rem, 3vw, 1.5rem); font-weight: 600; letter-spacing: -.01em; }
.mail__hint {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent);
}
.contact__alt { display: flex; gap: 10px; flex-wrap: wrap; }
.link-btn {
  padding: 12px 18px; border-radius: 12px; color: var(--muted);
  border: 1px solid var(--line); font-size: .95rem; font-weight: 500;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.link-btn:hover { color: var(--text); border-color: var(--line-strong); }

/* ============================= FOOTER =========================== */
.foot {
  max-width: var(--maxw); margin: clamp(60px, 12vw, 130px) auto 0;
  padding: 28px clamp(18px, 5vw, 40px);
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.foot__brand { font-weight: 700; }
.foot__copy { color: var(--faint); font-size: .88rem; }
.foot__status {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: .74rem; color: var(--muted);
}
.foot__status i { width: 8px; height: 8px; border-radius: 50%; background: #54e08a; box-shadow: 0 0 8px #54e08a; }

/* ========================= COMMAND PALETTE ====================== */
.palette { position: fixed; inset: 0; z-index: 120; display: grid; place-items: start center; }
.palette[hidden] { display: none; }
.palette__backdrop {
  position: absolute; inset: 0;
  background: color-mix(in oklab, var(--bg) 55%, rgba(0,0,0,.6));
  animation: fade .2s var(--ease);
}
.palette__panel {
  position: relative; margin-top: 13vh; width: min(560px, 92vw);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 18px; overflow: hidden;
  box-shadow: var(--shadow);
  animation: pop .22s var(--ease);
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(-10px) scale(.98); } }
.palette__input {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
}
.palette__search { color: var(--muted); font-size: 1.1rem; }
.palette__input input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 1.05rem; font-family: var(--font);
}
.palette__input input::placeholder { color: var(--faint); }
.palette__list { list-style: none; max-height: 50vh; overflow-y: auto; padding: 8px; }
.palette__list li {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 14px; border-radius: 11px; cursor: pointer;
  color: var(--text);
}
.palette__list li .pi {
  width: 26px; text-align: center; color: var(--accent); font-size: 1rem;
}
.palette__list li .pl { flex: 1; }
.palette__list li .ph { font-family: var(--mono); font-size: .72rem; color: var(--faint); }
.palette__list li[aria-selected="true"],
.palette__list li:hover { background: var(--surface-2); }
.palette__list li[aria-selected="true"] { box-shadow: inset 0 0 0 1px var(--line-strong); }
.palette__empty { padding: 22px 16px; color: var(--muted); text-align: center; }

/* ============================== TOAST =========================== */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  z-index: 140; padding: 12px 20px; border-radius: 12px;
  background: var(--text); color: var(--bg);
  font-weight: 600; font-size: .92rem;
  opacity: 0; pointer-events: none; box-shadow: var(--shadow);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============================= REVEAL =========================== */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* =========================== RESPONSIVE ========================= */
@media (max-width: 640px) {
  .bar__nav { display: none; }
  .hero__title { letter-spacing: -.03em; }
}

/* ========================= REDUCED MOTION ======================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .spotlight { display: none; }
}
