/* ===== CSS Variables ===== */
:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #0f1420;
  --bg-card: #151b2b;
  --bg-card-hover: #1a2236;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #60a5fa;
  --accent-dim: #3b82f6;
  --accent-glow: rgba(96, 165, 250, 0.15);
  --green: #4ade80;
  --yellow: #fbbf24;
  --red: #f87171;
  --border: #1e293b;
  --border-light: #2d3a52;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --nav-height: 60px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--green);
}

/* ===== Background Canvas ===== */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ===== Navigation ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 1000;
  backdrop-filter: blur(12px);
  background: rgba(10, 14, 23, 0.85);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.nav.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.nav-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: color 0.2s;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent);
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-secondary);
  transition: all 0.3s;
}

.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: rgba(10, 14, 23, 0.95);
  backdrop-filter: blur(12px);
  padding: 1rem 2rem;
  z-index: 999;
  border-bottom: 1px solid var(--border);
  flex-direction: column;
  gap: 1rem;
}

.mobile-menu.open {
  display: flex;
}

.mobile-link {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 0.5rem 0;
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  padding: 2rem;
}

.hero-content {
  max-width: 720px;
  text-align: center;
}

.hero-greeting {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--green);
  margin-bottom: 0.5rem;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.2s;
}

.hero-name {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.4s;
}

.name-text {
  background: linear-gradient(135deg, var(--accent) 0%, #a78bfa 50%, var(--green) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 6s ease infinite;
}

.cursor {
  color: var(--accent);
  animation: blink 1s step-end infinite;
  font-weight: 300;
}

.hero-titles {
  font-family: var(--font-mono);
  font-size: clamp(0.9rem, 2.5vw, 1.2rem);
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  min-height: 1.8em;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.6s;
}

.title-prefix {
  color: var(--green);
}

.typed-cursor {
  color: var(--accent);
  animation: blink 0.7s step-end infinite;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.8s;
}

.hero-desc strong {
  color: var(--text-primary);
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 1s;
}

.btn {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0.75rem 1.75rem;
  border-radius: 6px;
  transition: all 0.3s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent-dim);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
}

.btn-outline:hover {
  background: var(--accent-glow);
  color: var(--accent);
  transform: translateY(-2px);
}

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  animation: fadeIn 0.6s ease forwards 1.4s;
}

.scroll-arrow {
  width: 24px;
  height: 24px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  animation: scrollBounce 2s infinite;
}

/* ===== Sections ===== */
.section {
  position: relative;
  z-index: 1;
  padding: 5rem 0;
}

.section-alt {
  background: var(--bg-secondary);
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 3rem;
  text-align: center;
}

.title-decoration {
  font-family: var(--font-mono);
  color: var(--accent);
  margin-right: 0.5rem;
}

/* ===== Reveal Animation ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Terminal (About) ===== */
.terminal {
  background: #0d1117;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  overflow: hidden;
  max-width: 700px;
  margin: 0 auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #161b22;
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal-dot.red { background: var(--red); }
.terminal-dot.yellow { background: var(--yellow); }
.terminal-dot.green { background: var(--green); }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 8px;
}

.terminal-body {
  padding: 1.25rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.8;
}

.terminal-body p {
  margin-bottom: 0.5rem;
}

.prompt {
  color: var(--green);
  margin-right: 0.5rem;
}

.terminal-output {
  color: var(--text-secondary);
  padding-left: 1.5rem;
}

.hl {
  color: var(--accent);
  font-weight: 600;
}

.blink {
  animation: blink 1s step-end infinite;
}

/* ===== Skills ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  transition: all 0.3s;
}

.skill-card:hover {
  border-color: var(--accent-dim);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.skill-icon {
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
  color: var(--accent);
}

.skill-card h3 {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.3rem 0.65rem;
  background: rgba(96, 165, 250, 0.1);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: all 0.2s;
}

.skill-card:hover .tag {
  border-color: var(--border-light);
  background: rgba(96, 165, 250, 0.15);
}

/* ===== Projects ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--green));
  opacity: 0;
  transition: opacity 0.3s;
}

.project-card:hover {
  border-color: var(--accent-dim);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.project-card:hover::before {
  opacity: 1;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.project-icon {
  font-size: 2rem;
}

.project-link {
  color: var(--text-muted);
  font-size: 1.2rem;
}

.project-link:hover {
  color: var(--accent);
}

.project-name {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.tech-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  background: rgba(74, 222, 128, 0.1);
  color: var(--green);
  border: 1px solid rgba(74, 222, 128, 0.2);
  border-radius: 3px;
}

.project-details {
  list-style: none;
}

.project-details li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  padding-left: 1rem;
  position: relative;
  margin-bottom: 0.4rem;
}

.project-details li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

/* ===== Education / Timeline ===== */
.timeline {
  max-width: 700px;
  margin: 0 auto 3rem;
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--green));
}

.timeline-item {
  position: relative;
  padding-bottom: 1.5rem;
}

.timeline-marker {
  position: absolute;
  left: -2rem;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-secondary);
  transform: translateX(-5px);
  box-shadow: 0 0 8px var(--accent-glow);
}

.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.timeline-content h3 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.timeline-place {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.timeline-gpa {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--green);
  margin-bottom: 0.75rem;
}

.timeline-courses {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.timeline-courses strong {
  color: var(--text-secondary);
}

.subsection-title {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--accent);
  text-align: center;
  margin-bottom: 1.5rem;
}

.certs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  max-width: 700px;
  margin: 0 auto;
}

.cert-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  transition: border-color 0.3s;
}

.cert-card:hover {
  border-color: var(--accent-dim);
}

.cert-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.cert-card h4 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.cert-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== Contact ===== */
.contact-content {
  text-align: center;
}

.contact-text {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  max-width: 700px;
  margin: 0 auto;
}

.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: all 0.3s;
  color: var(--text-primary);
}

.contact-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  color: var(--text-primary);
}

.contact-icon {
  font-size: 1.5rem;
}

.contact-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.contact-value {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ===== Footer ===== */
.footer {
  position: relative;
  z-index: 1;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-code {
  font-family: var(--font-mono);
  color: var(--accent);
}

/* ===== Animations ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes scrollBounce {
  0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: 0.4; }
  50% { transform: rotate(45deg) translate(6px, 6px); opacity: 1; }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }

  .section { padding: 3.5rem 0; }
  .section-title { font-size: 1.5rem; margin-bottom: 2rem; }

  .skills-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .projects-grid { grid-template-columns: 1fr; }

  .terminal-body { font-size: 0.8rem; padding: 1rem; }

  .hero-desc { font-size: 0.95rem; }
}

@media (max-width: 480px) {
  .nav { padding: 0 1rem; }
  .container { padding: 0 1rem; }
  .hero { padding: 1rem; }
  .contact-grid { grid-template-columns: 1fr; }
}
