:root {
  /* Core color system for dark futuristic theme. */
  --bg: #060913;
  --bg-soft: #0b1020;
  --panel: rgba(18, 24, 44, 0.62);
  --text: #e8eeff;
  --muted: #9bacd9;
  --line: rgba(143, 168, 255, 0.22);
  --primary: #5aa8ff;
  --secondary: #9b6dff;
  --accent: #46ffe0;
  --shadow: 0 18px 50px rgba(6, 10, 28, 0.45);
  --radius: 16px;

  --gradient-start: #111a33;
  --gradient-end: #05070e;
  --loader-bg: #04070f;
  --input-bg: rgba(7, 10, 21, 0.7);
  --label-focus-bg: #0b1020;
  --chip-bg: rgba(18, 33, 63, 0.5);
  --profile-hover-bg: rgba(18, 33, 63, 0.95);
  --btn-text: #061120;
  --modal-overlay-bg: rgba(6, 9, 19, 0.85);
  --orb-1: #2a67ff;
  --orb-2: #8f3dff;
  --orb-3: #9b51e0;
}

[data-theme="light"] {
  --bg: #f8fafc;
  --bg-soft: #ffffff;
  --panel: rgba(255, 255, 255, 0.7);
  --text: #0f172a;
  --muted: #475569;
  --line: rgba(0, 0, 0, 0.1);
  --primary: #2563eb;
  --secondary: #7c3aed;
  --accent: #059669;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.05);

  --gradient-start: #e2e8f0;
  --gradient-end: #f1f5f9;
  --loader-bg: #f8fafc;
  --input-bg: rgba(255, 255, 255, 0.8);
  --label-focus-bg: #f8fafc;
  --chip-bg: rgba(255, 255, 255, 0.6);
  --profile-hover-bg: rgba(255, 255, 255, 1);
  --btn-text: #ffffff;
  --modal-overlay-bg: rgba(248, 250, 252, 0.85);
  --orb-1: #60a5fa;
  --orb-2: #a78bfa;
  --orb-3: #c084fc;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--bg);
  overflow-x: hidden;
}

/* Custom Scrollbar for Webkit (Chrome/Safari/Edge) */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 999px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background: radial-gradient(circle at 10% 10%, var(--gradient-start) 0%, var(--bg) 38%, var(--gradient-end) 100%);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
}

/* --- Testimonials Slider --- */
.testimonial-slider-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 10px 0;
}

.testimonial-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  width: 100%;
}

.testimonial-card {
  flex: 0 0 100%;
  min-width: 100%;
  padding: 40px;
  box-sizing: border-box;
  text-align: center;
}

.testimonial-quote {
  font-size: 1.1rem;
  line-height: 1.6;
  font-style: italic;
  margin-bottom: 24px;
}

.testimonial-author h4 {
  color: var(--accent);
  margin-bottom: 4px;
}

.testimonial-author p {
  font-size: 0.9rem;
  color: var(--muted);
}

.slider-controls {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}

.slider-btn {
  background: rgba(90, 168, 255, 0.1);
  border: 1px solid rgba(143, 168, 255, 0.3);
  color: var(--text);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.slider-btn:hover {
  background: var(--primary);
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.1);
}

@media (min-width: 768px) {
  .testimonial-card {
    flex: 0 0 80%;
    min-width: 80%;
    margin: 0 10%;
  }
}

/* --- Project Filters --- */
.project-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 30px;
}

.filter-btn {
  background: rgba(90, 168, 255, 0.05);
  border: 1px solid rgba(143, 168, 255, 0.15);
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 20px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn:hover {
  background: rgba(90, 168, 255, 0.15);
  color: var(--text);
  border-color: rgba(143, 168, 255, 0.4);
}

.filter-btn.active {
  background: rgba(90, 168, 255, 0.2);
  color: var(--accent);
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(90, 168, 255, 0.2);
}

/* --- Project Grid --- */
.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  overflow: hidden;
}

.bg-glow::before,
.bg-glow::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  animation: floatOrb 20s infinite alternate ease-in-out;
}

.bg-glow::before {
  width: 40vw;
  height: 40vw;
  background: var(--accent);
  top: -10vw;
  left: -10vw;
}

.bg-glow::after {
  width: 50vw;
  height: 50vw;
  background: var(--orb-3);
  bottom: -20vw;
  right: -10vw;
  animation-delay: -10s;
  animation-duration: 25s;
}

