:root {
  --bg: #03050d;
  --panel: rgba(12, 18, 40, 0.72);
  --panel-strong: rgba(14, 23, 56, 0.92);
  --text: #f5fbff;
  --muted: #a9b8d8;
  --blue: #00a8ff;
  --cyan: #00fff0;
  --purple: #b100ff;
  --pink: #ff3df5;
  --line: rgba(120, 225, 255, 0.22);
  --shadow: 0 0 34px rgba(0, 212, 255, 0.28);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 15% 10%, rgba(177, 0, 255, 0.22), transparent 28rem),
    radial-gradient(circle at 80% 0%, rgba(0, 255, 240, 0.17), transparent 26rem),
    linear-gradient(180deg, #02030a 0%, #061027 52%, #03050d 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.loader {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1rem;
  background: #02030a;
  transition: opacity .55s ease, visibility .55s ease;
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-core {
  width: 82px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--cyan);
  border-left-color: var(--purple);
  box-shadow: 0 0 45px rgba(0, 255, 240, .45);
  animation: spin 1s linear infinite;
}

.loader p {
  color: var(--muted);
  letter-spacing: 0;
  font-weight: 700;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#particle-canvas,
#hero-space {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#particle-canvas {
  z-index: -3;
}

#hero-space {
  z-index: -2;
}

.cursor-dot,
.cursor-ring {
  position: fixed;
  pointer-events: none;
  z-index: 998;
  transform: translate(-50%, -50%);
  display: none;
}

.cursor-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 16px var(--cyan);
}

.cursor-ring {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(0, 255, 240, .7);
  border-radius: 50%;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem clamp(1rem, 4vw, 4rem);
  background: rgba(3, 5, 13, 0.6);
  border-bottom: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  font-weight: 800;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, .16);
  box-shadow: var(--shadow);
}

.nav-links {
  display: none;
  align-items: center;
  gap: .5rem;
}

.nav-links a {
  color: var(--muted);
  padding: .62rem .8rem;
  border-radius: var(--radius);
  font-weight: 700;
  transition: color .2s ease, background .2s ease;
}

.nav-links a:hover {
  color: white;
  background: rgba(255,255,255,.08);
}

.menu-toggle {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: white;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
}

.nav-links.open {
  position: absolute;
  top: 4.35rem;
  left: 1rem;
  right: 1rem;
  display: grid;
  background: rgba(9, 15, 35, .96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .75rem;
}

.section {
  position: relative;
  padding: clamp(4.5rem, 10vw, 7.5rem) clamp(1rem, 4vw, 4rem);
}

.hero {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding-top: 6.75rem;
}

.hero-grid {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 3rem;
  align-items: center;
}

.eyebrow,
.section-heading span {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--cyan);
  font-weight: 900;
  text-transform: uppercase;
  font-size: .78rem;
}

.hero h1 {
  margin: .65rem 0 0;
  font-size: clamp(3rem, 15vw, 7.5rem);
  line-height: .88;
  letter-spacing: 0;
  text-shadow: 0 0 28px rgba(0, 255, 240, .22);
}

.typing-line {
  min-height: 2.35rem;
  margin: 1.1rem 0 0;
  color: var(--cyan);
  font-size: clamp(1.22rem, 5vw, 2rem);
  font-weight: 900;
}

.hero-text {
  max-width: 660px;
  color: var(--muted);
  font-size: clamp(1.02rem, 2.5vw, 1.22rem);
  line-height: 1.7;
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  margin-top: 1.4rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 48px;
  padding: .9rem 1rem;
  border: 0;
  border-radius: var(--radius);
  color: white;
  font-weight: 900;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.btn:hover {
  transform: translateY(-3px);
}

.btn.primary {
  background: linear-gradient(135deg, var(--blue), var(--purple));
  box-shadow: 0 0 28px rgba(0, 168, 255, .32);
}

.btn.secondary {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .7rem;
  margin-top: 1.5rem;
  max-width: 560px;
}

.mini-stats span {
  min-width: 0;
  padding: .85rem;
  border-radius: var(--radius);
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--muted);
}

.mini-stats strong {
  display: block;
  color: white;
  font-size: 1.2rem;
}

.profile-stage {
  position: relative;
  min-height: 430px;
  display: grid;
  place-items: center;
}

.profile-card {
  position: relative;
  width: min(330px, 82vw);
  aspect-ratio: .78;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(255,255,255,.18), rgba(255,255,255,.04)),
    radial-gradient(circle at 50% 25%, rgba(0,255,240,.42), transparent 11rem);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 28px;
  box-shadow: 0 0 60px rgba(0, 212, 255, .26), inset 0 0 40px rgba(255,255,255,.05);
  backdrop-filter: blur(22px);
}

