/* Budget Engineer — base styles */

:root {
  --bg: #0b0612;
  --bg-2: #110a1f;
  --surface: #170d2b;
  --surface-2: #1d1235;
  --border: #2a1a4a;
  --border-soft: #1f1437;
  --purple: #7c2dc7;
  --purple-deep: #4a1284;
  --purple-glow: #b466ff;
  --neon: #39ff14;
  --neon-soft: #6cff52;
  --neon-dim: #1a8d09;
  --text: #e8e6f0;
  --text-muted: #8a85a3;
  --text-dim: #5a557a;
  --danger: #ff4d6d;
  --amber: #ffb000;

  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --max: 1120px;
  --gutter: clamp(20px, 4vw, 48px);
  --section-pad: clamp(72px, 10vh, 128px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

/* ── Animated background canvas ── */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  display: block;
  z-index: 0;
  pointer-events: none;
  opacity: 0.75;
}

/* Scanline overlay (toggle via body class) */
body.scanlines::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.18) 3px,
    rgba(0, 0, 0, 0) 4px
  );
  mix-blend-mode: multiply;
}

/* Page wrapper */
.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* ── Top nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px var(--gutter);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  background: linear-gradient(180deg, rgba(11,6,18,0.85) 0%, rgba(11,6,18,0.55) 100%);
  border-bottom: 1px solid var(--border-soft);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.nav-brand img {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 0 8px rgba(57,255,20,0.4));
}
.nav-brand .b-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--neon);
  letter-spacing: 0;
}
.nav-brand .b-mark span { color: var(--purple-glow); }
.nav-links {
  display: flex;
  gap: 24px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}
.nav-links a {
  position: relative;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--neon); }
.nav-links a::before { content: '· '; opacity: 0.4; }
.nav-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}
.nav-status .dot {
  width: 8px; height: 8px;
  background: var(--neon);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--neon), 0 0 14px rgba(57,255,20,0.4);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* ── Container ── */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ── Section frame ── */
section.sect {
  padding: var(--section-pad) 0;
  position: relative;
}
.sect-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 36px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.sect-head .num {
  color: var(--neon);
  font-weight: 600;
}
.sect-head .line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border) 0%, transparent 100%);
}
.sect-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--text);
}
.sect-sub {
  font-family: var(--font-mono);
  color: var(--text-muted);
  max-width: 56ch;
  margin: 0 0 56px;
  font-size: 13px;
}

/* ── HERO ── */
.hero {
  padding: clamp(80px, 14vh, 160px) 0 clamp(80px, 12vh, 140px);
  position: relative;
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 32px;
  background: rgba(23, 13, 43, 0.5);
}
.hero-tag .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--neon);
  box-shadow: 0 0 6px var(--neon);
  animation: pulse 2s ease-in-out infinite;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(48px, 9vw, 112px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin: 0 0 24px;
}
.hero h1 .accent { color: var(--neon); }
.hero h1 .purple { color: var(--purple-glow); }
.hero h1 .crsr {
  display: inline-block;
  width: 0.22em;
  height: 0.75em;
  background: var(--neon);
  margin-left: 0.04em;
  vertical-align: -0.06em;
  animation: blink 1.05s steps(1) infinite;
  box-shadow: 0 0 12px var(--neon);
}
@keyframes blink {
  50% { opacity: 0; }
}
.hero-sub {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text-muted);
  max-width: 60ch;
  margin: 0 0 40px;
  line-height: 1.7;
}
.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(23, 13, 43, 0.6);
  color: var(--text);
  transition: all 0.18s ease;
  position: relative;
  overflow: hidden;
}
.btn:hover {
  border-color: var(--neon);
  color: var(--neon);
  box-shadow: 0 0 16px rgba(57,255,20,0.18), inset 0 0 16px rgba(57,255,20,0.06);
  transform: translateY(-1px);
}
.btn.primary {
  background: var(--neon);
  color: #07120a;
  border-color: var(--neon);
  font-weight: 600;
}
.btn.primary:hover {
  background: var(--neon-soft);
  color: #07120a;
  box-shadow: 0 0 24px rgba(57,255,20,0.45);
}
.btn .arrow {
  transition: transform 0.18s ease;
}
.btn:hover .arrow {
  transform: translateX(3px);
}

