:root {
  --bg: #070b18;
  --bg-2: #0b1124;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --text: #e6eaf5;
  --muted: #9aa4bf;
  --accent: #38bdf8;
  --accent-2: #818cf8;
  --accent-3: #34d399;
  --grad: linear-gradient(120deg, #38bdf8 0%, #818cf8 55%, #c084fc 100%);
  --radius: 18px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Space Grotesk', 'Inter', sans-serif;
}

* { scroll-margin-top: 80px; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5 { font-family: var(--display); letter-spacing: -0.02em; color: #fff; }
a { color: var(--accent); text-decoration: none; }
::selection { background: rgba(56, 189, 248, 0.35); }

.text-accent { color: var(--accent) !important; }
.text-muted-2 { color: var(--muted) !important; }
.mono { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; color: var(--accent-3); }
.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* scroll progress */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: var(--grad); z-index: 2000; transition: width .1s linear;
}

/* ===== Buttons ===== */
.btn-accent {
  background: var(--grad); color: #06101f; font-weight: 600; border: 0;
  box-shadow: 0 10px 30px -10px rgba(56, 189, 248, 0.6);
  transition: transform .2s ease, box-shadow .2s ease;
}
.btn-accent:hover, .btn-accent:focus { color: #06101f; transform: translateY(-2px); box-shadow: 0 14px 34px -10px rgba(129, 140, 248, 0.75); }
.btn-ghost {
  color: var(--text); border: 1px solid var(--border); background: var(--surface);
  backdrop-filter: blur(8px); font-weight: 500; transition: all .2s ease;
}
.btn-ghost:hover { color: #fff; border-color: var(--accent); background: rgba(56, 189, 248, 0.08); transform: translateY(-2px); }

/* ===== Navbar ===== */
#mainNav { padding: 1.1rem 0; transition: all .3s ease; }
#mainNav.scrolled {
  padding: .6rem 0; background: rgba(7, 11, 24, 0.78);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
#mainNav .nav-link { color: var(--muted); font-weight: 500; font-size: .95rem; padding: .5rem .85rem !important; border-radius: 10px; transition: color .2s; }
#mainNav .nav-link:hover, #mainNav .nav-link.active { color: #fff; }
#mainNav .nav-link.active { background: var(--surface-2); }
.navbar-toggler { color: var(--text); }
.navbar-toggler:focus { box-shadow: none; }
@media (max-width: 991.98px) {
  #navLinks { background: rgba(11, 17, 36, 0.97); border: 1px solid var(--border); border-radius: 16px; padding: 1rem; margin-top: .75rem; }
}

.brand { display: inline-flex; align-items: center; gap: .6rem; color: #fff; font-family: var(--display); font-weight: 700; font-size: 1.2rem; }
.brand:hover { color: #fff; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: var(--grad); color: #06101f; font-weight: 700; font-size: 1.05rem;
}

/* ===== Hero ===== */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; padding: 130px 0 90px; overflow: hidden; }
#netCanvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}
.hero .container { z-index: 2; }
.hero-glow { position: absolute; border-radius: 50%; filter: blur(110px); opacity: .45; pointer-events: none; }
.glow-1 { width: 520px; height: 520px; background: #1d4ed8; top: -120px; left: -140px; }
.glow-2 { width: 460px; height: 460px; background: #7c3aed; bottom: -160px; right: -100px; opacity: .35; }

.status-pill {
  display: inline-flex; align-items: center; gap: .55rem; padding: .45rem 1rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: .88rem;
}
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-3); box-shadow: 0 0 0 0 rgba(52, 211, 153, .7); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,.6);} 70% { box-shadow: 0 0 0 10px rgba(52,211,153,0);} 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0);} }

