/* Global Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Noto+Sans+Tamil:wght@400;500;600;700&display=swap');

:root {
  --bg-primary: #121212;
  --bg-secondary: #1E1E1E;
  --text-primary: #FFFFFF;
  --text-secondary: #B0B0B0;
  --accent-color: #38BDAE;
  /* Teal accent from target */
  --accent-hover: #2DA092;
  --border-color: rgba(255, 255, 255, 0.1);
  --card-bg: rgba(30, 30, 30, 0.6);
  /* Semi-transparent for glassmorphism */
  --hover-bg: #252525;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;

  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 999;
  opacity: 0.4;
  mix-blend-mode: overlay;
}

/* Premium Ambient Background */
.ambient-light {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  z-index: -1;
  opacity: 0.4;
  animation: floatLight 10s infinite alternate ease-in-out;
}

.light-1 {
  top: -10%;
  left: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(56, 189, 174, 0.2) 0%, rgba(0, 0, 0, 0) 70%);
}

.light-2 {
  bottom: -10%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(60, 100, 255, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
  animation-duration: 15s;
  animation-delay: -5s;
}

@keyframes floatLight {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(50px, 50px) scale(1.1);
  }
}

/* Custom Cursor */
.cursor-dot,
.cursor-outline {
  position: fixed;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 9999;
  pointer-events: none;
  display: none;
  /* Hidden by default, shown via JS on desktop */
}

@media (pointer: fine) {
  body {
    cursor: none;
  }

  .cursor-dot,
  .cursor-outline {
    display: block;
  }
}

.cursor-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-color);
  box-shadow: 0 0 10px var(--accent-color);
  border-radius: 50%;
}

.cursor-outline {
  width: 35px;
  height: 35px;
  border: 1px solid rgba(56, 189, 174, 0.5);
  box-shadow: 0 0 20px rgba(56, 189, 174, 0.2);
  border-radius: 50%;
  transition: width 0.2s, height 0.2s, background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

/* Hover state for cursor (added via JS) */
body.hovering .cursor-outline {
  width: 50px;
  height: 50px;
  background-color: rgba(56, 189, 174, 0.1);
  border-color: var(--accent-color);
  box-shadow: 0 0 30px var(--accent-color);
}

/* Text Reveal Animation (Split Text) */
.word-mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  margin-right: 0.1em;
  /* Space between words */
}

.word-inner {
  display: inline-block;
  transform: translateY(110%) rotateX(20deg);
  opacity: 0;
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1), opacity 1s ease;
  will-change: transform, opacity;
}

.title-reveal.active .word-inner {
  transform: translateY(0) rotateX(0deg);
  opacity: 1;
}

/* Premium Custom Scrollbar - Minimalist */
body::-webkit-scrollbar {
  width: 4px;
}

body::-webkit-scrollbar-track {
  background: transparent;
}

body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
}

body::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

/* Scroll Progress Bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-color), #fff);
  z-index: 1001;
  box-shadow: 0 0 10px var(--accent-color);
  transition: width 0.1s ease-out;
}

/* Base Scroll Reveal - Refined */
.reveal {
  opacity: 0;
  transform: translateY(40px) scale(0.96);
  filter: blur(8px);
  transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity, filter;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

a {
  text-decoration: none;
  color: var(--text-primary);
  transition: var(--transition);
}

ul {
  list-style: none;
}

/* Layout Utilities */
body {
  margin-left: 0;
  /* No left margin needed for bottom nav */
}

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

section {
  padding: 6rem 0;
  /* Increased padding for better spacing */
}

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

  .container {
    padding: 0 1.5rem;
  }
}

