/* ============================================================
   PORTFOLIO WEBSITE — Shivam Chand Kaushik
   AI/ML Engineer | Semiconductor Domain Expert
   ============================================================ */

/* ---------- CSS Custom Properties (Dark Theme Default) ---------- */
:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --accent: #d4a017;
  --accent-hover: #e8b830;
  --accent-dim: rgba(212, 160, 23, 0.15);
  --border: #30363d;
  --shadow: rgba(0, 0, 0, 0.4);
  --nav-bg: rgba(13, 17, 23, 0.85);
  --card-hover: #1c2129;
  --tag-bg: rgba(212, 160, 23, 0.12);
  --tag-text: #d4a017;
  --timeline-line: #30363d;
}

/* ---------- Light Theme ---------- */
body.light-theme {
  --bg-primary: #ffffff;
  --bg-secondary: #f6f8fa;
  --bg-tertiary: #eaeef2;
  --text-primary: #1f2328;
  --text-secondary: #656d76;
  --accent: #b8860b;
  --accent-hover: #d4a017;
  --accent-dim: rgba(184, 134, 11, 0.1);
  --border: #d0d7de;
  --shadow: rgba(0, 0, 0, 0.1);
  --nav-bg: rgba(255, 255, 255, 0.85);
  --card-hover: #f0f3f6;
  --tag-bg: rgba(184, 134, 11, 0.1);
  --tag-text: #8a6508;
  --timeline-line: #d0d7de;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

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

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

section {
  padding: 80px 0;
}

/* ---------- Section Titles ---------- */
.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 40px;
  text-align: center;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--accent);
  margin: 12px auto 0;
  border-radius: 2px;
}

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  transform: translateY(-100%);
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.navbar.visible {
  transform: translateY(0);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 1.1rem;
  transition: all 0.2s;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.nav-resume-btn {
  background: var(--accent);
  color: #000;
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
}

.nav-resume-btn:hover {
  background: var(--accent-hover);
  color: #000;
}

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ---------- Hero Section ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  background: var(--bg-primary);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 40%, var(--accent-dim) 0%, transparent 50%),
              radial-gradient(circle at 70% 60%, rgba(56, 139, 253, 0.06) 0%, transparent 50%);
  animation: heroGlow 15s ease-in-out infinite alternate;
}

@keyframes heroGlow {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-3%, -3%); }
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 8px;
}

.hero h1 .accent {
  color: var(--accent);
}

.hero-subtitle {
  font-size: 1.4rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
  min-height: 2rem;
}

.hero-tagline {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 36px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  color: #000;
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(212, 160, 23, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--border);
}

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

.hero-theme-toggle {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 10;
}

/* ---------- Stats Bar ---------- */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 32px;
}

.stat-item {
  text-align: center;
  padding: 20px;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  display: block;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ---------- About ---------- */
#about {
  background: var(--bg-secondary);
}

.about-text {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-secondary);
  max-width: 900px;
  margin: 0 auto 40px;
  text-align: center;
}

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.skill-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  transition: all 0.3s;
}

.skill-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px var(--shadow);
}

.skill-card h3 {
  color: var(--accent);
  font-size: 1.05rem;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
}

/* ---------- Experience Timeline ---------- */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding-left: 40px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--timeline-line);
}

.timeline-item {
  position: relative;
  margin-bottom: 40px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -29px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 0 2px var(--accent);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.timeline-role {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.timeline-date {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

.timeline-company {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.timeline-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 10px;
}

.timeline-item ul {
  list-style: none;
  padding: 0;
}

.timeline-item li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 6px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.timeline-item li::before {
  content: '\25B8';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ---------- Projects ---------- */
#projects {
  background: var(--bg-secondary);
}

.project-filters {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 8px 20px;
  border-radius: 24px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.project-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  transition: all 0.3s;
  cursor: pointer;
}

.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 20px var(--shadow);
}

.project-card.hidden {
  display: none;
}

.project-category-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 8px;
}

.project-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary);
  line-height: 1.4;
}

