:root {
  --bg-main: #040816;
  --bg-deep: #02040d;
  --card-bg: rgba(10, 17, 39, 0.72);
  --text-main: #e9ecff;
  --text-soft: #b8c0e8;
  --accent: #5a6fff;
  --accent-2: #7d58ff;
  --border: rgba(125, 139, 255, 0.32);
  --glow: 0 0 25px rgba(93, 112, 255, 0.45);
  --scroll-progress: 0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", sans-serif;
  background: radial-gradient(circle at 86% 8%, rgba(95, 73, 212, 0.26), transparent 42%),
    radial-gradient(circle at 18% 16%, rgba(93, 112, 255, 0.14), transparent 32%),
    linear-gradient(180deg, var(--bg-main), var(--bg-deep));
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.65;
  overflow-x: hidden;
}

.page-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 30% 30%, rgba(108, 85, 255, 0.08), transparent 30%),
    radial-gradient(circle at 80% 45%, rgba(61, 101, 255, 0.08), transparent 35%);
  z-index: -1;
}

.ambient-layer {
  position: fixed;
  pointer-events: none;
  z-index: -3;
  border-radius: 999px;
  filter: blur(55px);
  will-change: transform;
}

.ambient-layer-one {
  width: min(46vw, 620px);
  height: min(46vw, 620px);
  right: -9vw;
  top: -12vh;
  background: radial-gradient(circle, rgba(108, 87, 255, 0.32) 0%, rgba(55, 81, 204, 0.06) 68%, transparent 100%);
  transform: translateY(calc(var(--scroll-progress) * -6vh)) rotate(calc(var(--scroll-progress) * 45deg));
}

.ambient-layer-two {
  width: min(35vw, 500px);
  height: min(35vw, 500px);
  left: -8vw;
  top: 32vh;
  background: radial-gradient(circle, rgba(66, 122, 255, 0.22) 0%, rgba(59, 84, 175, 0.02) 70%, transparent 100%);
  transform: translateY(calc(var(--scroll-progress) * 4vh)) rotate(calc(var(--scroll-progress) * -30deg));
}

.cyber-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -4;
  background-image:
    linear-gradient(rgba(111, 130, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(111, 130, 255, 0.06) 1px, transparent 1px);
  background-size: 90px 90px;
  mask-image: radial-gradient(circle at 50% 10%, black 15%, transparent 72%);
  opacity: 0.33;
  transform: translateY(calc(var(--scroll-progress) * 35px));
}

.backdrop-word {
  position: fixed;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: -2;
  font-size: clamp(4.6rem, 13vw, 10.8rem);
  font-weight: 800;
  letter-spacing: 0.45rem;
  color: rgba(138, 154, 255, 0.06);
  user-select: none;
}

.container {
  width: min(1120px, 92%);
  margin: 0 auto;
}

.section {
  padding: 86px 0;
  position: relative;
}

.section-title {
  font-size: 2rem;
  margin-bottom: 28px;
  letter-spacing: 0.02em;
}

.section-title::after {
  content: "";
  display: block;
  width: 84px;
  height: 2px;
  margin-top: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(106, 127, 255, 0.7), rgba(139, 103, 255, 0.1));
}

.navbar {
  position: sticky;
  top: 12px;
  z-index: 1000;
  width: min(1020px, 92%);
  margin: 12px auto 0;
  border-radius: 18px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(10, 16, 36, 0.56);
  border: 1px solid rgba(133, 150, 255, 0.28);
  box-shadow: 0 10px 28px rgba(4, 8, 25, 0.5);
}

.nav-inner {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
}

.logo {
  font-size: 1.03rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--text-main);
  letter-spacing: 0.4px;
}

.logo span {
  color: #86a1ff;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 auto;
}

.nav-links a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.82rem;
  padding: 7px 11px;
  border-radius: 7px;
  border: 1px solid transparent;
  transition: color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.nav-links a:hover {
  color: #dbe2ff;
  background: rgba(90, 111, 255, 0.2);
}

.nav-links a.active {
  color: #eef2ff;
  border-color: rgba(147, 164, 255, 0.22);
  background: linear-gradient(120deg, rgba(90, 111, 255, 0.92), rgba(125, 88, 255, 0.84));
  box-shadow: 0 0 10px rgba(99, 110, 255, 0.36);
  transform: translateY(-1px);
}

.menu-toggle {
  display: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-main);
  padding: 8px 11px;
  border-radius: 10px;
  cursor: pointer;
}

.hero {
  min-height: calc(100vh - 90px);
  display: flex;
  align-items: center;
  padding-top: 20px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.72fr;
  align-items: center;
  gap: 38px;
  width: min(980px, 100%);
  min-height: 620px;
  margin: 0 auto;
  padding: 58px 48px;
  border: 1px solid rgba(120, 139, 255, 0.3);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(11, 16, 38, 0.82), rgba(7, 12, 29, 0.85));
  box-shadow: 0 0 0 1px rgba(120, 139, 255, 0.14), 0 0 48px rgba(93, 112, 255, 0.32);
  position: relative;
}

