:root {
  --bg: #050911;
  --bg-soft: #0b1324;
  --line: #263042;
  --text: #edf2ff;
  --muted: #9faecc;
  --blue: #2c6bff;
  --blue-2: #4d86ff;
  --blue-3: #79a6ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: Inter, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  position: relative;
  overflow-x: hidden;
}

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
  pointer-events: none;
  z-index: -2;
}

.bg-glow-1 {
  width: 420px;
  height: 420px;
  background: #1848cc;
  left: -120px;
  top: -120px;
  animation: floatGlow 12s ease-in-out infinite alternate;
}

.bg-glow-2 {
  width: 380px;
  height: 380px;
  background: #0f2e87;
  right: -100px;
  top: 30%;
  animation: floatGlow 14s ease-in-out infinite alternate-reverse;
}

.grid-overlay {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(89, 135, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(89, 135, 255, 0.08) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 30% 20%, black 30%, transparent 80%);
  animation: gridFlow 18s linear infinite;
  z-index: -1;
  pointer-events: none;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.4;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(5, 9, 17, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  color: var(--blue);
  font-family: Teko, sans-serif;
  font-size: 2rem;
  line-height: 1;
}

.brand h1 {
  margin: 0;
  letter-spacing: 0.2em;
  font-size: 1.2rem;
}

.brand p {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.45em;
  color: var(--muted);
}

.nav-links {
  list-style: none;
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  display: grid;
  gap: 6px;
  width: min(320px, 92vw);
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(120, 162, 255, 0.28);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(5, 11, 22, 0.98), rgba(13, 24, 45, 0.96));
  box-shadow: 0 18px 50px rgba(9, 25, 70, 0.48);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px) scale(0.96);
  transform-origin: top right;
  transition: opacity 0.28s ease, transform 0.28s ease, visibility 0s linear 0.28s;
  overflow: hidden;
}

.nav-links::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(77, 134, 255, 0.26), transparent 46%);
  pointer-events: none;
}

.nav-links.open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition-delay: 0s;
}

.nav-links li {
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: translateX(18px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.nav-links.open li {
  opacity: 1;
  transform: translateX(0);
}

.nav-links.open li:nth-child(1) {
  transition-delay: 0.04s;
}

.nav-links.open li:nth-child(2) {
  transition-delay: 0.07s;
}

.nav-links.open li:nth-child(3) {
  transition-delay: 0.1s;
}

.nav-links.open li:nth-child(4) {
  transition-delay: 0.13s;
}

.nav-links.open li:nth-child(5) {
  transition-delay: 0.16s;
}

.nav-links.open li:nth-child(6) {
  transition-delay: 0.19s;
}

.nav-links.open li:nth-child(7) {
  transition-delay: 0.22s;
}

.nav-links.open li:nth-child(8) {
  transition-delay: 0.25s;
}

.nav-links.open li:nth-child(9) {
  transition-delay: 0.28s;
}

.nav-links a {
  display: block;
  text-decoration: none;
  color: var(--text);
  font-size: 0.95rem;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.nav-links a:hover {
  color: var(--blue-2);
  background: rgba(45, 86, 169, 0.2);
  border-color: rgba(121, 166, 255, 0.24);
  transform: translateX(4px);
}

.menu-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(120, 162, 255, 0.3);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(20, 39, 77, 0.9), rgba(7, 13, 25, 0.94));
  box-shadow: 0 10px 30px rgba(22, 61, 163, 0.25);
  cursor: pointer;
  overflow: hidden;
}

.menu-toggle::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 90deg, transparent, rgba(77, 134, 255, 0.36), transparent 32%);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.45s ease;
}

.menu-toggle:hover::before,
.menu-toggle[aria-expanded="true"]::before {
  opacity: 1;
  transform: rotate(90deg);
}

.menu-toggle span {
  position: absolute;
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: #dce8ff;
  box-shadow: 0 0 10px rgba(117, 163, 255, 0.54);
  transition: transform 0.25s ease, opacity 0.2s ease, width 0.25s ease;
}

.menu-toggle span:nth-child(1) {
  transform: translateY(-8px);
}

.menu-toggle span:nth-child(2) {
  width: 16px;
  transform: translateY(0);
}

.menu-toggle span:nth-child(3) {
  transform: translateY(8px);
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: translateX(12px);
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: rotate(-45deg);
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  padding: 68px 0 28px;
  align-items: center;
}

