/* ============================================================
   Portfolio Styles — Swastik De | Data Scientist
   ============================================================ */

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

:root {
  --accent: #6c63ff;
  --accent-light: #8b85ff;
  --accent-dim: rgba(108, 99, 255, 0.12);
  --bg: #0d0d1a;
  --bg2: #12122b;
  --bg3: #1a1a35;
  --surface: #1e1e3a;
  --surface2: #252545;
  --text: #e8e8f0;
  --text-muted: #9494b8;
  --border: rgba(108, 99, 255, 0.2);
  --green: #4ade80;
  --yellow: #fbbf24;
  --red: #f87171;
  --font: 'Inter', system-ui, sans-serif;
  --font-mono: 'Fira Code', 'Courier New', monospace;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.5);
  --transition: 0.25s ease;
}

/* ---------- Light Mode ---------- */
[data-theme="light"] {
  --accent: #5b52e0;
  --accent-light: #6c63ff;
  --accent-dim: rgba(108, 99, 255, 0.1);
  --bg: #f5f5fa;
  --bg2: #eeeef5;
  --bg3: #e4e4ef;
  --surface: #ffffff;
  --surface2: #f0f0f8;
  --text: #1a1a2e;
  --text-muted: #555577;
  --border: rgba(108, 99, 255, 0.18);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] #navbar.scrolled {
  background: rgba(245, 245, 250, 0.92);
}

[data-theme="light"] .nav-links a { color: var(--text-muted); }
[data-theme="light"] .nav-links a:hover { color: var(--text); }
[data-theme="light"] .nav-logo { color: var(--text); }

[data-theme="light"] .hero-name {
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="light"] .social-link.github { background: #24292e; color: #fff; }
[data-theme="light"] .social-link.linkedin { background: #0077b5; color: #fff; }
[data-theme="light"] .social-link.email { background: var(--surface); color: var(--text); border-color: var(--border); }

[data-theme="light"] a:hover { color: var(--accent); }
[data-theme="light"] .btn-primary:hover { color: #fff; }
[data-theme="light"] .btn-outline:hover { color: var(--accent); }

[data-theme="light"] .timeline-dot { border-color: var(--bg); }

[data-theme="light"] .code-body .kw { color: #7b2ff2; }
[data-theme="light"] .code-body .str { color: #2e7d32; }
[data-theme="light"] .code-body .fn { color: #1565c0; }
[data-theme="light"] .code-body .comment { color: #90a4ae; }

/* ---------- Theme Toggle Button ---------- */
.theme-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.15rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  margin-left: 1rem;
  flex-shrink: 0;
}
.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 0 12px rgba(108, 99, 255, 0.3);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

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

/* ---------- Scroll bar ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; }
a { color: var(--accent-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: #fff; }

/* ---------- Utilities ---------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

.accent { color: var(--accent-light); }

.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  border: none;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff;
}
.btn-primary:hover { color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--accent-light);
  border: 2px solid var(--accent);
}
.btn-outline:hover { background: var(--accent-dim); color: #fff; }

.btn-large { padding: 1rem 2.5rem; font-size: 1.05rem; }

/* ---------- Section Titles ---------- */
.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 0.5rem;
  text-align: center;
}
.section-subtitle {
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 3rem;
  font-size: 1rem;
}

section { padding: 6rem 0; }
section:nth-child(odd) { background: var(--bg); }
section:nth-child(even) { background: var(--bg2); }

/* ---------- Fade-in Animation ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   Navigation
   ============================================================ */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.25rem 2rem;
  transition: background var(--transition), box-shadow var(--transition), padding var(--transition);
}
#navbar.scrolled {
  background: rgba(13, 13, 26, 0.92);
  backdrop-filter: blur(12px);
  padding: 0.75rem 2rem;
  box-shadow: var(--shadow);
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 1px;
}
.nav-logo .accent { font-size: 1.8rem; }

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}
.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color var(--transition);
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition);
}
.nav-links a:hover { color: #fff; }
.nav-links a:hover::after { width: 100%; }

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

/* ============================================================
   Hero
   ============================================================ */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  background: radial-gradient(ellipse 80% 60% at 50% -20%, rgba(108, 99, 255, 0.18) 0%, transparent 70%), var(--bg);
  position: relative;
  overflow: hidden;
}

