:root{
  --bg:#08111f;
  --panel:rgba(255,255,255,0.08);
  --panel-2:rgba(255,255,255,0.05);
  --text:#e8eefc;
  --muted:#b8c4e0;
  --accent:#8b5cf6;
  --accent-2:#22c55e;
  --border:rgba(255,255,255,0.12);
  --shadow:0 16px 50px rgba(0,0,0,.25);
  --radius:22px;
  --container:min(1120px, calc(100% - 32px));
}

*{
  box-sizing:border-box;
}

html{
  scroll-behavior:smooth;
}

body{
  margin:0;
  font-family:"Inter", system-ui, sans-serif;
  color:var(--text);
  background:radial-gradient(circle at top left, #14233d 0%, #08111f 42%, #050b15 100%);
  min-height:100vh;
  overflow-x:hidden;
}

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

a{
  color:inherit;
  text-decoration:none;
}

.container{
  width:var(--container);
  margin:auto;
}

.header{
  position:sticky;
  top:0;
  z-index:50;
  backdrop-filter:blur(16px);
  background:rgba(5,11,21,.6);
  border-bottom:1px solid rgba(255,255,255,.05);
}

.nav{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:18px 0;
  gap:18px;
}

.brand{
  font-weight:800;
  letter-spacing:.08em;
  font-size:1.05rem;
  padding:.65rem .9rem;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--panel-2);
  flex-shrink:0;
}

nav{
  display:flex;
  gap:18px;
  flex-wrap:wrap;
}

nav a{
  color:var(--muted);
  font-weight:600;
  transition:color .2s ease;
}

nav a:hover{
  color:var(--text);
}

.hero{
  display:grid;
  grid-template-columns:1.2fr .8fr;
  gap:28px;
  align-items:center;
  padding:86px 0 44px;
}

.eyebrow{
  color:#c4b5fd;
  text-transform:uppercase;
  letter-spacing:.14em;
  font-size:.78rem;
  font-weight:700;
  margin-bottom:10px;
}

h1{
  font-size:clamp(2.6rem, 6vw, 4.8rem);
  line-height:1.02;
  margin:.1rem 0;
  word-break:break-word;
}

h2{
  font-size:clamp(1.15rem, 2vw, 1.55rem);
  color:var(--muted);
  font-weight:600;
  margin:.5rem 0 1rem;
}

.lead{
  font-size:1.08rem;
  line-height:1.8;
  color:var(--muted);
  max-width:62ch;
}

.hero-actions{
  display:flex;
  gap:14px;
  flex-wrap:wrap;
  margin-top:28px;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:14px 20px;
  border-radius:14px;
  font-weight:700;
  border:1px solid var(--border);
  transition:transform .2s ease, opacity .2s ease, border-color .2s ease;
}

.btn:hover{
  transform:translateY(-2px);
  opacity:.95;
}

.btn-primary{
  background:linear-gradient(135deg, var(--accent), #6d28d9);
  color:#fff;
}

.btn-secondary{
  background:var(--panel-2);
  color:#fff;
}

.mini-stats{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:14px;
  margin-top:28px;
}

.mini-stats div,
.glass.card,
.skill-card,
.project-card,
.contact-card,
.cert-intro{
  border:1px solid var(--border);
  background:var(--panel);
  box-shadow:var(--shadow);
  border-radius:var(--radius);
}

.mini-stats div{
  padding:16px;
}

.mini-stats strong{
  display:block;
  font-size:1.4rem;
}

.mini-stats span{
  color:var(--muted);
  font-size:.95rem;
}

.glass{
  border:1px solid var(--border);
  background:linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.05));
  box-shadow:var(--shadow);
  border-radius:var(--radius);
}

.hero-card{
  padding:24px;
}

.avatar{
  width:90px;
  height:90px;
  border-radius:50%;
  display:grid;
  place-items:center;
  font-size:1.4rem;
  font-weight:800;
  background:linear-gradient(135deg, #8b5cf6, #06b6d4);
  margin-bottom:18px;
  color:#fff;
}

.photo-avatar{
  width:110px;
  height:110px;
  overflow:hidden;
  padding:0;
}

.photo-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
  border-radius:50%;
}

.hero-card h3{
  margin:0 0 14px;
}

.hero-card ul{
  list-style:none;
  padding:0;
  margin:0;
  display:grid;
  gap:12px;
}

.hero-card li{
  display:flex;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  padding-bottom:12px;
  border-bottom:1px dashed rgba(255,255,255,.08);
}

.hero-card li:last-child{
  padding-bottom:0;
  border-bottom:none;
}

.hero-card span{
  color:var(--muted);
}

.section{
  padding:42px 0;
  scroll-margin-top:90px;
}

.section-heading{
  margin-bottom:20px;
}

.section-heading h2{
  color:var(--text);
  font-size:clamp(1.8rem, 4vw, 2.6rem);
}

