/* ============================================================
   Georg Hofer · Nerd-Site
   Retro / Space / CRT theme
   ============================================================ */

:root {
  --bg:        #05010f;
  --bg-soft:   #0c0820;
  --panel:     rgba(18, 12, 40, 0.72);
  --panel-brd: rgba(0, 255, 213, 0.22);
  --ink:       #e7e9ff;
  --ink-soft:  #9aa0c8;
  --neon:      #00ffd5;   /* cyan */
  --neon-2:    #ff2e97;   /* magenta */
  --neon-3:    #b388ff;   /* violet */
  --amber:     #ffd166;
  --green:     #38ff9a;
  --radius:    14px;
  --maxw:      1100px;
  --font-mono: "SF Mono", "JetBrains Mono", "Fira Code", Consolas, "Courier New", monospace;
  --font-body: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- Background FX ---------- */
#quantumfield {
  position: fixed; inset: 0; z-index: -2;
  width: 100%; height: 100%;
  background: radial-gradient(ellipse at 50% 50%, #1a1145 0%, #06030f 60%, #05010f 100%);
}
.scanlines {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0, rgba(0,0,0,0) 2px, rgba(0,0,0,.18) 3px);
  mix-blend-mode: overlay; opacity: .5;
}

/* ---------- Helpers ---------- */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--neon); color: #001; padding: .6rem 1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

a { color: var(--neon); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1rem;
  padding: .8rem clamp(1rem, 4vw, 2rem);
  background: rgba(5, 1, 15, 0.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--panel-brd);
}
.logo {
  font-family: var(--font-mono); font-weight: 700; font-size: 1.2rem;
  color: var(--ink); letter-spacing: 1px;
}
.logo:hover { text-decoration: none; }
.logo-bracket { color: var(--neon-2); }
.logo-cursor { color: var(--neon); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.main-nav { margin-left: auto; display: flex; gap: 1.4rem; }
.main-nav a {
  font-family: var(--font-mono); font-size: .92rem; color: var(--ink-soft);
  position: relative; padding: .2rem 0; text-transform: lowercase;
}
.main-nav a::after {
  content: ""; position: absolute; left: 0; bottom: -3px; height: 2px; width: 0;
  background: var(--neon); transition: width .25s ease;
}
.main-nav a:hover { color: var(--neon); text-decoration: none; }
.main-nav a:hover::after { width: 100%; }

.header-tools { display: flex; align-items: center; gap: .6rem; }
.lang-toggle {
  font-family: var(--font-mono); font-size: .82rem; cursor: pointer;
  background: transparent; color: var(--ink-soft);
  border: 1px solid var(--panel-brd); border-radius: 8px; padding: .35rem .55rem;
  transition: .2s;
}
.lang-toggle:hover { border-color: var(--neon); color: var(--neon); }
.lang-sep { opacity: .4; margin: 0 2px; }
body[data-lang="de"] .lang-de { color: var(--neon); font-weight: 700; }
body[data-lang="en"] .lang-en { color: var(--neon); font-weight: 700; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; width: 30px; height: 24px; position: relative; }
.nav-toggle span { display: block; height: 2px; width: 100%; background: var(--ink); position: absolute; left: 0; transition: .3s; }
.nav-toggle span:nth-child(1) { top: 2px; }
.nav-toggle span:nth-child(2) { top: 11px; }
.nav-toggle span:nth-child(3) { top: 20px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { top: 11px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { top: 11px; transform: rotate(-45deg); }

/* ---------- Layout ---------- */
.section {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6rem) clamp(1rem, 4vw, 2rem);
}
.section-head { display: flex; align-items: baseline; gap: .8rem; margin-bottom: 1.6rem; }
.section-index {
  font-family: var(--font-mono); color: var(--neon-2); font-size: 1rem; opacity: .8;
}
.section-head h2 {
  font-size: clamp(1.6rem, 4vw, 2.4rem); letter-spacing: 1px;
  text-shadow: 0 0 18px rgba(0,255,213,.25);
}
.section-lead { color: var(--ink-soft); max-width: 60ch; margin-bottom: 2rem; }

/* ---------- Hero ---------- */
.hero {
  min-height: 92vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 5rem clamp(1rem, 4vw, 2rem) 3rem; position: relative;
}
.hero-inner { max-width: 760px; }
.hero-eyebrow { font-family: var(--font-mono); color: var(--neon); letter-spacing: 2px; font-size: .82rem; margin-bottom: 1rem; }
.hero-title { font-size: clamp(2.2rem, 8vw, 4.2rem); line-height: 1.05; margin-bottom: 1rem; }
.hero-title > span { display: block; }
.hero-title > span:first-child { font-size: .42em; color: var(--ink-soft); font-weight: 400; font-family: var(--font-mono); }

.glitch { position: relative; color: var(--ink); text-shadow: 0 0 22px rgba(0,255,213,.35); }
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0; overflow: hidden;
}
.glitch::before { color: var(--neon-2); transform: translate(2px, 0); clip-path: inset(0 0 55% 0); animation: glitch1 3s infinite linear alternate; opacity: .8; }
.glitch::after  { color: var(--neon);   transform: translate(-2px,0); clip-path: inset(55% 0 0 0); animation: glitch2 2.4s infinite linear alternate; opacity: .8; }
@keyframes glitch1 { 0%{clip-path:inset(0 0 55% 0)} 50%{clip-path:inset(20% 0 30% 0)} 100%{clip-path:inset(40% 0 10% 0)} }
@keyframes glitch2 { 0%{clip-path:inset(55% 0 0 0)} 50%{clip-path:inset(30% 0 20% 0)} 100%{clip-path:inset(10% 0 40% 0)} }

.hero-subtitle { font-family: var(--font-mono); font-size: clamp(1rem, 3.5vw, 1.4rem); color: var(--neon-3); min-height: 1.6em; margin-bottom: 1.2rem; }
.caret { color: var(--neon); animation: blink 1s steps(1) infinite; }
.hero-text { color: var(--ink-soft); max-width: 56ch; margin: 0 auto 2rem; }

.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 2.5rem; }

