:root {
  --bg: #0f1117;
  --surface: #171a23;
  --surface-2: #1e2230;
  --text: #e7e9ee;
  --muted: #9aa1b1;
  --accent: #6d8cff;
  --accent-hover: #5878ff;
  --border: #262b3a;
  --radius: 14px;
  --max-width: 860px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- Hero ---------- */
/* ---------- Hero ---------- */
.hero {
  padding: 100px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 30% 20%, rgba(109, 140, 255, 0.1), transparent 50%),
              radial-gradient(circle at 70% 80%, rgba(109, 140, 255, 0.06), transparent 50%),
              var(--bg);
  min-height: 60vh;
  display: flex;
  align-items: center;
}

/* Animated background orb */
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(109, 140, 255, 0.05), transparent 60%);
  animation: heroOrb 20s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes heroOrb {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(10%, 10%) scale(1.2); }
}

.hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
}

.name {
  font-size: clamp(2.8rem, 8vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text) 0%, var(--text) 40%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 0.8s ease;
}

.designation {
  color: var(--muted);
  font-size: 1.25rem;
  margin-top: 8px;
  font-weight: 500;
  animation: fadeInUp 0.8s ease 0.2s both;
}

.current {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  animation: fadeInUp 0.8s ease 0.3s both;
}

.actions {
  margin-top: 32px;
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  animation: fadeInUp 0.8s ease 0.4s both;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
  min-width: 160px;
}

.btn-icon {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.btn:hover .btn-icon {
  transform: none;
}

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

.btn-outline {
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-primary .btn-icon {
  stroke: #fff;
}

.btn-outline .btn-icon {
  stroke: var(--text);
}

.btn-outline:hover .btn-icon {
  stroke: var(--accent);
}

/* ---------- Sections ---------- */
section { padding: 44px 0; border-top: 1px solid var(--border); }

/* Scroll-reveal: sections fade/slide in as they enter view (JS only) */
.js main > section {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js main > section.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .js main > section { opacity: 1; transform: none; transition: none; }
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}

/* ---------- About ---------- */
.about-text {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
}
.about-text strong { color: var(--text); font-weight: 600; }

/* ---------- Experience ---------- */
.exp-item { margin-bottom: 24px; }
.exp-item:last-child { margin-bottom: 0; }

.exp-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.exp-company { font-size: 1.1rem; font-weight: 600; }
.exp-date { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }
.exp-role { color: var(--muted); font-size: 0.92rem; margin-top: 2px; }
.exp-desc { color: var(--muted); margin-top: 6px; }

/* Bullet lists inside description text */
.desc-list {
  margin: 6px 0 0;
  padding-left: 1.2em;
}
.desc-list li { margin: 2px 0; }

/* ---------- Skills ---------- */
.skill-group { margin-bottom: 22px; }
.skill-group:last-child { margin-bottom: 0; }
.skill-group-label {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 12px;
}
.skills-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.skills-list li {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 7px 15px;
  border-radius: 999px;
  font-size: 0.9rem;
}

/* ---------- Projects ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.project-card:hover { transform: translateY(-3px); border-color: var(--accent); }

/* Pinned badge — solid accent pill (original look) */
.pin-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.pin-badge svg { flex-shrink: 0; }

/* Status labels — solid, colour-coded pill with a small dot */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.status-badge.is-live {
  background: #13291d;
  border: 1px solid #2f6043;
  color: #6ee7a0;
}
.status-badge.is-soon {
  background: #2a2113;
  border: 1px solid #6b532b;
  color: #edc07a;
}

/* Status labels stack top-left without overlapping */
.status-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.s-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.s-dot-live { background: #4ade80; animation: livePulse 1.8s ease-out infinite; }
.s-dot-soon { background: #e0a84f; }

@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5); }
  70%  { box-shadow: 0 0 0 5px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

/* Status projects stay visually neutral — the label alone signals state. */

/* Inline note where links would go, for status projects without links yet */
.project-wip,
.project-building {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.project-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: var(--surface-2);
}
/* Real cover images are clickable to preview full size */
img.project-cover { cursor: zoom-in; transition: opacity 0.15s ease; }
img.project-cover:hover { opacity: 0.9; }

/* Fallback shown when a cover is missing or fails to load */
.project-cover-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  border-bottom: 1px solid var(--border);
}
.project-cover-ph span {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
}

/* Cards hidden until "See more" is clicked */
.project-card.is-hidden,
.cert-card.is-hidden { display: none; }
.projects-grid.show-all .project-card.is-hidden,
.cert-grid.show-all .cert-card.is-hidden { display: flex; }

.see-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}
.see-more-btn { cursor: pointer; background: transparent; }

.project-body {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.project-name { font-size: 1.05rem; font-weight: 600; }

/* Headline metric chip, e.g. "30+ FPS on edge" */
.project-metric {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  margin-top: 8px;
  padding: 3px 11px;
  border-radius: 999px;
  background: rgba(109, 140, 255, 0.1);
  border: 1px solid rgba(109, 140, 255, 0.32);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
}
.project-metric svg { flex-shrink: 0; }

.project-desc { color: var(--muted); font-size: 0.92rem; margin-top: 10px; }

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.project-tag {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.project-links {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
  flex-wrap: wrap;
}
.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.project-link:hover { border-color: var(--accent); color: var(--accent); }
.project-link svg { flex-shrink: 0; }

/* ---------- Certifications ---------- */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.cert-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.cert-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.cert-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(109, 140, 255, 0.12);
  color: var(--accent);
}
.cert-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
.cert-name { font-size: 0.98rem; font-weight: 600; line-height: 1.3; }
.cert-issuer { color: var(--muted); font-size: 0.88rem; }
.cert-date { color: var(--muted); font-size: 0.8rem; opacity: 0.8; }
.cert-link {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.cert-link:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Education ---------- */
.edu-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.edu-item:last-child { margin-bottom: 0; }
.edu-institute { font-size: 1.05rem; font-weight: 600; }
.edu-degree { color: var(--muted); font-size: 0.92rem; margin-top: 2px; }
.edu-date { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }

/* ---------- Get in Touch ---------- */
.contact-lead {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 20px;
}
.contact-email {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}
.contact-email:hover { border-color: var(--accent); }

.contact-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  background: var(--surface);
  transition: transform 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.social-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-3px);
}
.social-link svg { display: block; }

/* ---------- Footer ---------- */
.footer {
  padding: 30px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------- Back to top ---------- */
.to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 900;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s,
    border-color 0.15s ease, color 0.15s ease;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ---------- Image preview (lightbox) ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(6, 7, 10, 0.9);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.2s ease;
  cursor: zoom-out;
}
.lightbox.open {
  display: flex;
  opacity: 1;
}
.lightbox-img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  cursor: default;
  animation: lightboxZoom 0.2s ease;
  opacity: 1;
  transition: opacity 0.2s ease;
}
/* Hide the image and show the spinner while the file is still downloading */
.lightbox.loading .lightbox-img { opacity: 0; }
.lightbox-spinner {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  animation: lightboxSpin 0.8s linear infinite;
  display: none;
}
.lightbox.loading .lightbox-spinner { display: block; }
@keyframes lightboxSpin { to { transform: rotate(360deg); } }
@keyframes lightboxZoom {
  from { transform: scale(0.96); opacity: 0.6; }
  to   { transform: scale(1); opacity: 1; }
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 22px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.18); transform: scale(1.05); }
