/* Reset + base */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #222;
  line-height: 1.5;
}

/* Side nav bar */
.sidenav {
  height: 100vh;
  width: 200px;
  position: fixed;
  left: 0;
  top: 0;
  background-color: #333;
  padding: 20px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: 2px 0 10px rgba(0,0,0,0.18);
  z-index: 10;
}

.nav-profile { text-align: center; }

.nav-image {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.nav-name {
  color: #fff;
  margin: 10px 0 0;
  font-size: 1rem;
}

.sidenav ul {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  width: 100%;
}

.sidenav li { margin: 10px 0; }

.sidenav a {
  display: block;
  color: #fff;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 6px;
}

.sidenav a:hover { background-color: #575757; }

/* Main content: ensure it doesn't sit under the fixed sidebar */
main {
  margin-left: 220px; /* 200px sidebar + 20px gap */
  padding: 24px;
}

section {
  padding: 16px 0;
  max-width: 900px;
}

/* Optional section headings styling */
section h1, section h2 {
  margin: 0 0 8px;
}

/* Responsive: stack nav on top for small screens */
@media (max-width: 768px) {
  .sidenav {
    position: sticky;
    top: 0;
    height: auto;
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    padding: 12px 16px;
  }

  .nav-profile {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .nav-image { width: 44px; height: 44px; }
  .nav-name { font-size: 0.95rem; }

  .sidenav ul {
    display: flex;
    gap: 8px;
    width: auto;
    margin: 0;
  }

  .sidenav li { margin: 0; }

  main {
    margin-left: 0;
    padding: 16px;
  }
}

/* ---------- Theme & utilities ---------- */
:root{
  --bg: #f7f8fb;
  --surface: #ffffff;
  --ink: #1f2a37;
  --muted: #6b7280;
  --brand: #2563eb;          /* primary */
  --brand-2: #7c3aed;        /* accent */
  --ring: rgba(37, 99, 235, .18);
  --shadow: 0 10px 25px rgba(0,0,0,.08);
  --radius: 16px;
}

@media (prefers-color-scheme: dark){
  :root{
    --bg:#0b1020; --surface:#111833; --ink:#e5e7eb; --muted:#9aa2b2;
    --shadow: 0 8px 20px rgba(0,0,0,.45);
  }
}

body{ background: var(--bg); color: var(--ink); }

/* Better anchors (accounting for sticky nav on mobile) */
section { scroll-margin-top: 84px; }

/* ---------- Section framing & headers ---------- */
main { background: transparent; }

section{
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px 28px 18px;
  margin: 22px 0;
  box-shadow: var(--shadow);
  border: 1px solid rgba(99,102,241,.08);
  position: relative;
  overflow: clip;
}

/* Gradient accent bar on section */
section::before{
  content:"";
  position: absolute; inset: 0 auto 0 0;
  width: 5px; border-radius: 8px 0 0 8px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  opacity: .9;
}

/* Headings with subtle underline */
section h1, section h2{
  font-weight: 800;
  letter-spacing: .2px;
  margin: 0 0 14px;
  position: relative;
}

section h1::after, section h2::after{
  content:"";
  display:block;
  width: 56px; height: 3px; margin-top: 8px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  border-radius: 999px;
  opacity: .9;
}

/* ---------- Subtle entrance animation ---------- */
@media (prefers-reduced-motion: no-preference){
  section{
    animation: rise .6s ease both;
    transform-origin: 50% 80%;
  }
  section:nth-of-type(2){ animation-delay: .03s; }
  section:nth-of-type(3){ animation-delay: .06s; }
  section:nth-of-type(4){ animation-delay: .09s; }
  @keyframes rise{
    from{ opacity: 0; translate: 0 10px; }
    to{ opacity: 1; translate: 0 0; }
  }
}

/* ---------- Theme & utilities ---------- */
:root{
  --bg: #f7f8fb;
  --surface: #ffffff;
  --ink: #1f2a37;
  --muted: #6b7280;
  --brand: #2563eb;          /* primary */
  --brand-2: #7c3aed;        /* accent */
  --ring: rgba(37, 99, 235, .18);
  --shadow: 0 10px 25px rgba(0,0,0,.08);
  --radius: 16px;
}

@media (prefers-color-scheme: dark){
  :root{
    --bg:#0b1020; --surface:#111833; --ink:#e5e7eb; --muted:#9aa2b2;
    --shadow: 0 8px 20px rgba(0,0,0,.45);
  }
}

body{ background: var(--bg); color: var(--ink); }

/* Better anchors (accounting for sticky nav on mobile) */
section { scroll-margin-top: 84px; }

/* ---------- Section framing & headers ---------- */
main { background: transparent; }

section{
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px 28px 18px;
  margin: 22px 0;
  box-shadow: var(--shadow);
  border: 1px solid rgba(99,102,241,.08);
  position: relative;
  overflow: clip;
}

/* Gradient accent bar on section */
section::before{
  content:"";
  position: absolute; inset: 0 auto 0 0;
  width: 5px; border-radius: 8px 0 0 8px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  opacity: .9;
}

/* Headings with subtle underline */
section h1, section h2{
  font-weight: 800;
  letter-spacing: .2px;
  margin: 0 0 14px;
  position: relative;
}

section h1::after, section h2::after{
  content:"";
  display:block;
  width: 56px; height: 3px; margin-top: 8px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  border-radius: 999px;
  opacity: .9;
}

/* ---------- Subtle entrance animation ---------- */
@media (prefers-reduced-motion: no-preference){
  section{
    animation: rise .6s ease both;
    transform-origin: 50% 80%;
  }
  section:nth-of-type(2){ animation-delay: .03s; }
  section:nth-of-type(3){ animation-delay: .06s; }
  section:nth-of-type(4){ animation-delay: .09s; }
  @keyframes rise{
    from{ opacity: 0; translate: 0 10px; }
    to{ opacity: 1; translate: 0 0; }
  }
}

/* ---------- Lists with nicer bullets ---------- */
section ul{
  padding-left: 0;
  list-style: none;
}

section ul li{
  padding-left: 26px;
  margin: 8px 0;
  position: relative;
  color: var(--ink);
}

section ul li::before{
  content:"";
  position: absolute; left: 0; top: .6em;
  width: 8px; height: 8px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 0 0 4px var(--ring);
}

/* ---------- Cards inside sections (jobs/projects) ---------- */
.job, .project{
  background: color-mix(in lab, var(--surface) 92%, #0000);
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 14px;
  padding: 16px 16px 10px;
  margin: 14px 0;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.job:hover, .project:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(0,0,0,.10);
  border-color: rgba(99,102,241,.35);
}

.job h3, .project h3{
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.job p strong{ 
  background: rgba(99,102,241,.10);
  padding: 2px 8px; border-radius: 999px; font-size: .85rem;
}

/* ---------- Experience timeline look ---------- */
#experience .job{
  position: relative; padding-left: 26px;
}

#experience .job::before{
  content:"";
  position: absolute; left: 10px; top: 14px; bottom: -14px;
  width: 2px; background: linear-gradient(var(--brand), transparent);
}

#experience .job::after{
  content:"";
  position: absolute; left: 4px; top: 14px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--brand);
  box-shadow: 0 0 0 4px var(--ring);
}

/* ---------- Skill chips ---------- */
#skills ul{
  display: flex; flex-wrap: wrap; gap: 10px; 
}

