/* =============================================
   CUSTOM PROPERTIES
   ============================================= */
:root {
  --bg:             #ffffff;
  --bg-alt:         #f7f8fa;
  --text:           #1f2328;
  --text-secondary: #57606a;
  --accent:         #4f46e5;
  --accent-light:   #6366f1;
  --accent-tint:    #eef2ff;
  --accent-border:  #c7d2fe;
  --border:         #e1e4e8;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:      0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.05);
  --shadow-lift:    0 8px 24px rgba(79,70,229,.14), 0 4px 8px rgba(0,0,0,.06);
  --radius:         12px;
  --radius-sm:      8px;
  --font-body:      'Inter', system-ui, -apple-system, sans-serif;
  --font-heading:   'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-mono:      'JetBrains Mono', 'Fira Code', monospace;
  --max-width:      860px;
  --nav-h:          60px;
}

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color .15s;
}
a:hover { color: var(--accent-light); text-decoration: underline; }

ul, ol { list-style: none; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb { background: var(--accent-border); border-radius: 3px; }

/* =============================================
   NAVIGATION
   ============================================= */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: var(--nav-h);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(225,228,232,.7);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.nav-brand {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-brand:hover { color: var(--accent); text-decoration: none; }

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: .1rem;
}
.nav-links a {
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: .32rem .65rem;
  border-radius: 6px;
  transition: color .18s, background .18s;
  text-decoration: none;
}
.nav-links a:hover {
  color: var(--accent);
  background: var(--accent-tint);
  text-decoration: none;
}

/* =============================================
   LAYOUT HELPERS
   ============================================= */
#main-content { padding-top: var(--nav-h); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.section         { padding: 5rem 0; background: var(--bg); }
.section-alt     { padding: 5rem 0; background: var(--bg-alt); }
.section-accent  {
  padding: 5rem 0;
  background: linear-gradient(135deg, var(--accent-tint) 0%, rgba(238,242,255,.45) 100%);
  border-top: 1px solid var(--accent-border);
  border-bottom: 1px solid var(--accent-border);
}

/* =============================================
   SECTION HEADINGS
   ============================================= */
.section-heading {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .4rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  letter-spacing: -.01em;
}

.section-sub {
  font-size: .95rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.rule {
  width: 44px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 2px;
  margin: .6rem 0 2.25rem;
  border: none;
}

/* =============================================
   HERO
   ============================================= */
.hero {
  padding: 6.5rem 0 5rem;
  text-align: center;
  background: var(--bg);
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-border);
  box-shadow: 0 0 0 6px var(--accent-tint), var(--shadow-md);
  margin: 0 auto 1.5rem;
  display: block;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.025em;
  line-height: 1.1;
  margin-bottom: .5rem;
}

.hero-role {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.hero-intro {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto 2rem;
  line-height: 1.78;
}

/* Social pills */
.social-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: center;
  margin-bottom: 1.75rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .48rem 1.1rem;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform .18s, box-shadow .18s, opacity .18s;
  white-space: nowrap;
}
.pill:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  opacity: .92;
}
.pill svg { width: 15px; height: 15px; flex-shrink: 0; }

