:root {
  --bg: #060913;
  --surface: rgba(13, 21, 38, 0.78);
  --surface-strong: rgba(16, 26, 46, 0.92);
  --border: rgba(148, 163, 184, 0.16);
  --cyan: #00f0ff;
  --gold: #ffb703;
  --pink: #ff2a85;
  --emerald: #34d399;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 18% 12%, rgba(0, 240, 255, 0.08), transparent 40%),
              radial-gradient(circle at 82% 18%, rgba(255, 42, 133, 0.07), transparent 42%),
              radial-gradient(circle at 50% 85%, rgba(255, 183, 3, 0.06), transparent 45%),
              var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Subtle LetsVibe-inspired syntax-highlighted code backdrop */
.code-backdrop {
  position: fixed;
  inset: 0 0 auto 0;
  height: 75vh;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  opacity: 0.13;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.65) 55%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.65) 55%, transparent 100%);
}

.code-backdrop pre {
  margin: 0;
  padding: 24px 36px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  color: #cbd5e1;
  white-space: pre-wrap;
}

.tok-kw { color: #c084fc; }
.tok-fn { color: #38bdf8; }
.tok-str { color: #34d399; }
.tok-num { color: #fbbf24; }
.tok-cm { color: #64748b; }

.container {
  position: relative;
  z-index: 1;
  max-width: 1160px;
  margin: 0 auto;
  padding: 24px 20px 72px;
}

/* Top Nav */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-radius: 16px;
  background: rgba(10, 17, 32, 0.72);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  margin-bottom: 36px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.3px;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--cyan);
  object-fit: cover;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  transition: color 0.18s ease;
}

.nav-links a:hover {
  color: var(--cyan);
}

/* Status Pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.status-pill:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 240, 255, 0.45);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
}

.status-pill.is-online {
  border-color: rgba(52, 211, 153, 0.42);
  color: #d1fae5;
}

.status-pill.is-online .status-dot {
  background: var(--emerald);
  box-shadow: 0 0 12px var(--emerald);
}

.status-pill.is-offline {
  border-color: rgba(148, 163, 184, 0.25);
  color: var(--muted);
}

.status-pill.is-offline .status-dot {
  background: #64748b;
  box-shadow: none;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.85fr;
  gap: 32px;
  align-items: center;
  padding: 36px 38px;
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(14, 23, 42, 0.88), rgba(10, 15, 29, 0.92));
  border: 1px solid rgba(0, 240, 255, 0.22);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  margin-bottom: 52px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--cyan);
  margin-bottom: 12px;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(2.1rem, 4.2vw, 3.3rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.hero h1 .accent-cyan {
  color: var(--cyan);
  text-shadow: 0 0 24px rgba(0, 240, 255, 0.35);
}

.hero h1 .accent-gold {
  color: var(--gold);
}

.hero-lead {
  color: #cbd5e1;
  font-size: 1.05rem;
  max-width: 58ch;
  margin: 0 0 24px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), #0ea5e9);
  color: #03101e;
  box-shadow: 0 10px 26px rgba(0, 240, 255, 0.28);
}

.btn-pink {
  background: linear-gradient(135deg, var(--pink), #fb7185);
  color: #fff;
  box-shadow: 0 10px 26px rgba(255, 42, 133, 0.25);
}

.btn-ghost {
  background: rgba(15, 23, 42, 0.72);
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: var(--cyan);
}

.hero-sprite-wrap {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 360px;
}

.hero-sprite-glow {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.24), rgba(255, 183, 3, 0.12) 55%, transparent 72%);
  filter: blur(18px);
  z-index: 0;
}

.hero-sprite {
  position: relative;
  z-index: 1;
  max-height: 410px;
  width: auto;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.55));
  user-select: none;
}

/* Section Headers */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.section-head h2 {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: -0.01em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 22px;
  margin-bottom: 56px;
}

.project-card {
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 240, 255, 0.42);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}

.card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #090f1f;
  overflow: hidden;
  cursor: zoom-in;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.project-card:hover .card-media img {
  transform: scale(1.03);
}

.grade-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 5px 10px;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(6, 9, 19, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
}

.grade-a { color: #34d399; border-color: rgba(52, 211, 153, 0.5); }
.grade-b-plus { color: #38bdf8; border-color: rgba(56, 189, 248, 0.5); }
.grade-b { color: #ffb703; border-color: rgba(255, 183, 3, 0.5); }
.grade-flagship { color: var(--cyan); border-color: rgba(0, 240, 255, 0.6); }

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px 20px 20px;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.card-title-row h3 {
  margin: 0;
  font-size: 1.14rem;
}

.card-desc {
  margin: 0 0 16px;
  color: #cbd5e1;
  font-size: 0.9rem;
  flex: 1;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 7px;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
}

.card-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.card-links a {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--cyan);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 9px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.24);
  transition: background 0.15s ease;
}

.card-links a:hover {
  background: rgba(0, 240, 255, 0.18);
}

.card-links a.link-gold {
  color: var(--gold);
  background: rgba(255, 183, 3, 0.09);
  border-color: rgba(255, 183, 3, 0.3);
}

/* Ko-fi Support Banner */
.kofi-card {
  border-radius: 22px;
  overflow: hidden;
  background: var(--surface-strong);
  border: 1px solid rgba(255, 42, 133, 0.3);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.4);
  padding: 20px;
  text-align: center;
}

.kofi-card a.banner-link {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 14px;
}

.kofi-card img {
  width: 100%;
  height: auto;
  display: block;
}

.kofi-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Footer */
footer {
  margin-top: 44px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(3, 6, 15, 0.9);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox.open {
  display: flex;
}

.lightbox-inner {
  max-width: min(1040px, 95vw);
  text-align: center;
}

.lightbox-inner img {
  max-width: 100%;
  max-height: 82vh;
  border-radius: 14px;
  border: 1px solid rgba(0, 240, 255, 0.35);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
}

.lightbox-caption {
  margin-top: 10px;
  color: #cbd5e1;
  font-size: 0.92rem;
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 26px 22px;
    text-align: center;
  }
  .hero-actions {
    justify-content: center;
  }
  .hero-lead {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-sprite-wrap {
    min-height: 280px;
  }
  .hero-sprite {
    max-height: 320px;
  }
}