.btn {
  font-family: var(--font-mono); font-size: .95rem; cursor: pointer;
  padding: .8rem 1.5rem; border-radius: 10px; border: 1px solid transparent;
  transition: .2s; display: inline-block;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--neon); color: #002; box-shadow: 0 0 22px rgba(0,255,213,.4); font-weight: 700; }
.btn-primary:hover { box-shadow: 0 0 30px rgba(0,255,213,.7); }
.btn-ghost { border-color: var(--panel-brd); color: var(--ink); }
.btn-ghost:hover { border-color: var(--neon); color: var(--neon); }
.btn-block { width: 100%; }

.hero-stats { display: flex; gap: clamp(1rem,5vw,3rem); justify-content: center; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-num { font-family: var(--font-mono); font-size: 1.8rem; color: var(--amber); text-shadow: 0 0 14px rgba(255,209,102,.4); }
.stat-label { font-size: .78rem; color: var(--ink-soft); }

.scroll-hint { position: absolute; bottom: 1.4rem; font-size: 1.4rem; color: var(--neon); animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(8px); } }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
.about-text p { margin-bottom: 1rem; color: var(--ink-soft); }
.about-facts { list-style: none; margin-top: 1.5rem; display: grid; gap: .6rem; }
.about-facts li { display: flex; gap: .8rem; font-family: var(--font-mono); font-size: .9rem; }
.fact-key { color: var(--neon); min-width: 90px; }
.fact-key::after { content: ":"; }
.status-online { color: var(--green); }
.status-online::before { content: "● "; }

