:root {
  --bg-main: #0d1117;
  --bg-card: #161b22;
  --text-main: #c9d1d9;
  --text-muted: #8b949e;
  --accent: #00599c;
  --accent-glow: rgba(0, 89, 156, 0.4);
  --border: #30363d;
  --nav-height: 70px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 15% 30%, rgba(0, 89, 156, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 85% 70%, rgba(0, 89, 156, 0.03) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.6;
}

/* Typography */
h1 {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(1.2rem, 3vw, 2rem);
  line-height: 1.4;
  margin-bottom: 1rem;
  color: #fff;
}

h2.section-title {
  font-family: 'Fira Code', Consolas, monospace;
  font-size: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

p {
  color: var(--text-muted);
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
  display: flex;
  align-items: center;
}

.nav-container {
  width: min(1120px, 92%);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: 'Fira Code', monospace;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

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

/* Buttons */
.gh-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #21262d;
  color: var(--text-main);
  font-family: 'Fira Code', Consolas, monospace;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.gh-button[hidden] {
  display: none !important;
}

.gh-button:hover {
  background: #30363d;
  border-color: #8b949e;
}

.gh-button.primary-btn {
  background: linear-gradient(135deg, #00599c, #003666);
  color: #ffffff;
  border: 1px solid transparent;
}

.gh-button.primary-btn:hover {
  background: linear-gradient(135deg, #006bba, #004680);
  box-shadow: 0 4px 15px rgba(0, 89, 156, 0.4);
  border-color: transparent;
  transform: translateY(-2px);
}

.lang-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Fira Code', monospace;
  font-weight: bold;
  transition: background 0.2s, color 0.2s;
}

.lang-toggle:hover {
  background: var(--border);
}

/* Layout */
.container {
  width: min(1120px, 92%);
  margin: 4rem auto;
  display: flex;
  flex-direction: column;
  gap: 5rem;
}

/* Hero Section */
.hero-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 768px) {
  .hero-section {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

.badge {
  display: inline-block;
  background: rgba(88, 166, 255, 0.1);
  color: var(--accent);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  border: 1px solid rgba(88, 166, 255, 0.2);
  font-family: 'Fira Code', monospace;
  font-size: 0.8rem;
  margin-bottom: 1.5rem;
}

.hero-bio {
  font-size: 1.05rem;
  margin-bottom: 2rem;
  max-width: 600px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-visual {
  display: flex;
  justify-content: center;
}

.profile-frame {
  position: relative;
  width: min(280px, 100%);
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 8px;
  background: rgba(22, 27, 34, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 4px solid rgba(0, 89, 156, 0.8);
  box-shadow: 0 0 40px rgba(0, 89, 156, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
}

.profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  background: var(--bg-main); /* Fallback */
}

/* Gallery Section */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.gallery-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 89, 156, 0.5);
  box-shadow: 0 8px 30px rgba(0, 89, 156, 0.2);
}

.image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
}

.image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover .image-wrapper img:not(.pixel-art) {
  transform: scale(1.05);
}

.pixel-art {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.item-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 17, 23, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.item-overlay span {
  background: var(--bg-main);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  transform: translateY(10px);
  transition: transform 0.3s ease;
  border: 1px solid var(--border);
}

.gallery-item:hover .item-overlay {
  opacity: 1;
}

.gallery-item:hover .item-overlay span {
  transform: translateY(0);
}

/* Archive Section */
.archive-desc {
  margin-top: -1rem;
  margin-bottom: 2rem;
}

.archive-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.archive-item .image-wrapper img {
  transition: transform 0.5s ease;
}

/* Modal Lightbox */
.modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal[hidden] {
  display: none !important;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 4, 9, 0.85);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.modal-content-wrapper {
  position: relative;
  z-index: 1000;
  width: 100%;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.close-modal {
  position: absolute;
  top: -2.5rem;
  right: 0;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 2rem;
  cursor: pointer;
  transition: color 0.2s;
}

.close-modal:hover {
  color: #fff;
}

.modal-content {
  background: transparent;
  border: none;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: none;
}

#modal-image {
  max-width: 100%;
  max-height: calc(90vh - 120px); /* Leave room for buttons and padding */
  object-fit: contain;
  border-radius: 6px;
}

.modal-actions {
  margin-top: 1rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  width: 100%;
}