.hero-grid::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 24px;
  pointer-events: none;
  box-shadow: inset 0 0 28px rgba(106, 121, 255, 0.12);
}

.hero-grid::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 24px;
  pointer-events: none;
  border: 1px solid rgba(160, 176, 255, 0.12);
}

.hero-intro {
  color: #b5c1ff;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin-bottom: 8px;
}

.hero h1 {
  font-size: clamp(2.1rem, 4.8vw, 3.35rem);
  line-height: 1.1;
  max-width: 480px;
}

.hero h1 span {
  color: #6e80ff;
}

.hero h2 {
  font-size: clamp(0.98rem, 1.8vw, 1.12rem);
  color: #90a2ff;
  margin-top: 12px;
  letter-spacing: 0.08rem;
  font-weight: 500;
}

.hero-description {
  margin-top: 16px;
  max-width: 520px;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.hero-actions {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 7px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  color: #edf1ff;
  background: linear-gradient(120deg, rgba(94, 112, 255, 0.95), rgba(126, 89, 255, 0.9));
  box-shadow: 0 0 16px rgba(102, 104, 255, 0.42);
}

.btn-primary:hover {
  box-shadow: 0 0 24px rgba(109, 110, 255, 0.62);
}

.btn-secondary {
  border-color: var(--border);
  color: var(--text-soft);
  background: rgba(16, 25, 54, 0.5);
}

.btn-secondary:hover {
  color: #e8edff;
  border-color: rgba(154, 164, 255, 0.45);
}

.hero-image-wrap {
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: 360px;
  padding: 10px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(52, 74, 160, 0.16), rgba(129, 90, 230, 0.12));
  border: 1px solid rgba(122, 142, 255, 0.28);
  box-shadow: 0 16px 34px rgba(4, 8, 24, 0.48);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-image-glow {
  position: absolute;
  inset: -20px;
  border-radius: 16px;
  background: radial-gradient(circle, rgba(108, 84, 255, 0.3), transparent 72%);
  filter: blur(14px);
}

.hero-image-wrap:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 38px rgba(6, 10, 26, 0.54), 0 0 26px rgba(95, 109, 247, 0.24);
}

.hero-image {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5.1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(123, 141, 255, 0.34);
  display: block;
  box-shadow: 0 14px 36px rgba(2, 4, 12, 0.56);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 12px 30px rgba(3, 6, 18, 0.42);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: -30% auto auto -20%;
  width: 240px;
  height: 180px;
  background: radial-gradient(circle, rgba(120, 145, 255, 0.12), transparent 70%);
  pointer-events: none;
}

.card h4 {
  margin-bottom: 12px;
  color: #d6ddff;
}

.card p,
.card li {
  color: var(--text-soft);
}

.skill-card ul {
  padding-left: 18px;
}

.skill-card {
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.skill-card h4::before {
  content: "◉";
  font-size: 0.7rem;
  color: #94a4ff;
  margin-right: 8px;
  vertical-align: middle;
}

.skill-card:hover {
  transform: translateY(-6px);
  border-color: rgba(149, 164, 255, 0.5);
  box-shadow: 0 0 0 1px rgba(116, 137, 255, 0.2), 0 14px 32px rgba(4, 8, 24, 0.5), 0 0 28px rgba(104, 118, 255, 0.2);
}

.project-card {
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(146, 158, 255, 0.52);
  box-shadow: 0 0 30px rgba(100, 114, 255, 0.24);
}

.meta {
  margin-top: 12px;
  font-size: 0.92rem;
  color: #9aa8e8;
}

.resume-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.resume-preview > div {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(129, 147, 255, 0.2);
  background: linear-gradient(160deg, rgba(15, 22, 49, 0.7), rgba(9, 15, 36, 0.62));
}

.cert-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  line-height: 1.6;
}

.cert-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  padding: 2px 0;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(206, 214, 245, 0.82);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.22s ease, text-shadow 0.22s ease, transform 0.22s ease;
}

.cert-link::after {
  content: "";
  color: rgba(206, 214, 245, 0.5);
  margin-left: 2px;
}

.cert-link:last-child::after {
  content: "";
}

.cert-link::before {
  content: "↗";
  font-weight: 800;
  color: rgba(156, 170, 255, 0.72);
  text-shadow: 0 0 10px rgba(102, 116, 255, 0.25);
}

.cert-link:hover {
  transform: translateY(-1px);
  color: rgba(240, 245, 255, 0.98);
  text-shadow: 0 0 10px rgba(120, 145, 255, 0.6), 0 0 18px rgba(125, 88, 255, 0.28);
}