.pill-github     { background: #24292f; color: #fff; }
.pill-linkedin   { background: #0a66c2; color: #fff; }
.pill-email      { background: var(--bg-alt); color: var(--text); border-color: var(--border); }
.pill-hackerrank { background: #00ea64; color: #1a1a1a; }

/* Stat chips */
.stat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  justify-content: center;
}

.chip {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .32rem .85rem;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}
.chip strong { color: var(--accent); font-weight: 700; }

/* =============================================
   OPEN SOURCE SECTION
   ============================================= */
.stats-bar {
  background: rgba(255,255,255,.75);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: center;
  margin: 1.75rem 0;
}

.stat-item { text-align: center; min-width: 70px; }
.stat-item .val {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.stat-item .lbl {
  font-size: .75rem;
  color: var(--text-secondary);
  margin-top: .15rem;
}

.pr-list { margin: 1.5rem 0; }
.pr-item {
  padding: .8rem 0;
  border-bottom: 1px solid rgba(199,210,254,.5);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .6rem 1rem;
  align-items: start;
}
.pr-item:last-child { border-bottom: none; }

.pr-repo {
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 500;
  color: var(--accent);
  background: rgba(79,70,229,.08);
  padding: .18rem .5rem;
  border-radius: 4px;
  white-space: nowrap;
  align-self: center;
}

.pr-body {}
.pr-title {
  font-size: .88rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}
.pr-title a { color: var(--text); }
.pr-title a:hover { color: var(--accent); text-decoration: none; }

.pr-impact {
  font-size: .78rem;
  color: var(--text-secondary);
  margin-top: .2rem;
  line-height: 1.5;
}

.badge-merged {
  display: inline-block;
  font-size: .68rem;
  font-weight: 600;
  padding: .1rem .42rem;
  border-radius: 4px;
  background: #dafbe1;
  color: #1a7f37;
  margin-left: .4rem;
  vertical-align: middle;
}

.badge-review {
  display: inline-block;
  font-size: .68rem;
  font-weight: 600;
  padding: .1rem .42rem;
  border-radius: 4px;
  background: #fff1e5;
  color: #953800;
  margin-left: .4rem;
  vertical-align: middle;
}

.github-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin: 2rem 0 .5rem;
}
.github-stats img {
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-border);
  max-height: 165px;
  width: auto;
}

/* =============================================
   MERMAID / DIAGRAMS
   ============================================= */
.diagram-wrapper {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem 1.5rem;
  margin: 2rem 0;
  overflow-x: auto;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.diagram-wrapper { width: 100%; text-align: center; }
.diagram-wrapper .mermaid,
.mermaid { display: block; width: 100%; min-width: 0; margin: 1.25rem auto; text-align: center; }
/* Force mermaid SVGs to scale up to the content column (override mermaid's small inline max-width) */
.mermaid svg { width: 100% !important; max-width: 820px !important; height: auto !important; }

.diagram-caption {
  text-align: center;
  font-size: .82rem;
  color: var(--text-secondary);
  margin-top: .75rem;
  font-style: italic;
}

/* =============================================
   EXPERIENCE
   ============================================= */
.timeline { margin-top: 2.5rem; }

.timeline-item {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 3rem;
  border-left: 2px solid var(--border);
}
.timeline-item.current { border-left-color: var(--accent); }

.timeline-item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
}
.timeline-item.current::before { background: var(--accent); }

.exp-co {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .15rem;
}
.exp-meta {
  font-size: .83rem;
  color: var(--text-secondary);
  margin-bottom: .85rem;
}
.exp-meta strong { color: var(--text); font-weight: 600; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-bottom: .9rem;
}
.tag {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .16rem .5rem;
  font-size: .73rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.bullets { padding: 0; }
.bullets li {
  position: relative;
  padding: .3rem 0 .3rem 1.3rem;
  font-size: .9rem;
  color: var(--text-secondary);
  line-height: 1.65;
}
.bullets li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}
.bullets li strong { color: var(--text); }
.bullets li a { color: var(--accent); }

/* =============================================
   PROJECT CARDS
   ============================================= */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform .22s, box-shadow .22s, border-color .22s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
  border-color: var(--accent-border);
}

.card-emoji { font-size: 1.75rem; margin-bottom: .7rem; display: block; }

.card-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .45rem;
  line-height: 1.3;
}

.card-desc {
  font-size: .865rem;
  color: var(--text-secondary);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 1.1rem;
}

.card-links {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
}
.card-link {
  font-size: .78rem;
  font-weight: 600;
  color: var(--accent);
  padding: .3rem .75rem;
  border: 1px solid var(--accent-border);
  border-radius: 6px;
  transition: background .18s, color .18s;
  text-decoration: none;
}
.card-link:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

