:root {
  --font-main: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius-xl: 2rem;
  --radius-lg: 1.4rem;
  --brand: #0ea5e9;
  --brand-2: #22c55e;
  --brand-3: #8b5cf6;
  --warning: #f59e0b;
  --glass: rgba(15, 23, 42, .72);
  --glass-light: rgba(255, 255, 255, .72);
  --line: rgba(148, 163, 184, .22);
  --shadow: 0 2rem 5rem rgba(2, 6, 23, .35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; }
body {
  min-height: 100vh;
  font-family: var(--font-main);
  overflow-x: hidden;
  background:
    radial-gradient(circle at 15% 12%, rgba(14, 165, 233, .22), transparent 26rem),
    radial-gradient(circle at 85% 18%, rgba(139, 92, 246, .22), transparent 27rem),
    radial-gradient(circle at 45% 78%, rgba(34, 197, 94, .14), transparent 32rem),
    var(--bs-body-bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -3;
  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: linear-gradient(to bottom, #000, transparent 86%);
}

body.light-mode {
  background:
    radial-gradient(circle at 15% 12%, rgba(14, 165, 233, .18), transparent 26rem),
    radial-gradient(circle at 85% 18%, rgba(139, 92, 246, .13), transparent 27rem),
    radial-gradient(circle at 45% 78%, rgba(34, 197, 94, .11), transparent 32rem),
    #f8fafc;
}

::selection { background: rgba(14, 165, 233, .35); }

.fw-black { font-weight: 900; letter-spacing: -.055em; }
.text-balance { text-wrap: balance; }

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 0;
  background: linear-gradient(90deg, var(--brand), var(--brand-2), var(--brand-3));
  z-index: 1100;
  box-shadow: 0 0 24px rgba(14, 165, 233, .7);
}

.hero-canvas {
  position: fixed;
  inset: 0;
  z-index: -2;
  opacity: .5;
  pointer-events: none;
}

.navbar-glass {
  --bs-navbar-padding-y: .85rem;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(2, 6, 23, .6);
  border-bottom: 1px solid var(--line);
  transition: padding .25s ease, background .25s ease, box-shadow .25s ease;
}

[data-bs-theme="light"] .navbar-glass {
  background: rgba(255, 255, 255, .72);
}

.navbar-glass.is-scrolled {
  --bs-navbar-padding-y: .55rem;
  box-shadow: 0 1rem 3rem rgba(2, 6, 23, .18);
}

.brand-orb {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 1rem;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(135deg, var(--brand), var(--brand-3));
  box-shadow: 0 1rem 2rem rgba(14, 165, 233, .28);
}

.brand-text { font-weight: 850; letter-spacing: -.03em; }
.nav-link {
  font-weight: 650;
  position: relative;
  opacity: .84;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: .5rem;
  right: .5rem;
  bottom: .35rem;
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.nav-link.active::after,
.nav-link:hover::after { transform: scaleX(1); }

.btn-icon {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, .08);
  color: var(--bs-body-color);
}
.btn-icon:hover { border-color: rgba(14, 165, 233, .45); color: var(--brand); }

.btn { border-radius: 999px; font-weight: 750; }
.btn-primary {
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: #0284c7;
  --bs-btn-hover-border-color: #0284c7;
  box-shadow: 0 1rem 2rem rgba(14, 165, 233, .2);
}
.btn-ghost {
  color: var(--bs-body-color);
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, .08);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

.hero-section {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  overflow: hidden;
}
.hero-section .min-vh-100 {
  min-height: 100vh;
  padding-top: clamp(6rem, 9vw, 8rem);
  padding-bottom: 2rem;
}
.blob {
  position: absolute;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .34;
  z-index: -1;
  animation: blobMove 13s ease-in-out infinite alternate;
}
.blob-a { left: -8rem; top: 8rem; background: var(--brand); }
.blob-b { right: -8rem; bottom: 0; background: var(--brand-3); animation-delay: -5s; }

@keyframes blobMove {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(2rem, -3rem, 0) scale(1.1); }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  width: fit-content;
  padding: .48rem .85rem;
  border-radius: 999px;
  color: var(--brand);
  background: rgba(14, 165, 233, .13);
  border: 1px solid rgba(14, 165, 233, .24);
  font-size: .82rem;
  font-weight: 850;
  letter-spacing: .02em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.gradient-text {
  background: linear-gradient(90deg, #38bdf8, #22c55e, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-subtitle {
  max-width: 48rem;
  font-size: clamp(1.12rem, 2vw, 1.45rem);
  color: var(--bs-secondary-color);
}
#typewriter {
  color: var(--brand);
  border-right: 2px solid currentColor;
  padding-right: .2rem;
  white-space: nowrap;
  animation: caretBlink .75s step-end infinite;
}
@keyframes caretBlink { 50% { border-color: transparent; } }

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  max-width: 46rem;
}
.hero-badge,
.chip,
.contact-pill,
.command-item,
.filter-btn {
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, .08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .72rem .95rem;
  border-radius: 999px;
  color: var(--bs-body-color);
  font-weight: 700;
  transform: translateY(6px);
  opacity: 0;
  animation: floatIn .5s ease forwards;
}
.hero-badge i { color: var(--brand); }
@keyframes floatIn { to { opacity: 1; transform: translateY(0); } }

.profile-stage {
  position: relative;
  max-width: 28rem;
  margin: 0 auto;
  perspective: 1200px;
}
.profile-card {
  position: relative;
  z-index: 2;
  padding: 1rem;
  border-radius: 2rem;
  background: linear-gradient(145deg, rgba(255,255,255,.11), rgba(255,255,255,.04));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  transform-style: preserve-3d;
  transition: transform .12s ease;
  overflow: hidden;
}
.profile-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: conic-gradient(from 180deg, transparent 0 30%, rgba(14,165,233,.45), rgba(139,92,246,.42), transparent 72% 100%);
  z-index: -2;
  animation: spinGlow 8s linear infinite;
}
.profile-card::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: rgba(15, 23, 42, .86);
  z-index: -1;
}
[data-bs-theme="light"] .profile-card::after { background: rgba(255, 255, 255, .88); }
@keyframes spinGlow { to { transform: rotate(360deg); } }