#skills li{ margin: 0; padding: 0; }

#skills li strong{ display:block; margin: 8px 0 2px; }

.chips{
  display:flex; flex-wrap:wrap; gap:8px; margin:8px 0 0;
}

.chip{
  border: 1px solid rgba(99,102,241,.25);
  padding: 6px 10px; border-radius: 999px;
  background: color-mix(in lab, var(--brand) 9%, var(--surface));
  font-size: .9rem; color: var(--ink);
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.chip:hover{ transform: translateY(-1px); background: color-mix(in lab, var(--brand) 14%, var(--surface)); }

/* ---------- Projects grid ---------- */
#projects .project{
  display: grid; gap: 6px;
}

@media (min-width: 860px){
  #projects{
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: 16px;
  }
  #projects > h2{ grid-column: 1 / -1; }
}

/* ---------- Contact panel ---------- */
#contact p a{
  text-decoration: none;
  border-bottom: 1px dashed color-mix(in lab, var(--brand) 60%, var(--ink));
}

#contact p a:hover{
  border-bottom-style: solid;
}

/* ---------- Sidenav polish ---------- */
.sidenav{
  background: linear-gradient(180deg, #111827, #1f2937);
  border-right: 1px solid rgba(255,255,255,.08);
}

.sidenav a{
  transition: background .15s ease, transform .15s ease;
}

.sidenav a:hover{ transform: translateX(2px); }

/* ---------- Small type tweaks ---------- */
p{ color: var(--ink); }
em, small{ color: var(--muted); }


/* ---------- Education cards ---------- */
.edu-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 10px;
}

.edu-card {
  flex: 1 1 320px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(148,163,184,.18);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 18px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.edu-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 22px rgba(0,0,0,.1);
  border-color: rgba(99,102,241,.35);
}

.edu-logo {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(99,102,241,.06);
  border-radius: 50%;
  overflow: hidden;
}