/* hero meta grid */
.hero-meta {
  margin-top: 64px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 24px;
  padding-top: 32px;
  border-top: 1px dashed var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
}
.hero-meta .lbl {
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  margin-bottom: 6px;
}
.hero-meta .val {
  color: var(--text);
}
.hero-meta .val .accent { color: var(--neon); }

/* ── NOW section (terminal) ── */
.terminal {
  background: linear-gradient(180deg, rgba(11,6,18,0.92) 0%, rgba(15,8,26,0.88) 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(57,255,20,0.04), 0 20px 60px rgba(0,0,0,0.4);
  position: relative;
}
.terminal::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(57,255,20,0.04) 0%, transparent 30%);
  pointer-events: none;
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(0,0,0,0.4);
  border-bottom: 1px solid var(--border-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.term-bar .lights { display: flex; gap: 6px; }
.term-bar .lights span {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--border);
}
.term-bar .path {
  margin-left: 8px;
  color: var(--text-dim);
}
.term-bar .path b { color: var(--neon); font-weight: 500; }
.term-body {
  padding: 24px 24px 28px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.85;
}
.term-line {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.term-line .prompt {
  color: var(--purple-glow);
  user-select: none;
  flex-shrink: 0;
}
.term-line .out {
  color: var(--text-muted);
}
.term-line .out b { color: var(--text); font-weight: 500; }
.term-line .out .ok { color: var(--neon); }
.term-line .out .warn { color: var(--amber); }
.term-line .out .err { color: var(--danger); }
.term-line.cmd .out { color: var(--text); }
.term-divider {
  height: 1px;
  background: var(--border-soft);
  margin: 14px 0;
}

/* ── PROJECTS grid ── */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}
.proj-card {
  position: relative;
  padding: 24px;
  background: linear-gradient(180deg, rgba(23,13,43,0.6) 0%, rgba(15,8,26,0.7) 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 220px;
  transition: all 0.2s ease;
  overflow: hidden;
  cursor: pointer;
}
.proj-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at var(--mx, 50%) var(--my, 0%),
                    rgba(57,255,20,0.08) 0%,
                    transparent 50%);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.proj-card:hover {
  border-color: rgba(57,255,20,0.4);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(57,255,20,0.1);
}
.proj-card:hover::before { opacity: 1; }
.proj-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.proj-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text);
}
.proj-id {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  margin-bottom: 4px;
  text-transform: uppercase;
}
.proj-status {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 4px;
  background: rgba(57,255,20,0.08);
  color: var(--neon);
  border: 1px solid rgba(57,255,20,0.25);
  white-space: nowrap;
}
.proj-status.wip {
  background: rgba(255,176,0,0.08);
  color: var(--amber);
  border-color: rgba(255,176,0,0.25);
}
.proj-status.idea {
  background: rgba(180,102,255,0.08);
  color: var(--purple-glow);
  border-color: rgba(180,102,255,0.25);
}
.proj-status.dead {
  background: rgba(138,133,163,0.08);
  color: var(--text-muted);
  border-color: var(--border);
}
.proj-status .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 5px currentColor;
}
.proj-desc {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.65;
  flex: 1;
}
.proj-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 3px;
  background: rgba(124,45,199,0.12);
  border: 1px solid rgba(124,45,199,0.3);
  color: var(--purple-glow);
  letter-spacing: 0.03em;
}
.proj-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  padding-top: 12px;
  border-top: 1px dashed var(--border-soft);
}
.proj-foot .arrow {
  color: var(--neon);
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.2s ease;
}
.proj-card:hover .proj-foot .arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ── Live demos ── */
.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.demo-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(15,8,26,0.5);
  transition: all 0.2s ease;
}
.demo-card:hover {
  border-color: var(--neon);
  background: rgba(23,13,43,0.7);
  box-shadow: 0 0 0 1px rgba(57,255,20,0.15);
}
.demo-preview {
  aspect-ratio: 16 / 9;
  background:
    repeating-linear-gradient(135deg,
      rgba(124,45,199,0.08) 0px,
      rgba(124,45,199,0.08) 6px,
      transparent 6px,
      transparent 12px),
    linear-gradient(135deg, rgba(15,8,26,0.6), rgba(11,6,18,0.6));
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}
.demo-preview .ico {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 36px;
  color: var(--neon);
  opacity: 0.6;
  text-shadow: 0 0 14px rgba(57,255,20,0.5);
}
.demo-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.demo-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}
.demo-link {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--neon);
}
.demo-card:hover .demo-link { text-decoration: underline; }
.demo-desc {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

/* ── Bluesky feed ── */
.feed-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 760px) { .feed-wrap { grid-template-columns: 1fr; } }
.post {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(15,8,26,0.5);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.18s ease;
}
.post:hover {
  border-color: rgba(57,255,20,0.4);
  background: rgba(23,13,43,0.65);
}
.post-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
}
.post-av {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-deep), var(--neon-dim));
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  color: var(--neon);
  letter-spacing: 0;
}
.post-handle b { color: var(--text); font-weight: 500; }
.post-handle span { color: var(--text-dim); }
.post-time { margin-left: auto; color: var(--text-dim); font-size: 10px; }
.post-body {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  margin: 0;
  white-space: pre-wrap;
}
.post-body .tag { display: inline; padding: 0; background: none; border: 0; color: var(--neon); }
.post-stats {
  display: flex;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}