.project-summary {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.5;
}

.project-details {
  display: none;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.project-card.expanded .project-details {
  display: block;
}

.project-details p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.6;
}

.project-links {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.project-link {
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--accent);
  padding: 2px 8px;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

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

.project-company-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  padding: 2px 10px;
  border-radius: 12px;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.project-publication {
  font-size: 0.82rem;
  color: var(--accent);
  font-style: italic;
  margin-top: 10px;
  margin-bottom: 2px;
}

.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.stack-tag {
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.project-expand {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--accent);
  margin-top: 12px;
  font-weight: 500;
}

.project-expand .arrow {
  transition: transform 0.2s;
  display: inline-block;
}

.project-card.expanded .project-expand .arrow {
  transform: rotate(90deg);
}

/* ---------- Education ---------- */
.education-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.edu-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  transition: all 0.3s;
}

.edu-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.edu-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.edu-card .degree {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.edu-card .edu-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ---------- Achievements ---------- */
#achievements {
  background: var(--bg-secondary);
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.achievement-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.publication-highlight {
  background: var(--bg-primary);
  border: 2px solid var(--accent);
  border-radius: 12px;
  padding: 28px 32px;
  max-width: 800px;
  margin: 0 auto 32px;
  position: relative;
}

.publication-highlight .pub-label {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.publication-highlight h3 {
  color: var(--text-primary);
  font-size: 1rem;
  margin-bottom: 8px;
  line-height: 1.5;
}

.publication-highlight .pub-meta {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.publication-highlight .pub-recognition {
  font-size: 0.88rem;
  color: var(--accent);
  font-weight: 600;
}

.publication-highlight .pub-links {
  margin-top: 12px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.publication-highlight .pub-links a {
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.publication-highlight .pub-links a:hover {
  border-bottom-color: var(--accent);
}

.achievement-card h3 {
  color: var(--accent);
  font-size: 1rem;
  margin-bottom: 6px;
}

.achievement-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ---------- Certifications ---------- */
.cert-table {
  max-width: 700px;
  margin: 0 auto;
  width: 100%;
  border-collapse: collapse;
}

.cert-table th,
.cert-table td {
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.cert-table th {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cert-table td {
  color: var(--text-secondary);
}

.cert-badge {
  display: inline-block;
  background: var(--accent-dim);
  color: var(--accent);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 8px;
}

/* ---------- Footer / Contact ---------- */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 60px 0 30px;
  text-align: center;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.contact-link {
  color: var(--text-secondary);
  font-size: 0.95rem;
  transition: color 0.2s;
}

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

.contact-link span {
  font-weight: 600;
  color: var(--text-primary);
  margin-right: 6px;
}

.footer-note {
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-style: italic;
  margin-top: 24px;
}

.footer-copy {
  color: var(--text-secondary);
  font-size: 0.78rem;
  margin-top: 16px;
  opacity: 0.6;
}

/* ---------- Scroll Animations ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Typing Cursor ---------- */
.typing-cursor {
  display: inline-block;
  width: 3px;
  height: 1.3em;
  background: var(--accent);
  margin-left: 4px;
  animation: blink 0.8s step-end infinite;
  vertical-align: text-bottom;
}

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

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 16px 20px;
    gap: 12px;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-hamburger {
    display: block;
  }

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

  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  .education-grid,
  .achievements-grid {
    grid-template-columns: 1fr;
  }

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

  .hero-subtitle {
    font-size: 1.1rem;
  }

  section {
    padding: 60px 0;
  }

  .timeline {
    padding-left: 30px;
  }

  .timeline::before {
    left: 10px;
  }

  .timeline-item::before {
    left: -24px;
  }

  .timeline-header {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.7rem;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

  .stats-bar {
    grid-template-columns: 1fr;
  }

  .contact-links {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  .project-filters {
    gap: 8px;
  }

  .filter-btn {
    padding: 6px 14px;
    font-size: 0.8rem;
  }
}
