:root {
  --bg: #0b1120;
  --bg-alt: #111a2e;
  --card: #16213a;
  --border: #24314f;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #a855f7;
  --accent-2: #22d3ee;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}
a { color: var(--accent-2); text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

.container { width: min(1120px, 92%); margin: 0 auto; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--accent); color: #fff; padding: .5rem 1rem; z-index: 100; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 17, 32, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.logo { font-weight: 800; font-size: 1.4rem; color: var(--text); }
.logo span { color: var(--accent); }
.nav nav { display: flex; gap: 1.5rem; align-items: center; }
.nav nav a { color: var(--muted); font-weight: 500; font-size: .95rem; }
.nav nav a:hover { color: var(--text); }

/* Buttons */
.btn {
  display: inline-block; padding: .75rem 1.4rem; border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff !important; font-weight: 600; transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(168, 85, 247, .35); }
.btn-ghost { background: transparent; border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); box-shadow: none; }
.btn-sm { padding: .45rem 1rem; font-size: .9rem; }

/* Hero (styles at end of file) */
.cta { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.cta.center { justify-content: center; }

/* Sections */
.section { padding: 5rem 0; }
.section.alt { background: var(--bg-alt); }
.section-title { font-size: 2rem; font-weight: 800; margin-bottom: .5rem; }
.section-title::after { content: ""; display: block; width: 56px; height: 4px; border-radius: 4px; margin-top: .6rem; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.section-sub { color: var(--muted); margin-bottom: 2rem; }
.section-title + .about-grid, .section-title + .cards, .section-title + .timeline { margin-top: 2rem; }

.about-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 3rem; }
.about-grid p { color: var(--muted); margin-bottom: 1rem; }
.about-grid strong { color: var(--text); }
.facts { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; height: fit-content; }
.facts li { padding: .6rem 0; border-bottom: 1px solid var(--border); }
.facts li:last-child { border: 0; }
.facts span { display: block; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.4rem; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem; transition: transform .2s, border-color .2s; color: var(--text); }
.card:hover { transform: translateY(-4px); border-color: var(--accent); }
.card h3 { font-size: 1.15rem; margin-bottom: .7rem; }
.card p { color: var(--muted); font-size: .95rem; }
.tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.tags li { font-size: .82rem; padding: .3rem .7rem; border-radius: 999px; background: rgba(168, 85, 247, .12); color: #d8b4fe; }
.project { display: flex; flex-direction: column; }
.project p { flex: 1; margin-bottom: 1rem; }
.lang { font-size: .8rem; color: var(--muted); }
.lang::before { content: "●"; margin-right: .4rem; }
.lang.html::before { color: #e34c26; }
.lang.js::before { color: #f1e05a; }
.lang.py::before { color: #3572a5; }
.lang.odoo::before { color: #a855f7; }

/* Timeline */
.timeline { border-left: 2px solid var(--border); padding-left: 2rem; list-style: none; }
.timeline > li { position: relative; margin-bottom: 2.5rem; }
.timeline > li::before { content: ""; position: absolute; left: calc(-2rem - 8px); top: .45rem; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(168, 85, 247, .25); }
.tl-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.tl-meta { color: var(--accent-2); font-size: .9rem; }
.timeline ul li { color: var(--muted); padding-left: 1.2rem; position: relative; margin-bottom: .35rem; }
.timeline ul li::before { content: "▹"; position: absolute; left: 0; color: var(--accent); }

/* Contact & footer */
.contact { text-align: center; }
.contact .section-title::after { margin-left: auto; margin-right: auto; }
.contact p { color: var(--muted); margin: 1.5rem auto 2rem; max-width: 55ch; }
.footer { padding: 2rem 0; text-align: center; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--border); }

@media (max-width: 820px) {
  .nav nav a:not(.btn) { display: none; }
  .about-grid { grid-template-columns: 1fr; }
}

/* Education */
.edu-main { display: flex; gap: 2rem; align-items: center; margin-top: 2rem; }
.edu-main:hover { transform: none; }
.cgpa {
  flex-shrink: 0; width: 130px; height: 130px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), #0891b2);
  box-shadow: 0 10px 30px rgba(168, 85, 247, .3);
}
.cgpa strong { font-size: 2.2rem; line-height: 1; }
.cgpa span { font-size: .8rem; opacity: .9; }
.edu-school { color: var(--accent-2) !important; font-weight: 600; margin-bottom: .3rem; }
.certs { margin-top: 1.4rem; }
@media (max-width: 600px) { .edu-main { flex-direction: column; text-align: center; } }
.edu { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 1.4rem; }
@media (max-width: 600px) { .edu { grid-template-columns: 1fr; } }
.grade { display: inline-block; margin-bottom: .6rem; padding: .2rem .7rem; border-radius: 999px; font-size: .8rem; font-weight: 700; color: #052e16; background: linear-gradient(135deg, #4ade80, #22d3ee); }

/* Certificate popup */
.cert { cursor: pointer; display: flex; flex-direction: column; }
.cert p { flex: 1; margin-bottom: 1rem; }
.cert .view { color: var(--accent-2); font-weight: 600; font-size: .9rem; }
.cert .grade { align-self: flex-start; }
#cert-modal {
  border: 0; padding: 0; background: transparent; margin: auto;
  max-width: min(900px, 94vw); max-height: 94vh; overflow: visible;
}
#cert-modal::backdrop { background: rgba(2, 6, 23, .85); backdrop-filter: blur(4px); }
#cert-modal img { max-height: 82vh; width: auto; max-width: 100%; margin: 0 auto; border-radius: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.modal-caption { text-align: center; color: var(--text); margin-top: .8rem; font-size: .95rem; }
.modal-caption a { margin-left: .6rem; }
.modal-close {
  position: absolute; top: -14px; right: -14px; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: var(--accent); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer;
}

/* WhatsApp */
.btn-wa { background: linear-gradient(135deg, #25d366, #128c7e); }
.btn-wa:hover { box-shadow: 0 8px 24px rgba(37, 211, 102, .35); }
.wa-float {
  position: fixed; right: 22px; bottom: 22px; z-index: 60; width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #25d366; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); transition: transform .15s;
}
.wa-float:hover { transform: scale(1.08); }

/* ================= Animated hero ================= */
.hero { position: relative; overflow: hidden; min-height: calc(100vh - 64px); display: flex; align-items: center; padding: 5rem 0 6rem; }
.hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; animation: drift 18s ease-in-out infinite alternate; }
.b1 { width: 520px; height: 520px; background: #7c3aed; top: -160px; right: -120px; }
.b2 { width: 420px; height: 420px; background: #0891b2; bottom: -160px; left: -120px; animation-duration: 22s; }
.b3 { width: 300px; height: 300px; background: #db2777; top: 40%; left: 45%; opacity: .25; animation-duration: 26s; }
@keyframes drift { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(60px, 40px) scale(1.15); } 100% { transform: translate(-40px, 70px) scale(.95); } }
.grid-overlay {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(148, 163, 184, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(148, 163, 184, .06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.35fr 1fr; gap: 3rem; align-items: center; }

.badge { display: inline-flex; align-items: center; gap: .55rem; padding: .4rem .9rem; border-radius: 999px; font-size: .85rem; color: #bbf7d0; background: rgba(34, 197, 94, .1); border: 1px solid rgba(34, 197, 94, .35); margin-bottom: 1.4rem; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .7); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }

.hero h1 { line-height: 1.05; margin-bottom: .8rem; }
.hero h1 .hi { display: block; font-size: clamp(1rem, 2vw, 1.25rem); font-weight: 600; color: var(--accent-2); letter-spacing: .04em; margin-bottom: .4rem; }
.hero h1 .name {
  display: block; font-size: clamp(2.4rem, 6vw, 4.4rem); font-weight: 900; letter-spacing: -.02em;
  background: linear-gradient(90deg, #fff 0%, #e9d5ff 25%, #a855f7 50%, #22d3ee 75%, #fff 100%);
  background-size: 250% auto; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 8s linear infinite;
}
@keyframes shine { to { background-position: 250% center; } }
.role { font-size: clamp(1.1rem, 2.4vw, 1.5rem); font-weight: 600; color: var(--text); margin-bottom: .6rem; }
.role strong { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.typing { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: clamp(.95rem, 1.8vw, 1.15rem); color: var(--accent-2); min-height: 1.8em; margin-bottom: 1rem; }
.caret { display: inline-block; width: 2px; height: 1.1em; background: var(--accent-2); margin-left: 3px; vertical-align: -.15em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.lead { color: var(--muted); max-width: 60ch; margin-bottom: 2rem; }

.btn-glow { position: relative; }
.btn-glow::after { content: ""; position: absolute; inset: -3px; border-radius: inherit; z-index: -1; background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent)); background-size: 200%; filter: blur(10px); opacity: .7; animation: shine 4s linear infinite; }
.icon-btn { width: 46px; height: 46px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--text) !important; border: 1px solid var(--border); background: rgba(22, 33, 58, .6); transition: all .2s; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent) !important; transform: translateY(-3px); }

.stats { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: 2.2rem; margin-top: 2.6rem; }
.stats strong { display: block; font-size: 1.9rem; font-weight: 800; background: linear-gradient(90deg, #fff, #c4b5fd); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stats li > span { color: var(--muted); font-size: .85rem; }

/* Photo + orbit */
.hero-visual { position: relative; width: 100%; max-width: 440px; aspect-ratio: 1; margin: 0 auto; display: flex; align-items: center; justify-content: center; }
.avatar-ring { position: relative; width: 72%; aspect-ratio: 1; border-radius: 50%; padding: 6px; transition: transform .2s ease-out; z-index: 2;
  background: conic-gradient(from 0deg, var(--accent), var(--accent-2), #db2777, var(--accent)); animation: spin 6s linear infinite; box-shadow: 0 0 60px rgba(168, 85, 247, .45); }
.avatar-ring picture { display: block; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; border: 5px solid var(--bg); animation: spin 6s linear infinite reverse; }
.avatar-ring img { display: block; width: 100%; height: 100%; object-fit: cover; }
@keyframes spin { to { rotate: 360deg; } }
.orbit { position: absolute; inset: 0; border: 1px dashed rgba(148, 163, 184, .25); border-radius: 50%; animation: spin 40s linear infinite; }
.chip { position: absolute; padding: .3rem .7rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: rgba(22, 33, 58, .9); border: 1px solid var(--border); white-space: nowrap; animation: spin 40s linear infinite reverse; translate: -50% -50%; }
.float-card { position: absolute; z-index: 3; padding: .6rem .9rem; border-radius: 12px; font-size: .85rem; line-height: 1.3;
  background: rgba(22, 33, 58, .75); backdrop-filter: blur(8px); border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); animation: bob 5s ease-in-out infinite; }
.float-card strong { color: #4ade80; }
.float-card small { color: var(--muted); }
.fc1 { top: 14%; left: -14%; }
.fc2 { bottom: 14%; right: -14%; animation-delay: -2.5s; }
.fc2 strong { color: var(--accent-2); }
@keyframes bob { 50% { transform: translateY(-12px); } }

.scroll-hint { position: absolute; bottom: 1.6rem; left: 50%; translate: -50% 0; width: 26px; height: 42px; border: 2px solid var(--muted); border-radius: 14px; z-index: 1; }
.scroll-hint span { position: absolute; top: 7px; left: 50%; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--muted); animation: wheel 1.8s infinite; }
@keyframes wheel { to { opacity: 0; transform: translateY(14px); } }

/* Reveal on scroll (animations use translate/scale, so hover transforms still work) */
.js .reveal { opacity: 0; }
.js .reveal.in { animation: rise .75s cubic-bezier(.2, .7, .2, 1) var(--d, 0s) both; }
@keyframes rise { from { opacity: 0; translate: 0 28px; } to { opacity: 1; translate: 0 0; } }
.hero .reveal:nth-child(2) { --d: .08s; } .hero .reveal:nth-child(3) { --d: .16s; }
.hero .reveal:nth-child(4) { --d: .24s; } .hero .reveal:nth-child(5) { --d: .32s; }
.hero .reveal:nth-child(6) { --d: .4s; } .hero .reveal:nth-child(7) { --d: .48s; }
.js .hero-visual.reveal.in { animation: pop 1s cubic-bezier(.2, .7, .2, 1) .2s both; }
@keyframes pop { from { opacity: 0; scale: .85; } to { opacity: 1; scale: 1; } }

@media (max-width: 900px) {
  .hero { min-height: auto; padding: 3rem 0 5rem; }
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-visual { order: -1; max-width: 300px; }
  .cta, .stats { justify-content: center; }
  .stats { grid-template-columns: repeat(2, auto); gap: 1.5rem 2.5rem; }
  .lead { margin-left: auto; margin-right: auto; }
  .fc1 { left: -8%; } .fc2 { right: -8%; }
  .chip:nth-child(even) { display: none; }
  .scroll-hint { display: none; }
}
@media (max-width: 420px) { .chip { font-size: .7rem; } .float-card { font-size: .75rem; } }


/* Roles */
.roles .card h3 { color: #e9d5ff; }
.hire-line { text-align: center; margin-top: 2.2rem; color: var(--muted); }
.hire-line strong { color: var(--text); }

/* ================= Section animations ================= */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--accent), var(--accent-2), #db2777); box-shadow: 0 0 12px rgba(168, 85, 247, .7); }

/* Section titles: underline grows in */
.js .section-title::after { width: 0; transition: width .9s cubic-bezier(.2, .7, .2, 1) .2s; }
.js .section-title.in::after { width: 72px; }

/* Drifting glow behind alternate sections */
.section { position: relative; overflow: hidden; }
.section > .container { position: relative; z-index: 1; }
.section.alt::before, .section.alt::after { content: ""; position: absolute; border-radius: 50%; filter: blur(90px); opacity: .18; pointer-events: none; animation: drift 24s ease-in-out infinite alternate; }
.section.alt::before { width: 420px; height: 420px; background: #7c3aed; top: -120px; right: -100px; }
.section.alt::after { width: 360px; height: 360px; background: #0891b2; bottom: -140px; left: -80px; animation-duration: 30s; }

/* Cards: spotlight, glowing border, icon */
.card { position: relative; overflow: hidden; isolation: isolate; transition: transform .3s, border-color .3s, box-shadow .3s; }
.card::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .3s;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), rgba(168, 85, 247, .18), transparent 45%); }
.card:hover::before { opacity: 1; }
.card:hover { transform: translateY(-6px); border-color: rgba(168, 85, 247, .7); box-shadow: 0 18px 40px rgba(0, 0, 0, .35), 0 0 30px rgba(168, 85, 247, .18); }
.ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 1rem; color: #d8b4fe;
  background: linear-gradient(135deg, rgba(168, 85, 247, .22), rgba(34, 211, 238, .18)); border: 1px solid rgba(168, 85, 247, .35);
  transition: transform .45s cubic-bezier(.3, 1.6, .5, 1), color .3s; }
.card:hover .ico { transform: rotate(-10deg) scale(1.12); color: var(--accent-2); }

/* Skill tags pop in one by one */
.js .card.reveal .tags li { opacity: 0; scale: .7; }
.js .card.reveal.in .tags li { animation: tagpop .45s cubic-bezier(.3, 1.6, .5, 1) calc(var(--d, 0s) + .25s + var(--i, 0) * 45ms) both; }
@keyframes tagpop { to { opacity: 1; scale: 1; } }
.tags li { transition: background .2s, color .2s, translate .2s; }
.tags li:hover { background: rgba(34, 211, 238, .18); color: #a5f3fc; translate: 0 -2px; }

/* Timeline draws as you scroll */
.timeline { position: relative; }
.timeline::before { content: ""; position: absolute; left: -2px; top: 0; width: 2px; height: calc(var(--prog, 0) * 100%);
  background: linear-gradient(var(--accent), var(--accent-2)); box-shadow: 0 0 10px rgba(168, 85, 247, .8); }
.timeline > li::before { transition: transform .3s; }
.timeline > li.in::before { animation: dot 2.4s ease-out infinite; }
@keyframes dot { 0% { box-shadow: 0 0 0 0 rgba(168, 85, 247, .6); } 70%, 100% { box-shadow: 0 0 0 12px rgba(168, 85, 247, 0); } }
.timeline > li { padding: 1.2rem 1.4rem; margin: 0 0 .6rem -1.4rem; border-radius: var(--radius); transition: background .3s; }
.timeline > li::before { left: calc(-2rem - 8px + 1.4rem); top: 1.65rem; }
.timeline > li:hover { background: rgba(22, 33, 58, .6); }

/* CGPA progress rings */
@property --p { syntax: "<number>"; inherits: false; initial-value: 0; }
.cgpa { --p: 0; transition: --p 1.8s cubic-bezier(.2, .7, .2, 1) .2s; box-shadow: 0 0 40px rgba(168, 85, 247, .25);
  background: radial-gradient(closest-side, var(--card) 80%, transparent 81% 100%),
              conic-gradient(var(--accent-2), var(--accent) calc(var(--p) * 1%), rgba(148, 163, 184, .15) 0); }
.in .cgpa, .edu-main.in .cgpa { --p: var(--t); }
.cgpa strong { background: linear-gradient(90deg, #fff, #c4b5fd); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Certificate grade badge shimmer */
.grade { background-size: 200% auto; animation: shine 3s linear infinite; background-image: linear-gradient(90deg, #4ade80, #22d3ee, #4ade80); }

/* Contact heading shimmer */
.contact .section-title { background: linear-gradient(90deg, #fff, #c084fc, #22d3ee, #fff); background-size: 250% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 6s linear infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal, .js .card.reveal .tags li { opacity: 1; scale: 1; translate: none; }
  .cgpa { --p: var(--t); }
  .js .section-title::after { width: 72px; }
}
