*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --p: #1a56db;
  --p2: #1e40af;
  --bg: #ffffff;
  --bg-alt: #f7f8fc;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --card: #ffffff;
  --sh: 0 1px 2px rgba(0,0,0,0.05), 0 4px 20px rgba(0,0,0,0.06);
  --sh-hover: 0 8px 40px rgba(26,86,219,0.14);
  --radius: 14px;
}

body.dark {
  --bg: #0a0c14;
  --bg-alt: #0f1220;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --border: #1e2235;
  --card: #111525;
  --sh: 0 1px 2px rgba(0,0,0,0.3), 0 4px 20px rgba(0,0,0,0.25);
  --sh-hover: 0 8px 40px rgba(26,86,219,0.22);
}

html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; overflow-x: hidden; transition: background .35s, color .35s; }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: var(--p); border-radius: 4px; }

/* ── Navbar ── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 6%;
  transition: all .35s;
}
.navbar.scrolled {
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  padding: .75rem 6%;
  box-shadow: 0 1px 0 var(--border), 0 4px 24px rgba(0,0,0,0.06);
}
.nav-logo { font-size: 1.15rem; font-weight: 700; color: var(--text); letter-spacing: -.5px; }
.nav-logo .dot { color: var(--p); }
.nav-links { display: flex; list-style: none; gap: 2rem; }
.nav-links a { font-size: .875rem; font-weight: 500; color: var(--muted); text-decoration: none; transition: color .2s; position: relative; padding-bottom: 2px; }
.nav-links a::after { content: ''; position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%) scaleX(0); width: 16px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--p), #6366f1); transition: transform .25s ease; }
.nav-links a:hover::after, .nav-links a.active::after { transform: translateX(-50%) scaleX(1); }
.nav-links a:hover, .nav-links a.active { color: var(--p); }
.nav-right { display: flex; align-items: center; gap: .6rem; }
.theme-btn { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); color: var(--muted); font-size: .85rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .2s; }
.theme-btn:hover { color: var(--p); border-color: var(--p); }
.hamburger { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 4px; }
.hamburger span { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: all .3s; }

/* ── Hero ── */
.hero {
  min-height: 100vh;
  display: grid; grid-template-columns: 1fr 1fr;
  align-items: center; gap: 4rem;
  padding: 9rem 6% 5rem;
  position: relative; overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute; top: -200px; right: -200px;
  width: 700px; height: 700px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--p) 12%, transparent) 0%, transparent 65%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute; bottom: -100px; left: -100px;
  width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, #6366f1 8%, transparent) 0%, transparent 70%);
  pointer-events: none;
}

.hero-chip {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .78rem; font-weight: 600; letter-spacing: .5px;
  color: var(--p); background: color-mix(in srgb, var(--p) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--p) 20%, transparent);
  padding: .35rem .9rem; border-radius: 30px; margin-bottom: 1.5rem;
}
.chip-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; animation: pulse-dot 2s ease-in-out infinite; }
@keyframes pulse-dot { 0%,100%{box-shadow:0 0 0 0 rgba(34,197,94,.5)} 50%{box-shadow:0 0 0 5px rgba(34,197,94,0)} }

.hero-h1 {
  font-size: clamp(2.4rem, 4.5vw, 3.8rem);
  font-weight: 700; line-height: 1.1; letter-spacing: -1.5px;
  margin-bottom: 1.4rem;
}
.hero-h1 .line { display: block; }
.hero-h1 em { font-style: normal; background: linear-gradient(135deg, var(--p) 0%, #6366f1 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.hero-p { font-size: 1rem; color: var(--muted); max-width: 440px; line-height: 1.8; margin-bottom: 2rem; }

.hero-cta { display: flex; align-items: center; gap: 1.2rem; margin-bottom: 2.2rem; flex-wrap: wrap; }

.cta-primary {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .75rem 1.6rem; border-radius: 10px;
  background: var(--p); color: #fff;
  font-size: .9rem; font-weight: 600; text-decoration: none;
  border: none; cursor: pointer;
  transition: background .2s, transform .2s, box-shadow .2s;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--p) 35%, transparent);
}
.cta-primary:hover { background: var(--p2); transform: translateY(-2px); box-shadow: 0 8px 24px color-mix(in srgb, var(--p) 45%, transparent); }
.cta-primary i { transition: transform .2s; }
.cta-primary:hover i { transform: translateX(3px); }

