* {
  margin: 0;
  padding: 0;
  box-sizing: border-box
}

:root {
  --bg: #0d1117;
  --bg2: #161b22;
  --bg3: #1c2333;
  --bg4: #21262d;
  --border: #30363d;
  --border2: rgba(48, 54, 61, 0.6);
  --text: #e6edf3;
  --text2: #8b949e;
  --text3: #6e7681;
  --accent: #58a6ff;
  --accent2: #1f6feb;
  --btn-bg: #f0f6fc;
  --btn-text: #0d1117;
  --glow: rgba(31, 111, 235, 0.15);
}

body.light-theme {
  --bg: #ffffff;
  --bg2: #f8f9fa;
  --bg3: #f1f3f5;
  --bg4: #e9ecef;
  --border: #dee2e6;
  --border2: rgba(222, 226, 230, 0.6);
  --text: #212529;
  --text2: #495057;
  --text3: #adb5bd;
  --accent: #007bff;
  --accent2: #0056b3;
  --btn-bg: #0d1117;
  --btn-text: #ffffff;
  --glow: rgba(0, 123, 255, 0.1);
}

html {
  scroll-behavior: smooth;
  font-size: 16px
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden
}

::-webkit-scrollbar {
  width: 6px
}

::-webkit-scrollbar-track {
  background: var(--bg)
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1.5rem;
  background: rgba(13, 17, 23, .85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border)
}

.nav-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -.5px
}

.nav-right {
  display: flex;
  align-items: center;
  gap: .75rem
}

.theme-btn {
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  font-size: 1.1rem;
  padding: .4rem;
  border-radius: 6px;
  transition: color .2s
}

.theme-btn:hover {
  color: var(--text)
}

.hamburger {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  padding: .45rem .6rem;
  border-radius: 8px;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex-direction: column
}

.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px
}

/* Mobile nav overlay */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--bg);
  padding: 1rem 1.5rem;
  flex-direction: column
}

.mobile-nav.open {
  display: flex
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem
}

.mobile-nav-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  padding: .45rem .65rem;
  border-radius: 8px;
  font-size: 1rem
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: .25rem
}

.mobile-nav-links a,
.mobile-nav-links button {
  background: none;
  border: none;
  text-align: left;
  font-size: 1rem;
  color: var(--text2);
  padding: .75rem .5rem;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  border-radius: 6px
}

.mobile-nav-links a:hover,
.mobile-nav-links button:hover {
  color: var(--text)
}

.mobile-nav-links .contact-active {
  background: var(--btn-bg);
  color: var(--btn-text) !important;
  border-radius: 8px;
  font-weight: 600
}

.mobile-nav-links .dl-cv {
  font-weight: 600;
  color: var(--text) !important
}

/* ── HERO ── */
#home {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem 3rem;
  position: relative;
  overflow: hidden
}

.hero-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(31, 111, 235, .18), transparent 70%);
  pointer-events: none;
  bottom: -100px;
  right: -100px
}

.hero-glow2 {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(31, 111, 235, .12), transparent 70%);
  pointer-events: none;
  top: 100px;
  left: -80px
}

.hero-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 2px solid var(--border);
  overflow: hidden;
  margin-bottom: 1.5rem;
  background: var(--bg3)
}

.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top
}

.hero-name {
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  font-weight: 400;
  color: var(--text);
  margin-bottom: .5rem;
  letter-spacing: -.3px
}

.hero-role {
  font-size: clamp(2rem, 8vw, 4rem);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 1.2rem;
  min-height: 1.2em;
  letter-spacing: -1.5px
}

#typedText {
  border-right: none;
  padding-right: 0;
}

.cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background-color: var(--text);
  margin-left: 2px;
  vertical-align: middle;
}

.hero-desc {
  font-size: .9rem;
  color: var(--text2);
  max-width: 550px;
  margin: 0 auto 2rem;
  line-height: 1.7;
  text-transform: uppercase;
  letter-spacing: .5px
}

.hero-btns {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 1rem;
  width: auto;
  margin: 0 auto 2rem;
  align-items: center
}

@media (max-width: 600px) {
  .hero-btns {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 360px
  }
}

.btn-solid {
  background: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  padding: .85rem 2rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s, transform .15s;
  text-decoration: none;
  display: block;
  text-align: center;
  white-space: nowrap
}

.btn-solid:hover {
  opacity: .85;
  transform: translateY(-1px)
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: .85rem 2rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .2s, transform .15s;
  text-decoration: none;
  display: block;
  text-align: center;
  white-space: nowrap
}

.btn-outline:hover {
  border-color: var(--accent);
  transform: translateY(-1px)
}

.hero-socials {
  display: flex;
  gap: 1.5rem;
  justify-content: center
}