/* =============================================
   SKILLS BADGES
   ============================================= */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.skill-group {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem 1.4rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s;
}
.skill-group:hover { box-shadow: var(--shadow-md); }

.skill-group-title {
  font-family: var(--font-heading);
  font-size: .75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .75rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}

.badges { display: flex; flex-wrap: wrap; gap: .4rem; }
.badges img {
  height: 22px;
  width: auto;
  border-radius: 4px;
  transition: transform .15s, box-shadow .15s;
}
.badges img:hover {
  transform: scale(1.08) translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* =============================================
   ACHIEVEMENT CARDS
   ============================================= */
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.a-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem 1.3rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.a-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
}
.a-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: var(--accent-border);
}

.a-rank {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
  margin-bottom: .3rem;
}

.a-title {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .25rem;
  line-height: 1.4;
}

.a-meta {
  font-size: .77rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.a-meta a { color: var(--accent); }

/* =============================================
   EDUCATION
   ============================================= */
.edu-list { margin-top: 2rem; }

.edu-item {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.edu-item:last-child { border-bottom: none; }

.edu-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  background: var(--accent-tint);
  border: 1px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.edu-degree {
  font-family: var(--font-heading);
  font-size: .98rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .15rem;
}
.edu-school {
  font-size: .855rem;
  color: var(--text-secondary);
}
.edu-school a { color: var(--accent); }

/* =============================================
   CONTACT / FOOTER
   ============================================= */
.contact-section {
  background: var(--text);
  color: rgba(255,255,255,.8);
  padding: 5rem 0 3.5rem;
  text-align: center;
}

.contact-section .section-heading {
  color: #fff;
  justify-content: center;
  margin-bottom: .4rem;
}
.contact-section .section-sub { color: rgba(255,255,255,.5); }

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  justify-content: center;
  margin: 2rem 0;
}

.c-pill {
  padding: .55rem 1.25rem;
  border-radius: 999px;
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  transition: transform .18s, background .18s;
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.85);
  background: rgba(255,255,255,.07);
}
.c-pill:hover {
  background: rgba(255,255,255,.14);
  color: #fff;
  transform: translateY(-2px);
  text-decoration: none;
}
.c-pill.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.c-pill.primary:hover { background: var(--accent-light); }

.footer-note {
  font-size: .75rem;
  color: rgba(255,255,255,.25);
  margin-top: 2.5rem;
}

/* =============================================
   CODE / PRE
   ============================================= */
code {
  font-family: var(--font-mono);
  font-size: .875em;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .15em .4em;
  color: var(--text);
}

pre {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.25rem 0;
}
pre code { background: none; border: none; padding: 0; font-size: .85em; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 640px) {
  .nav-brand    { display: none; }
  .nav-inner    { justify-content: center; padding: 0 1rem; }
  .nav-links a  { padding: .28rem .5rem; font-size: .78rem; }

  .hero         { padding: 4.5rem 0 3rem; }
  .hero h1      { font-size: 1.85rem; }
  .hero-intro   { font-size: .95rem; }

  .section,
  .section-alt,
  .section-accent { padding: 3.5rem 0; }

  .container { padding: 0 1.25rem; }

  .card-grid           { grid-template-columns: 1fr; }
  .achievement-grid    { grid-template-columns: 1fr; }
  .skills-grid         { grid-template-columns: 1fr; }
  .github-stats        { flex-direction: column; align-items: center; }
  .stats-bar           { gap: .75rem 1.5rem; }

  .pr-item { grid-template-columns: 1fr; }
  .pr-repo { justify-self: start; }
}

@media (max-width: 400px) {
  .social-pills { gap: .4rem; }
  .pill         { padding: .4rem .85rem; font-size: .8rem; }
  .stat-chips   { gap: .35rem; }
  .chip         { font-size: .75rem; }
}