.cta-link { font-size: .9rem; font-weight: 600; color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--border); padding-bottom: 1px; transition: color .2s, border-color .2s; }
.cta-link:hover { color: var(--p); border-color: var(--p); }

.hero-socials { display: flex; gap: .6rem; }
.hero-socials a { width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--border); background: var(--card); display: flex; align-items: center; justify-content: center; color: var(--muted); text-decoration: none; font-size: .95rem; transition: all .2s; box-shadow: var(--sh); }
.hero-socials a:hover { border-color: var(--p); color: var(--p); transform: translateY(-2px); box-shadow: var(--sh-hover); }

/* Hero deco */
.hero-deco {
  position: relative;
  width: 340px; height: 420px;
  flex-shrink: 0;
}

.photo-stack {
  position: relative;
  width: 100%; height: 100%;
}

.photo-card {
  position: absolute;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.photo-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.photo-card.back {
  width: 240px; height: 300px;
  top: 30px; right: 0;
  border: 3px solid var(--bg);
}

.photo-card.front {
  width: 260px; height: 320px;
  top: 40px; left: 0;
  border: 4px solid var(--bg);
  background: linear-gradient(135deg, var(--p), #6366f1);
  padding: 3px;
  z-index: 2;
}

.photo-card.front img { border-radius: 21px; }

.photo-label {
  position: absolute;
  bottom: 14px; left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  color: #0f172a;
  font-size: .72rem; font-weight: 700;
  padding: .4rem .9rem; border-radius: 30px;
  white-space: nowrap;
  display: flex; align-items: center; gap: .4rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}

body.dark .photo-label { background: rgba(15,18,32,0.92); color: #f1f5f9; }

.label-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; animation: pulse-dot 2s ease-in-out infinite; }

@keyframes card-sway { 0%,100%{transform:rotate(6deg) translateY(0)} 50%{transform:rotate(6deg) translateY(-10px)} }
@keyframes card-sway-front { 0%,100%{transform:rotate(-3deg) translateY(0)} 50%{transform:rotate(-3deg) translateY(-14px)} }

.skill-pill {
  position: absolute;
  display: flex; align-items: center; gap: .4rem;
  padding: .45rem .9rem; border-radius: 30px;
  background: var(--card); border: 1px solid var(--border);
  box-shadow: var(--sh); font-size: .78rem; font-weight: 700;
  color: var(--text); white-space: nowrap; z-index: 3;
}
.skill-pill i { color: var(--p); }
.sp1 { top: 0px;    left: 50%; transform: translateX(-50%); animation: card-float 4s ease-in-out infinite; }
.sp2 { bottom: 60px; right: -20px; animation: card-float 4s ease-in-out infinite .8s; }
.sp3 { bottom: 0px;  left: 10px;  animation: card-float 4s ease-in-out infinite 1.6s; }

@keyframes card-float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
@keyframes blob-float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-14px)} }

/* ── Sections ── */
.section { padding: 6rem 0; }
.bg-alt { background: var(--bg-alt); }
.container { max-width: 1060px; margin: 0 auto; padding: 0 6%; }

.eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--p); margin-bottom: .4rem; }
.h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); font-weight: 700; letter-spacing: -.5px; margin-bottom: 2.5rem; }
.h2::after {
  content: ''; display: block;
  width: 40px; height: 3px; margin-top: .5rem; border-radius: 2px;
  background: linear-gradient(90deg, var(--p), #6366f1);
}
.section-sub { color: var(--muted); font-size: .95rem; margin-top: -.5rem; margin-bottom: 2.5rem; }

/* ── About ── */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; }
.about-left p { color: var(--muted); font-size: .95rem; line-height: 1.8; margin-bottom: 1rem; }
.about-left strong { color: var(--text); font-weight: 600; }
.stats-row { display: flex; gap: 2rem; padding-top: 1.8rem; border-top: 1px solid var(--border); margin-top: 1.8rem; }
.stat b { display: block; font-size: 1.7rem; font-weight: 700; line-height: 1; background: linear-gradient(135deg, var(--p), #6366f1); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat span { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

.about-right { display: flex; flex-direction: column; gap: .8rem; }
.acard { display: flex; align-items: flex-start; gap: 1rem; padding: 1.1rem 1.3rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); box-shadow: var(--sh); transition: border-color .25s, transform .25s, box-shadow .25s; }
.acard:hover { border-color: var(--p); transform: translateX(5px); box-shadow: var(--sh-hover), inset 0 0 0 1px color-mix(in srgb, var(--p) 10%, transparent); }
.acard-icon { width: 40px; height: 40px; border-radius: 10px; background: color-mix(in srgb, var(--p) 10%, transparent); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; color: var(--p); flex-shrink: 0; }
.acard h4 { font-size: .88rem; font-weight: 600; margin-bottom: .2rem; }
.acard p { font-size: .8rem; color: var(--muted); }

/* ── Skills ── */
.skills-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.5rem; }
.skill-col { padding: 1.6rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); box-shadow: var(--sh); transition: border-color .25s, transform .25s, box-shadow .25s; }
.skill-col:hover { border-color: var(--p); transform: translateY(-4px); box-shadow: var(--sh-hover); }
.skill-label { font-size: .85rem; font-weight: 700; margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem; }
.skill-label i { color: var(--p); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chips span { font-size: .76rem; font-weight: 500; padding: .28rem .7rem; border-radius: 6px; background: color-mix(in srgb, var(--p) 7%, transparent); border: 1px solid color-mix(in srgb, var(--p) 16%, transparent); color: var(--text); transition: all .2s; cursor: default; }
.chips span:hover { background: var(--p); color: #fff; border-color: var(--p); }

/* ── Projects ── */
.proj-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 1.2rem; }
.proj-card { padding: 1.8rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); box-shadow: var(--sh); transition: border-color .25s, transform .25s, box-shadow .25s; position: relative; overflow: hidden; }
.proj-card::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--p), #6366f1); transform: scaleX(0); transform-origin: left; transition: transform .35s ease; }
.proj-card:hover::after { transform: scaleX(1); }
.proj-card:hover { border-color: color-mix(in srgb, var(--p) 40%, transparent); transform: translateY(-5px); box-shadow: var(--sh-hover); }
.proj-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.2rem; }
.proj-num { font-size: .75rem; font-weight: 700; color: var(--p); letter-spacing: 1px; }
.proj-gh { color: var(--muted); text-decoration: none; font-size: 1rem; transition: color .2s; }
.proj-gh:hover { color: var(--p); }
.proj-icon { font-size: 1.6rem; color: var(--p); margin-bottom: .8rem; display: block; }
.proj-card h4 { font-size: .95rem; font-weight: 700; margin-bottom: .4rem; }
.proj-card p { font-size: .82rem; color: var(--muted); line-height: 1.7; margin-bottom: 1rem; }
.proj-more { display: flex; align-items: center; justify-content: center; border-style: dashed; min-height: 160px; }
.proj-more::after { display: none; }
.proj-more a { display: flex; flex-direction: column; align-items: center; gap: .5rem; text-decoration: none; color: var(--muted); transition: color .2s; }
.proj-more a i { font-size: 1.8rem; color: var(--p); }
.proj-more a span { font-size: .85rem; font-weight: 600; }
.proj-more:hover { border-color: var(--p); }
.proj-more:hover a { color: var(--text); }

/* ── Contact ── */
.contact-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 3rem; align-items: start; }
.clink { display: flex; align-items: center; gap: .8rem; padding: .9rem 1.1rem; border-radius: 10px; border: 1px solid var(--border); background: var(--card); text-decoration: none; color: var(--text); font-size: .875rem; font-weight: 500; margin-bottom: .7rem; box-shadow: var(--sh); transition: all .2s; }
.clink i { color: var(--p); width: 16px; text-align: center; }
.clink:hover { border-color: var(--p); color: var(--p); transform: translateX(4px); box-shadow: var(--sh-hover); }
form { display: flex; flex-direction: column; gap: .8rem; }
form input, form textarea { padding: .75rem 1rem; border-radius: 9px; border: 1px solid var(--border); background: var(--card); color: var(--text); font-family: 'Inter', sans-serif; font-size: .875rem; transition: border-color .2s, box-shadow .2s; resize: none; }
form input::placeholder, form textarea::placeholder { color: var(--muted); }
form input:focus, form textarea:focus { outline: none; border-color: var(--p); box-shadow: 0 0 0 3px color-mix(in srgb, var(--p) 12%, transparent); }

/* ── Footer ── */
footer { padding: 1.4rem 6%; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; background: var(--bg); }
footer span { font-size: .8rem; color: var(--muted); }
.foot-links { display: flex; gap: .8rem; }
.foot-links a { color: var(--muted); font-size: .95rem; text-decoration: none; transition: color .2s; }
.foot-links a:hover { color: var(--p); }