.hero-socials a {
  color: var(--text2);
  font-size: 1.2rem;
  transition: color .2s;
  text-decoration: none;
  line-height: 1
}

.hero-socials a:hover {
  color: var(--text)
}

.hero-scroll {
  margin-top: 3rem;
  color: var(--text3);
  font-size: .85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  text-decoration: none
}

.hero-scroll svg {
  animation: bounce 1.5s ease-in-out infinite
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(5px)
  }
}

/* Floating dots */
.dots-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center
}

/* ── SECTIONS ── */
section {
  padding: 5rem 1.5rem
}

.section-title {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 800;
  text-align: center;
  margin-bottom: .75rem
}

.section-title .dim {
  color: var(--text2);
  font-weight: 800
}

.section-sub {
  text-align: center;
  color: var(--text2);
  font-size: .95rem;
  max-width: 600px;
  margin: 0 auto 3rem;
  line-height: 1.7
}

/* ── ABOUT ── */
#about {
  background: var(--bg)
}

.about-wrap {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto
}

.about-img-card {
  position: relative;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  max-width: 420px;
  margin: 0 auto;
  width: 100%
}

.about-img-card img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  object-position: top;
  display: block
}

.about-code-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(22, 27, 34, .8);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  color: var(--text2)
}

.about-coffee {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(22, 27, 34, .85);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .4rem .6rem;
  font-size: 1rem
}

.about-text-block {
  display: flex;
  flex-direction: column;
  gap: 1.25rem
}

.about-text-block h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text)
}

.about-text-block p {
  color: var(--text2);
  font-size: .95rem;
  line-height: 1.8
}

.about-divider {
  height: 1px;
  background: var(--border);
  margin: .5rem 0
}

.about-meta {
  display: flex;
  flex-direction: column;
  gap: .6rem
}

.about-meta-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: var(--text2);
  font-size: .9rem
}

.about-meta-item svg {
  flex-shrink: 0;
  color: var(--text3)
}

.about-meta-badge {
  display: flex;
  align-items: center;
  gap: .4rem
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #3fb950;
  border-radius: 50%;
  flex-shrink: 0
}

.when-not-coding {
  margin-top: .5rem
}

.when-not-coding h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem
}

.stat-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center
}

.stat-num {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text)
}

.stat-lbl {
  font-size: .8rem;
  color: var(--text2);
  margin-top: .15rem
}

/* ── SKILLS ── */
#skills {
  background: var(--bg2)
}

.skill-cat {
  margin-bottom: 2.5rem
}

.skill-cat-title {
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: .3rem
}

.skill-cat-sub {
  text-align: center;
  color: var(--text2);
  font-size: .85rem;
  margin-bottom: 1.25rem
}

.skill-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem
}

.skill-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem .75rem;
  text-align: center;
  transition: border-color .2s
}

.skill-card:hover {
  border-color: var(--accent2)
}

.skill-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto .6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem
}

.skill-icon img {
  width: 44px;
  height: 44px;
  object-fit: contain
}

.skill-name {
  font-size: .9rem;
  font-weight: 600;
  margin-bottom: .5rem
}

.skill-bar-wrap {
  background: var(--bg4);
  border-radius: 99px;
  height: 4px;
  margin: .4rem 0
}

.skill-bar {
  height: 4px;
  border-radius: 99px;
  background: var(--accent2)
}

.skill-level {
  font-size: .75rem;
  color: var(--text2)
}

/* ── RESEARCH ── */
#research {
  background: var(--bg)
}

.research-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  max-width: 780px;
  margin: 0 auto 1.5rem
}

.research-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.5
}

.research-authors {
  margin-bottom: .75rem
}

.research-authors h4 {
  font-size: .8rem;
  color: var(--text2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: .3rem
}

.research-authors p {
  font-size: .85rem;
  color: var(--text2)
}

.research-abstract h4 {
  font-size: .8rem;
  color: var(--text2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: .3rem
}

.research-abstract p {
  font-size: .85rem;
  color: var(--text2);
  line-height: 1.7
}

.research-keywords {
  margin: .75rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem
}

.kw-tag {
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .2rem .55rem;
  font-size: .75rem;
  color: var(--text2)
}

.research-meta {
  font-size: .8rem;
  color: var(--text2);
  margin: .75rem 0
}

.btn-pub {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  border-radius: 8px;
  padding: .5rem 1rem;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity .2s
}

.btn-pub:hover {
  opacity: .8
}

.research-cta {
  text-align: center;
  margin-top: 2rem
}

.research-cta p {
  color: var(--text2);
  font-size: .9rem;
  margin-bottom: 1rem
}

/* ── PROJECTS ── */
#projects {
  background: var(--bg2)
}

.search-bar {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .65rem 1rem;
  max-width: 780px;
  margin: 0 auto 2rem
}

.search-bar svg {
  color: var(--text3);
  flex-shrink: 0
}

.search-bar input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: .9rem;
  width: 100%;
  font-family: inherit
}

