:root {
  --bg-primary: #060609;
  --bg-secondary: #0d0d13;
  --bg-card: #13131b;
  --bg-card-hover: #191924;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-soft: rgba(59, 130, 246, 0.14);
  --accent-border: rgba(59, 130, 246, 0.38);
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1b2;
  --text-muted: #727285;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 14px;
  --transition: 0.25s ease;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

code,
pre {
  font-family: 'JetBrains Mono', monospace;
}

.container {
  width: min(1140px, 92%);
  margin: 0 auto;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(6, 6, 9, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.logo span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition);
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-size: 0.94rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.28);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-primary);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-full {
  width: 100%;
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 110px 0 70px;
}

.hero-glow {
  position: absolute;
  top: 15%;
  left: 10%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.16), transparent 70%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3rem;
  align-items: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: #93c5fd;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.hero-greeting {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.hero-title {
  font-size: clamp(2.6rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0.25rem 0 0.6rem;
}

.hero-title .accent {
  color: var(--accent);
}

.hero-subtitle {
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 1.1rem;
}

.hero-desc {
  color: var(--text-secondary);
  max-width: 56ch;
  margin-bottom: 1.8rem;
  font-size: 0.98rem;
}

.hero-desc strong {
  color: var(--text-primary);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.hero-socials {
  display: flex;
  gap: 0.9rem;
}

.hero-socials a {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.hero-socials a:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* Terminal Card */
.hero-terminal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: #191923;
  border-bottom: 1px solid var(--border);
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.terminal-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.terminal-body {
  padding: 1.25rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.cmd-prompt {
  color: var(--accent);
  font-weight: 700;
}

.code-block {
  margin: 0.75rem 0;
  white-space: pre-wrap;
  line-height: 1.55;
  color: #d8d8e6;
}

.code-block .key { color: #60a5fa; }
.code-block .str { color: #9be0a8; }
.code-block .num { color: #ffd479; }

.cursor {
  color: var(--accent);
  animation: blink 1s infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Sections */
.section {
  padding: 92px 0;
}

.dark-alt {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 3.25rem;
}

.section-heading {
  font-size: clamp(1.9rem, 3.2vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}

.section-heading.left {
  text-align: left;
}

.section-heading span {
  color: var(--accent);
}

.section-sub {
  color: var(--text-secondary);
  font-size: 0.98rem;
}

/* About Me */
.about-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 3.5rem;
  align-items: center;
  margin-bottom: 3.5rem;
}

.about-image-card {
  background: linear-gradient(145deg, #161620, #0d0d13);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  position: relative;
}

.about-image-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 18px;
  padding: 1px;
  background: linear-gradient(135deg, var(--accent-border), transparent 60%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.about-intro-accent {
  color: var(--accent);
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

.about-bio {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-size: 0.96rem;
}

.about-bio strong {
  color: var(--text-primary);
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem 1.5rem;
  margin: 1.5rem 0;
  padding: 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.pillar-item {
  font-weight: 600;
  font-size: 0.94rem;
  color: var(--text-primary);
}

.pillar-num {
  color: var(--accent);
  margin-right: 0.35rem;
}

.edu-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
  margin-bottom: 1.6rem;
}

.edu-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.95rem 1rem;
}

.edu-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.edu-top h4 {
  font-size: 0.9rem;
  font-weight: 700;
}

.edu-card p {
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: var(--accent-soft);
  color: #93c5fd;
  white-space: nowrap;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: transform var(--transition), border-color var(--transition);
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-border);
}

.stat-number {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 0.3rem;
}

/* Experience Timeline */
.timeline {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  padding-left: 1.75rem;
  border-left: 2px solid var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 1.75rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -2.22rem;
  top: 1.35rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color var(--transition);
}

.timeline-card:hover {
  border-color: var(--accent-border);
}

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

.timeline-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.org {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
}

.time-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  white-space: nowrap;
}

.exp-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.exp-list li {
  position: relative;
  padding-left: 1.1rem;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.exp-list li::before {
  content: '▹';
  position: absolute;
  left: 0;
  color: var(--accent);
}

.exp-list strong {
  color: var(--text-primary);
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.35rem;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform var(--transition), border-color var(--transition);
}

.skill-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-border);
}

.skill-card-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.1rem;
}

.skill-card-head i {
  color: var(--accent);
  font-size: 1.15rem;
}

.skill-card-head h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tags span {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35rem 0.7rem;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

/* Achievements */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.35rem;
}

.achievement-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  transition: transform var(--transition), border-color var(--transition);
}

.achievement-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-border);
}

.ach-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.achievement-card h3 {
  font-size: 1.08rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.achievement-card p {
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.achievement-card strong {
  color: var(--text-primary);
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), border-color var(--transition);
}

.project-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-border);
}

.project-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.9rem;
}

.project-cat {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  background: var(--accent-soft);
  color: #93c5fd;
}

.icon-link {
  color: var(--text-secondary);
  font-size: 1.2rem;
  transition: color var(--transition);
}

.icon-link:hover {
  color: var(--accent);
}

.project-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.project-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.15rem;
  flex-grow: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.2rem;
}

.project-tags span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  padding: 0;
  transition: gap var(--transition);
}

.btn-link:hover {
  gap: 0.7rem;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 2.5rem;
}

.contact-info h3,
.contact-form h3 {
  font-size: 1.3rem;
  margin-bottom: 0.65rem;
}

.contact-lead {
  color: var(--text-secondary);
  font-size: 0.94rem;
  margin-bottom: 1.5rem;
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color var(--transition);
}

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

.contact-item i {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
}

.contact-item span {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.contact-item strong {
  font-size: 0.92rem;
}

.contact-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.85rem;
}

.form-group {
  margin-bottom: 1.1rem;
}

.form-group label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.8rem 0.95rem;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.92rem;
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-status {
  margin-top: 0.85rem;
  font-size: 0.88rem;
  color: #7ee787;
  text-align: center;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  background: var(--bg-secondary);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Scroll to top */
.scroll-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition);
  z-index: 900;
}

.scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  z-index: 1200;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--accent-border);
  border-radius: 16px;
  max-width: 620px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.75);
}

.modal-close {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
}

.modal-badge {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  background: var(--accent-soft);
  color: #93c5fd;
  margin-bottom: 0.65rem;
}

.modal-card h3 {
  font-size: 1.45rem;
  margin-bottom: 0.65rem;
}

.modal-summary {
  color: var(--text-secondary);
  font-size: 0.94rem;
  margin-bottom: 1.15rem;
}

.modal-subhead {
  font-size: 0.92rem;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
}

.modal-bullets {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.modal-bullets li {
  position: relative;
  padding-left: 1.1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.modal-bullets li::before {
  content: '▹';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* Reveal Animation */
.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.js-ready .reveal {
  opacity: 0;
  transform: translateY(18px);
}

.js-ready .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 960px) {
  .hero-grid,
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .projects-grid,
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .hamburger {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 72px;
    right: -100%;
    width: 250px;
    height: calc(100vh - 72px);
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 1.75rem;
    transition: right var(--transition);
  }

  .nav-links.open {
    right: 0;
  }

  .projects-grid,
  .skills-grid,
  .achievements-grid,
  .edu-cards,
  .pillars-grid {
    grid-template-columns: 1fr;
  }

  .timeline-header {
    flex-direction: column;
  }
}