/* === DESIGN TOKENS === */
:root {
  --bg: #080808;
  --bg-2: #0d0d0d;
  --bg-card: #111111;
  --bg-card-hover: #161616;
  --border: #1a1a1a;
  --border-bright: #262626;
  --accent: #00ff88;
  --red: #ff4757;
  --yellow: #ffd93d;
  --accent-glow: rgba(0, 255, 136, 0.2);
  --accent-dim: rgba(0, 255, 136, 0.08);
  --accent2: #00ccff;
  --text: #c8c8c8;
  --text-dim: #444;
  --text-muted: #777;
  --text-bright: #f0f0f0;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-sans: 'Inter', system-ui, sans-serif;
  --radius: 8px;
  --radius-sm: 4px;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { font-weight: 800; color: var(--text-bright); line-height: 1.1; }

/* === NOISE OVERLAY === */
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* === LAYOUT === */
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }

/* === NAV === */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  background: rgba(8, 8, 8, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  width: 100%; max-width: 1200px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
}
.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 700;
}
.nav-links { display: flex; gap: 2rem; }
.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }

/* === HERO === */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px 2rem 4rem;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  top: 40%; left: 30%;
  width: 500px; height: 400px;
  background: radial-gradient(ellipse, rgba(0,255,136,0.04) 0%, transparent 70%);
  pointer-events: none;
  transform: translate(-50%, -50%);
}
.hero-inner {
  max-width: 1200px; margin: 0 auto; width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.terminal-line {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}
.terminal-line .prompt { color: var(--text-muted); }
.terminal-line .accent { color: var(--accent); }
.terminal-line .cmd { color: var(--text); }
.hero-title {
  font-size: clamp(2.5rem, 5.5vw, 4.5rem);
  letter-spacing: -2px;
  margin-bottom: 1.5rem;
}
.hero-sub {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  height: 1.7em;
  display: flex;
  align-items: center;
  gap: 2px;
}
.cursor {
  animation: blink 1s step-end infinite;
  color: var(--accent);
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* === BUTTONS === */
.btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.75rem;
  background: var(--accent);
  color: #000;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  transition: all 0.2s;
  cursor: pointer;
}
.btn-primary:hover {
  background: transparent;
  color: var(--accent);
  box-shadow: 0 0 24px var(--accent-glow);
}
.btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.75rem;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  cursor: pointer;
}
.btn-ghost:hover { color: var(--text-bright); border-color: var(--text-muted); }

/* === CODE WINDOW === */
.code-window {
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0,255,136,0.04), 0 20px 60px rgba(0,0,0,0.6);
}
.window-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 16px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }
.window-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-left: 8px;
}
.code-content {
  padding: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.9;
}
.kw { color: #c792ea; }
.var { color: var(--accent); }
.key { color: var(--accent2); }
.str { color: #c3e88d; }
.bool { color: #ff9d00; }
.num { color: #f78c6c; }

/* === SCROLL HINT === */
.scroll-hint {
  position: absolute;
  bottom: 2rem; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 3px;
  text-transform: uppercase;
  animation: fadeInUp 1s 1.5s both;
}
.scroll-line {
  width: 1px; height: 40px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

/* === ABOUT === */
.about { padding: 6rem 0; }
.section-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
  letter-spacing: 2px;
}
.section-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  letter-spacing: -1px;
  margin-bottom: 2.5rem;
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}
.about-text p {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 1.25rem;
}
.stack-list { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.tag {
  display: inline-block;
  padding: 0.4rem 1rem;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: all 0.2s;
  cursor: default;
}
.tag:hover { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }

/* === HOMELAB === */
.homelab { padding: 6rem 0; background: var(--bg-2); }
.homelab-intro {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 3rem;
  max-width: 600px;
  line-height: 1.8;
}
.server-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.server-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.server-card:hover {
  border-color: var(--border-bright);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}
.server-card-header {
  padding: 0.9rem 1.1rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.server-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.server-status-dot.active {
  background: var(--accent);
  box-shadow: 0 0 6px rgba(0,255,136,0.5);
  animation: pulse-status 2s ease-in-out infinite;
}
.server-status-dot.offline { background: var(--border-bright); }
.server-hostname {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-bright);
  flex: 1;
}
.server-badge {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  padding: 0.15rem 0.5rem;
  background: rgba(0,204,255,0.08);
  border: 1px solid rgba(0,204,255,0.25);
  color: var(--accent2);
  border-radius: 3px;
  white-space: nowrap;
}
.server-specs {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border);
}
.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.3rem 0;
  font-family: var(--font-mono);
  font-size: 0.73rem;
}
.spec-row span { color: var(--text-dim); flex-shrink: 0; }
.spec-row b { color: var(--text); font-weight: 400; text-align: right; }
.server-services {
  padding: 0.75rem 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.service-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0.2rem 0.55rem;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 3px;
}

@keyframes pulse-status {
  0%, 100% { box-shadow: 0 0 6px rgba(0,255,136,0.5); }
  50% { box-shadow: 0 0 14px rgba(0,255,136,0.8); }
}

/* === DEMOS === */
.demos { padding: 6rem 0; }
.section-sub {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-top: -1.5rem;
  margin-bottom: 3rem;
}
.demo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.demo-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  transition: all 0.3s;
  position: relative;
}
.demo-card::before {
  content: attr(data-index);
  position: absolute;
  top: 1rem; right: 1rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  z-index: 1;
}
.demo-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 30px var(--accent-glow), 0 8px 40px rgba(0,0,0,0.5);
  transform: translateY(-4px);
}
.demo-card-preview {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

/* Components preview */
.components-preview { flex-direction: column; align-items: flex-start; padding: 1.5rem 2rem; gap: 0.75rem; }
.prev-btn {
  padding: 0.35rem 0.9rem;
  background: var(--accent); color: #000;
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 700;
  border-radius: 4px;
}
.toggle-track {
  width: 44px; height: 24px; border-radius: 12px;
  background: var(--border-bright);
  display: flex; align-items: center; padding: 2px;
}
.toggle-track.on { background: var(--accent); }
.toggle-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: white; margin-left: auto;
}
.prev-badge {
  padding: 0.2rem 0.65rem;
  background: rgba(0,204,255,0.1);
  border: 1px solid var(--accent2);
  color: var(--accent2);
  font-family: var(--font-mono); font-size: 0.7rem;
  border-radius: 99px;
}