.hero-title { font-size: clamp(2.4rem, 5.6vw, 4.4rem); font-weight: 700; line-height: 1.05; margin-bottom: 1rem; }
.hero-role { font-size: clamp(1.15rem, 2.2vw, 1.5rem); color: #cbd5f5; font-weight: 500; margin-bottom: 1.25rem; min-height: 2.2em; }
.caret { display: inline-block; width: 3px; height: 1.1em; background: var(--accent); margin-left: 4px; vertical-align: -0.15em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-lead { color: var(--muted); font-size: 1.1rem; max-width: 600px; margin-bottom: 2rem; }

.hero-social { display: flex; gap: .75rem; }
.hero-social a {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: 1.15rem; transition: all .2s;
}
.hero-social a:hover { color: #fff; border-color: var(--accent); transform: translateY(-3px); background: rgba(56,189,248,.1); }

.portrait-wrap { position: relative; display: inline-block; max-width: 380px; width: 100%; }
.portrait {
  position: relative; z-index: 2; width: 100%; height: auto; aspect-ratio: 4/5; object-fit: cover;
  border-radius: 28px; border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.8);
}
.portrait-ring {
  position: absolute; inset: -14px; border-radius: 36px; z-index: 1;
  background: conic-gradient(from 0deg, #38bdf8, #818cf8, #c084fc, #34d399, #38bdf8);
  filter: blur(18px); opacity: .55; animation: spin 10s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.float-chip {
  position: absolute; z-index: 3; display: flex; align-items: center; gap: .5rem;
  padding: .55rem .9rem; border-radius: 12px; font-size: .85rem; font-weight: 600; color: #fff; white-space: nowrap;
  background: rgba(11, 17, 36, 0.82); border: 1px solid var(--border); backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px -12px rgba(0,0,0,.7); animation: float 6s ease-in-out infinite;
}
.float-chip i { color: var(--accent); }
.chip-1 { top: 9%; left: -12%; }
.chip-2 { top: 48%; right: -8%; animation-delay: -2s; }
.chip-2 i { color: var(--accent-2); }
.chip-3 { bottom: 7%; left: -8%; animation-delay: -4s; }
.chip-3 i { color: var(--accent-3); }
@keyframes float { 0%,100% { transform: translateY(0);} 50% { transform: translateY(-10px);} }
@media (max-width: 575.98px) {
  .portrait-wrap { max-width: 270px; }
  .chip-1 { left: -6%; } .chip-2 { right: -6%; } .chip-3 { left: -2%; }
  .float-chip { font-size: .75rem; padding: .45rem .7rem; }
}

.stats .stat {
  text-align: center; padding: 1.4rem 1rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(8px); height: 100%;
}
.stat-num { font-family: var(--display); font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-label { color: var(--muted); font-size: .88rem; }

.scroll-hint { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 1.4rem; z-index: 3; animation: bounce 2s infinite; }
@keyframes bounce { 0%,100% { transform: translate(-50%,0);} 50% { transform: translate(-50%,8px);} }

/* ===== Sections ===== */
.section { padding: 110px 0; position: relative; }
.section-alt { background: linear-gradient(180deg, var(--bg-2), var(--bg)); }
.section-head { margin-bottom: 3rem; max-width: 720px; }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 700; margin-top: .5rem; }
.section-sub { color: var(--muted); font-size: 1.05rem; margin: .75rem 0 0; }
.eyebrow { font-family: ui-monospace, Consolas, monospace; color: var(--accent); font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; }

.glass { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); backdrop-filter: blur(10px); }
.lead-text { font-size: 1.15rem; color: #dbe2f4; }
.info-line { display: flex; gap: .7rem; align-items: center; color: #cbd3ea; font-size: .95rem; }
.info-line i { color: var(--accent); font-size: 1.05rem; }

.highlight {
  display: flex; gap: 1rem; align-items: flex-start; padding: 1.15rem 1.25rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); transition: all .25s ease; height: 100%;
}
.highlight:hover { border-color: rgba(56,189,248,.45); transform: translateX(6px); background: var(--surface-2); }
.highlight h3 { font-size: 1.02rem; margin: 0 0 .2rem; }
.highlight p { color: var(--muted); font-size: .9rem; margin: 0; }
.hl-icon {
  flex: 0 0 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem;
  background: linear-gradient(135deg, rgba(56,189,248,.18), rgba(129,140,248,.18)); color: var(--accent);
}

/* ===== Skills ===== */
.skill-card {
  height: 100%; padding: 1.8rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  position: relative; overflow: hidden; transition: transform .3s ease, border-color .3s ease;
}
.skill-card::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .3s;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), rgba(56,189,248,.12), transparent 45%);
}
.skill-card:hover { transform: translateY(-6px); border-color: rgba(129,140,248,.45); }
.skill-card:hover::before { opacity: 1; }
.skill-card h3 { font-size: 1.2rem; margin: 1rem 0 1.1rem; position: relative; }
.skill-icon {
  width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem; color: #06101f;
  background: var(--grad); position: relative;
}
.tags { display: flex; flex-wrap: wrap; gap: .5rem; position: relative; }
.tags span {
  font-size: .82rem; padding: .35rem .75rem; border-radius: 999px; color: #d6dcf0;
  background: rgba(255,255,255,.05); border: 1px solid var(--border); transition: all .2s;
}
.tags span:hover { border-color: var(--accent); color: #fff; }
.bars { position: relative; }
.bar { margin-bottom: 1rem; }
.bar-top { display: flex; justify-content: space-between; font-size: .88rem; color: #cbd3ea; margin-bottom: .4rem; }
.bar-track { height: 8px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; }
.bar-fill { height: 100%; width: 0; border-radius: 99px; background: var(--grad); transition: width 1.4s cubic-bezier(.2,.8,.2,1); }

/* ===== Timeline ===== */
.timeline { position: relative; padding-left: 0; }
.timeline::before {
  content: ""; position: absolute; left: 23px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2), transparent);
}
.tl-item { position: relative; padding-left: 72px; margin-bottom: 2rem; }
.tl-dot {
  position: absolute; left: 0; top: 6px; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: var(--bg-2); border: 1px solid rgba(56,189,248,.5); color: var(--accent); font-size: 1.15rem;
  box-shadow: 0 0 0 6px var(--bg), 0 0 24px rgba(56,189,248,.35);
}
.tl-card { padding: 1.75rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); transition: border-color .3s; }
.tl-card:hover { border-color: rgba(56,189,248,.35); }
.tl-card h3 { font-size: 1.25rem; margin: 0; }
.tl-card h3 small { font-size: .8rem; font-weight: 500; font-family: var(--font); }
.tl-org { color: var(--accent); font-weight: 500; font-size: .95rem; margin-top: .2rem; }
.tl-date { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; color: #cbd3ea; padding: .35rem .75rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap; }
.tl-list { list-style: none; padding: 0; margin: 1.1rem 0 0; }
.tl-list li { position: relative; padding-left: 1.4rem; color: #c5cde3; margin-bottom: .55rem; font-size: .97rem; }
.tl-list li::before { content: ""; position: absolute; left: 0; top: .62em; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); transform: rotate(45deg); }

.progression { margin-top: 1.5rem; padding: 1.25rem; border-radius: 14px; background: rgba(0,0,0,.2); border: 1px dashed var(--border); }
.prog-title { font-weight: 600; color: #fff; font-size: .95rem; margin-bottom: 1rem; }
.prog-title i { color: var(--accent-3); }
.prog-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; }
.prog-step { padding: .85rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: .25rem; }
.prog-step.active { border-color: rgba(52,211,153,.55); background: rgba(52,211,153,.07); }
.ps-year { font-family: ui-monospace, Consolas, monospace; font-size: .75rem; color: var(--accent-3); }
.ps-role { font-size: .85rem; color: #d6dcf0; line-height: 1.4; }
@media (max-width: 991.98px) { .prog-steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575.98px) {
  .prog-steps { grid-template-columns: 1fr; }
  .timeline::before { left: 17px; }
  .tl-item { padding-left: 52px; }
  .tl-dot { width: 36px; height: 36px; border-radius: 10px; font-size: .95rem; }
  .tl-card { padding: 1.25rem; }
}

/* ===== Projects ===== */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.filter-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-weight: 500;
  padding: .5rem 1.1rem; border-radius: 999px; font-size: .9rem; transition: all .2s;
}
.filter-btn:hover { color: #fff; border-color: var(--accent); }
.filter-btn.active { background: var(--grad); color: #06101f; border-color: transparent; font-weight: 600; }

.project { transition: opacity .35s ease, transform .35s ease; }
.project.hide { display: none; }
.project.fade-in { animation: fadeUp .45s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px);} to { opacity: 1; transform: none; } }

.project-card {
  height: 100%; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--border);
  display: flex; flex-direction: column; transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.project-card:hover { transform: translateY(-8px); border-color: rgba(129,140,248,.5); box-shadow: 0 30px 60px -30px rgba(56,189,248,.35); }
.pc-top { position: relative; height: 130px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pc-top i { font-size: 3rem; color: rgba(255,255,255,.95); filter: drop-shadow(0 8px 18px rgba(0,0,0,.35)); transition: transform .4s ease; }
.project-card:hover .pc-top i { transform: scale(1.15) rotate(-4deg); }
.pc-top::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.18) 1px, transparent 1px); background-size: 16px 16px; opacity: .45; }
.pc-date { position: absolute; top: 12px; right: 12px; z-index: 2; font-size: .72rem; font-weight: 600; padding: .25rem .6rem; border-radius: 999px; background: rgba(0,0,0,.35); color: #fff; backdrop-filter: blur(6px); }
.grad-a { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.grad-b { background: linear-gradient(135deg, #6366f1, #a855f7); }
.grad-c { background: linear-gradient(135deg, #0891b2, #10b981); }
.grad-d { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.grad-e { background: linear-gradient(135deg, #ec4899, #8b5cf6); }
.grad-f { background: linear-gradient(135deg, #2563eb, #06b6d4); }
.grad-g { background: linear-gradient(135deg, #10b981, #3b82f6); }
.grad-h { background: linear-gradient(135deg, #7c3aed, #0ea5e9); }
.pc-body { padding: 1.5rem; display: flex; flex-direction: column; flex: 1; }
.pc-cat { font-family: ui-monospace, Consolas, monospace; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.pc-body h3 { font-size: 1.15rem; margin: .4rem 0 .7rem; }
.pc-body p { color: var(--muted); font-size: .92rem; flex: 1; }
.pc-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.pc-tags span { font-size: .74rem; padding: .25rem .6rem; border-radius: 8px; background: rgba(129,140,248,.12); color: #c7cdfb; border: 1px solid rgba(129,140,248,.2); }
.pc-progress { margin-top: 1rem; height: 6px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.pc-progress div { height: 100%; background: var(--grad); border-radius: 99px; }

/* ===== Education ===== */
.edu-card {
  display: flex; gap: 1.25rem; align-items: flex-start; padding: 1.5rem; margin-bottom: 1rem;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); transition: all .25s;
}
.edu-card:hover { border-color: rgba(56,189,248,.45); transform: translateY(-3px); }
.edu-icon { flex: 0 0 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem; background: var(--grad); color: #06101f; }
.edu-year { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; color: var(--accent-3); }
.edu-card h3 { font-size: 1.15rem; margin: .2rem 0 .25rem; }
.edu-card p { color: var(--muted); margin: 0; font-size: .93rem; }
.cert { display: flex; gap: 1rem; align-items: flex-start; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.cert:last-child { border-bottom: 0; padding-bottom: 0; }
.cert-year { flex: 0 0 auto; font-family: ui-monospace, Consolas, monospace; font-size: .8rem; font-weight: 600; padding: .3rem .6rem; border-radius: 8px; background: rgba(56,189,248,.12); color: var(--accent); }
.cert strong { color: #fff; font-weight: 600; }

/* ===== Contact ===== */
.cta-panel {
  position: relative; overflow: hidden; padding: clamp(1.75rem, 5vw, 3.5rem); border-radius: 28px;
  background: linear-gradient(135deg, rgba(56,189,248,.1), rgba(129,140,248,.08) 50%, rgba(192,132,252,.1));
  border: 1px solid rgba(129,140,248,.3);
}
.cta-panel::before { content: ""; position: absolute; width: 380px; height: 380px; border-radius: 50%; background: #38bdf8; filter: blur(140px); opacity: .18; top: -160px; right: -120px; }
.cta-panel h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 700; }
.contact-tile {
  position: relative; display: flex; flex-direction: column; gap: .2rem; padding: 1.25rem; border-radius: 16px; height: 100%;
  background: rgba(7,11,24,.55); border: 1px solid var(--border); color: var(--text); transition: all .25s;
}
.contact-tile:hover { border-color: var(--accent); transform: translateY(-4px); color: #fff; }
.contact-tile i { font-size: 1.5rem; color: var(--accent); margin-bottom: .4rem; }
.ct-label { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.ct-value { font-weight: 600; font-size: .95rem; word-break: break-word; }

/* ===== Footer ===== */
.footer { padding: 2rem 0; border-top: 1px solid var(--border); background: var(--bg); }
.small-brand { font-size: 1rem; }
.small-brand .brand-mark { width: 30px; height: 30px; font-size: .9rem; border-radius: 8px; }
.to-top { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--text); transition: all .2s; }
.to-top:hover { color: #06101f; background: var(--grad); }

/* ===== Reveal ===== */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .portrait-ring, .float-chip, .scroll-hint, .status-pill .dot { animation: none; }
}
@media (max-width: 767.98px) {
  .section { padding: 80px 0; }
  .hero { padding-top: 110px; }
}