.profile-topline {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: fit-content;
  padding: .5rem .8rem;
  border-radius: 999px;
  border: 1px solid rgba(34, 197, 94, .3);
  background: rgba(34, 197, 94, .1);
  font-size: .83rem;
  font-weight: 750;
  margin-bottom: 1rem;
}
.status-dot {
  width: .65rem;
  height: .65rem;
  border-radius: 50%;
  background: var(--brand-2);
  box-shadow: 0 0 0 .4rem rgba(34, 197, 94, .12);
}
.profile-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 1.45rem;
  border: 1px solid var(--line);
}
.profile-info { padding: 1.25rem .35rem .2rem; }
.profile-info h2 { font-size: 1.5rem; font-weight: 900; letter-spacing: -.04em; }
.profile-info p { color: var(--bs-secondary-color); margin: 0; }
.metric-card {
  text-align: center;
  padding: .85rem .4rem;
  border-radius: 1.1rem;
  background: rgba(148, 163, 184, .1);
  border: 1px solid var(--line);
}
.metric-card span { display: block; color: var(--brand); font-size: 1.6rem; font-weight: 900; }
.metric-card small { color: var(--bs-secondary-color); font-weight: 700; }
.orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(14, 165, 233, .25);
  inset: -1.7rem;
  animation: orbit 12s linear infinite;
}
.orbit-two {
  inset: -3.1rem;
  border-color: rgba(139, 92, 246, .24);
  animation-direction: reverse;
  animation-duration: 18s;
}
.orbit::before {
  content: "";
  position: absolute;
  top: 2rem;
  left: 3rem;
  width: .85rem;
  height: .85rem;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 1.5rem var(--brand);
}
.orbit-two::before { background: var(--brand-3); box-shadow: 0 0 1.5rem var(--brand-3); }
@keyframes orbit { to { transform: rotate(360deg); } }

.section {
  padding: clamp(4.5rem, 8vw, 7.5rem) 0;
  position: relative;
}
.section-heading {
  max-width: 780px;
  margin: 0 auto 3rem;
  text-align: center;
}
.section-heading h2 {
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  font-weight: 900;
  letter-spacing: -.055em;
  margin-bottom: .85rem;
}
.section-heading p { color: var(--bs-secondary-color); font-size: 1.08rem; margin: 0; }
.bg-soft {
  background: linear-gradient(180deg, transparent, rgba(148,163,184,.06), transparent);
}

