/* ============================================
   TUHIN ACHARJEE — PORTFOLIO
   Dark theme inspired by Meta/Google ML eng portfolios
   ============================================ */

:root {
  /* Colors */
  --bg-primary: #0a0a0b;
  --bg-secondary: #111113;
  --bg-card: #16161a;
  --bg-card-hover: #1c1c22;
  --border: #232329;
  --border-hover: #333340;
  --text-primary: #f0f0f3;
  --text-secondary: #a0a0b0;
  --text-muted: #6b6b7b;
  --accent: #6c63ff;
  --accent-glow: rgba(108, 99, 255, 0.15);
  --accent-hover: #7b73ff;
  --accent-green: #34d399;
  --accent-blue: #60a5fa;
  --accent-orange: #fb923c;
  --accent-pink: #f472b6;
  --gradient-1: linear-gradient(135deg, #6c63ff 0%, #34d399 100%);
  --gradient-2: linear-gradient(135deg, #60a5fa 0%, #6c63ff 100%);
  --gradient-text: linear-gradient(135deg, #6c63ff, #34d399, #60a5fa);

  /* Typography */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Spacing */
  --section-padding: 120px 0;
  --container-max: 1100px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

ul {
  list-style: none;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- SECTION ---- */
.section {
  padding: var(--section-padding);
}

.section__label {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.section__title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 48px;
  color: var(--text-primary);
}

/* ---- NAV ---- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  transition: background 0.3s, backdrop-filter 0.3s, box-shadow 0.3s;
}

.nav.scrolled {
  background: rgba(10, 10, 11, 0.85);
  backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 var(--border);
}

.nav__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav__link {
  font-size: 0.85rem;
  font-weight: 500;
  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 {
  color: var(--text-primary);
}

.nav__link:hover::after {
  width: 100%;
}

.nav__link--resume {
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 6px 16px;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

.nav__link--resume::after {
  display: none;
}

.nav__link--resume:hover {
  background: var(--accent);
  color: var(--bg-primary);
}

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

.nav__toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: transform 0.3s, opacity 0.3s;
}

.nav__toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav__toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav__toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ---- HERO ---- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 120px 24px 80px;
}

.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.4;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 700px;
  text-align: center;
}

.hero__greeting {
  font-size: 0.95rem;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.hero__name {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 16px;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__role {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--text-secondary);
  margin-bottom: 24px;
  min-height: 2em;
}

.hero__role-prefix {
  color: var(--text-muted);
}

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

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

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

.hero__desc {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 40px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.hero__stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.hero__stat {
  text-align: center;
}

.hero__stat-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
}

.hero__stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

.hero__scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.7rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.hero__scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--text-muted), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  gap: 8px;
}

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

.btn--primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

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

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

.btn--full {
  width: 100%;
}

/* ---- ABOUT ---- */
.about__grid {
  display: grid;
  gap: 60px;
}

.about__text p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 1rem;
  line-height: 1.8;
}

.about__focus h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 24px;
  color: var(--text-primary);
}

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

.about__focus-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: border-color 0.3s, transform 0.3s;
}

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

.about__focus-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 16px;
}

.about__focus-card h4 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.about__focus-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---- EXPERIENCE ---- */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

.timeline__item {
  position: relative;
  padding-bottom: 48px;
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__dot {
  position: absolute;
  left: -28px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

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

.timeline__content:hover {
  border-color: var(--border-hover);
}

.timeline__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.timeline__header h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}

.timeline__date {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
  white-space: nowrap;
}

.timeline__company {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.timeline__list {
  margin-bottom: 16px;
}

.timeline__list li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 8px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.timeline__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
}

.timeline__list li strong {
  color: var(--text-primary);
  font-weight: 600;
}

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

.timeline__tags span {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 500;
}

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

.skills__category {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: border-color 0.3s;
}

.skills__category:hover {
  border-color: var(--border-hover);
}

.skills__cat-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.skills__cat-title svg {
  color: var(--accent);
  flex-shrink: 0;
}

.skills__items {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.skill-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.skill-item__name {
  font-size: 0.82rem;
  color: var(--text-secondary);
  min-width: 110px;
  flex-shrink: 0;
}

.skill-item__bar {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.skill-item__fill {
  height: 100%;
  background: var(--gradient-1);
  border-radius: 4px;
  width: 0;
  transition: width 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ---- PROJECTS ---- */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}

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

.project-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.project-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.project-card__links {
  display: flex;
  gap: 8px;
}

.project-card__link {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: color 0.2s, background 0.2s;
}

.project-card__link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.project-card__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.project-card__desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
  flex: 1;
}

.project-card__metrics {
  display: flex;
  gap: 24px;
  margin-bottom: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.project-card__metric-value {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  display: block;
}

.project-card__metric-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-card__tags span {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(108, 99, 255, 0.08);
  color: var(--text-secondary);
  font-weight: 500;
}

/* ---- EDUCATION ---- */
.education__card {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  max-width: 600px;
  transition: border-color 0.3s;
}

.education__card:hover {
  border-color: var(--border-hover);
}

.education__icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.education__info h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.education__school {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.education__date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---- CONTACT ---- */
.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

.contact__desc {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 32px;
}

.contact__links {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact__link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color 0.2s;
}

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

.contact__link svg {
  flex-shrink: 0;
  color: var(--accent);
}

/* Form */
.form__group {
  position: relative;
  margin-bottom: 20px;
}

.form__group input,
.form__group textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color 0.2s;
  outline: none;
}

.form__group input:focus,
.form__group textarea:focus {
  border-color: var(--accent);
}

.form__group label {
  position: absolute;
  top: 14px;
  left: 16px;
  font-size: 0.9rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: all 0.2s;
}

.form__group input:focus ~ label,
.form__group input:not(:placeholder-shown) ~ label,
.form__group textarea:focus ~ label,
.form__group textarea:not(:placeholder-shown) ~ label {
  top: -8px;
  left: 12px;
  font-size: 0.7rem;
  color: var(--accent);
  background: var(--bg-primary);
  padding: 0 4px;
}

.form__group textarea {
  resize: vertical;
  min-height: 120px;
}

/* ---- FOOTER ---- */
.footer {
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid var(--border);
}

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

/* ---- SCROLL ANIMATIONS ---- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
  .skills__grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 768px) {
  :root {
    --section-padding: 80px 0;
  }

  .nav__links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    flex-direction: column;
    justify-content: center;
    gap: 24px;
    transition: right 0.3s ease;
    z-index: 99;
  }

  .nav__links.open {
    right: 0;
  }

  .nav__toggle {
    display: flex;
    z-index: 101;
  }

  .hero__stats {
    gap: 24px;
  }

  .hero__stat-value {
    font-size: 1.4rem;
  }

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

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

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

  .contact__grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .timeline {
    padding-left: 24px;
  }

  .timeline__dot {
    left: -20px;
  }

  .timeline__header {
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 480px) {
  :root {
    --section-padding: 60px 0;
  }

  .hero__name {
    font-size: 2rem;
  }

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

  .education__card {
    flex-direction: column;
    text-align: center;
  }
}
