/* ==========================================================================
   Tokens  (Farbwelt der alten Seite)
   ========================================================================== */
:root {
  color-scheme: dark;

  --bg: #0d0d0d;
  --surface: #111111;
  --surface-2: #161616;
  --border: #222222;
  --border-strong: #333333;

  --text: #e8e8e8;
  --text-2: #8a8a8a;
  --text-3: #5c5c5c;

  --green: #22c55e;
  --pointer: #818cf8;

  /* Tech-Akzente – identisch mit den Tags der alten Seite */
  --t-discord: #7aa2f7;
  --t-node: #9bdc98;
  --t-js: #f6d365;
  --t-express: #cbd5e1;
  --t-oauth: #f59f9f;

  --online: #23a55a;
  --idle: #f0b232;
  --dnd: #f23f42;
  --offline: #80848e;

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;

  --radius: 10px;
  --radius-lg: 14px;
  --container: 960px;
  --nav-h: 60px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.25s;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; }

::selection { background: rgba(255, 255, 255, 0.14); }

:focus-visible {
  outline: 1px solid var(--text-2);
  outline-offset: 3px;
  border-radius: 6px;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-fill { fill: currentColor; stroke: none; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

main, .footer { position: relative; z-index: 1; }

/* ==========================================================================
   Partikel-Hintergrund & Scroll-Fortschritt
   ========================================================================== */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100lvh; /* größter Viewport: deckt mobil auch bei eingeklappter Adressleiste alles ab */
  z-index: 0;
  pointer-events: none;
}

.progress {
  position: fixed;
  inset: 0 0 auto;
  height: 2px;
  z-index: 200;
  pointer-events: none;
}
.progress-bar {
  display: block;
  height: 100%;
  background: rgba(255, 255, 255, 0.35);
  transform: scaleX(0);
  transform-origin: left;
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background var(--dur) ease, border-color var(--dur) ease;
}
.nav.is-scrolled {
  background: rgba(13, 13, 13, 0.72);
  border-bottom-color: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav-inner {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-links {
  position: relative;
  display: flex;
  gap: 2px;
}
.nav-links a {
  position: relative;
  z-index: 1;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text-2);
  transition: color var(--dur) ease;
}
.nav-links a:hover,
.nav-links a[aria-current] { color: var(--text); }

.nav-pill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 8px;
  background: #121212;
  border: 1px solid var(--border);
  opacity: 0;
  transition: transform 0.45s var(--ease-out), width 0.45s var(--ease-out), opacity var(--dur) ease;
}
.nav-pill.is-visible { opacity: 1; }

/* ==========================================================================
   Status-Punkt (Discord-Präsenz)
   ========================================================================== */
.status-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--offline);
  color: var(--offline);
  transition: background 0.4s ease;
}
.status-dot[data-status='online'] { background: var(--online); color: var(--online); }
.status-dot[data-status='idle']   { background: var(--idle);   color: var(--idle); }
.status-dot[data-status='dnd']    { background: var(--dnd);    color: var(--dnd); }
.status-dot[data-status='online']::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: currentColor;
  animation: ping 2.4s var(--ease-out) infinite;
}
@keyframes ping {
  0% { transform: scale(1); opacity: 0.55; }
  80%, 100% { transform: scale(2.4); opacity: 0; }
}

/* ==========================================================================
   Gemeinsame Bausteine
   ========================================================================== */
.label {
  margin-bottom: 18px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}

.section-title {
  font-size: clamp(1.6rem, 3.2vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 20px;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
  transition: color var(--dur) ease, border-color var(--dur) ease, background var(--dur) ease, transform 0.4s var(--ease-out);
}
.ghost-btn .icon { font-size: 15px; transition: transform 0.4s var(--ease-out); }
.ghost-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
}
.ghost-btn:hover .icon { transform: translateY(2px); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 40px) 0 80px;
}
.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hero .label { margin-bottom: 26px; }

