:root {
  --bg: #0b1020;
  --surface: #121a30;
  --surface-2: #1a2440;
  --text: #eaf0ff;
  --muted: #b8c4e6;
  --accent: #7c9cff;
  --accent-2: #49d1c6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(180deg, #070b18 0%, var(--bg) 50%, #070b18 100%);
  color: var(--text);
  line-height: 1.6;
}

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(8, 12, 24, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(124, 156, 255, 0.2);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0;
}

.brand {
  font-weight: 800;
  color: var(--accent-2);
  text-decoration: none;
  letter-spacing: 0.3px;
}

.nav ul {
  list-style: none;
  display: flex;
  gap: 1.1rem;
  margin: 0;
  padding: 0;
}

.nav a {
  color: var(--text);
  text-decoration: none;
}

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

.hero {
  padding: 2rem 0 0.5rem;
}

.hero-banner {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35);
}

.hero-content {
  margin-top: 1.4rem;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.8rem;
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.hero-content p {
  color: var(--muted);
  max-width: 80ch;
}

.hero-shot {
  margin: 1.5rem 0 0;
  background: #ffffff;
  border: 1px solid rgba(124, 156, 255, 0.18);
  border-radius: 14px;
  padding: 0.8rem;
}

.hero-shot img {
  width: 100%;
  border-radius: 10px;
  display: block;
}

.hero-shot figcaption {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

.features,
.gallery,
.github {
  padding: 2rem 0;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid rgba(124, 156, 255, 0.2);
  border-radius: 14px;
  padding: 1rem;
}

.card p {
  color: var(--muted);
  margin: 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.gallery-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #0f162a;
}

.gallery-intro {
  color: var(--muted);
  margin-top: 0;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.compare-card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid rgba(124, 156, 255, 0.2);
  border-radius: 14px;
  padding: 1rem;
}

.compare-card h3 {
  margin-bottom: 0.7rem;
}

.compare-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.compare-images figure {
  margin: 0;
}

.compare-images figcaption {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.thumb-btn {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 0;
  width: 100%;
  background: #0f162a;
  cursor: zoom-in;
  overflow: hidden;
}

.thumb-btn.output {
  border-color: rgba(73, 209, 198, 0.75);
  box-shadow: 0 0 0 2px rgba(73, 209, 198, 0.15);
}

.thumb-btn img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(2, 4, 10, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 1rem;
  z-index: 99;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: min(1200px, 95vw);
  max-height: 82vh;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: #000;
}

.lightbox.output-mode img {
  width: min(95vw, 1400px);
  max-width: none;
  max-height: 90vh;
  object-fit: contain;
  image-rendering: pixelated;
}

.lightbox p {
  color: #dce6ff;
  margin: 0.7rem 0 0;
}

.lightbox-close {
  position: absolute;
  top: 14px;
  right: 18px;
  border: 0;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.github-card {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid rgba(124, 156, 255, 0.2);
  border-radius: 14px;
  padding: 1rem;
}

.github-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 10px;
  background: #0f162a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.45rem;
  flex-shrink: 0;
}

.github-card p {
  margin: 0 0 0.6rem;
  color: var(--muted);
}

.github-link {
  display: inline-block;
  text-decoration: none;
  color: #061127;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  padding: 0.55rem 0.9rem;
  border-radius: 9px;
  font-weight: 700;
}

.github-link:hover {
  filter: brightness(1.07);
}

.facebook-footer {
  margin-top: 1.5rem;
  padding: 1.2rem 0 2rem;
  border-top: 1px solid rgba(124, 156, 255, 0.2);
  background: rgba(8, 12, 24, 0.6);
}

.facebook-card {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid rgba(124, 156, 255, 0.2);
  border-radius: 14px;
  padding: 1rem;
}

.facebook-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.4rem;
  flex-shrink: 0;
}

.facebook-card p {
  margin: 0 0 0.6rem;
  color: var(--muted);
}

.facebook-link {
  display: inline-block;
  text-decoration: none;
  color: white;
  background: #1877f2;
  padding: 0.55rem 0.9rem;
  border-radius: 9px;
  font-weight: 700;
}

.facebook-link:hover {
  filter: brightness(1.08);
}

@media (max-width: 900px) {
  .feature-grid,
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compare-grid {
    grid-template-columns: 1fr;
  }

  .compare-images {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .nav {
    flex-direction: column;
    gap: 0.5rem;
  }

  .feature-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .github-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .facebook-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==============================
   Home SoManyBits (index.html)
   ============================== */

.home-hero {
  padding: 2rem 0 1rem;
}

.home-intro {
  margin-top: 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid rgba(124, 156, 255, 0.2);
  border-radius: 14px;
  padding: 1rem;
}

.home-logo {
  width: 100px;
  height: 100px;
  object-fit: contain;
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.45rem;
  flex-shrink: 0;
}

.home-intro p {
  margin: 0;
  color: var(--muted);
}

.home-projects,
.about-card {
  padding: 1rem 0 2rem;
}

.project-list {
  display: grid;
  gap: 0.9rem;
}

.project-card {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid rgba(124, 156, 255, 0.2);
  border-radius: 14px;
  padding: 1rem;
}

.project-card img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  background: #fff;
  border-radius: 10px;
  padding: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.project-card p,
.about-card p {
  color: var(--muted);
}

.project-link {
  display: inline-block;
  text-decoration: none;
  color: #061127;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  padding: 0.5rem 0.85rem;
  border-radius: 9px;
  font-weight: 700;
}

.about-card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid rgba(124, 156, 255, 0.2);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.about-portrait {
  width: 100%;
  max-width: 180px;
  border-radius: 12px;
  border: none;
  background: transparent;
  margin: 0;
}

.about-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1rem;
  align-items: start;
}

.portrait-btn {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: zoom-in;
  width: 100%;
  max-width: 180px;
}

.about-signature {
  font-weight: 700;
  color: var(--accent-2);
  margin-top: 0.8rem;
}

.home-footer {
  border-top: 1px solid rgba(124, 156, 255, 0.2);
  background: rgba(8, 12, 24, 0.6);
  padding: 1rem 0 1.4rem;
}

.home-footer-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.home-footer-links a {
  text-decoration: none;
  color: var(--accent-2);
}

.home-footer-links a:hover {
  color: var(--accent);
}

@media (max-width: 700px) {
  .home-intro,
  .project-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .about-layout {
    grid-template-columns: 1fr;
  }
}