.section-row{
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
}

.about-grid,
.skills-grid,
.projects-grid{
  display:grid;
  gap:18px;
}

.about-grid{
  grid-template-columns:1.1fr .9fr;
}

.skills-grid{
  grid-template-columns:repeat(3, 1fr);
}

.projects-grid{
  grid-template-columns:repeat(2, 1fr);
}

.card,
.skill-card,
.project-card,
.contact-card,
.cert-intro{
  padding:22px;
}

.check-list{
  margin:0;
  padding-left:18px;
  line-height:1.9;
  color:var(--muted);
}

.skill-card h3,
.project-card h3,
.cert-card h3{
  margin-top:0;
}

.skill-card p,
.project-card p,
.card p,
.contact-card p{
  color:var(--muted);
  line-height:1.8;
}

.tag{
  display:inline-block;
  margin-bottom:10px;
  padding:8px 12px;
  border-radius:999px;
  background:rgba(139,92,246,.16);
  color:#ddd6fe;
  font-size:.84rem;
  font-weight:700;
}

.project-card{
  display:flex;
  flex-direction:column;
  height:100%;
}

.project-card ul{
  padding-left:18px;
  color:var(--muted);
  line-height:1.8;
  margin-bottom:0;
}

.project-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:16px;
}

.project-actions .btn{
  flex:1 1 160px;
}

.filters{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.filter-btn{
  background:var(--panel-2);
  color:var(--muted);
  border:1px solid var(--border);
  padding:10px 14px;
  border-radius:999px;
  font-weight:700;
  cursor:pointer;
  transition:all .2s ease;
}

.filter-btn:hover{
  color:#fff;
  border-color:rgba(255,255,255,.25);
}

.filter-btn.active{
  background:linear-gradient(135deg, rgba(139,92,246,.32), rgba(6,182,212,.18));
  color:#fff;
}

.cert-grid{
  margin-top:18px;
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:18px;
}

.cert-card-link{
  display:block;
  height:100%;
}

.cert-card{
  height:100%;
  padding:16px;
  border-radius:22px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  transition:transform .25s ease, border-color .25s ease, box-shadow .25s ease;
  box-shadow:var(--shadow);
}

.cert-card:hover{
  transform:translateY(-6px);
  border-color:rgba(255,255,255,.25);
}

.cert-thumb{
  position:relative;
  min-height:170px;
  border-radius:18px;
  padding:16px;
  margin-bottom:14px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  border:1px solid rgba(255,255,255,.12);
}

.thumb-badge{
  position:absolute;
  top:14px;
  right:14px;
  min-width:48px;
  height:48px;
  display:grid;
  place-items:center;
  border-radius:14px;
  font-weight:800;
  font-size:.95rem;
  background:rgba(255,255,255,.14);
  color:#fff;
  backdrop-filter:blur(8px);
}

.thumb-title{
  font-weight:800;
  font-size:1rem;
  line-height:1.4;
  color:#fff;
  max-width:85%;
}

.thumb-sub{
  margin-top:8px;
  font-size:.88rem;
  color:rgba(255,255,255,.82);
}

.thumb-microsoft{
  background:
    linear-gradient(135deg, rgba(139,92,246,.92), rgba(59,130,246,.85)),
    radial-gradient(circle at top left, rgba(255,255,255,.18), transparent 45%);
}

.thumb-coursera{
  background:
    linear-gradient(135deg, rgba(37,99,235,.92), rgba(6,182,212,.84)),
    radial-gradient(circle at top left, rgba(255,255,255,.18), transparent 45%);
}

.thumb-iot{
  background:
    linear-gradient(135deg, rgba(34,197,94,.92), rgba(6,182,212,.82)),
    radial-gradient(circle at top left, rgba(255,255,255,.18), transparent 45%);
}

.thumb-robotics{
  background:
    linear-gradient(135deg, rgba(249,115,22,.92), rgba(236,72,153,.82)),
    radial-gradient(circle at top left, rgba(255,255,255,.18), transparent 45%);
}

.thumb-ml{
  background:
    linear-gradient(135deg, rgba(168,85,247,.92), rgba(14,165,233,.82)),
    radial-gradient(circle at top left, rgba(255,255,255,.18), transparent 45%);
}

.thumb-default{
  background:
    linear-gradient(135deg, rgba(71,85,105,.92), rgba(30,41,59,.88)),
    radial-gradient(circle at top left, rgba(255,255,255,.16), transparent 45%);
}

.cert-meta{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:12px;
}

.pill{
  display:inline-flex;
  padding:7px 10px;
  border-radius:999px;
  font-size:.78rem;
  font-weight:700;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.06);
  color:#dbe4ff;
}

.cert-card h3{
  margin:.2rem 0 .7rem;
  font-size:1.06rem;
  line-height:1.45;
}

.cert-card p{
  margin:.2rem 0;
  color:var(--muted);
  line-height:1.7;
}