@keyframes floatOrb {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(100px, 100px) scale(1.2);
  }
}

#particles-js {
  /* Fullscreen particle canvas layer. */
  position: fixed;
  inset: 0;
  z-index: -3;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(75px);
  z-index: -2;
  opacity: 0.32;
  transition: transform 0.1s linear;
  will-change: transform;
}

.orb-1 {
  width: 380px;
  height: 380px;
  background: var(--orb-1);
  top: -70px;
  right: -90px;
}

.orb-2 {
  width: 300px;
  height: 300px;
  background: var(--orb-2);
  left: -90px;
  bottom: -70px;
  animation-delay: 2s;
}

@keyframes floatOrb {

  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }

  50% {
    transform: translate3d(0, -20px, 0);
  }
}

#loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: var(--loader-bg);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

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

.loader-glow {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 2px solid rgba(90, 168, 255, 0.55);
  border-top-color: var(--accent);
  animation: spin 1.2s linear infinite;
  margin: 0 auto 14px;
}

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

.glass {
  /* Shared glassmorphism surface style. */
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.site-header {
  position: sticky;
  top: 12px;
  width: min(1120px, calc(100% - 28px));
  margin: 12px auto 0;
  border-radius: 999px;
  padding: 10px 32px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 100;
}

@media (min-width: 761px) {
  .brand {
    margin-right: auto;
  }

  .site-nav {
    order: 2;
  }

  .header-actions {
    order: 3;
  }
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.site-nav {
  display: flex;
  gap: 12px;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.94rem;
  padding: 7px 10px;
  border-radius: 999px;
  transition: color 0.25s, background-color 0.25s;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
  background: rgba(90, 168, 255, 0.15);
}

.nav-toggle {
  display: none;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(90, 168, 255, 0.12);
  color: var(--text);
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  background: rgba(90, 168, 255, 0.25);
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.section {
  width: 100%;
  max-width: 1152px;
  margin: 0 auto;
  padding: 88px 16px;
}

.hero {
  /* Hero split layout for desktop. */
  min-height: calc(100vh - 90px);
  display: grid;
  align-items: center;
  grid-template-columns: 1.18fr 0.82fr;
  gap: 26px;
}

.kicker {
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  margin-bottom: 10px;
}

h1 {
  margin: 0;
  font-size: clamp(1.8rem, 7vw, 3.8rem);
  line-height: 1.15;
  background: linear-gradient(135deg, var(--text) 20%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  margin-top: 18px;
  max-width: 62ch;
  color: var(--muted);
}

.hero-card {
  border-radius: var(--radius);
  padding: 24px;
}

.hero-card h2 {
  margin-top: 0;
}

.hero-card ul {
  margin: 0;
  padding-left: 1.1rem;
}

.profile-img-container {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.profile-pic {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(90, 168, 255, 0.4);
  box-shadow: 0 8px 24px rgba(70, 255, 224, 0.15);
}

.cta-row {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "JetBrains Mono", monospace;
  outline: none;
  border: none;
}

.magnetic-btn {
  transition: transform 0.1s ease-out, background 0.3s ease, box-shadow 0.3s ease;
  will-change: transform;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
}

.btn-primary {
  color: var(--btn-text);
  background: linear-gradient(120deg, var(--primary), var(--accent));
  box-shadow: 0 8px 28px rgba(70, 255, 224, 0.2);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  color: var(--btn-text);
}

.btn-secondary {
  color: var(--text);
  border-color: rgba(143, 168, 255, 0.4);
  background: rgba(143, 168, 255, 0.12);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  color: var(--text);
}

.section-title {
  margin: 0 0 20px;
  font-size: clamp(1.5rem, 4vw, 2.1rem);
}

.panel {
  border-radius: var(--radius);
  padding: 24px;
}

.journey-track {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.journey-track span {
  display: inline-block;
  border: 1px solid rgba(143, 168, 255, 0.3);
  background: rgba(90, 168, 255, 0.09);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.9rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.skill-card h3 {
  margin-top: 0;
}

.skill {
  margin-bottom: 12px;
}

.skill-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.skill-label span:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

.skill-label svg,
.skill-label i {
  stroke: var(--accent);
  color: var(--accent);
  font-size: 1.1rem;
}

.skill-bar {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.skill-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
}

.chip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.chip-list li {
  border: 1px solid rgba(143, 168, 255, 0.28);
  border-radius: 999px;
  padding: 7px 12px;
  background: var(--chip-bg);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chip-list li svg,
.chip-list li i {
  stroke: var(--accent);
  color: var(--accent);
  font-size: 1.1rem;
}

.timeline {
  position: relative;
  margin-left: 8px;
  padding-left: 26px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8px;
  width: 2px;
  height: 100%;
  background: linear-gradient(var(--primary), var(--secondary));
}

.timeline-item {
  position: relative;
}

.timeline-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  left: -34px;
  top: 14px;
  box-shadow: 0 0 20px rgba(70, 255, 224, 0.7);
}

.timeline-period,
.timeline-role,
.project-tech,
.muted {
  color: var(--muted);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.project-card {
  /* Cards are animated/tilted in script.js. */
  min-height: 220px;
  display: flex;
  flex-direction: column;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: auto;
}

a {
  color: var(--primary);
}

a:hover,
a:focus-visible {
  color: var(--accent);
}

.github-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 900px) {
  .github-layout {
    grid-template-columns: 1fr 1.6fr;
  }
}

.github-box {
  display: flex;
  flex-direction: column;
}

.github-box > p {
  flex-grow: 1;
}

.github-box .github-stats {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.github-heatmap {
  transition: filter 0.3s ease;
}

html[data-theme="dark"] .github-heatmap {
  /* Make the empty dots blend with the background and make colored dots glow strongly */
  filter: invert(1) hue-rotate(180deg) brightness(2.5) contrast(1.5) drop-shadow(0 0 5px rgba(90, 168, 255, 0.5));
  mix-blend-mode: screen;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.contact-methods {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: rgba(90, 168, 255, 0.05);
  border: 1px solid rgba(143, 168, 255, 0.15);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.3s ease;
}

.contact-item:hover {
  background: rgba(90, 168, 255, 0.15);
  border-color: var(--accent);
  transform: translateY(-2px);
  color: var(--text);
}

.contact-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(90, 168, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.contact-item:hover .contact-icon {
  background: var(--primary);
  color: #fff;
  transform: scale(1.1);
}

.contact-details {
  display: flex;
  flex-direction: column;
}

.contact-label {
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.contact-value {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.95rem;
  font-weight: 500;
  margin-top: 4px;
}

.contact-form {
  display: grid;
  gap: 16px;
}

.form-group {
  position: relative;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 16px 14px 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(143, 168, 255, 0.27);
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(70, 255, 224, 0.2);
}

.form-group label {
  position: absolute;
  top: 14px;
  left: 14px;
  color: var(--muted);
  pointer-events: none;
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

.contact-form input:focus~label,
.contact-form input:not(:placeholder-shown)~label,
.contact-form textarea:focus~label,
.contact-form textarea:not(:placeholder-shown)~label {
  top: -10px;
  left: 10px;
  font-size: 0.8rem;
  color: var(--accent);
  background: var(--label-focus-bg);
  padding: 0 4px;
  border-radius: 4px;
}

.site-footer {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 30px 0 38px;
  color: var(--muted);
  border-top: 1px solid rgba(143, 168, 255, 0.2);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

.footer-links {
  display: flex;
  gap: 16px;
  align-items: center;
}

.footer-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, color 0.25s ease;
}

.footer-links a:hover {
  transform: translateY(-4px);
  color: var(--accent);
}

/* --- Developer Platforms Grid --- */
.profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  text-decoration: none;
  transition: transform 0.3s ease, border-color 0.3s ease, background 0.3s ease;
  text-align: center;
}

.profile-card:hover {
  transform: translateY(-5px);
  border-color: rgba(70, 255, 224, 0.4);
  background: var(--profile-hover-bg);
}

.profile-icon {
  width: 48px;
  height: 48px;
  background-color: var(--accent);
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  margin-bottom: 16px;
  transition: transform 0.3s ease;
}

.profile-card:hover .profile-icon {
  transform: scale(1.1);
}

.profile-card h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--text);
}

.profile-card .view-link {
  font-size: 0.9rem;
  color: var(--muted);
  transition: color 0.3s ease;
}

.profile-card:hover .view-link {
  color: var(--accent);
}

@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 760px) {
  .site-header {
    border-radius: 16px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 10px 16px;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(143, 168, 255, 0.35);
    border-radius: 10px;
    background: rgba(90, 168, 255, 0.12);
    color: var(--text);
    padding: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
  }

  .nav-toggle:active {
    transform: scale(0.95);
  }

  .site-nav {
    width: 100%;
    display: none;
    flex-direction: column;
    padding-top: 6px;
    order: 3;
  }

  .site-nav.open {
    display: flex;
  }

  .section {
    padding: 74px 16px;
  }

  .skills-grid,
  .project-grid,
  .contact-grid,
  .github-box .github-stats {
    grid-template-columns: 1fr;
  }

  .contact-value {
    word-break: break-all;
  }
}

/* --- Skeleton Loaders --- */
.skeleton-bg,
.skeleton-text,
.skeleton-icon,
.skeleton-btn {
  background: linear-gradient(90deg, rgba(143, 168, 255, 0.05) 25%, rgba(143, 168, 255, 0.12) 50%, rgba(143, 168, 255, 0.05) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: 4px;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.skeleton-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-bottom: 16px;
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}

.skeleton-title {
  width: 60%;
  height: 20px;
  margin-bottom: 12px;
}

.skeleton-link {
  width: 40%;
}

.skeleton-period {
  width: 30%;
  margin-bottom: 12px;
}

.skeleton-company {
  width: 45%;
  margin-bottom: 16px;
}

.skeleton-desc {
  width: 100%;
}

.skeleton-desc.line-2 {
  width: 80%;
}

.skeleton-tech {
  width: 50%;
  margin-top: auto;
  margin-bottom: 16px;
}

.skeleton-project {
  display: flex;
  flex-direction: column;
}

.skeleton-btn {
  width: 70px;
  height: 24px;
  border-radius: 4px;
}

.skeleton-timeline .timeline-dot.skeleton-bg {
  background: rgba(143, 168, 255, 0.2);
  box-shadow: none;
}

/* --- Custom Cursor --- */
body.has-custom-cursor {
  cursor: none;
}

body.has-custom-cursor a,
body.has-custom-cursor button,
body.has-custom-cursor input,
body.has-custom-cursor textarea {
  cursor: none;
}

.cursor-dot,
.cursor-outline {
  position: fixed;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 9999;
  pointer-events: none;
}

.cursor-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent);
}

.cursor-outline {
  width: 36px;
  height: 36px;
  border: 2px solid rgba(90, 168, 255, 0.5);
  /* Optional transition for size change on hover */
  transition: width 0.2s ease-out, height 0.2s ease-out, background-color 0.2s ease-out;
}

/* Disable custom cursor on mobile/tablets where touch is used */
@media (max-width: 1024px) {

  body.has-custom-cursor,
  body.has-custom-cursor a,
  body.has-custom-cursor button,
  body.has-custom-cursor input,
  body.has-custom-cursor textarea {
    cursor: auto;
  }

  .cursor-dot,
  .cursor-outline {
    display: none;
  }
}

/* --- Typewriter Effect --- */
.typewriter-text {
  color: var(--accent);
  font-weight: 600;
}

.typewriter-cursor {
  color: var(--accent);
  font-weight: 500;
  animation: blink 1s step-end infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/* --- Back to Top Button --- */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--btn-text);
  border: none;
  box-shadow: 0 8px 24px rgba(90, 168, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 28px rgba(90, 168, 255, 0.6);
}

@media (max-width: 760px) {
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
  }
}

/* --- Scroll Progress --- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  z-index: 10000;
  transition: width 0.1s ease-out;
}

/* --- Preloader --- */
.preloader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.loaded {
  opacity: 0;
  visibility: hidden;
}

.preloader .spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(90, 168, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

.preloader-text {
  font-family: "JetBrains Mono", monospace;
  color: var(--accent);
  letter-spacing: 4px;
  margin-right: -4px;
  animation: pulse 1.5s ease-in-out infinite;
}

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

@keyframes pulse {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}

/* --- Layout --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--modal-overlay-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: all 0.3s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-content {
  position: relative;
  width: min(600px, 90%);
  padding: 30px;
  transform: translateY(0) scale(1);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.hidden .modal-content {
  transform: translateY(30px) scale(0.95);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: var(--accent);
  background: rgba(70, 255, 224, 0.1);
}

.project-card {
  cursor: pointer;
}

/* Mobile Performance Optimizations */
@media (max-width: 768px) {
  .bg-orb {
    filter: blur(30px) !important;
    opacity: 0.15 !important;
  }
}