/* ── Reveal ── */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .6s cubic-bezier(.16,1,.3,1), transform .6s cubic-bezier(.16,1,.3,1); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── Responsive ── */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 7rem;
    padding-bottom: 4rem;
    gap: 3rem;
    justify-items: center;
    text-align: center;
  }
  .hero-inner { display: flex; flex-direction: column; align-items: center; }
  .hero-p { max-width: 100%; }
  .hero-cta { justify-content: center; }
  .hero-socials { justify-content: center; }

  /* Show photo on mobile, scaled down */
  .cta-primary { justify-content: center; }

  .hero-deco {
    display: block;
    width: 340px;
    height: 420px;
    margin: 0 auto;
  }
  .photo-card.back  { width: 240px; height: 310px; top: 20px; right: 0; }
  .photo-card.front { width: 260px; height: 330px; top: 30px; left: 0; }

  .skill-pill { font-size: .7rem; padding: .35rem .7rem; }
  .sp2 { right: -10px; bottom: 50px; }
  .sp3 { left: 5px; bottom: 0; }

  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
  .skills-row { grid-template-columns: 1fr 1fr; }
  .proj-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: 1rem 6%; gap: 1rem; }
  .nav-links.open { display: flex; }
  .hamburger { display: flex; }
  .skills-row { grid-template-columns: 1fr; }
  footer { flex-direction: column; gap: .6rem; text-align: center; }

  .hero-deco {
    width: 300px;
    height: 380px;
  }
  .photo-card.back  { width: 200px; height: 260px; }
  .photo-card.front { width: 220px; height: 280px; }
  .edu-year { position: static; margin-top: .5rem; display: inline-block; }
  .edu-card { flex-wrap: wrap; }
}

/* ── Focus visible ── */
:focus-visible { outline: 2px solid var(--p); outline-offset: 3px; border-radius: 4px; }

/* ── Selection color ── */
::selection { background: color-mix(in srgb, var(--p) 20%, transparent); color: var(--text); }

/* ── Smooth card lift on proj-card ── */
.proj-card:hover .proj-icon { transform: scale(1.1); transition: transform .25s; }

/* Click hint */
.click-hint {
  position: absolute;
  top: 12px; right: 12px;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(8px);
  color: var(--p);
  font-size: .7rem; font-weight: 700;
  padding: .3rem .7rem; border-radius: 20px;
  display: flex; align-items: center; gap: .3rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  animation: hint-fade 3s ease-in-out 2s forwards;
  opacity: 1;
}
body.dark .click-hint { background: rgba(15,18,32,0.88); }
@keyframes hint-fade { 0%{opacity:1} 100%{opacity:0; pointer-events:none} }

/* Swap animation states */
.photo-stack { cursor: pointer; }

.photo-card {
  position: absolute;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  will-change: transform;
}

.highlight {
  background: linear-gradient(135deg, var(--p), #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 600;
}

/* ── Resume button ── */
.cta-resume {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .7rem 1.4rem; border-radius: 10px;
  background: transparent; color: var(--p);
  font-size: .9rem; font-weight: 600; text-decoration: none;
  border: 1.5px solid color-mix(in srgb, var(--p) 35%, transparent);
  transition: all .2s;
}
.cta-resume:hover { background: color-mix(in srgb, var(--p) 8%, transparent); border-color: var(--p); transform: translateY(-1px); }

/* ── Education ── */
.edu-list { display: flex; flex-direction: column; gap: 1rem; }
.edu-card {
  display: flex; align-items: flex-start; gap: 1.2rem;
  padding: 1.5rem 1.8rem; border-radius: 14px;
  border: 1px solid var(--border); background: var(--card);
  box-shadow: var(--sh); transition: border-color .25s, transform .25s;
  position: relative;
}
.edu-card:hover { border-color: var(--p); transform: translateX(5px); }
.edu-icon { width: 44px; height: 44px; border-radius: 12px; background: color-mix(in srgb, var(--p) 10%, transparent); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; color: var(--p); flex-shrink: 0; margin-top: 2px; }
.edu-info h4 { font-size: .95rem; font-weight: 700; margin-bottom: .2rem; }
.edu-place { font-size: .82rem; color: var(--p); font-weight: 600; margin-bottom: .4rem; }
.edu-desc { font-size: .82rem; color: var(--muted); line-height: 1.6; }
.edu-year { position: absolute; top: 1.5rem; right: 1.8rem; font-size: .75rem; font-weight: 700; color: var(--muted); background: var(--bg-alt); padding: .25rem .7rem; border-radius: 20px; border: 1px solid var(--border); white-space: nowrap; }
