@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap");

:root {
  
  --bg: #0f172a;
  --text: #f8fafc;
  --accent: #38bdf8;
  --card: #1e293b;
  --hero-end: #1e293b;
  --shadow: rgba(0, 0, 0, 0.2);
  --shadow-strong: rgba(0, 0, 0, 0.28);
}

[data-theme="light"] {
  
  --bg: #ffffff;
  --text: #0f1c30;
  --card: #f3f6fb;
  --accent: #0284c7;
  --hero-end: #e0f2fe;
  --shadow: rgba(15, 23, 42, 0.08);
  --shadow-strong: rgba(15, 23, 42, 0.14);
}

html {
  scroll-behavior: smooth;
}

body {
 
  font-family: "Poppins", sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  position: sticky;
  top: 0;
  background: var(--bg);
  box-shadow: 0 2px 10px var(--shadow);
  z-index: 999;
}

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

.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: var(--accent);
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  line-height: 1;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  z-index: 1001;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

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

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

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

.hero {
  height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(145deg, var(--bg), var(--hero-end));
}

.hero h1 {
  font-size: 3rem;
  margin: 0;
}

.subtitle {
  opacity: 0.8;
  font-size: 1.2rem;
}

.btn {
  display: inline-block;
  margin-top: 1.5rem;
  background: var(--accent);
  color: var(--bg);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s ease, background 0.3s ease;
}

.btn:hover {
  transform: scale(1.05);
  background: color-mix(in srgb, var(--accent) 85%, black);
}

.section {
  padding: 5rem 2rem;
  max-width: 1100px;
  margin: auto;
}

h2 {
  text-align: center;
  margin-bottom: 3rem;
  font-size: 2rem;
}

.about-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 3rem;
  align-items: center;
}

.profile-pic {
  width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 0 20px color-mix(in srgb, var(--accent) 20%, transparent);
  justify-self: center;
}

.profile-logo {
  width: 38px;
  height: 38px;
  min-width: 38px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 0 20px color-mix(in srgb, var(--accent) 20%, transparent);
  border: 2px solid var(--accent);
  display: block;
  flex-shrink: 0;
}

.about-grid p {
  margin: 0;
}

h2 + .section-subtitle {
  margin-top: -2.25rem;
}

.section-subtitle {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 3rem;
  opacity: 0.75;
  font-size: 0.95rem;
}

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

.card {
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px var(--shadow-strong);
}