/* Navbar - Bottom Center */
.navbar {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(30, 30, 30, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  padding: 0.75rem 1.5rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

.nav-links {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  list-style: none;
  align-items: center;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text-secondary);
  position: relative;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0.5rem 1rem;
  border-radius: 50px;
}

.nav-indicator {
  display: none;
  /* Hide indicators for bottom nav */
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  background: rgba(56, 189, 174, 0.15);
}

.nav-link.active {
  background: rgba(56, 189, 174, 0.2);
}

.nav-text {
  transition: color 0.3s ease;
  white-space: nowrap;
}

/* Mobile Navigation */
@media (max-width: 768px) {
  .navbar {
    bottom: 1rem;
    padding: 0.5rem 0.75rem;
    max-width: calc(100% - 2rem);
    left: 50%;
    transform: translateX(-50%);
  }

  .nav-links {
    gap: 0.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
  }

  .nav-links::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
  }

  .nav-link {
    padding: 0.4rem 0.65rem;
    font-size: 0.7rem;
    flex-shrink: 0;
  }

  .nav-text {
    font-size: 0.7rem;
  }
}

/* Even smaller screens */
@media (max-width: 480px) {
  .navbar {
    bottom: 0.75rem;
    padding: 0.4rem 0.6rem;
    max-width: calc(100% - 1.5rem);
  }

  .nav-link {
    padding: 0.35rem 0.55rem;
    font-size: 0.65rem;
  }

  .nav-text {
    font-size: 0.65rem;
  }
}


/* Hero Section */
.hero {
  padding-top: 100px;
  min-height: 100vh;
  /* Full viewport height for better presence */
  display: flex;
  align-items: center;
  padding-bottom: 8rem;
  /* Extra padding for bottom nav */
}

@media (max-width: 768px) {
  .hero {
    padding-top: 80px;
    min-height: 90vh;
    padding-bottom: 6rem;
  }
}

.hero-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
}

@media (max-width: 968px) {
  .hero-container {
    flex-direction: column-reverse;
    text-align: center;
  }

  .hero-content {
    max-width: 100%;
  }
}

.hero-content {
  flex: 1;
  max-width: 600px;
}

.hero-image-container {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-image {
  position: relative;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border-color);
  box-shadow: 0 0 20px rgba(56, 189, 174, 0.1);
  transition: var(--transition);
}

.hero-image::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent-color);
  opacity: 0.5;
  transition: var(--transition);
}

.hero-image:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(56, 189, 174, 0.2);
  border-color: var(--accent-color);
}

.hero-image:hover::after {
  opacity: 1;
  inset: -5px;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-weight: 400;
}

.hero-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

/* Contact Section Quote - Smaller & Subtle */
.contact-quote {
  margin-top: 2.5rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.contact-quote-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.6;
  margin-bottom: 0.4rem;
  font-family: 'Noto Sans Tamil', 'Latha', 'Tamil Sangam MN', sans-serif;
}

.contact-quote-attribution {
  font-size: 0.75rem;
  color: rgba(56, 189, 174, 0.7);
  text-align: right;
  font-weight: 400;
  font-family: 'Noto Sans Tamil', 'Latha', 'Tamil Sangam MN', sans-serif;
}

.hero-badges {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(56, 189, 174, 0.1);
  color: var(--accent-color);
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid rgba(56, 189, 174, 0.2);
}

.topmate-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.topmate-badge:hover {
  border-color: var(--accent-color);
  transform: translateY(-2px);
  background: rgba(56, 189, 174, 0.1);
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-color);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-color);
}


/* What I'm Doing Section */
.what-doing {
  padding-top: 2rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 3rem;
  position: relative;
  display: inline-block;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.service-card {
  background-color: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 2.5rem;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.service-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-color);
  box-shadow: 0 10px 30px -10px rgba(56, 189, 174, 0.2);
  background-color: rgba(30, 30, 30, 0.8);
}

.service-icon {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

.service-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.service-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
}

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

.skill-item {
  background-color: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  transition: var(--transition);
}

.skill-item:hover {
  border-color: var(--accent-color);
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(56, 189, 174, 0.15);
  background-color: rgba(30, 30, 30, 0.8);
}

.skill-icon {
  font-size: 2rem;
  display: none;
  /* Hide old icon span if present */
}

.skill-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin-bottom: 0.5rem;
}

.skill-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.skill-item:hover .skill-name {
  color: var(--text-primary);
}

/* Resume Timeline */
.timeline {
  position: relative;
  max-width: 800px;
  margin-left: 1rem;
  padding-left: 2rem;
  border-left: 2px solid var(--border-color);
}