.glass-card,
.project-card,
.education-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(15, 23, 42, .62);
  box-shadow: 0 1.5rem 4rem rgba(2, 6, 23, .18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: clamp(1.4rem, 3vw, 2.2rem);
  overflow: hidden;
}
[data-bs-theme="light"] .glass-card,
[data-bs-theme="light"] .project-card,
[data-bs-theme="light"] .education-card {
  background: rgba(255, 255, 255, .74);
}
.glass-card::before,
.project-card::before,
.education-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 0%), rgba(14, 165, 233, .18), transparent 28%);
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
.glass-card:hover::before,
.project-card:hover::before,
.education-card:hover::before { opacity: 1; }
.section-icon {
  width: 54px;
  height: 54px;
  display: inline-grid;
  place-items: center;
  border-radius: 1.1rem;
  color: #fff;
  font-size: 1.35rem;
  background: linear-gradient(135deg, var(--brand), var(--brand-3));
  box-shadow: 0 1rem 2rem rgba(14, 165, 233, .2);
}

.chip-cloud { display: flex; flex-wrap: wrap; gap: .75rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .7rem .9rem;
  border-radius: 999px;
  font-weight: 750;
  transition: transform .25s ease, border-color .25s ease;
}
.chip:hover { transform: translateY(-4px); border-color: rgba(14,165,233,.45); }
.chip i { color: var(--brand); }

.timeline {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, var(--brand), var(--brand-3), transparent);
}
.timeline-item {
  position: relative;
  width: 50%;
  padding: 0 2.4rem 2.2rem 0;
}
.timeline-item:nth-child(even) { margin-left: 50%; padding: 0 0 2.2rem 2.4rem; }
.timeline-dot {
  position: absolute;
  right: -12px;
  top: 1.3rem;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border: 5px solid var(--bs-body-bg);
  box-shadow: 0 0 0 .45rem rgba(14, 165, 233, .16);
  z-index: 2;
}
.timeline-item:nth-child(even) .timeline-dot { left: -12px; right: auto; }
.timeline-card {
  padding: 1.45rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, .65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}
[data-bs-theme="light"] .timeline-card { background: rgba(255,255,255,.78); }
.timeline-card:hover {
  transform: translateY(-8px);
  border-color: rgba(14,165,233,.4);
  box-shadow: 0 1.4rem 3rem rgba(2, 6, 23, .2);
}
.timeline-card .period {
  color: var(--brand);
  font-weight: 850;
  font-size: .9rem;
}
.timeline-card h3 { font-size: 1.15rem; font-weight: 900; margin: .35rem 0 .1rem; }
.timeline-card h4 { font-size: 1rem; color: var(--bs-secondary-color); margin-bottom: 1rem; }
.timeline-card ul { padding-left: 1.1rem; margin: 0; color: var(--bs-secondary-color); }
.timeline-card li + li { margin-top: .55rem; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .75rem;
  margin-bottom: 1.5rem;
}
.filter-btn {
  color: var(--bs-body-color);
  border-radius: 999px;
  padding: .7rem 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform .22s ease, background .22s ease, border-color .22s ease;
}
.filter-btn:hover { transform: translateY(-3px); border-color: rgba(14,165,233,.48); }
.filter-btn.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-3));
  color: #fff;
  border-color: transparent;
}
.project-card {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform .3s ease, opacity .3s ease, filter .3s ease;
}
.project-card.is-hidden {
  transform: scale(.92);
  opacity: 0;
  filter: blur(5px);
  pointer-events: none;
}
.project-card .project-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 1.2rem;
  color: #fff;
  font-size: 1.45rem;
  background: linear-gradient(135deg, var(--brand), var(--brand-3));
  margin-bottom: 1.2rem;
}
.project-card h3 { font-weight: 900; letter-spacing: -.035em; }
.project-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: auto; padding-top: 1.4rem; }
.project-tags span {
  font-size: .78rem;
  font-weight: 800;
  color: var(--brand);
  background: rgba(14,165,233,.12);
  padding: .42rem .62rem;
  border-radius: 999px;
}
.project-open {
  width: fit-content;
  margin-top: 1.2rem;
  color: var(--brand);
  font-weight: 850;
  border: 0;
  background: transparent;
  padding: 0;
}
.project-open i { transition: transform .22s ease; }
.project-open:hover i { transform: translateX(4px); }