.card-image-wrap {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.project-card {
  cursor: pointer;
}

.project-modal-box {
  max-width: 700px;
}

.project-modal-image-wrap {
  margin: -2rem -2rem 1.25rem;
  overflow: hidden;
  border-radius: 14px 14px 0 0;
}

.project-modal-image-wrap img {
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  background: color-mix(in srgb, var(--card) 60%, black 10%);
  display: block;
}

.project-modal-box .tags {
  margin-top: 1rem;
}

.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.card:hover .card-image-wrap img {
  transform: scale(1.06);
}

.card-body {
  padding: 1.25rem 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}

.card-body h3 {
  margin: 0;
  font-size: 1.15rem;
}

.card-body p {
  margin: 0;
  opacity: 0.85;
  font-size: 0.95rem;
  flex: 1;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-pill {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.project-buttons {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.4rem;
}

.btn-outline {
  border: 1.5px solid var(--accent);
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  transition: background 0.25s ease, color 0.25s ease;
}

.btn-outline:hover {
  background: var(--accent);
  color: var(--bg);
}

.btn-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.placeholder-card {
  border: 2px dashed color-mix(in srgb, var(--accent) 35%, transparent);
  background: transparent;
}

.placeholder-image {
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  color: var(--accent);
  font-weight: 600;
  font-size: 1.05rem;
}

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

.internship-card .card-body {
  gap: 0.5rem;
}

.internship-company {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  opacity: 1;
  margin: 0 0 0.25rem;
}

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

.certificate-image-wrap {
  position: relative;
  user-select: none;
}

.certificate-image-wrap img {
  -webkit-user-drag: none;
}

.watermark-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><text x='-10' y='140' font-size='22' fill='rgba(255,255,255,0.4)' font-family='Poppins, sans-serif' font-weight='600' transform='rotate(-28 130,130)'>VIEW ONLY</text></svg>");
  background-repeat: repeat;
  mix-blend-mode: normal;
}

.certificate-modal-image-wrap {
  position: relative;
  margin-top: 0.5rem;
  border-radius: 10px;
  overflow: hidden;
  user-select: none;
}

.certificate-modal-image-wrap img {
  width: 100%;
  display: block;
  -webkit-user-drag: none;
}

.certificate-modal-box {
  max-width: 640px;
}

.certificate-view-note {
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.6;
  margin-top: 0.75rem;
  margin-bottom: 0;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.hero-buttons .btn {
  margin-top: 0;
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

.btn-secondary:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  transform: scale(1.05);
}

.nav-resume-btn {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
}

.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding-left: 2rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(var(--accent), transparent 95%);
  opacity: 0.4;
}

.timeline-item {
  position: relative;
  padding: 0 0 2.5rem 1.75rem;
  cursor: pointer;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 0.25rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.timeline-item:hover .timeline-dot {
  transform: scale(1.2);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 50%, transparent);
}

.timeline-period {
  display: inline-block;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.timeline-card {
  background: var(--card);
  border-radius: 10px;
  padding: 1.1rem 1.4rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.timeline-item:hover .timeline-card {
  transform: translateX(6px);
  box-shadow: 0 8px 20px var(--shadow);
}

.timeline-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

.timeline-card p {
  margin: 0;
  opacity: 0.8;
  font-size: 0.9rem;
}

.timeline-hint {
  display: inline-block;
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.visible {
  display: flex;
}

.modal-box {
  background: var(--card);
  color: var(--text);
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  border-radius: 14px;
  padding: 2rem;
  position: relative;
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.modal-close:hover {
  opacity: 1;
}

.modal-period {
  display: inline-block;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.5rem;
}

.modal-box h3 {
  margin: 0 0 0.75rem;
}

.modal-box p {
  opacity: 0.85;
  white-space: pre-line;
}

.modal-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.modal-images img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
}

.modal-images-empty {
  margin-top: 1.25rem;
  padding: 1.5rem;
  border: 2px dashed color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 8px;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.6;
}

.contact p {
  text-align: center;
  margin-bottom: 2rem;
}

.socials {
  text-align: center;
}

.socials a {
  color: var(--accent);
  margin: 0 1rem;
  text-decoration: none;
  font-weight: 600;
}

footer {
  text-align: center;
  padding: 1.5rem;
  background: var(--card);
  margin-top: 4rem;
  font-size: 0.9rem;
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--card);
  position: relative;
  cursor: pointer;
  overflow: hidden;
  transition: background 0.4s ease;
}

.theme-toggle .icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%) rotate(0deg);
  box-shadow: 0 0 8px var(--accent);
  transition: all 0.5s ease;
}

body[data-theme="light"] .theme-toggle .icon {
  background: #facc15; 
  box-shadow: 0 0 10px #facc15, 0 0 30px #fde68a;
  transform: translate(-50%, -50%) rotate(180deg);
}

body[data-theme="dark"] .theme-toggle .icon {
  background: #38bdf8; 
  box-shadow: 0 0 10px #38bdf8, inset -4px 0 0 0 #0f172a;
  transform: translate(-50%, -50%) rotate(360deg);
}

/* Base: make everything fluid by default */
* {
  box-sizing: border-box;
}

img {
  max-width: 100%;
}

.section {
  width: 100%;
}

/* Large desktops / wide screens */
@media (min-width: 1400px) {
  .section {
    max-width: 1280px;
  }

  .hero h1 {
    font-size: 3.5rem;
  }
}

/* Tablets and small laptops */
@media (max-width: 1024px) {
  .section {
    max-width: 100%;
    padding: 4.5rem 2rem;
  }

  .about-grid {
    grid-template-columns: 200px 1fr;
    gap: 2rem;
  }

  .project-grid,
  .internship-grid,
  .certificate-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

/* Tablets / large phones */
@media (max-width: 768px) {
  .navbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    position: relative;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    margin-top: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    box-shadow: 0 12px 24px var(--shadow-strong);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.3s ease, opacity 0.25s ease;
  }

  .nav-links.active {
    max-height: 80vh;
    opacity: 1;
    pointer-events: auto;
    overflow-y: auto;
  }

  .nav-links li {
    width: 100%;
    text-align: center;
  }

  .nav-links a {
    display: block;
    padding: 0.9rem 1.5rem;
    border-bottom: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
  }

  .nav-links li:has(.theme-toggle) {
    display: flex;
    justify-content: center;
    padding: 1rem 0 1.25rem;
    border-bottom: none;
  }

  .nav-links li:nth-last-child(2) a {
    border-bottom: none;
  }

  .hero {
    height: auto;
    min-height: 80vh;
    padding: 4rem 1.25rem;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

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

  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
  }

  .section {
    padding: 4rem 1.5rem;
  }

  h2 {
    font-size: 1.6rem;
    margin-bottom: 2.25rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .profile-pic {
    margin: 0 auto;
    width: 180px;
    height: 180px;
  }

  .project-grid,
  .internship-grid,
  .certificate-grid {
    grid-template-columns: 1fr;
  }

  .socials {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .socials a {
    margin: 0;
  }

  .timeline {
    padding-left: 2rem;
  }

  .timeline-item {
    padding-left: 1.25rem;
  }

  .timeline-dot {
    left: -1.5rem;
  }

  .timeline-card {
    padding: 1rem 1.1rem;
  }

  .modal-box {
    padding: 1.5rem;
    max-height: 90vh;
  }

  .project-modal-image-wrap {
    margin: -1.5rem -1.5rem 1rem;
  }

  .project-modal-image-wrap img {
    max-height: 45vh;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .logo {
    font-size: 1.15rem;
    gap: 0.5rem;
  }

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

  .nav-links a {
    padding: 0.8rem 1.25rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero .subtitle {
    font-size: 0.9rem;
    padding: 0 0.5rem;
  }

  .btn {
    width: 100%;
    text-align: center;
    padding: 0.7rem 1.25rem;
  }

  .section {
    padding: 3rem 1.1rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  .card-body {
    padding: 1rem 1rem 1.25rem;
  }

  .card-body h3 {
    font-size: 1.05rem;
  }

  .card-body p {
    font-size: 0.88rem;
  }

  .modal-box {
    padding: 1.1rem;
    border-radius: 10px;
  }

  .modal-overlay {
    padding: 0.75rem;
  }

  .modal-images {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  }

  .certificate-modal-box,
  .project-modal-box {
    max-width: 100%;
  }

  .project-modal-image-wrap {
    margin: -1.1rem -1.1rem 1rem;
    border-radius: 8px 8px 0 0;
  }

  .contact-box {
    width: 100%;
    text-align: center;
  }

  footer {
    padding: 1.25rem 1rem;
    font-size: 0.8rem;
  }
}

/* Very small phones */
@media (max-width: 340px) {
  .hero h1 {
    font-size: 1.7rem;
  }

  .nav-links a {
    font-size: 0.9rem;
    padding: 0.7rem 1rem;
  }
}

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s ease-out;
}

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

.contact-box {
  margin: 1.5rem auto 0;
  padding: 1rem 1.5rem;
  background: var(--card);
  border-radius: 10px;
  width: fit-content;
  color: var(--accent);
  font-weight: 600;
  font-size: 1.1rem;
  box-shadow: 0 0 15px color-mix(in srgb, var(--accent) 15%, transparent);
  transition: transform 0.3s ease;
}

.contact-box:hover {
  transform: translateY(-4px);
}