.eyebrow {
  color: var(--muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.eyebrow span {
  color: var(--blue-2);
}

.hero h2 {
  margin: 14px 0;
  font-family: Teko, sans-serif;
  font-size: clamp(2.8rem, 7vw, 6rem);
  line-height: 0.92;
}

.hero h2 span {
  color: var(--blue);
}

.lead {
  max-width: 580px;
  color: #d4ddf1;
  font-size: 1.12rem;
  line-height: 1.7;
}

.identity {
  margin: 0 0 8px;
  color: var(--blue-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.82rem;
}

.hero-actions {
  margin-top: 22px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 12px 18px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  transition: 0.25s transform, 0.25s box-shadow, 0.25s background;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(120deg, #1f5dff, #3f7dff);
  color: #fff;
  box-shadow: 0 10px 30px rgba(39, 97, 255, 0.35);
}

.btn-ghost {
  border: 1px solid #3e4f70;
  color: var(--text);
}

.hero-visual {
  position: relative;
  overflow: hidden;
  min-height: 360px;
  padding: 16px;
  background: linear-gradient(145deg, rgba(77, 134, 255, 0.26), rgba(8, 13, 24, 0.6));
  border: 1px solid rgba(120, 162, 255, 0.25);
  border-radius: 18px;
  transform-style: preserve-3d;
  transition: transform 0.2s ease-out, box-shadow 0.3s ease;
  box-shadow: 0 16px 45px rgba(22, 61, 163, 0.36);
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(117, 163, 255, 0.23), transparent 38%);
  pointer-events: none;
}

.data-dot {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(132, 176, 255, 0.8);
  box-shadow: 0 0 10px rgba(95, 152, 255, 0.7);
  animation: floatDot linear infinite;
  z-index: 1;
}

.glare {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  filter: blur(18px);
  background: rgba(114, 162, 255, 0.35);
  top: 0;
  left: 0;
  transform: translate(-60px, -60px);
  pointer-events: none;
}

.system-card {
  position: relative;
  z-index: 2;
  height: 100%;
  border-radius: 14px;
  border: 1px solid #365084;
  background: linear-gradient(160deg, rgba(5, 11, 22, 0.95), rgba(12, 23, 43, 0.9));
  padding: 20px;
}

.system-label {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  color: var(--blue-3);
  text-transform: uppercase;
}

.system-card h4 {
  margin: 8px 0 18px;
  font-size: clamp(1.35rem, 4vw, 2rem);
}

.code-lines {
  display: grid;
  gap: 10px;
}

.code-lines span {
  display: block;
  padding: 11px 12px;
  border-radius: 8px;
  background: rgba(8, 15, 29, 0.86);
  border: 1px solid #2e446c;
  font-family: "Courier New", monospace;
  color: #d2e3ff;
  white-space: nowrap;
  overflow: hidden;
  animation: dataPulse 2.8s ease-in-out infinite;
}

.code-lines span:nth-child(2) {
  animation-delay: 0.4s;
}

.code-lines span:nth-child(3) {
  animation-delay: 0.8s;
}

.code-lines span:nth-child(4) {
  animation-delay: 1.2s;
}

.pulse-ring {
  position: absolute;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 1px solid rgba(101, 148, 255, 0.48);
  right: -24px;
  bottom: -24px;
  animation: ping 3s ease-out infinite;
}

.about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 38px auto 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(12, 18, 33, 0.58);
}

.about h3 {
  margin: 0 0 12px;
  font-size: 2rem;
}

.about h3 span {
  color: var(--blue-2);
}

.about p {
  margin: 0;
  color: #d2dbef;
  line-height: 1.75;
}

.about-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 10px;
}

.about-metrics article {
  background: #090f1c;
  border: 1px solid #29354d;
  border-radius: 12px;
  padding: 16px;
}

.about-metrics strong {
  font-size: 2rem;
  color: var(--blue-2);
  display: block;
}

.about-metrics span {
  color: #c9d4eb;
  font-size: 0.92rem;
}

.education {
  margin-top: 24px;
}

.education-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.edu-card {
  padding: 20px;
  border-radius: 14px;
  border: 1px solid #30466f;
  background: linear-gradient(180deg, rgba(13, 22, 40, 0.92), rgba(8, 14, 27, 0.95));
}

.edu-label {
  margin: 0 0 10px;
  color: var(--blue-3);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
}

.edu-card h4 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}

.edu-card p {
  margin: 0;
  color: #ccdaef;
  line-height: 1.65;
}

.section-title {
  margin: 40px 0 16px;
  letter-spacing: 0.16em;
  color: #dfebff;
}

.skills {
  margin-top: 24px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.skill-chip {
  position: relative;
  isolation: isolate;
  padding: 16px 14px;
  border: 1px solid #355187;
  border-radius: 12px;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, rgba(15, 27, 50, 0.85), rgba(9, 15, 29, 0.9));
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.skill-chip::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: linear-gradient(120deg, transparent 15%, rgba(95, 145, 255, 0.36), transparent 85%);
  transform: translateX(-120%);
  animation: scan 3.4s linear infinite;
  z-index: -1;
}

.skill-chip:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: #568dff;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.service-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border: 1px solid #2a3954;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(15, 23, 39, 0.95), rgba(8, 13, 25, 0.95));
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.service-card::after {
  content: "";
  position: absolute;
  inset: auto -50% -80%;
  height: 120px;
  background: radial-gradient(circle, rgba(72, 125, 255, 0.25), transparent 70%);
  transform: translateY(30px);
  transition: transform 0.3s ease;
}

