/* Variables */
:root {
  --primary-color: #00ff00;
  --secondary-color: #03A062;
  --accent-color: #B2FF59;
  --text-color: #e0e0e0;
  --text-muted: #a0a0a0;
  --bg-color: #0d0d0d;
  --overlay-color: rgba(10, 10, 10, 0.85);
  --glass-border: 1px solid rgba(0, 255, 0, 0.15);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --font-heading: 'Orbitron', monospace;
  --font-body: 'Open Sans', sans-serif;
  --spacing-unit: 1.5rem;
  --transition-speed: 0.3s;
  --header-height: 80px;
  --footer-height: 120px;
  --card-surface: rgba(0, 0, 0, 0.6);
  --border-soft: rgba(0, 255, 0, 0.1);
  --nav-bg: rgba(5, 5, 5, 0.9);
  --footer-bg: rgba(5, 5, 5, 0.95);
  --matrix-char: #00ff8a;
  --matrix-char-hover: #B2FF59;
  --matrix-fade: rgba(0, 0, 0, 0.16);
  --matrix-shadow: rgba(0, 255, 138, 0.35);
  --glow-hero: 0 0 15px rgba(0, 255, 0, 0.6);
  --glow-title: 0 0 10px rgba(0, 255, 0, 0.3);
}

[data-theme="light"] {
  --primary-color: #0f7a3b;
  --secondary-color: #0f9d58;
  --accent-color: #0c6f34;
  --text-color: #0c0c0c;
  --text-muted: #4a4a4a;
  --bg-color: #8a8e95;
  /* closer to reference gray */
  --overlay-color: rgba(235, 237, 240, 0.78);
  --glass-border: 1px solid rgba(15, 122, 59, 0.2);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.08);
  --card-surface: rgba(255, 255, 255, 0.82);
  --border-soft: rgba(15, 122, 59, 0.15);
  --nav-bg: rgba(255, 255, 255, 0.9);
  --footer-bg: rgba(255, 255, 255, 0.9);
  --matrix-char: rgba(200, 200, 200, 0.75);
  --matrix-char-hover: #ffffff;
  --matrix-fade: rgba(138, 142, 149, 0.22);
  --matrix-shadow: rgba(255, 255, 255, 0.7);
  --glow-hero: 0 0 12px rgba(120, 120, 120, 0.35);
  --glow-title: 0 0 8px rgba(120, 120, 120, 0.3);
}

/* General Styling */
body {
  font-family: var(--font-heading);
  margin: 0;
  padding: 0;
  line-height: 1.8;
  color: var(--text-color);
  background-color: var(--bg-color);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  box-sizing: border-box;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

p {
  font-family: var(--font-body);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: all var(--transition-speed) ease;
  position: relative;
}

a:hover {
  color: var(--accent-color);
  text-shadow: 0 0 8px var(--primary-color);
}

/* Layout */
.main-content {
  position: relative;
  z-index: 2;
  flex: 1 0 auto;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(var(--header-height) + var(--spacing-unit)) var(--spacing-unit) calc(var(--footer-height) + var(--spacing-unit));
  box-sizing: border-box;
}

.container {
  max-width: 1000px;
  margin: 4rem auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.content-column {
  background-color: var(--card-surface);
  padding: 2rem;
  border-radius: 16px;
  text-align: center;
  width: 100%;
  backdrop-filter: blur(5px);
  /* Reduced blur */
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid var(--border-soft);
  box-shadow: var(--glass-shadow);
}

/* Header & Navigation */
header {
  background-color: var(--nav-bg);
  padding: 1.2rem var(--spacing-unit);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

nav ul {
  display: flex;
  justify-content: center;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 3rem;
  flex-wrap: wrap;
}

nav li {
  margin: 0;
}

nav a {
  font-size: 1.1rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-color);
  padding: 0.5rem 0;
}

nav a.active,
nav a:hover {
  color: var(--primary-color);
}

nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  box-shadow: 0 0 8px var(--primary-color);
  transition: width var(--transition-speed) ease-in-out;
}

nav a:hover::after,
nav a.active::after {
  width: 100%;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: transparent;
  color: var(--text-color);
  cursor: pointer;
  font-family: var(--font-body);
  transition: all var(--transition-speed) ease;
}

.theme-toggle:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  box-shadow: 0 0 12px rgba(0, 255, 0, 0.15);
}

.theme-toggle__icon {
  font-size: 1rem;
  line-height: 1;
}