/* Tools preview */
.tools-preview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  padding: 1.5rem;
}
.color-swatch { width: 36px; height: 36px; border-radius: 6px; }
.prev-code {
  grid-column: 1 / -1;
  font-family: var(--font-mono); font-size: 0.68rem;
  color: var(--text-dim); text-align: center;
  padding-top: 0.25rem;
}

/* API preview */
.api-preview { flex-direction: row; gap: 1.5rem; }
.api-icon {
  width: 56px; height: 56px; border-radius: 50%;
  border: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 800; color: var(--accent);
  font-family: var(--font-mono); flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}
.api-lines { display: flex; flex-direction: column; gap: 8px; flex: 1; justify-content: center; }
.api-line {
  height: 8px; background: var(--border-bright); border-radius: 4px;
  animation: shimmer 1.5s ease-in-out infinite;
}
.api-line.short { width: 55%; }

/* Snake preview */
.snake-preview { background: #000; }

/* Demo card info */
.demo-card-info { padding: 1.5rem; padding-right: 2.5rem; flex: 1; }
.demo-card-info h3 { font-size: 1.05rem; margin-bottom: 0.5rem; }
.demo-card-info p { font-size: 0.875rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 1rem; }
.demo-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.demo-tags span {
  font-family: var(--font-mono); font-size: 0.68rem;
  padding: 0.2rem 0.55rem;
  background: var(--accent-dim); color: var(--accent);
  border-radius: var(--radius-sm);
}
.demo-card-arrow {
  position: absolute; bottom: 1.5rem; right: 1.5rem;
  color: var(--text-dim); font-size: 1.1rem;
  transition: all 0.3s;
}
.demo-card:hover .demo-card-arrow { color: var(--accent); transform: translateX(4px); }

/* === CONTACT === */
.contact { padding: 6rem 0; }
.contact-terminal {
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 580px;
}
.terminal-body { padding: 1.5rem; }
.terminal-out {
  font-family: var(--font-mono); font-size: 0.875rem;
  color: var(--text-muted); margin-bottom: 1rem;
}
.terminal-json {
  font-family: var(--font-mono); font-size: 0.875rem;
  line-height: 2; padding: 1rem;
  background: var(--bg); border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.terminal-json .key { color: var(--accent2); }
.terminal-json .str { color: #c3e88d; }
.terminal-json a { color: #c3e88d; }
.terminal-json a:hover { text-decoration: underline; }

/* === FOOTER === */
.footer { padding: 2rem 0; border-top: 1px solid var(--border); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; }
.footer-logo { font-family: var(--font-mono); font-size: 1rem; color: var(--accent); }
.footer-link { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); transition: color 0.2s; }
.footer-link:hover { color: var(--accent); }
.footer-copy { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-dim); }

/* === GLITCH EFFECT === */
.glitch { position: relative; display: inline-block; }
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}
.glitch::before {
  color: #00ffcc;
  animation: glitch1 4s infinite;
  clip-path: polygon(0 25%, 100% 25%, 100% 45%, 0 45%);
  transform: translate(-3px);
}
.glitch::after {
  color: #ff006e;
  animation: glitch2 4s infinite;
  clip-path: polygon(0 60%, 100% 60%, 100% 80%, 0 80%);
  transform: translate(3px);
}

/* === ANIMATIONS === */
@keyframes blink { 50% { opacity: 0; } }

@keyframes glitch1 {
  0%, 88%, 100% { transform: translate(-3px); opacity: 0; }
  90% { transform: translate(-3px, -2px) skewX(6deg); opacity: 1; }
  92% { transform: translate(2px, 1px) skewX(-4deg); opacity: 1; }
  94% { transform: translate(-3px); opacity: 0; }
}
@keyframes glitch2 {
  0%, 91%, 100% { transform: translate(3px); opacity: 0; }
  93% { transform: translate(3px, 2px) skewX(-6deg); opacity: 1; }
  95% { transform: translate(-2px, -1px) skewX(4deg); opacity: 1; }
  97% { transform: translate(3px); opacity: 0; }
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(0.5); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 15px var(--accent-glow); }
  50% { box-shadow: 0 0 35px rgba(0,255,136,0.4); }
}
@keyframes shimmer {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.55; }
}