.service-card:hover {
  transform: translateY(-6px);
  border-color: #4a7cff;
}

.service-card:hover::after {
  transform: translateY(0);
}

.service-card h4 {
  margin: 0 0 8px;
}

.service-card p {
  margin: 0;
  color: #c9d3e8;
  line-height: 1.6;
}

.projects {
  margin-top: 26px;
}

.project-panel {
  border: 1px solid #30415f;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(20, 32, 56, 0.88), rgba(7, 11, 19, 0.95));
  padding: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.project-copy h4 {
  margin: 0 0 12px;
  font-size: 1.7rem;
}

.project-copy p {
  margin: 0;
  color: #c8d3ea;
  line-height: 1.7;
}

.experience,
.extras {
  margin-top: 24px;
}

.experience-grid,
.extras-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.xp-card,
.extra-card {
  padding: 20px;
  border-radius: 14px;
  border: 1px solid #30466f;
  background: linear-gradient(180deg, rgba(13, 22, 40, 0.92), rgba(8, 14, 27, 0.95));
}

.xp-card h4,
.extra-card h4 {
  margin: 0 0 8px;
  font-size: 1.3rem;
}

.xp-card p,
.extra-card p {
  margin: 0;
  color: #ccdaef;
  line-height: 1.65;
}

.terminal {
  font-family: "Courier New", monospace;
  background: #050a14;
  border: 1px solid #2b3b58;
  border-radius: 12px;
  padding: 14px;
}

.terminal-head {
  display: flex;
  gap: 7px;
  margin-bottom: 12px;
}

.terminal-head span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #486aa2;
}

.terminal p {
  margin: 6px 0;
  color: #b5c6e8;
  animation: blinkLine 4s steps(1, end) infinite;
}

.terminal p:nth-child(2) {
  animation-delay: 0.3s;
}

.terminal p:nth-child(3) {
  animation-delay: 0.6s;
}

.terminal p:nth-child(4) {
  animation-delay: 0.9s;
}

.terminal p:nth-child(5) {
  animation-delay: 1.2s;
}

.accent {
  color: var(--blue-2);
}

.contact {
  margin: 64px auto 42px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  border: 1px solid #334766;
  border-radius: 14px;
  overflow: hidden;
}

.contact .section-title {
  grid-column: 1 / -1;
  padding: 0 24px;
  margin-top: 32px;
}

.contact a {
  text-decoration: none;
  color: #d6e1f8;
  padding: 24px;
  border-right: 1px solid #334766;
  background: rgba(9, 14, 26, 0.75);
  transition: background 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact a:last-child {
  border-right: none;
}

.contact a:hover {
  background: rgba(29, 49, 92, 0.62);
}

.contact strong {
  color: var(--text);
  font-size: 1.25rem;
  overflow-wrap: break-word;
  word-break: break-word;
  line-height: 1.3;
}

.site-footer {
  text-align: center;
  color: #90a4ca;
  letter-spacing: 0.34em;
  font-size: 0.75rem;
  padding: 8px 12px 34px;
}

.site-footer span {
  color: var(--blue-2);
}

.reveal {
  opacity: 0;
  transform: translateY(24px) scale(0.98);
  transition: opacity 0.7s ease, transform 0.7s ease;
  transition-delay: var(--delay, 0ms);
}

.reveal.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@keyframes gridFlow {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 0 42px, 42px 0;
  }
}

@keyframes floatGlow {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(30px);
  }
}

@keyframes ping {
  0% {
    transform: scale(0.6);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.3);
    opacity: 0;
  }
}

@keyframes dataPulse {
  0%,
  100% {
    border-color: #2e446c;
    box-shadow: 0 0 0 rgba(65, 112, 255, 0);
  }
  50% {
    border-color: #4e75c0;
    box-shadow: 0 0 20px rgba(65, 112, 255, 0.2);
  }
}

@keyframes scan {
  to {
    transform: translateX(120%);
  }
}

@keyframes blinkLine {
  0%,
  87%,
  100% {
    opacity: 1;
  }
  88%,
  89% {
    opacity: 0.7;
  }
}

@keyframes floatDot {
  0% {
    transform: translateY(10px);
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  100% {
    transform: translateY(-20px);
    opacity: 0;
  }
}

@media (max-width: 980px) {
  .hero,
  .about,
  .project-panel,
  .education-panel {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 320px;
  }

  .about-metrics {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 760px) {
  .brand h1 {
    font-size: 1rem;
  }

  .brand p {
    letter-spacing: 0.28em;
  }

  .nav-links {
    right: 0;
    width: min(300px, 92vw);
  }

  .nav-links a {
    font-size: 1rem;
  }

  .about-metrics {
    grid-template-columns: 1fr;
  }

  .contact {
    grid-template-columns: 1fr;
  }

  .contact .section-title {
    margin-top: 24px;
    padding: 0 18px;
  }

  .contact a {
    border-right: none;
    border-bottom: 1px solid #334766;
    padding: 18px;
  }

  .contact a:last-child {
    border-bottom: none;
  }
}