.post-stats span { display: inline-flex; gap: 5px; align-items: center; }

/* ── About ── */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; } }
.about-prose p {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  margin: 0 0 18px;
}
.about-prose p:last-child { color: var(--text-muted); }
.stats {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 0;
  background: rgba(15,8,26,0.4);
}
.stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  border-bottom: 1px dashed var(--border-soft);
}
.stat:last-child { border-bottom: 0; }
.stat .k { color: var(--text-muted); }
.stat .v { color: var(--text); }
.stat .v.ok { color: var(--neon); }

/* ── Contact ── */
.contact {
  text-align: center;
  padding: clamp(80px, 12vh, 140px) var(--gutter);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(124,45,199,0.10) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(57,255,20,0.06) 0%, transparent 50%);
}
.contact h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 6vw, 72px);
  letter-spacing: -0.03em;
  margin: 0 0 16px;
}
.contact h2 .accent { color: var(--neon); }
.contact p {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 14px;
  max-width: 52ch;
  margin: 0 auto 32px;
}
.contact-channels {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.chan {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 22px;
  min-width: 180px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(15,8,26,0.6);
  text-align: left;
  transition: all 0.2s ease;
}
.chan:hover {
  border-color: var(--neon);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4), 0 0 0 1px rgba(57,255,20,0.15);
}
.chan .lbl {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}
.chan .val {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
}
.chan:hover .val { color: var(--neon); }

/* ── Footer ── */
.foot {
  padding: 28px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  gap: 16px;
  flex-wrap: wrap;
}
.foot .mono-blink::after {
  content: '_';
  color: var(--neon);
  animation: blink 1s steps(1) infinite;
}

/* ── Glitch hover (toggleable) ── */
body.glitch-on .glitchable {
  position: relative;
  transition: text-shadow 0.1s;
}
body.glitch-on .glitchable:hover {
  text-shadow:
    1px 0 0 rgba(255,77,109,0.7),
    -1px 0 0 rgba(57,255,20,0.7);
  animation: glitch-shake 0.22s steps(2) 1;
}
@keyframes glitch-shake {
  0% { transform: translate(0); }
  20% { transform: translate(-1px, 1px); }
  40% { transform: translate(1px, -1px); }
  60% { transform: translate(-1px, 0); }
  80% { transform: translate(1px, 1px); }
  100% { transform: translate(0); }
}

/* Selection */
::selection {
  background: var(--neon);
  color: #07120a;
}

/* compact density */
body.density-compact {
  --section-pad: clamp(48px, 7vh, 88px);
}
body.density-compact .sect-sub { margin-bottom: 36px; }

/* Konami toast */
.konami {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  padding: 24px 36px;
  background: var(--bg);
  border: 1px solid var(--neon);
  box-shadow: 0 0 40px rgba(57,255,20,0.5), inset 0 0 24px rgba(57,255,20,0.1);
  font-family: var(--font-mono);
  color: var(--neon);
  font-size: 14px;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}
.konami.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.konami .title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 6px;
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .nav-status {
    display: none;
  }
  .nav {
    padding: 12px 16px;
  }
  .nav-brand .b-mark {
    font-size: 15px;
  }
}