.theme-toggle__label {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Hero Section */
.hero {
  padding: 2rem 0;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  color: var(--text-color);
  text-shadow: var(--glow-hero);
  letter-spacing: 2px;
}

.hero img {
  border-radius: 50%;
  width: 220px;
  height: 220px;
  object-fit: cover;
  margin: 2.5rem 0;
  border: 3px solid var(--primary-color);
  box-shadow: 0 0 25px rgba(0, 255, 0, 0.4);
  transition: transform var(--transition-speed) ease;
}

.hero img:hover {
  transform: scale(1.05);
}

.hero h2 {
  font-size: 1.6rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-weight: 400;
}

.hero p {
  font-size: 1.2rem;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.9;
}

/* Projects Grid */
.projects-container {
  padding: 4rem 0;
}

.page-title {
  text-align: center;
  font-size: 3rem;
  margin-bottom: 3rem;
  color: var(--text-color);
  text-shadow: var(--glow-title);
}

.glow-title {
  color: var(--text-color);
  text-shadow: var(--glow-hero);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  /* Back to 300px min */
  grid-auto-rows: auto;
  align-items: start;
  /* Let each card define its own height to prevent overlap */
  gap: 3rem;
  /* Increased gap for better separation */
  padding: 1rem;
}

.project-bubble {
  background-color: var(--card-surface);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  /* More rounded for bubble effect */
  padding: 2rem;
  display: flex;
  flex-direction: column;
  min-height: 90%;
  transition: all var(--transition-speed) ease;
  backdrop-filter: blur(5px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.project-bubble:hover {
  transform: translateY(-5px);
  border-color: var(--primary-color);
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.2);
}

.project-header {
  margin-bottom: 1rem;
}

.project-title {
  font-size: 1.4rem;
  color: var(--primary-color);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1.3;
}

.project-body {
  flex-grow: 1;
  margin-bottom: 1.5rem;
}

.project-description {
  font-size: 1.1rem;
  color: var(--text-color);
  line-height: 1.6;
  margin: 0;
}

.project-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-tags {
  font-size: 0.9rem;
  color: var(--accent-color);
  font-family: 'Orbitron', sans-serif;
  margin: 0;
}

.project-link {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: rgba(0, 255, 0, 0.1);
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  text-decoration: none;
  text-align: center;
  border-radius: 4px;
  transition: all 0.3s ease;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.project-link:hover {
  background-color: var(--primary-color);
  color: #000;
  box-shadow: 0 0 10px var(--primary-color);
}

/* About Section */
.about-section {
  background-color: rgba(0, 0, 0, 0.6);
  /* More transparent */
  padding: 2.5rem;
  border-radius: 16px;
  margin-bottom: 3rem;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(0, 255, 0, 0.1);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  max-width: 1000px;
  margin: 0 auto;
}

.about-intro {
  text-align: left;
  margin-bottom: 3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 2rem;
}

.about-intro h1 {
  font-size: 3rem;
  color: #fff;
  margin-bottom: 1.5rem;
  text-shadow: 0 0 10px rgba(0, 255, 0, 0.4);
}

.skills-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.skills-section h2,
.other-skills-section h2,
.experience-section h2 {
  font-size: 1.8rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
}

.skills-section h2::after,
.other-skills-section h2::after,
.experience-section h2::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--primary-color), transparent);
  margin-left: 1rem;
  opacity: 0.5;
}

/* Reverting the JS animation hack for consistency */
.skill-bar {
  display: block;
  height: 0.8rem;
  background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
  box-shadow: 0 0 10px var(--secondary-color);
  margin: 0.8rem 0 2rem;
  position: relative;
  border-radius: 4px;
  width: 0;
  /* Start at 0 */
  transition: width 1.5s ease-out;
}

.skill-bar::before {
  display: none;
  /* Remove the pseudo-element bar */
}

.skill-bar::after {
  content: attr(data-percentage);
  color: #fff;
  position: absolute;
  right: 0;
  top: -1.5rem;
  font-size: 0.9rem;
  font-weight: bold;
  font-family: var(--font-heading);
}

.experience-section {
  margin-top: 3rem;
}

.timeline-item {
  border-left: 2px solid var(--primary-color);
  padding-left: 2rem;
  margin-left: 0.6rem;
  margin-bottom: 3rem;
  position: relative;
}

.about-section {
  background: var(--card-surface);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--glass-shadow);
}

.about-section h1 {
  color: var(--text-color);
  text-shadow: var(--glow-title);
}

.skills-section,
.other-skills-section,
.timeline-item {
  background: var(--overlay-color);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: var(--glass-shadow);
}

.skills-container {
  gap: 1rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

html {
  font-size: 12px;
  /* Scaled down to ~75% */
  scroll-behavior: smooth;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 6px;
  width: 12px;
  height: 12px;
  background-color: var(--bg-color);
  border: 2px solid var(--primary-color);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--primary-color);
  transition: background-color 0.3s ease;
}

.timeline-item:hover::before {
  background-color: var(--primary-color);
}

.timeline-item h3 {
  font-size: 1.4rem;
  color: var(--text-color);
  margin: 0 0 0.5rem 0;
}

.timeline-item p {
  margin: 0.5rem 0;
  color: var(--text-muted);
}

/* Footer */
footer {
  text-align: center;
  padding: 3rem 0;
  font-size: 0.9rem;
  background-color: var(--footer-bg);
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  border-top: 1px solid var(--border-soft);
}

footer p {
  margin-bottom: 1rem;
}

footer a {
  margin: 0 1rem;
  color: var(--text-muted);
}

footer a:hover {
  color: var(--primary-color);
}

/* Background Animation */
#background-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

/* Responsive */
@media (max-width: 768px) {
  :root {
    --spacing-unit: 1rem;
    --header-height: 72px;
    --footer-height: 140px;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  nav ul {
    gap: 1.5rem;
    flex-direction: column;
    align-items: center;
  }

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

  .content-column,
  .about-section {
    padding: 1.5rem;
  }

  .skills-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}