.education-card {
  height: 100%;
  transition: transform .3s ease, border-color .3s ease;
}
.education-card:hover { transform: translateY(-8px); border-color: rgba(14,165,233,.42); }
.education-card .edu-year { color: var(--brand); font-weight: 900; }
.education-card h3 { font-weight: 900; letter-spacing: -.035em; }
.education-card .institution { color: var(--bs-body-color); font-weight: 800; }
.education-card p { color: var(--bs-secondary-color); }

.skill-item + .skill-item,
.software-item + .software-item { margin-top: 1.15rem; }
.skill-head,
.software-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-weight: 850;
  margin-bottom: .52rem;
}
.progress {
  height: .75rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, .16);
  overflow: hidden;
}
.progress-bar {
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width 1s cubic-bezier(.22, 1, .36, 1);
}
.software-icon-line {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.software-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: .9rem;
  background: rgba(14, 165, 233, .14);
  color: var(--brand);
}

.contact-section { overflow: hidden; }
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}
.contact-pill {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .8rem 1rem;
  border-radius: 999px;
  color: var(--bs-body-color);
  text-decoration: none;
  font-weight: 750;
}
.contact-pill:hover { color: var(--brand); border-color: rgba(14,165,233,.44); }
.quick-list { display: grid; gap: .9rem; }
.quick-list span {
  display: flex;
  gap: .7rem;
  align-items: flex-start;
  color: var(--bs-secondary-color);
  font-weight: 650;
}
.quick-list i { color: var(--brand-2); font-size: 1.1rem; }
.footer {
  border-top: 1px solid var(--line);
  background: rgba(2, 6, 23, .3);
}
[data-bs-theme="light"] .footer { background: rgba(255,255,255,.5); }
.back-top {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--brand);
  text-decoration: none;
  font-weight: 850;
}

.glass-modal {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(15,23,42,.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
[data-bs-theme="light"] .glass-modal { background: rgba(255,255,255,.94); }
.command-input {
  border-radius: 1.2rem;
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, .08);
}
.command-results { display: grid; gap: .65rem; max-height: 330px; overflow-y: auto; }
.command-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: .9rem;
  text-align: left;
  color: var(--bs-body-color);
  border-radius: 1.1rem;
  padding: .85rem;
  text-decoration: none;
}
.command-item:hover { color: var(--brand); border-color: rgba(14,165,233,.42); }
.command-item i {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: .85rem;
  background: rgba(14,165,233,.12);
}

.reveal {
  opacity: 0;
  transform: translate3d(0, 32px, 0) scale(.98);
  filter: blur(4px);
  transition: opacity .72s ease, transform .72s cubic-bezier(.22,1,.36,1), filter .72s ease;
  transition-delay: var(--delay, 0ms);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
  filter: none;
}

.magnetic { transition: transform .16s ease; }

@media (max-width: 991.98px) {
  .navbar-glass { background: rgba(2, 6, 23, .82); }
  [data-bs-theme="light"] .navbar-glass { background: rgba(255, 255, 255, .9); }
  .hero-section .min-vh-100 { min-height: auto !important; padding-top: 8.5rem !important; padding-bottom: 2rem !important; }
  .timeline::before { left: 12px; }
  .timeline-item,
  .timeline-item:nth-child(even) {
    width: 100%;
    margin-left: 0;
    padding-left: 2.5rem;
    padding-right: 0;
  }
  .timeline-dot,
  .timeline-item:nth-child(even) .timeline-dot { left: 0; right: auto; }
  .orbit { display: none; }
}

@media (max-width: 575.98px) {
  .hero-section .min-vh-100 { min-height: auto !important; padding-top: 9rem !important; padding-bottom: 1.5rem !important; }
  .display-3 { font-size: 3rem; }
  .profile-stage { max-width: 22rem; }
  .metric-card span { font-size: 1.25rem; }
  .section { padding: 4rem 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
  .hero-canvas, .blob, .orbit { display: none; }
  .reveal { opacity: 1; transform: none; filter: none; }
}