.edu-logo img {
  width: 60%;
  height: auto;
  object-fit: contain;
  opacity: 0.9;
}

.edu-info h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.edu-info p {
  margin: 0;
  line-height: 1.4;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Responsive behavior */
@media (max-width: 768px) {
  .edu-card {
    flex-direction: column;
    text-align: center;
    padding: 20px;
  }
  .edu-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 8px;
  }
}

/* ---------- Certifications: simplified two-card layout ---------- */
.cert-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 24px;
  margin-top: 10px;
}

/* Base card style */
.cert-card {
  flex: 1 1 260px;
  max-width: 300px;
  min-height: 350px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(148,163,184,.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  padding: 20px;
}

.cert-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 26px rgba(0,0,0,.1);
  border-color: rgba(99,102,241,.35);
}

/* CCP-only card */
.ccp-only {
  padding: 10px;
}

/* Credly iframe (AWS CCP) */
.ccp-only [data-share-badge-id] iframe {
  border: none !important;
  border-radius: 8px;
  width: 100% !important;
  max-width: 160px !important;
  height: 280px !important;
  object-fit: contain;
}

/* Agile card */
.cert-logo {
  width: 160px;
  height: 160px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(99,102,241,.05);
  border-radius: 12px;
  overflow: visible;
  margin-bottom: 16px;
}

.cert-logo img {
  width: 80%;
  height: auto;
  object-fit: contain;
  opacity: 0.95;
}

.cert-info h3 {
  margin: 10px 0 4px;
  font-size: 1.05rem;
}

.cert-info p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .cert-container {
    justify-content: center;
  }

  .cert-card {
    flex: 1 1 100%;
    max-width: 320px;
  }
}
/* ---------- Contact icons ---------- */
.contact-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
}

.contact-links i {
  color: var(--brand);
  margin-right: 6px;
}

.contact-links a {
  color: var(--ink);
  text-decoration: none;
  transition: color .15s ease, transform .15s ease;
}

.contact-links a:hover {
  color: var(--brand-2);
  transform: translateY(-1px);
}

.contact-links span {
  display: flex;
  align-items: center;
}
/* ---------- Visitor Counter ---------- */
.visitor-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-family: "Segoe UI", Roboto, sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  color: #f9fafb;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.visitor-counter:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}

.visitor-counter i {
  color: #ffffff;
  font-size: 1rem;
}

.visitor-counter span {
  font-family: "Poppins", "Segoe UI", Roboto, sans-serif;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ---------- Mobile top bar with left-aligned hamburger + dropdown ---------- */
@media (max-width: 768px){
  /* turn the sidenav into a top bar and allow wrapping */
  .sidenav{
    position: sticky;
    top: 0;
    height: auto;
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;              /* key: let the <ul> wrap to a new row */
    gap: 8px;
    padding: 12px 16px;
    z-index: 10;
  }

  /* show the hamburger and pin it to the left */
  .menu-toggle{
    display: inline-block;
    order: 0;                     /* first in the row */
    margin-right: 8px;
  }

  /* profile stays on the bar, takes remaining space, centered */
  .nav-profile{
    order: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;               /* grows to fill */
    min-width: 0;
  }

  .nav-image { width: 44px; height: 44px; }
  .nav-name  { font-size: 0.95rem; }

  /* nav list becomes a full-width block BELOW the bar */
  .sidenav ul{
    order: 2;                     /* goes to the next “row” */
    flex-basis: 100%;             /* full width under bar */
    width: 100%;
    overflow: hidden;
    max-height: 0;                /* collapsed by default */
    padding: 0;
    margin: 0;
    transition: max-height .25s ease, padding .2s ease;
    background: linear-gradient(180deg, #111827, #1f2937);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.06);
  }

  /* expand the dropdown when .open is on the container */
  .sidenav.open ul{
    max-height: 420px;            /* adjust if you add more links */
    padding: 8px 6px;
  }

  .sidenav ul li{ margin: 4px 0; }
  .sidenav a{ padding: 10px 12px; }

  /* keep main content spacing right on mobile */
  main{
    margin-left: 0;
    padding: 16px;
  }
}

/* hamburger animation to X (keep your existing rules) */
.sidenav.open .menu-toggle .bar:nth-child(1){ transform: translateY(7px) rotate(45deg); }
.sidenav.open .menu-toggle .bar:nth-child(2){ opacity: 0; width: 0; }
.sidenav.open .menu-toggle .bar:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }

/* SPA-style section toggling + active nav */
.is-hidden { display: none !important; }

.sidenav a.active {
  background-color: #575757;
  transform: translateX(2px);
}