.timeline-item {
  margin-bottom: 3rem;
  position: relative;
}

.timeline-dot {
  position: absolute;
  left: -2.6rem;
  top: 0.5rem;
  width: 1rem;
  height: 1rem;
  background-color: var(--card-bg);
  border: 2px solid var(--accent-color);
  border-radius: 50%;
}

.timeline-content {
  background-color: transparent;
}

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

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

.timeline-duration {
  font-size: 0.9rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
}

.timeline-company {
  color: var(--accent-color);
  font-weight: 500;
  margin-bottom: 1rem;
}

.timeline-details {
  list-style: disc;
  margin-left: 1.5rem;
  color: var(--text-secondary);
}

.timeline-details li {
  margin-bottom: 0.5rem;
}

/* Portfolio Section */
.portfolio-filter {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.filter-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}

.filter-btn.active,
.filter-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-color);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.portfolio-card {
  background-color: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.portfolio-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-color);
  background-color: rgba(30, 30, 30, 0.8);
}

.portfolio-image-placeholder {
  width: 100%;
  height: 180px;
  background-color: #252525;
}

.portfolio-image-container {
  width: 100%;
  height: 180px;
  background-color: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.social-link svg {
  width: 100%;
  height: 100%;
  transition: var(--transition);
}

.portfolio-img-contain {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.portfolio-info {
  padding: 1.5rem;
}

.portfolio-title {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.portfolio-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* Blog Section */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.blog-item {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.blog-date {
  min-width: 100px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding-top: 0.2rem;
}

.blog-details {
  flex: 1;
}

.blog-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.blog-title a {
  color: var(--text-primary);
}

.blog-title a:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

.blog-summary {
  color: var(--text-secondary);
}

/* Contact Section */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.contact-heading {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

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

.social-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.social-link {
  display: inline-block;
  width: 32px;
  height: 32px;
  color: var(--text-secondary);
  transition: var(--transition);
}

.social-link:hover {
  transform: translateY(-3px);
  color: var(--accent-color);
}

.contact-details p {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.btn-download {
  display: inline-block;
  margin-top: 2rem;
  background-color: transparent;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 500;
  transition: var(--transition);
}

.btn-download:hover {
  background-color: var(--accent-color);
  color: #121212;
}

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

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: inherit;
  transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-color);
}

.btn-submit {
  background-color: transparent;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
  align-self: flex-start;
}

.btn-submit:hover {
  background-color: var(--accent-color);
  color: #121212;
}

/* Footer style from target */
footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
  margin-top: 4rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Responsive */
/* Responsive */
@media (max-width: 900px) {
  .container {
    padding: 0 1.5rem;
  }

  .hero-title {
    font-size: 3rem;
  }
}

@media (max-width: 768px) {
  .hero {
    padding-top: 120px;
  }

  .hero-container {
    flex-direction: column-reverse;
    text-align: center;
    gap: 3rem;
  }

  .hero-content {
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-description {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-image {
    width: 250px;
    height: 250px;
    margin: 0 auto;
    /* Fix centering */
  }

  .hero-title {
    font-size: 2.5rem;
    line-height: 1.2;
  }

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

  .nav-container {
    justify-content: center;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    /* Allow scroll bar if needed or just space */
    -webkit-overflow-scrolling: touch;
  }

  .nav-links {
    gap: 1.5rem;
    font-size: 0.9rem;
    padding: 0 1rem;
    white-space: nowrap;
  }

  /* Center the status badge on mobile */
  .hero-content .hero-badges {
    justify-content: center;
  }

  .contact-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }

  .social-links {
    justify-content: center;
  }

  .btn-submit {
    /* Center submit button on mobile contact form */
    align-self: center;
  }

  .blog-item {
    flex-direction: column;
    gap: 0.5rem;
  }

  .timeline {
    margin-left: 0;
    padding-left: 20px;
    border-left-width: 2px;
  }

  .timeline-dot {
    left: -27px;
    /* Adjust for padding + border width */
  }
}

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

  .nav-links {
    gap: 1rem;
    font-size: 0.85rem;
  }
}