#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%236c63ff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero-content {
  flex: 1;
  max-width: 560px;
  z-index: 1;
}

.hero-greeting {
  color: var(--accent-light);
  font-family: var(--font-mono);
  font-size: 1rem;
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

.hero-name {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  background: linear-gradient(135deg, #fff 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.hero-title {
  font-size: clamp(1.2rem, 3vw, 1.75rem);
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 1.5rem;
}
.typed-text {
  color: var(--accent-light);
  font-weight: 600;
  border-right: 3px solid var(--accent);
  padding-right: 4px;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%, 100% { border-color: var(--accent); } 50% { border-color: transparent; } }

.hero-description {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 480px;
}

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

.hero-scroll {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 3rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.scroll-arrow {
  width: 20px;
  height: 20px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  animation: bounce 1.5s infinite;
}
@keyframes bounce { 0%, 100% { transform: rotate(45deg) translateY(0); } 50% { transform: rotate(45deg) translateY(4px); } }

/* Code card */
.hero-visual {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  z-index: 1;
}

.code-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  width: min(420px, 90vw);
  box-shadow: var(--shadow-lg), 0 0 60px rgba(108, 99, 255, 0.1);
  overflow: hidden;
}

.code-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.75rem 1rem;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}

.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background: var(--red); }
.dot.yellow { background: var(--yellow); }
.dot.green { background: var(--green); }

.code-filename {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  margin-left: auto;
}

.code-body {
  padding: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--text);
  overflow-x: auto;
}
.code-body code { display: block; }
.kw { color: #c792ea; }
.str { color: #c3e88d; }
.fn { color: #82aaff; }
.comment { color: #546e7a; font-style: italic; }

/* ============================================================
   About
   ============================================================ */
#about { background: var(--bg2) !important; }

.about-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 4rem;
  align-items: start;
  margin-top: 3rem;
}

.about-avatar {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, #a78bfa 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2rem;
  border: 3px solid var(--border);
  box-shadow: 0 0 40px rgba(108, 99, 255, 0.2);
}

.avatar-initials {
  font-size: 3.5rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 2px;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 0.75rem;
  text-align: center;
}
.stat-number {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent-light);
  line-height: 1;
  margin-bottom: 0.25rem;
}
.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 0.97rem;
  line-height: 1.75;
}
.about-text strong { color: var(--text); }

.about-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: transform var(--transition), box-shadow var(--transition);
  border: 1px solid var(--border);
}
.social-link svg { width: 18px; height: 18px; }
.social-link:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.social-link.github { background: #24292e; color: #fff; }
.social-link.linkedin { background: #0077b5; color: #fff; }
.social-link.email { background: var(--surface); color: var(--text); }

/* ============================================================
   Skills
   ============================================================ */
#skills { background: var(--bg) !important; }

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

.skill-category {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color var(--transition), transform var(--transition);
}
.skill-category:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.skill-category-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
}
.skill-icon { font-size: 1.2rem; }

.skill-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.skill-tag {
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--bg3);
  color: var(--text-muted);
  border: 1px solid rgba(255,255,255,0.06);
  transition: all var(--transition);
}
.skill-tag.primary {
  background: var(--accent-dim);
  color: var(--accent-light);
  border-color: rgba(108, 99, 255, 0.3);
}
.skill-tag:hover {
  background: var(--accent-dim);
  color: var(--accent-light);
  border-color: var(--accent);
}

/* ============================================================
   Projects
   ============================================================ */
#projects { background: var(--bg2) !important; }

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

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.project-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 8px 32px rgba(108, 99, 255, 0.15);
}
.project-card.featured {
  border-color: rgba(108, 99, 255, 0.35);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(108, 99, 255, 0.06) 100%);
}

.project-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.project-icon { font-size: 2rem; }
.project-links { display: flex; gap: 0.75rem; }
.project-links a {
  color: var(--text-muted);
  transition: color var(--transition), transform var(--transition);
}
.project-links a:hover { color: var(--accent-light); transform: translateY(-2px); }
.project-links svg { width: 22px; height: 22px; }