.cert-link:focus-visible {
  outline: none;
  color: rgba(240, 245, 255, 0.98);
  text-shadow: 0 0 10px rgba(120, 145, 255, 0.6), 0 0 18px rgba(125, 88, 255, 0.28);
}

.resume-action {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 4px;
  padding: 10px 12px;
  border: none !important;
  background: transparent !important;
}

.resume-action .btn {
  min-width: 180px;
}

.resume-action .cv-fit-btn {
  min-width: auto;
  width: auto;
  padding-inline: 18px;
}

.contact-card {
  padding: 30px;
}

.contact-kicker {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.72rem;
  color: #97a6ef;
  margin-bottom: 8px;
}

.contact-card h4 {
  margin-bottom: 18px;
}

.contact-list {
  display: grid;
  gap: 12px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  text-decoration: none;
  color: inherit;
  border-radius: 12px;
  border: 1px solid rgba(132, 150, 255, 0.24);
  background: linear-gradient(150deg, rgba(14, 22, 52, 0.76), rgba(11, 17, 39, 0.66));
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.contact-item + .contact-item {
  position: relative;
}

.contact-item + .contact-item::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: -7px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(122, 137, 232, 0.35), transparent);
}

.contact-item:hover {
  transform: translateY(-3px);
  border-color: rgba(150, 166, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(121, 141, 255, 0.18), 0 8px 20px rgba(4, 8, 22, 0.45), 0 0 18px rgba(105, 123, 255, 0.22);
}

.contact-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: #eaf0ff;
  background: linear-gradient(145deg, rgba(95, 113, 255, 0.8), rgba(128, 90, 255, 0.78));
  box-shadow: 0 0 15px rgba(102, 116, 255, 0.36);
}

.contact-item span {
  display: grid;
}

.contact-item strong {
  color: #e8edff;
}

.contact-item small {
  color: #a5b1e6;
  font-size: 0.84rem;
}

.footer {
  border-top: 1px solid rgba(130, 144, 255, 0.22);
  padding: 22px 0;
  text-align: center;
  color: #97a3df;
  font-size: 0.92rem;
}

@keyframes ambientPulse {
  0%, 100% {
    opacity: 0.9;
    transform: translateY(calc(var(--scroll-progress) * 4vh)) scale(1);
  }
  50% {
    opacity: 1;
    transform: translateY(calc(var(--scroll-progress) * 4vh - 8px)) scale(1.06);
  }
}

.ambient-layer-two {
  animation: ambientPulse 12s ease-in-out infinite;
}

.cv-main {
  padding-top: 28px;
}

.cv-header {
  text-align: center;
  margin-bottom: 28px;
}

.cv-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.9rem);
  margin-bottom: 10px;
}

.cv-header p {
  color: var(--text-soft);
  max-width: 760px;
  margin: 0 auto;
}

.cv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.cv-grid .card h4 {
  margin-bottom: 10px;
}

.cv-grid ul {
  padding-left: 18px;
}

.cv-actions {
  margin-top: 26px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .backdrop-word {
    font-size: clamp(4rem, 15vw, 8rem);
    top: 6px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    text-align: left;
    min-height: auto;
    width: min(860px, 100%);
    padding: 40px 34px;
  }

  .hero-image-wrap {
    width: min(360px, 100%);
    justify-self: start;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .navbar {
    width: min(430px, 92%);
    top: 8px;
    margin-top: 8px;
  }

  .nav-inner {
    min-height: 58px;
    justify-content: space-between;
  }

  .menu-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 64px;
    right: 4%;
    width: min(260px, 90vw);
    background: rgba(8, 14, 32, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin: 0;
  }

  .nav-links.open {
    display: flex;
  }

  .section {
    padding: 62px 0;
  }

  .hero {
    min-height: auto;
    padding-top: 16px;
  }

  .hero-grid {
    border-radius: 20px;
    padding: 28px 22px;
    gap: 24px;
  }

  .hero h1 {
    font-size: clamp(1.9rem, 9vw, 2.6rem);
  }

  .hero h2 {
    font-size: 0.92rem;
    letter-spacing: 0.04rem;
  }

  .hero-description {
    font-size: 0.92rem;
  }

  .hero-image-wrap {
    width: min(320px, 100%);
  }

  .backdrop-word {
    opacity: 0.6;
    font-size: clamp(3.1rem, 16vw, 6.4rem);
  }

  .card-grid,
  .resume-preview,
  .cv-grid {
    grid-template-columns: 1fr;
  }

  .resume-preview > div {
    padding: 14px;
  }

  .resume-action {
    padding: 8px 10px;
  }

  .contact-card {
    padding: 24px 18px;
  }

  .contact-item {
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .navbar {
    width: min(360px, 94%);
  }

  .hero-grid {
    padding: 24px 18px;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  .hero-actions {
    gap: 10px;
  }

  .section-title {
    font-size: 1.55rem;
  }

  .cv-actions .btn {
    width: 100%;
  }
}