.cert-link{
  display:inline-flex;
  margin-top:14px;
  font-weight:700;
  color:#c4b5fd;
}

/* IoT showcase */
.media-grid,
.video-grid{
  display:grid;
  grid-template-columns:repeat(2, 1fr);
  gap:16px;
  margin-top:20px;
}

.media-grid img,
.video-grid video{
  width:100%;
  border-radius:18px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.04);
  box-shadow:var(--shadow);
}

.media-grid img{
  aspect-ratio:16/10;
  object-fit:cover;
}

.video-grid video{
  min-height:220px;
  object-fit:cover;
}

.contact-links{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-top:14px;
}

.contact-links a{
  padding:12px 16px;
  border-radius:12px;
  border:1px solid var(--border);
  background:var(--panel-2);
  color:#fff;
  transition:transform .2s ease, border-color .2s ease;
}

.contact-links a:hover{
  transform:translateY(-2px);
  border-color:rgba(255,255,255,.24);
}

.footer{
  padding:28px 0 40px;
  color:var(--muted);
  text-align:center;
}

.bg-orb{
  position:fixed;
  inset:auto;
  border-radius:999px;
  filter:blur(50px);
  opacity:.28;
  pointer-events:none;
}

.orb-1{
  width:240px;
  height:240px;
  background:#8b5cf6;
  top:8%;
  left:-60px;
}

.orb-2{
  width:260px;
  height:260px;
  background:#06b6d4;
  bottom:6%;
  right:-70px;
}

body.light-mode{
  --bg:#f4f7fb;
  --panel:rgba(255,255,255,0.92);
  --panel-2:rgba(255,255,255,0.72);
  --text:#0f172a;
  --muted:#475569;
  --border:rgba(15,23,42,0.12);
  background:linear-gradient(180deg, #eef4ff 0%, #f8fbff 100%);
}

#typingText{
  display:inline-block;
  min-height:1.5em;
}

/* Tablet */
@media (max-width: 980px){
  .hero{
    grid-template-columns:1fr;
    gap:24px;
  }

  .about-grid,
  .skills-grid,
  .projects-grid,
  .cert-grid,
  .media-grid,
  .video-grid{
    grid-template-columns:1fr 1fr;
  }

  .hero-card{
    max-width:100%;
  }

  .mini-stats{
    grid-template-columns:repeat(3, 1fr);
  }

  .cert-thumb{
    min-height:160px;
  }
}

/* Mobile */
@media (max-width: 700px){
  .container{
    width:min(100% - 20px, 1120px);
  }

  .header{
    position:sticky;
    top:0;
  }

  .nav{
    flex-direction:column;
    align-items:flex-start;
    padding:14px 0;
  }

  nav{
    display:flex;
    width:100%;
    gap:10px;
    justify-content:flex-start;
  }

  nav a{
    font-size:.92rem;
  }

  .hero{
    grid-template-columns:1fr;
    padding:48px 0 28px;
    gap:18px;
  }

  .hero-text{
    text-align:left;
  }

  h1{
    font-size:2.2rem;
  }

  h2{
    font-size:1.02rem;
    line-height:1.6;
  }

  .lead{
    font-size:.98rem;
    line-height:1.75;
  }

  .hero-actions{
    flex-direction:column;
    align-items:stretch;
  }

  .hero-actions .btn,
  .project-actions .btn{
    width:100%;
  }

  .mini-stats{
    grid-template-columns:1fr;
  }

  .hero-card{
    padding:18px;
  }

  .hero-card li{
    flex-direction:column;
    gap:4px;
  }

  .about-grid,
  .skills-grid,
  .projects-grid,
  .cert-grid,
  .media-grid,
  .video-grid{
    grid-template-columns:1fr;
  }

  .section{
    padding:34px 0;
  }

  .card,
  .skill-card,
  .project-card,
  .contact-card,
  .cert-intro,
  .cert-card{
    padding:18px;
  }

  .section-row{
    align-items:flex-start;
  }

  .filters{
    width:100%;
    gap:8px;
  }

  .filter-btn{
    font-size:.85rem;
    padding:9px 12px;
  }

  .cert-thumb{
    min-height:150px;
  }

  .thumb-title{
    max-width:100%;
    font-size:.98rem;
  }

  .contact-links{
    flex-direction:column;
  }

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

  .bg-orb{
    opacity:.18;
  }
}

/* Small mobile */
@media (max-width: 420px){
  .brand{
    font-size:.95rem;
    padding:.55rem .8rem;
  }

  h1{
    font-size:1.9rem;
  }

  .eyebrow{
    font-size:.7rem;
  }

  .mini-stats strong{
    font-size:1.2rem;
  }

  .btn{
    padding:12px 16px;
    font-size:.95rem;
  }

  .filter-btn{
    width:100%;
    text-align:center;
  }
}
