/* ==========================================================================
   1. CSS Custom Properties (Design Tokens)
   ========================================================================== */
:root {
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  --teal-300: #5eead4;
  --teal-400: #2dd4bf;
  --teal-900: #134e4a;

  --blue-500: #3b82f6;
  --purple-500: #a855f7;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--slate-900);
  color: var(--slate-400);
  line-height: 1.625;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection {
  background-color: var(--teal-300);
  color: var(--teal-900);
}

/* ==========================================================================
   3. Interactive Spotlight Background
   ========================================================================== */
#spotlight {
  background: radial-gradient(600px at var(--x, 0px) var(--y, 0px), rgba(59, 130, 246, 0.15), transparent 80%);
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 30;
  transition: opacity 1s ease;
}

@media (max-width: 1023px) {
  #spotlight {
    display: none;
  }
}

/* ==========================================================================
   4. Layout Utilities
   ========================================================================== */
.mx-auto { margin-left: auto; margin-right: auto; }
.max-w-screen-xl { max-width: 1280px; }
.min-h-screen { min-height: 100vh; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }

@media (min-width: 768px) {
  .md\:px-12 { padding-left: 3rem; padding-right: 3rem; }
  .md\:py-20 { padding-top: 5rem; padding-bottom: 5rem; }
}

@media (min-width: 1024px) {
  .lg\:px-24 { padding-left: 6rem; padding-right: 6rem; }
  .lg\:py-0 { padding-top: 0; padding-bottom: 0; }
  .lg\:flex { display: flex; }
  .lg\:justify-between { justify-content: space-between; }
  .lg\:gap-4 { gap: 1rem; }

  header.lg\:sticky {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100vh;
    padding-top: 6rem;
    padding-bottom: 6rem;
    width: 40%;
  }

  main {
    width: 50%;
    padding-top: 6rem;
    padding-bottom: 6rem;
  }
}

/* ==========================================================================
   5. Header & Navigation
   ========================================================================== */
h1 {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 0.5rem;
}

h1 a {
  color: #ffffff;
  text-decoration: none;
}

h2 {
  color: var(--slate-200);
  font-size: 1.25rem;
  font-weight: 500;
  margin-top: 0.5rem;
}

header p {
  max-width: 320px;
  margin-top: 1.5rem;
  color: var(--slate-400);
}

/* Navigation Links */
.nav ul { list-style: none; margin-top: 4rem; }
.nav li { margin-bottom: 0.5rem; }

.nav a {
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
  color: var(--slate-500);
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-decoration: none;
  transition: all 0.3s ease;
}

/* Navigation Indicator Line */
.nav-indicator {
  width: 2rem;
  height: 1px;
  background-color: var(--slate-600);
  margin-right: 1rem;
  transition: all 0.3s ease;
}

/* Shared hover effect for all indicator-based links */
.nav a:hover .nav-indicator,
.nav a.active .nav-indicator,
.inline-link:hover .nav-indicator,
.back-link:hover .nav-indicator,
.btn-details:hover .nav-indicator,
.submit-btn:hover .nav-indicator {
  width: 4rem;
  background-color: var(--slate-200);
}

/* ==========================================================================
   6. Social Links
   ========================================================================== */
.social-links {
  list-style: none;
  display: flex;
  align-items: center;
  margin-top: 2rem;
  padding-left: 0.25rem;
}

.social-links li { margin-right: 1.5rem; }

.social-links a {
  display: inline-block;
  color: var(--slate-400);
  font-size: 1.5rem;
  transition: all 0.3s ease;
}

.social-links a:hover {
  transform: translateY(-3px);
}

.social-links a.hover-github:hover {
  color: #ffffff;
}

.social-links a.hover-linkedin:hover {
  color: #0077b5;
}

.social-links a.hover-kaggle:hover {
  color: #20beff;
}

/* ==========================================================================
   7. Content Sections
   ========================================================================== */
section {
  margin-bottom: 6rem;
  scroll-margin-top: 4rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

section.revealed {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 1024px) {
  section {
    margin-bottom: 12rem;
    scroll-margin-top: 6rem;
  }
}

/* Sticky Section Title (Mobile) */
.sticky-section-title {
  position: sticky;
  top: 0;
  z-index: 20;
  margin-left: -1.5rem;
  margin-right: -1.5rem;
  margin-bottom: 1.5rem;
  width: calc(100% + 3rem);
  background-color: rgba(15, 23, 42, 0.8);
  padding: 1.25rem 1.5rem;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

@media (min-width: 768px) {
  .sticky-section-title {
    margin-left: -3rem;
    margin-right: -3rem;
    width: calc(100% + 6rem);
    padding-left: 3rem;
    padding-right: 3rem;
  }
}

@media (min-width: 1024px) {
  .sticky-section-title {
    display: none;
  }
}

.sticky-section-title h2 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--slate-200);
  margin-top: 0;
}

/* ==========================================================================
   8. Cards (Experience & Projects)
   ========================================================================== */
.card-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  position: relative;
  display: grid;
  gap: 1rem;
  padding: 1.5rem;
  margin-bottom: 0.5rem;
  border-radius: 0.75rem;
  border: 1px solid transparent;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card.revealed {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 640px) {
  .card {
    grid-template-columns: repeat(8, 1fr);
    gap: 2rem;
  }
}