/* === RESPONSIVE === */
/* Terminal preview */
.terminal-preview {
  flex-direction: column; align-items: flex-start;
  padding: 1rem 1.25rem; gap: 0.3rem; background: #000;
  font-family: 'JetBrains Mono', monospace; font-size: 0.7rem;
}
.term-line { display: flex; gap: 0.3rem; align-items: center; white-space: nowrap; }
.term-prompt { color: #888; }
.term-accent { color: var(--accent); }
.term-cmd { color: var(--text); }
.term-out { color: var(--accent2); padding-left: 0.5rem; }
.term-cursor { color: var(--accent); animation: blink 1s step-end infinite; }

/* Algorithm preview */
.algo-preview { background: #000; padding: 1rem 1.5rem; align-items: flex-end; }
.algo-bars { display: flex; gap: 4px; align-items: flex-end; height: 90px; }
.algo-bar {
  flex: 1; background: rgba(0,255,136,0.3); border-radius: 2px 2px 0 0;
  transition: height 0.3s ease;
}
.algo-bar.active { background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
.algo-bar.comparing { background: #00ccff; }

/* SEO preview */
.seo-preview { flex-direction: row; gap: 1.25rem; align-items: center; }
.seo-score-ring { position: relative; flex-shrink: 0; }
.seo-ring-val {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.95rem; font-weight: 700;
  color: var(--accent);
}
.seo-checks { display: flex; flex-direction: column; gap: 0.3rem; }
.seo-check { font-family: var(--font-mono); font-size: 0.68rem; }
.seo-check.ok { color: var(--accent); }
.seo-check.warn { color: var(--yellow); }
.seo-check.err { color: var(--red); }

/* Dashboard preview */
.dashboard-preview { flex-direction: row; gap: 1.25rem; align-items: center; padding: 1rem 1.5rem; }
.dash-gauges { display: flex; gap: 0.75rem; }
.dash-gauge { display: flex; flex-direction: column; align-items: center; gap: 2px; position: relative; }
.dash-gauge svg { display: block; }
.dash-gauge-val {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -55%);
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 700; color: var(--accent);
}
.dash-gauge-lbl { font-family: var(--font-mono); font-size: 0.58rem; color: var(--text-dim); margin-top: -4px; }
.dash-services { display: flex; flex-direction: column; gap: 0.4rem; }
.dash-svc { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.4rem; }
.dash-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dash-dot.on { background: var(--accent); box-shadow: 0 0 4px var(--accent-glow); }
.dash-dot.off { background: var(--text-dim); }

/* Homelab demo card preview */
.homelab-demo-preview { flex-direction: row; gap: 1.75rem; align-items: center; padding: 1.25rem 1.75rem; }
.hl-topo-mini { display: flex; flex-direction: column; align-items: center; gap: 2px; flex-shrink: 0; }
.hl-node-mini {
  padding: 0.22rem 0.7rem;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  border: 1px solid #222;
  color: var(--text-dim);
  white-space: nowrap;
}
.hl-node-mini.caddy  { border-color: rgba(0,204,255,0.4); color: var(--accent2); }
.hl-node-mini.server { border-color: rgba(0,255,136,0.4); color: var(--accent); }
.hl-conn-mini {
  width: 1px; height: 14px;
  background: linear-gradient(to bottom, #333, var(--accent));
}
.hl-svc-list { display: flex; flex-direction: column; gap: 0.38rem; }
.hl-svc-item {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  display: flex; align-items: center; gap: 0.4rem;
}
.hl-svc-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }

@media (max-width: 1100px) {
  .demo-grid { grid-template-columns: repeat(2, 1fr); }
  .server-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-code { display: none; }
  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .demo-grid { grid-template-columns: 1fr; }
  .server-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; gap: 0.5rem; text-align: center; }
}