.hero-title {
  min-height: 1.1em;
  margin-bottom: 18px;
  font-size: clamp(2.5rem, 7vw, 4.4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.035em;
}
.hero-name { transition: text-shadow 0.9s ease; }
.hero-name.is-glowing { animation: name-glow 1.2s ease-out; }
@keyframes name-glow {
  40% { text-shadow: 0 0 18px rgba(255, 255, 255, 0.6), 0 0 48px rgba(255, 255, 255, 0.25); }
}
.hero-cursor {
  display: inline-block;
  margin-left: 2px;
  color: var(--text-2);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-command {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  min-width: 260px;
  padding: 0 20px;
  margin-bottom: 30px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--text-2);
}
.hero-prompt { color: rgba(255, 255, 255, 0.2); user-select: none; }

.hero-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 22px;
  margin-bottom: 40px;
}
.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-3);
  transition: color var(--dur) ease;
}
.hero-link .icon { font-size: 14px; }
.hero-link:hover { color: var(--text); }

/* Einstieg: Elemente steigen weich und gestaffelt auf */
.hero-anim {
  opacity: 0;
  transform: translateY(14px);
  filter: blur(4px);
}
.is-loaded .hero-anim {
  animation: rise 0.9s var(--ease-out) forwards;
  animation-delay: calc(var(--d, 0) * 120ms + 150ms);
}
@keyframes rise { to { opacity: 1; transform: none; filter: blur(0); } }

/* ==========================================================================
   Sections & Reveal
   ========================================================================== */
.section { padding: 110px 0; }

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.9s var(--ease-out),
    transform 0.9s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal].is-visible { opacity: 1; transform: none; }
[data-reveal].is-revealed { transition-delay: 0ms; }

/* ==========================================================================
   About
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 56px;
  align-items: start;
}
.about-text p {
  color: var(--text-2);
  margin-bottom: 14px;
  max-width: 520px;
}

.info-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(16, 16, 16, 0.85);
  overflow: hidden;
}
.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  transition: background var(--dur) ease;
}
.info-row:last-child { border-bottom: 0; }
.info-row:hover { background: rgba(255, 255, 255, 0.02); }
.info-row[hidden] { display: none; }
.info-row dt {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.info-row dt .icon { font-size: 14px; }
.info-row dd {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 500;
  text-align: right;
}
.is-positive { color: var(--green); }

.copyable {
  position: relative;
  transition: color var(--dur) ease;
}
.copyable .icon {
  position: absolute;
  top: 50%;
  left: -20px;
  margin-top: -6.5px;
  font-size: 13px;
  color: var(--text-3);
  opacity: 0;
  transform: translateX(4px);
  transition: opacity var(--dur) ease, transform 0.35s var(--ease-out);
}
.copyable:hover .icon { opacity: 1; transform: none; }

/* Tags im Stil der alten Seite */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 48px;
}
.tag {
  --c: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: 7px;
  border: 1px solid color-mix(in srgb, var(--c) 28%, transparent);
  background: #101010;
  font-size: 13px;
  color: var(--c);
  box-shadow: 0 0 14px 1px color-mix(in srgb, var(--c) 12%, transparent);
  transition:
    opacity 0.9s var(--ease-out),
    transform 0.45s var(--ease-out),
    box-shadow var(--dur) ease,
    border-color var(--dur) ease;
  transition-delay: var(--reveal-delay, 0ms);
}
.tag.is-revealed { transition-delay: 0ms; }
.tag.is-visible:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--c) 55%, transparent);
  box-shadow: 0 0 22px 3px color-mix(in srgb, var(--c) 24%, transparent);
}
.tag-token {
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid #1f1f1f;
  background: #151515;
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9aa0a6;
}

[data-tech='discord'] { --c: var(--t-discord); }
[data-tech='node']    { --c: var(--t-node); }
[data-tech='js']      { --c: var(--t-js); }
[data-tech='express'] { --c: var(--t-express); }
[data-tech='oauth']   { --c: var(--t-oauth); }

/* ==========================================================================
   Stack
   ========================================================================== */
/* Letzte Sektion: mindestens so hoch, dass sie (samt Footer) bis unter die Nav scrollen kann */
#stack {
  min-height: calc(100vh - var(--nav-h) - 97px);
  min-height: calc(100lvh - var(--nav-h) - 97px);
}

.stack-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  margin-top: 16px;
}

