/* ================================
   T KARTHIKEYAN PORTFOLIO STYLES
   Author: KK
   ================================ */

:root {
  --bg: #0b0b0c;
  --panel: #101214;
  --text: #f0f4f7;
  --muted: #a3abb5;
  --accent: #9b59ff;
  --accent-hover: #b37aff;
  --transition: all 0.25s ease;
  --radius: 12px;
  --shadow: 0 0 20px rgba(155, 89, 255, 0.25);
  --font-main: "Poppins", "Segoe UI", sans-serif;
}

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

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

/* ===== NAVBAR ===== */
.navbar {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 10%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: sticky;
  top: 0;
  z-index: 50;
}

.logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}
.logo span {
  color: var(--accent);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 28px;
}

.nav-links li a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  transition: var(--transition);
}
.nav-links li a:hover,
.nav-links li a.active {
  color: var(--accent);
}

#themeToggle {
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 1.3rem;
  cursor: pointer;
  transition: var(--transition);
}
#themeToggle:hover {
  color: var(--accent-hover);
}

/* ===== HERO ===== */
.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 60px 10%;
  flex-wrap: wrap;
}

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

.hero-left h1 {
  font-size: 2.4rem;
  margin-bottom: 16px;
}
.highlight {
  color: var(--accent);
}

.hero-left p {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.hero-buttons {
  display: flex;
  gap: 12px;
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}
.btn:hover {
  background: var(--accent);
  color: #0b0b0c;
}
.btn.primary {
  background: var(--accent);
  color: #0b0b0c;
}
.btn.primary:hover {
  background: var(--accent-hover);
}

.hero-right {
  flex: 1 1 280px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.profile-pic {
  border-radius: 50%;
  width: 240px;
  height: 240px;
  object-fit: cover;
  border: 3px solid var(--accent);
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.profile-pic:hover {
  transform: scale(1.05);
}

/* ===== SKILLS ===== */
.skills {
  padding: 50px 10%;
  background: var(--panel);
  text-align: center;
}
.skills h2 {
  font-size: 1.8rem;
  margin-bottom: 28px;
}
.skill-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.skill-grid span {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  padding: 8px 14px;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: var(--transition);
}
.skill-grid span:hover {
  background: var(--accent);
  color: #0b0b0c;
}

/* ===== PROJECTS ===== */
.projects {
  padding: 60px 10%;
}
.projects h2 {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 36px;
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}
.project-card {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: var(--transition);
}
.project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}
.project-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}
.project-info {
  padding: 18px;
}
.project-info h3 {
  margin-bottom: 10px;
  color: var(--accent);
}
.project-info p {
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 16px;
}
.view-more {
  text-align: center;
  margin-top: 28px;
}

/* ===== ABOUT PREVIEW ===== */
.about-preview {
  padding: 60px 10%;
  background: var(--panel);
  text-align: center;
}
.about-preview h2 {
  margin-bottom: 16px;
}
.about-preview p {
  color: var(--muted);
  max-width: 700px;
  margin: 0 auto 20px auto;
  line-height: 1.6;
}

/* ===== CONTACT PREVIEW ===== */
.contact-preview {
  padding: 60px 10%;
  text-align: center;
}
.contact-preview h2 {
  margin-bottom: 12px;
}
.contact-preview p {
  color: var(--muted);
  margin-bottom: 20px;
}

/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
  color: var(--muted);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 860px) {
  .hero {
    flex-direction: column-reverse;
    text-align: center;
  }
  .hero-right {
    margin-bottom: 28px;
  }
  .nav-links {
    gap: 18px;
  }
}

@media (max-width: 480px) {
  .profile-pic {
    width: 180px;
    height: 180px;
  }
  .btn {
    padding: 8px 14px;
  }
}

/* =========================*/

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  animation: ripple-effect 0.6s linear;
  transform: scale(0);
  pointer-events: none;
}
@keyframes ripple-effect {
  to { transform: scale(4); opacity: 0; }
}
.btn { position: relative; overflow: hidden; }


/* ===== MODAL ===== */
.modal.hidden { display: none; }
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-content {
  background: #111;
  padding: 20px;
  border-radius: 10px;
  max-width: 600px;
  width: 90%;
  text-align: center;
  animation: fadeIn 0.3s ease;
}
.modal-content img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 14px;
}
.close {
  position: absolute;
  top: 20px;
  right: 28px;
  font-size: 28px;
  color: #fff;
  cursor: pointer;
}


@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}


/* =============== */

body.light-gradient {
  background: radial-gradient(circle at top left, #f0e9ff 0%, #0b0b0c 80%);
  color: #eaeaea;
}
.contact-section, .about-main {
  padding: 60px 10%;
  text-align: center;
}
.about-photo img {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  margin-bottom: 20px;
}
.skill-list {
  list-style: none;
  margin: 16px 0;
}
.skill-list li {
  margin-bottom: 6px;
}
.stats-grid {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin: 20px 0;
}
.stats-grid div {
  background: rgba(255,255,255,0.05);
  padding: 10px 20px;
  border-radius: 10px;
  text-align: center;
}
.contact-links {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}
.contact-extra ul {
  list-style: none;
  padding: 0;
}
.contact-extra li {
  margin: 6px 0;
  color: var(--muted);
}


/* ===== GENERAL MOBILE FIXES ===== */

/* Offset for fixed navbar */
body {
  padding-top: 80px; /* ensures top content not hidden under nav */
}

/* Navbar mobile layout */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 15px 6%;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    gap: 15px;
    margin-top: 10px;
  }

  .nav-links a {
    font-size: 0.95rem;
  }

  /* 🌓 toggle reposition */
  #themeToggle {
    align-self: center;
    margin-top: 10px;
    font-size: 1.3rem;
  }

  /* Prevent background from overlapping contact form */
  section, .contact-container, .about-wrapper, .projects-wrapper {
    margin-top: 20px;
  }
}