.project-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text);
}
.project-description {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.65;
  flex: 1;
  margin-bottom: 1.25rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.project-tags span {
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--bg3);
  color: var(--accent-light);
  font-family: var(--font-mono);
  border: 1px solid rgba(108, 99, 255, 0.2);
}

.projects-more {
  text-align: center;
  margin-top: 3rem;
}

/* ============================================================
   Experience
   ============================================================ */
#experience { background: var(--bg) !important; }

.timeline {
  position: relative;
  max-width: 800px;
  margin: 3rem auto 0;
  padding-left: 2rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), transparent);
}

.timeline-item {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 2.5rem;
}

.timeline-dot {
  position: absolute;
  left: -2.45rem;
  top: 0.4rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 12px rgba(108, 99, 255, 0.4);
}

.timeline-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color var(--transition);
}
.timeline-content:hover { border-color: var(--accent); }

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.timeline-header h3 { font-size: 1.05rem; color: var(--text); }
.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-light);
  background: var(--accent-dim);
  padding: 0.2rem 0.75rem;
  border-radius: 20px;
}
.timeline-company {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}
.timeline-details {
  list-style: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.65;
  padding-left: 0;
  margin-bottom: 1rem;
}
.timeline-details li {
  padding-left: 1.2rem;
  position: relative;
  margin-bottom: 0.3rem;
}
.timeline-details li::before {
  content: '▹';
  position: absolute;
  left: 0;
  color: var(--accent);
}
.timeline-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.timeline-tags span {
  padding: 0.15rem 0.6rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  background: var(--bg3);
  color: var(--accent-light);
  border: 1px solid rgba(108, 99, 255, 0.2);
}

/* Education */
.subsection-title {
  font-size: 1.3rem;
  margin: 3rem 0 1.5rem;
  text-align: center;
}

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

.education-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: border-color var(--transition);
}
.education-card:hover { border-color: var(--accent); }
.education-icon { font-size: 1.8rem; flex-shrink: 0; }
.education-card h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.25rem; color: var(--text); }
.education-card p { font-size: 0.8rem; color: var(--text-muted); }

/* ============================================================
   Contact
   ============================================================ */
#contact { background: var(--bg2) !important; text-align: center; }

.contact-wrapper {
  max-width: 700px;
  margin: 2rem auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
}

.contact-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  text-align: left;
  transition: border-color var(--transition);
}
.contact-item:hover { border-color: var(--accent); }
.contact-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-dim);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-light);
  flex-shrink: 0;
}
.contact-icon svg { width: 22px; height: 22px; }
.contact-label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.15rem; }
.contact-item a { font-size: 0.9rem; color: var(--text); }
.contact-item a:hover { color: var(--accent-light); }

/* ============================================================
   Resume
   ============================================================ */
#resume { background: var(--bg) !important; }

.resume-wrapper {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.resume-viewer {
  width: 100%;
  height: 600px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.resume-download {
  text-align: center;
}

/* ============================================================
   Footer
   ============================================================ */
footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
}
footer p { color: var(--text-muted); font-size: 0.875rem; }
footer strong { color: var(--text); }
.footer-sub { font-size: 0.78rem; margin-top: 0.25rem; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  #hero {
    flex-direction: column;
    padding-top: 8rem;
    padding-bottom: 4rem;
    text-align: center;
  }
  .hero-cta { justify-content: center; }
  .hero-description { margin: 0 auto 2rem; }
  .hero-scroll { justify-content: center; }
  .hero-visual { padding: 1.5rem 0 0; }

  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .about-stats { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 13, 26, 0.97);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    z-index: 99;
  }
  [data-theme="light"] .nav-links {
    background: rgba(245, 245, 250, 0.97);
  }
  .nav-links.open { display: flex; }
  .nav-links a { font-size: 1.2rem; }
  .nav-toggle { display: block; z-index: 100; }

  section { padding: 4rem 0; }
  .about-stats { grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }

  .resume-viewer { height: 400px; }
}

@media (max-width: 480px) {
  .hero-cta { flex-direction: column; align-items: center; }
  .about-stats { grid-template-columns: 1fr 1fr; }
  .stat-card:last-child { grid-column: span 2; }
  .about-links { justify-content: center; }
  .timeline { padding-left: 1rem; }
  .timeline-item { padding-left: 1.5rem; }
  .timeline-dot { left: -1.95rem; }
}