.card:hover {
  background-color: rgba(30, 41, 59, 0.4);
  border-color: rgba(148, 163, 184, 0.1);
  box-shadow: 0 10px 30px -15px rgba(2, 6, 23, 0.7);
  transform: translateY(-4px);
}

/* Card Header (Date Column) */
.card-header {
  z-index: 10;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--slate-500);
  width: 168px;
}

@media (min-width: 640px) {
  .card-header { grid-column: span 2; }
}

/* Card Body */
.card-body { z-index: 10; }

@media (min-width: 640px) {
  .card-body { grid-column: span 6; }
}

/* Card Title */
.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--slate-200);
  margin-bottom: 0.5rem;
}

.card-title a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.card-title a i {
  font-size: 0.875rem;
  margin-left: 0.5rem;
  transition: transform 0.3s ease;
}

.card:hover .card-title { color: var(--teal-300); }
.card:hover .card-title i { transform: translate(3px, -3px); }

/* Card Description */
.card-description {
  font-size: 0.875rem;
  color: var(--slate-400);
  margin-bottom: 1rem;
}

/* Tags */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  gap: 0.5rem;
}

.tag {
  border-radius: 9999px;
  background-color: rgba(45, 212, 191, 0.1);
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--teal-300);
  border: 1px solid rgba(45, 212, 191, 0.1);
  transition: all 0.3s ease;
}

.card:hover .tag {
  background-color: rgba(45, 212, 191, 0.2);
  border-color: rgba(45, 212, 191, 0.2);
}

/* Project Card — Stacked Layout (Image on Top) */
.project-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.project-card img {
  width: 100%;
  height: 200px;
  border-radius: 0.75rem 0.75rem 0 0;
  border: none;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  object-fit: cover;
}

.project-card .card-body {
  padding: 1.5rem;
  grid-column: unset;
}

.project-card:hover img {
  transform: scale(1.03);
  filter: brightness(1.1);
}

.card:hover .project-card img {
  border-color: rgba(148, 163, 184, 0.3);
}

@media (min-width: 640px) {
  .project-card img {
    height: 220px;
  }
}

@media (min-width: 768px) {
  .project-card img {
    height: 240px;
  }
}

/* ==========================================================================
   9. Contact Section & Form
   ========================================================================== */
.contact-content { max-width: 600px; }
.contact-content p { color: var(--slate-400); margin-bottom: 2rem; }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group { position: relative; }

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 1rem 1.25rem;
  background-color: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 0.5rem;
  color: var(--slate-200);
  font-family: inherit;
  font-size: 0.875rem;
  transition: all 0.3s ease;
  outline: none;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--teal-300);
  background-color: rgba(30, 41, 59, 0.8);
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.1);
}

/* Submit Button */
.submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  background: #ffffff;
  color: var(--slate-900);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  width: fit-content;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.submit-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background-color: var(--teal-300);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}

.submit-btn .nav-indicator {
  background-color: var(--slate-900);
  margin-right: 0.5rem;
}

.submit-btn:hover::before { width: 100%; }
.submit-btn:hover .nav-indicator { background-color: var(--slate-900) !important; }

.submit-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px -10px rgba(45, 212, 191, 0.5);
}

.submit-btn:active { transform: translateY(0); }

/* ==========================================================================
   10. Footer
   ========================================================================== */
footer {
  padding-top: 4rem;
  padding-bottom: 4rem;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  margin-top: 4rem;
}

footer p {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--slate-500);
  max-width: 400px;
}

footer a {
  color: var(--slate-300);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.3s ease;
}

footer a:hover {
  color: var(--teal-300);
  border-bottom-color: var(--teal-300);
}

/* ==========================================================================
   11. Utility Classes
   ========================================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-8 { margin-top: 2rem; }

/* Inline Link (View Full Archive) */
.inline-link {
  display: inline-flex;
  align-items: center;
  color: var(--slate-200);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  transition: all 0.3s ease;
}

.inline-link:hover { color: var(--slate-200); }

.inline-link .nav-indicator {
  width: 2rem;
  height: 1px;
  background-color: var(--slate-600);
  margin-right: 1rem;
  transition: all 0.3s ease;
}

.inline-link i {
  font-size: 0.75rem;
  margin-left: 0.5rem;
  transition: transform 0.3s ease;
}

.inline-link:hover i { transform: translateX(4px); }

/* Detail Button (Per-Project) */
.btn-details {
  display: inline-flex;
  align-items: center;
  margin-top: 1.5rem;
  color: var(--slate-200);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  text-decoration: none;
  transition: all 0.3s ease;
  width: fit-content;
  position: relative;
  z-index: 20;
}

.btn-details:hover {
  color: var(--slate-200);
  transform: none;
  box-shadow: none;
}

.btn-details .nav-indicator {
  width: 2rem;
  height: 1px;
  background-color: var(--slate-600);
  margin-right: 1rem;
  transition: all 0.3s ease;
}

.btn-details i {
  font-size: 0.75rem;
  margin-left: 0.5rem;
  transition: transform 0.3s ease;
}

.btn-details:hover i { transform: translateX(4px); }