.stack-list { display: grid; gap: 4px; align-content: start; }
.stack-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px 9px 9px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  text-align: left;
  color: var(--text-2);
  transition: background var(--dur) ease, border-color var(--dur) ease, color var(--dur) ease, transform 0.4s var(--ease-out);
}
.stack-item:hover { color: var(--text); transform: translateX(3px); }
.stack-item.is-active {
  color: var(--text);
  background: rgba(16, 16, 16, 0.85);
  border-color: var(--border);
}
.stack-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #101010;
  font-size: 16px;
  color: var(--text-3);
  transition: color var(--dur) ease, border-color var(--dur) ease, box-shadow var(--dur) ease;
}
.stack-item.is-active .stack-icon {
  color: var(--c);
  border-color: color-mix(in srgb, var(--c) 35%, transparent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--c) 18%, transparent);
}
.stack-name { font-size: 14px; font-weight: 500; }
.stack-meta {
  margin-left: auto;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.editor {
  --c: var(--text-2);
  display: flex;
  flex-direction: column;
  min-height: 330px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(14, 14, 14, 0.92);
  overflow: hidden;
}
.editor-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.editor-dots { display: flex; gap: 6px; }
.editor-dots i { width: 10px; height: 10px; border-radius: 50%; background: #262626; }
.editor-file { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); }
.editor-meta {
  margin-left: auto;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c);
  transition: color 0.4s ease;
}
.editor-code {
  flex: 1;
  padding: 20px 22px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.75;
  color: #d4d4d4;
  white-space: pre;
  overflow-x: auto;
  scrollbar-width: none;
}
.editor-code::-webkit-scrollbar { display: none; }
.editor-code.is-switching { animation: editor-in 0.5s var(--ease-out); }
@keyframes editor-in { from { opacity: 0; transform: translateY(6px); } }
.editor-code .caret {
  display: inline-block;
  width: 7px;
  height: 1.1em;
  margin-left: 1px;
  vertical-align: text-bottom;
  background: var(--text-2);
  animation: blink 1s steps(1) infinite;
}

.editor-progress { height: 2px; background: #151515; }
.editor-progress span {
  display: block;
  height: 100%;
  background: var(--c);
  opacity: 0.6;
  transform: scaleX(0);
  transform-origin: left;
}
.editor-progress span.is-running { animation: progress 7s linear forwards; }
@keyframes progress { to { transform: scaleX(1); } }

/* Syntax-Farben der alten Seite */
.tok-keyword { color: #8ab4ff; }
.tok-string  { color: #f6d365; }
.tok-number  { color: #9bdc98; }
.tok-func    { color: #f59f9f; }
.tok-comment { color: var(--text-3); font-style: italic; }

/* ==========================================================================
   Footer & Toast
   ========================================================================== */
.footer {
  padding: 28px 0 36px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--text-3);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.footer-links { display: flex; gap: 4px; }
.footer-links a,
.footer-links button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 15px;
  color: var(--text-3);
  transition: color var(--dur) ease, background var(--dur) ease, transform 0.4s var(--ease-out);
}
.footer-links a:hover,
.footer-links button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 300;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 13.5px;
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.45s var(--ease-out);
}
.toast .icon { color: var(--green); font-size: 16px; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   404
   ========================================================================== */
.not-found {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  animation: page-in 1s var(--ease-out) both;
}
@keyframes page-in { from { opacity: 0; transform: translateY(16px); } }
.not-found-title {
  font-size: clamp(4rem, 14vw, 7rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
  color: rgba(255, 255, 255, 0.14);
  margin-bottom: 14px;
}
.not-found-text { color: var(--text-2); margin-bottom: 32px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 820px) {
  .about-grid,
  .stack-grid { grid-template-columns: 1fr; gap: 32px; }
  .stack-list { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .section { padding: 84px 0; }
}

@media (max-width: 520px) {
  .container, .nav-inner { padding: 0 16px; }
  .nav-links a { padding: 5px 9px; }
  .hero-links { flex-direction: column; align-items: center; gap: 10px; }
  .hero-command { min-width: 0; font-size: 12.5px; }
  .editor-code { padding: 16px; font-size: 12px; }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero-anim, [data-reveal] { opacity: 1; transform: none; filter: none; }
}