.about-terminal { background: #060312; border: 1px solid var(--panel-brd); border-radius: var(--radius); overflow: hidden; box-shadow: 0 0 30px rgba(0,255,213,.1); }
.term-bar { display: flex; gap: .4rem; padding: .6rem .8rem; background: #0d0824; border-bottom: 1px solid var(--panel-brd); }
.term-bar span { width: 11px; height: 11px; border-radius: 50%; }
.term-bar span:nth-child(1){ background:#ff5f56; } .term-bar span:nth-child(2){ background:#ffbd2e; } .term-bar span:nth-child(3){ background:#27c93f; }
.term-body { padding: 1rem 1.2rem; font-family: var(--font-mono); font-size: .85rem; color: var(--green); line-height: 1.7; white-space: pre-wrap; }
.term-body code > * { color: inherit; }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.4rem; }
.card {
  background: var(--panel); border: 1px solid var(--panel-brd); border-radius: var(--radius);
  padding: 1.6rem; backdrop-filter: blur(6px); transition: .25s; position: relative; overflow: hidden;
}
.card::before { content:""; position:absolute; inset:0; background: linear-gradient(135deg, transparent 60%, rgba(0,255,213,.06)); pointer-events:none; }
.card:hover { transform: translateY(-6px); border-color: var(--neon); box-shadow: 0 12px 40px rgba(0,255,213,.15); }
.card-icon { font-size: 2.2rem; margin-bottom: .6rem; }
.card h3 { font-size: 1.2rem; margin-bottom: .5rem; }
.card p { color: var(--ink-soft); font-size: .92rem; }
.card-feature { grid-column: span 1; border-color: var(--neon-2); }
.card-feature:hover { box-shadow: 0 12px 40px rgba(255,46,151,.18); }

.bar { margin-top: 1rem; height: 6px; background: rgba(255,255,255,.08); border-radius: 4px; overflow: hidden; }
.bar span { display: block; height: 100%; width: var(--lvl); background: linear-gradient(90deg, var(--neon), var(--neon-3)); border-radius: 4px; }

.tag-list { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.tag-list li { font-family: var(--font-mono); font-size: .78rem; padding: .25rem .6rem; border: 1px solid var(--panel-brd); border-radius: 20px; color: var(--neon-3); }

/* ---------- Retro pills ---------- */
.pill-grid { display: flex; flex-wrap: wrap; gap: .7rem; }
.pill {
  font-family: var(--font-mono); font-size: .9rem; padding: .5rem 1rem;
  border: 1px solid var(--panel-brd); border-radius: 30px; color: var(--ink);
  background: var(--panel); transition: .2s;
}
.pill:hover { color: var(--amber); border-color: var(--amber); transform: translateY(-2px); box-shadow: 0 0 16px rgba(255,209,102,.25); }

/* ---------- Contact ---------- */
.section-contact { max-width: 760px; }
.contact-form { display: grid; gap: 1.1rem; background: var(--panel); border: 1px solid var(--panel-brd); border-radius: var(--radius); padding: clamp(1.2rem, 4vw, 2rem); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.field { display: grid; gap: .4rem; }
.field > span { font-family: var(--font-mono); font-size: .82rem; color: var(--neon); }
.field input, .field textarea {
  font-family: var(--font-body); font-size: 1rem; color: var(--ink);
  background: #060312; border: 1px solid var(--panel-brd); border-radius: 8px; padding: .7rem .8rem;
  width: 100%; transition: .2s; resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--neon); box-shadow: 0 0 0 3px rgba(0,255,213,.15); }
.field input::placeholder, .field textarea::placeholder { color: #4a4f78; }

.form-status { font-family: var(--font-mono); font-size: .88rem; min-height: 1.2em; text-align: center; }
.form-status.ok { color: var(--green); }
.form-status.err { color: var(--neon-2); }
.form-status.sending { color: var(--amber); }

.contact-fallback { text-align: center; margin-top: 1.4rem; color: var(--ink-soft); font-family: var(--font-mono); font-size: .9rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--panel-brd); padding: 2.5rem 1rem; text-align: center; margin-top: 2rem; }
.social { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.4rem; }
.social a {
  width: 44px; height: 44px; display: grid; place-items: center;
  color: var(--ink-soft); border: 1px solid var(--panel-brd); border-radius: 12px; transition: .25s;
}
.social a:hover { color: var(--neon); border-color: var(--neon); transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,255,213,.2); }
.footer-note { font-family: var(--font-mono); font-size: .85rem; color: var(--ink-soft); display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.footer-copy { opacity: .7; }

/* ---------- Reveal animation ---------- */
.section, .hero-inner { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.section.in-view, .hero-inner.in-view { opacity: 1; transform: none; }

/* ---------- CRT toggle ---------- */
.crt-toggle {
  font-size: 1rem; line-height: 1; cursor: pointer; background: transparent;
  border: 1px solid var(--panel-brd); border-radius: 8px; padding: .3rem .5rem; transition: .2s;
  filter: grayscale(.3);
}
.crt-toggle:hover { border-color: var(--neon); }
.crt-toggle[aria-pressed="false"] { opacity: .45; filter: grayscale(1); }
body.crt-off .scanlines { display: none; }
body.crt-off .glitch::before, body.crt-off .glitch::after { display: none; }

/* ---------- SC server status ---------- */
.sc-status { display: flex; align-items: center; gap: .5rem; margin-top: 1rem; font-family: var(--font-mono); font-size: .82rem; color: var(--ink-soft); }
.sc-status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-soft); box-shadow: 0 0 8px currentColor; flex: 0 0 auto; }
.sc-status-dot[data-state="loading"] { background: var(--amber); animation: pulse 1.2s ease-in-out infinite; }
.sc-status-dot[data-state="ok"] { background: var(--green); color: var(--green); }
.sc-status-dot[data-state="warn"] { background: var(--amber); color: var(--amber); }
.sc-status-dot[data-state="down"] { background: var(--neon-2); color: var(--neon-2); }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- Now Playing / cartridge ---------- */
.now-playing { margin-top: 2.5rem; max-width: 420px; }
.np-head { display: flex; align-items: center; gap: .6rem; font-family: var(--font-mono); font-size: .8rem; letter-spacing: 3px; color: var(--neon); margin-bottom: .9rem; }
.np-led { width: 9px; height: 9px; border-radius: 50%; background: var(--neon-2); box-shadow: 0 0 10px var(--neon-2); animation: pulse 1.4s infinite; }
.cartridge {
  position: relative; border-radius: 10px 10px 6px 6px; padding: 1.2rem 1.2rem 1.6rem;
  background: linear-gradient(160deg, var(--cart-a, #2a2350), var(--cart-b, #120c2c));
  border: 1px solid var(--panel-brd); box-shadow: inset 0 2px 0 rgba(255,255,255,.08), 0 10px 30px rgba(0,0,0,.4);
  overflow: hidden; transition: transform .15s ease;
}
.cartridge::before { content:""; position:absolute; top:0; left:18%; right:18%; height:14px; background:#060312; border-radius:0 0 6px 6px; }
.cartridge::after { content:""; position:absolute; left:1rem; right:1rem; bottom:.55rem; height:18px; background: repeating-linear-gradient(90deg,#060312 0 6px,transparent 6px 12px); opacity:.5; border-radius:3px; }
.cartridge.swap { transform: scale(.97) rotate(-.5deg); }
.cart-label { margin-top: 1.4rem; background: rgba(5,1,15,.55); border: 1px solid rgba(255,255,255,.12); border-radius: 6px; padding: .8rem 1rem; display: grid; gap: .25rem; backdrop-filter: blur(2px); }
.cart-console { font-family: var(--font-mono); font-size: .72rem; letter-spacing: 2px; color: var(--amber); }
.cart-title { font-size: 1.25rem; font-weight: 700; color: var(--ink); }
.cart-year { font-family: var(--font-mono); font-size: .78rem; color: var(--ink-soft); }
.btn-sm { padding: .5rem 1rem; font-size: .85rem; margin-top: 1rem; }

/* ---------- Blog / Devlog ---------- */
.blog-list { display: grid; gap: 1.2rem; }
.blog-post { background: var(--panel); border: 1px solid var(--panel-brd); border-radius: var(--radius); overflow: hidden; transition: .25s; }
.blog-post:hover { border-color: var(--neon); }
.blog-post-head { width: 100%; text-align: left; cursor: pointer; background: transparent; border: 0; color: var(--ink); padding: 1.2rem 1.4rem; display: flex; align-items: baseline; gap: 1rem; font-family: inherit; }
.blog-post-head:hover { color: var(--neon); }
.blog-date { font-family: var(--font-mono); font-size: .8rem; color: var(--neon-2); flex: 0 0 auto; }
.blog-post-title { font-size: 1.15rem; flex: 1; }
.blog-toggle { font-family: var(--font-mono); color: var(--neon); transition: transform .2s; }
.blog-post.open .blog-toggle { transform: rotate(90deg); }
.blog-body { max-height: 0; overflow: hidden; transition: max-height .35s ease, padding .35s ease; padding: 0 1.4rem; color: var(--ink-soft); }
.blog-post.open .blog-body { max-height: 600px; padding: 0 1.4rem 1.4rem; }
.blog-body p { margin-bottom: .8rem; }
.blog-tags { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .6rem; }
.blog-tags span { font-family: var(--font-mono); font-size: .72rem; color: var(--neon-3); border: 1px solid var(--panel-brd); border-radius: 20px; padding: .15rem .55rem; }

/* ---------- Discord presence ---------- */
.discord-presence { display: inline-flex; align-items: center; gap: .7rem; padding: .55rem .9rem; margin-bottom: 1.4rem; background: var(--panel); border: 1px solid var(--panel-brd); border-radius: 30px; transition: .2s; }
.discord-presence:hover { border-color: var(--neon-3); text-decoration: none; transform: translateY(-2px); }
.dc-avatar { width: 34px; height: 34px; border-radius: 50%; background: #5865f2 center/cover; flex: 0 0 auto; }
.dc-info { display: grid; text-align: left; line-height: 1.25; }
.dc-name { font-weight: 700; font-size: .9rem; color: var(--ink); }
.dc-status { display: flex; align-items: center; gap: .4rem; font-family: var(--font-mono); font-size: .76rem; color: var(--ink-soft); }
.dc-dot { width: 9px; height: 9px; border-radius: 50%; background: #747f8d; box-shadow: 0 0 7px currentColor; }
.dc-dot[data-state="online"] { background: #3ba55d; color: #3ba55d; }
.dc-dot[data-state="idle"] { background: #faa61a; color: #faa61a; }
.dc-dot[data-state="dnd"] { background: #ed4245; color: #ed4245; }
.dc-dot[data-state="offline"] { background: #747f8d; }

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .main-nav {
    position: fixed; inset: 56px 0 auto 0; flex-direction: column; gap: 0;
    background: rgba(5,1,15,.97); backdrop-filter: blur(14px);
    padding: 1rem 0; border-bottom: 1px solid var(--panel-brd);
    transform: translateY(-120%); transition: transform .3s ease; margin-left: 0;
  }
  .main-nav.open { transform: translateY(0); }
  .main-nav a { padding: .9rem 2rem; font-size: 1.05rem; }
  .nav-toggle { display: block; }
  .header-tools { margin-left: auto; }
  .about-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