.search-bar input::placeholder {
  color: var(--text3)
}

.projects-list {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem
}

.proj-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  transition: border-color .2s
}

.proj-card:hover {
  border-color: var(--border)
}

.proj-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .6rem
}

.proj-name {
  font-size: 1rem;
  font-weight: 700
}

.proj-stars {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: .8rem;
  color: var(--text2)
}

.proj-stars span {
  display: flex;
  align-items: center;
  gap: .25rem
}

.proj-desc {
  color: var(--text2);
  font-size: .87rem;
  line-height: 1.6;
  margin-bottom: .75rem
}

.proj-lang-bar {
  height: 4px;
  border-radius: 99px;
  margin: .5rem 0;
  background: var(--accent)
}

.proj-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: .78rem;
  color: var(--text2);
  margin-bottom: .75rem
}

.proj-meta span {
  display: flex;
  align-items: center;
  gap: .3rem
}

.proj-divider {
  height: 1px;
  background: var(--border);
  margin: .75rem 0
}

.proj-links {
  display: flex;
  align-items: center;
  justify-content: space-between
}

.proj-link {
  display: flex;
  align-items: center;
  gap: .35rem;
  color: var(--text2);
  font-size: .82rem;
  text-decoration: none;
  transition: color .2s
}

.proj-link:hover {
  color: var(--text)
}

.proj-views {
  display: flex;
  align-items: center;
  gap: .3rem;
  font-size: .78rem;
  color: var(--text2)
}

.view-github {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  color: var(--text2);
  font-size: .9rem;
  text-decoration: none;
  margin-top: 1.5rem;
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
  transition: color .2s
}

.view-github:hover {
  color: var(--text)
}

/* ── CONTACT ── */
#contact {
  background: var(--bg)
}

.contact-wrap {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem
}

.contact-info-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: .3rem
}

.contact-info-text {
  color: var(--text2);
  font-size: .9rem;
  line-height: 1.7;
  margin-bottom: 1rem
}

.contact-items {
  display: flex;
  flex-direction: column;
  gap: .75rem
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: border-color .2s
}

.contact-item:hover {
  border-color: var(--accent2)
}

.contact-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text2);
  font-size: 1rem
}

.contact-label {
  font-size: .75rem;
  color: var(--text2);
  margin-bottom: .15rem;
  font-weight: 600
}

.contact-val {
  font-size: .9rem;
  color: var(--text);
  font-weight: 500
}

/* Send message */
.send-msg-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem
}

.form {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: .3rem
}

.form-group label {
  font-size: .8rem;
  color: var(--text2);
  font-weight: 500
}

.form-group input,
.form-group textarea {
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .65rem .85rem;
  color: var(--text);
  font-size: .88rem;
  font-family: inherit;
  outline: none;
  transition: border-color .2s
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent2)
}

.form-group textarea {
  resize: vertical;
  min-height: 90px
}

.btn-send {
  background: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  border-radius: 8px;
  padding: .75rem;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: opacity .2s
}

.btn-send:hover {
  opacity: .85
}

/* ── FOOTER ── */
footer {
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text2);
  font-size: .82rem
}

footer a {
  color: var(--text2);
  text-decoration: none
}

/* ── BACK TO TOP ── */
.back-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 500;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity .2s, transform .2s;
  opacity: 0;
  pointer-events: none
}

.back-top.show {
  opacity: 1;
  pointer-events: auto
}

.back-top:hover {
  transform: translateY(-3px)
}

/* ── ANIMATIONS ── */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .55s ease, transform .55s ease
}

.fade-up.in {
  opacity: 1;
  transform: none
}

@media(min-width:680px) {
  .hero-btns {
    flex-direction: row;
    max-width: 440px;
    align-items: center;
    justify-content: center
  }

  .hero-btns .btn-solid,
  .hero-btns .btn-outline {
    flex: 1
  }

  .about-wrap {
    flex-direction: row;
    align-items: flex-start;
    max-width: 900px
  }

  .about-img-card {
    flex: 0 0 340px;
    max-width: 340px
  }

  .about-text-block {
    flex: 1
  }

  .form-row {
    grid-template-columns: 1fr 1fr
  }
}

@media(max-width:400px) {
  .form-row {
    grid-template-columns: 1fr
  }

  .hero-role {
    font-size: clamp(1.6rem, 8vw, 2.8rem)
  }
}