.profile-card::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 90deg, transparent, rgba(0,255,240,.36), transparent, rgba(177,0,255,.42), transparent);
  animation: spin 8s linear infinite;
}

.profile-card::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 26px;
  background: rgba(6, 10, 28, .68);
}

.profile-avatar,
.profile-chip {
  position: relative;
  z-index: 2;
}

.profile-avatar {
  width: min(82%, 275px);
  max-height: 74%;
  object-fit: contain;
  filter: drop-shadow(0 0 28px rgba(0, 255, 240, .2));
}

.profile-chip {
  position: absolute;
  left: 20px;
  bottom: 24px;
  padding: .55rem .7rem;
  border-radius: var(--radius);
  background: rgba(0,255,240,.12);
  border: 1px solid rgba(0,255,240,.28);
  font-size: .78rem;
  font-weight: 900;
}

.profile-chip.alt {
  left: auto;
  right: 18px;
  bottom: 72px;
  background: rgba(177,0,255,.15);
  border-color: rgba(255,61,245,.28);
}

.orbit {
  position: absolute;
  width: 360px;
  max-width: 92vw;
  aspect-ratio: 1;
  border: 1px dashed rgba(0,255,240,.28);
  border-radius: 50%;
  animation: spin 18s linear infinite;
}

.orbit-two {
  width: 285px;
  transform: rotate(35deg);
  border-color: rgba(255,61,245,.24);
  animation-duration: 13s;
  animation-direction: reverse;
}

.float-icon {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--cyan);
  box-shadow: var(--shadow);
  animation: floaty 4s ease-in-out infinite;
}

.float-icon:nth-of-type(1) { left: 9%; top: 18%; }
.float-icon:nth-of-type(2) { right: 7%; top: 24%; animation-delay: -.9s; }
.float-icon:nth-of-type(3) { left: 8%; bottom: 17%; animation-delay: -1.6s; }
.float-icon:nth-of-type(4) { right: 9%; bottom: 13%; animation-delay: -2.4s; }

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-18px) rotate(7deg); }
}

.section-heading {
  width: min(980px, 100%);
  margin: 0 auto 2rem;
}

.section-heading h2 {
  margin: .55rem 0 0;
  max-width: 760px;
  font-size: clamp(2rem, 8vw, 4.4rem);
  line-height: 1;
  letter-spacing: 0;
}

.about-layout,
.hobby-arena {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 1rem;
}

.glass-panel,
.timeline,
.contact-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 0 45px rgba(0,0,0,.22);
  backdrop-filter: blur(18px);
}

.about-card,
.contact-card {
  padding: clamp(1.15rem, 4vw, 2rem);
}

.panel-icon,
.contact-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--blue), var(--purple));
  box-shadow: var(--shadow);
  font-size: 1.45rem;
}

.about-card h3,
.contact-card h3 {
  margin: 0 0 .8rem;
  font-size: clamp(1.45rem, 5vw, 2.2rem);
}

.about-card p,
.timeline p,
.project-card p,
.contact-card p {
  color: var(--muted);
  line-height: 1.65;
}

.timeline {
  padding: .7rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .9rem;
  padding: 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

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

.timeline-item span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  color: var(--cyan);
  background: rgba(0,255,240,.1);
}

.skill-grid,
.project-grid,
.stats-grid,
.hobby-grid {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
}

.skill-card,
.project-card,
.stat-card,
.hobby-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.04));
  backdrop-filter: blur(18px);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.skill-card::before,
.project-card::before,
.hobby-card::before,
.stat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,255,240,.18), transparent 45%, rgba(177,0,255,.2));
  opacity: 0;
  transition: opacity .22s ease;
}

.skill-card:hover,
.project-card:hover,
.hobby-card:hover,
.stat-card:hover {
  transform: translateY(-6px);
  border-color: rgba(0,255,240,.48);
  box-shadow: 0 0 35px rgba(0, 255, 240, .16);
}

.skill-card:hover::before,
.project-card:hover::before,
.hobby-card:hover::before,
.stat-card:hover::before {
  opacity: 1;
}

.skill-card,
.hobby-card {
  min-height: 130px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: .65rem;
  padding: 1rem;
}

.skill-card i,
.hobby-card i {
  position: relative;
  color: var(--cyan);
  font-size: 1.75rem;
}

.skill-card h3,
.hobby-card h3 {
  position: relative;
  margin: 0;
  font-size: 1rem;
}

.project-filters {
  width: min(1120px, 100%);
  margin: 0 auto 1rem;
  display: flex;
  gap: .6rem;
  overflow-x: auto;
  padding-bottom: .25rem;
}

