:root {
  --bg-color: #050505;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent: #818cf8;
  --accent-muted: #312e81;
  --border-color: #1e293b;
  --card-bg: #0f172a;
  --font-main: 'Space Grotesk', -apple-system, sans-serif;
  --noise: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

html.light-mode {
  --bg-color: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --accent: #4f46e5;
  --accent-muted: #e0e7ff;
  --border-color: #e2e8f0;
  --card-bg: #f1f5f9;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  min-height: 100vh;
  background-color: var(--bg-color);
  transition: background-color 0.3s ease;
}

body {
  font-family: var(--font-main);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  position: relative;
  transition: color 0.3s ease;
}

/* Noise texture overlay */
body.noise::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--noise);
  opacity: 0.04;
  pointer-events: none;
  z-index: 9999;
}

body.light-mode.noise::before {
  opacity: 0.02;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 80px 24px;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 80px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
}

.avatar.pulse-glow {
  box-shadow: 0 0 0 0 rgba(129, 140, 248, 0.4);
  animation: glow 3s infinite;
}

@keyframes glow {
  0% {
    box-shadow: 0 0 0 0 rgba(129, 140, 248, 0.4);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(129, 140, 248, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(129, 140, 248, 0);
  }
}

.name {
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 32px;
}

.header-right nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.header-right nav a:hover {
  color: var(--accent);
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.icon-btn:hover {
  color: var(--accent);
}

/* Intro Section */
.intro {
  margin-bottom: 60px;
}

.intro p {
  margin-bottom: 28px;
  color: var(--text-secondary);
  font-weight: 400;
  font-size: 17px;
}

.highlight-alt {
  color: var(--text-primary);
  font-weight: 500;
  border-bottom: 1.5px solid var(--accent-muted);
}

.link-inline-alt {
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1.5px solid var(--accent-muted);
  transition: all 0.2s ease;
}

.link-inline-alt:hover {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

/* Quick Links */
.quick-links {
  display: flex;
  gap: 20px;
  margin-bottom: 80px;
}

.nav-link-alt {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  padding-bottom: 2px;
}

.nav-link-alt::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1.5px;
  background-color: var(--accent);
  transition: width 0.3s ease;
}

.nav-link-alt:hover::after {
  width: 100%;
}

/* Featured Projects */
.section-title {
  font-size: 13px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 600;
  margin-bottom: 32px;
}

.featured-projects {
  margin-bottom: 80px;
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 40px;
}

.project-card-alt {
  display: flex;
  flex-direction: column;
}

.img-container-alt {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
}

.img-container-alt img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card-alt:hover .img-container-alt img {
  transform: scale(1.05);
}

.project-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.project-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.more-link-text {
  font-size: 15px;
  color: var(--text-secondary);
}

/* Project List Page */
.project-list-full {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.project-entry {
  border-left: 2px solid var(--accent-muted);
  padding-left: 24px;
  transition: border-left-color 0.3s ease;
}

.project-entry:hover {
  border-left-color: var(--accent);
}

.entry-title {
  font-size: 22px;
  margin-bottom: 4px;
}

.entry-stack {
  font-size: 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.entry-desc {
  margin-top: 12px;
  color: var(--text-secondary);
  max-width: 600px;
}

/* Arrow Link */
.more-options {
  margin-bottom: 80px;
}

.arrow-link-alt {
  color: var(--text-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  font-size: 16px;
}

.arrow-link-alt span {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.arrow-link-alt:hover span {
  transform: translateX(6px);
  color: var(--accent);
}

.theme-toggle .moon {
  display: none;
}

html.light-mode .theme-toggle .sun {
  display: none;
}

html.light-mode .theme-toggle .moon {
  display: block;
}

/* Footer Refined */
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 48px;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 13px;
  opacity: 0.8;
}

footer .footer-right {
  font-variant-numeric: tabular-nums;
}

/* Back Link for internal pages */
.back-link {
  text-decoration: none;
}

/* Responsive */
@media (max-width: 640px) {
  .project-grid {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 60px 20px;
  }

  footer {
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
  }

  .header-right nav {
    display: none;
  }
}