.filter {
  flex: 0 0 auto;
  min-height: 42px;
  padding: .65rem .9rem;
  color: var(--muted);
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
  font-weight: 900;
  cursor: pointer;
}

.filter.active {
  color: white;
  background: linear-gradient(135deg, rgba(0,168,255,.8), rgba(177,0,255,.8));
  box-shadow: var(--shadow);
}

.project-grid {
  grid-template-columns: 1fr;
}

.project-card {
  display: grid;
}

.project-card img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  background: #061027;
}

.project-card div {
  position: relative;
  padding: 1rem;
}

.project-card span {
  color: var(--cyan);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.project-card h3 {
  margin: .4rem 0 .5rem;
  font-size: 1.35rem;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-top: .2rem;
  color: white;
  font-weight: 900;
}

.stats-grid {
  margin-bottom: 1rem;
}

.stat-card {
  min-height: 145px;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 1rem;
}

.stat-card strong {
  position: relative;
  font-size: clamp(2.5rem, 12vw, 4.5rem);
  line-height: .9;
  color: var(--cyan);
  text-shadow: 0 0 26px rgba(0,255,240,.42);
}

.stat-card span {
  position: relative;
  color: var(--muted);
  font-weight: 800;
}

.badge-row {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
}

.badge-row span {
  padding: .72rem .85rem;
  border-radius: var(--radius);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.13);
  color: var(--muted);
  font-weight: 800;
}

.chess-board {
  position: relative;
  min-height: 300px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(45deg, rgba(0,255,240,.08) 25%, transparent 25%, transparent 75%, rgba(0,255,240,.08) 75%),
    linear-gradient(45deg, rgba(0,255,240,.08) 25%, transparent 25%, transparent 75%, rgba(0,255,240,.08) 75%),
    rgba(255,255,255,.04);
  background-position: 0 0, 32px 32px;
  background-size: 64px 64px;
}

.piece {
  position: absolute;
  font-size: clamp(4rem, 18vw, 7rem);
  text-shadow: 0 0 28px rgba(0,255,240,.44);
  animation: floaty 4s ease-in-out infinite;
}

.knight { left: 12%; top: 15%; color: var(--cyan); }
.king { right: 12%; top: 31%; color: white; animation-delay: -1s; }
.pawn { left: 42%; bottom: 8%; color: var(--pink); animation-delay: -2s; }

.contact-card {
  width: min(760px, 100%);
  margin: 0 auto;
  text-align: left;
}

.email-link,
.phone-link {
  display: inline-block;
  overflow-wrap: anywhere;
  color: var(--cyan);
  font-size: clamp(1.05rem, 4vw, 1.45rem);
  font-weight: 900;
}

.phone-link {
  display: block;
  width: max-content;
  max-width: 100%;
  margin-top: .55rem;
  color: white;
}

#copy-status {
  min-height: 1.5rem;
  margin-bottom: 0;
}

.chat-launcher {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  border: 0;
  border-radius: 50%;
  box-shadow: 0 0 34px rgba(0,168,255,.45);
  cursor: pointer;
}

.ai-popup {
  position: fixed;
  right: 1rem;
  bottom: 5.3rem;
  z-index: 60;
  width: min(320px, calc(100vw - 2rem));
  padding: 1rem;
  transform: translateY(16px) scale(.96);
  opacity: 0;
  pointer-events: none;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 0 50px rgba(0,0,0,.35);
  transition: transform .22s ease, opacity .22s ease;
}

.ai-popup.open {
  transform: none;
  opacity: 1;
  pointer-events: auto;
}

.ai-popup-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ai-close,
.ai-popup button {
  color: white;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
}

.ai-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
}

.ai-popup p {
  color: var(--muted);
  line-height: 1.5;
}

.ai-popup > button {
  width: 100%;
  min-height: 40px;
  margin-top: .5rem;
  font-weight: 800;
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
}

@media (hover: hover) and (pointer: fine) {
  .cursor-dot,
  .cursor-ring {
    display: block;
  }
}

@media (min-width: 680px) {
  .skill-grid,
  .stats-grid,
  .hobby-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (min-width: 920px) {
  .menu-toggle {
    display: none;
  }

  .nav-links {
    display: flex;
  }

  .hero-grid,
  .about-layout,
  .hobby-arena {
    grid-template-columns: 1.05fr .95fr;
  }

  .skill-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .project-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 410px) {
  .mini-stats {
    grid-template-columns: 1fr;
  }

  .hero-actions .btn,
  .contact-actions .btn {
    width: 100%;
  }

  .skill-grid,
  .stats-grid,
  .hobby-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
