@import url("https://fonts.googleapis.com/css2?family=Caveat:wght@400;700&family=VT323&display=swap");
:root {
  --bg-color: #0d0d0d;
  --text-color: #e5e5e5;
  --text-muted: #a1a1a1;
  --accent-color: #2997ff;
  --card-bg: rgba(255, 255, 255, 0.05);
  --glass-bg: rgba(13, 13, 13, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  background-color: var(--bg-color);
  transition: background-color 0.5s ease;
}
body {
  background-color: transparent;
  color: var(--text-color);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  line-height: 1.6;
  transition: background-color 0.5s ease, color 0.5s ease;
  overflow-x: hidden;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Syne", sans-serif;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.5rem;
  transition: color 0.5s ease;
}
a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.5s ease;
}
a:hover {
  color: var(--accent-color);
}
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem 2rem;
}
.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}
.nav-links a {
  color: var(--text-color);
  font-family: "Syne", sans-serif;
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.5px;
}
.nav-links a:hover {
  color: var(--accent-color);
}
.nav-links a.active {
  color: var(--accent-color);
  position: relative;
  text-shadow: 0 0 8px var(--accent-color);
}
.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background-color: var(--accent-color);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-color);
}
.btn-primary {
  display: inline-block;
  background: var(--accent-color);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-family: "Syne", sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: none;
  cursor: pointer;
  transition:
    background 0.3s ease,
    transform 0.2s ease;
  margin-top: 1rem;
}
.btn-primary:hover {
  background: #1a75ff;
  color: #fff;
  transform: translateY(-2px);
}
.badge {
  display: inline-block;
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  color: #000;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
  box-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
}
.tech-stack {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1rem;
}
.tech-stack-item {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  color: var(--text-color);
}
main {
  margin-top: 80px;
  padding: 2rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  min-height: calc(100vh - 160px);
  background: transparent;
}
.page-header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 4rem 0 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.page-header h1 {
  font-size: 3.5rem;
  background: linear-gradient(135deg, #E2E8F0, #FFFFFF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  margin-bottom: 1rem;
}
.page-header h2.sub-heading {
  font-size: 3.5rem;
  background: linear-gradient(135deg, #ffffff, #d1d5db);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  margin-bottom: 1rem;
  width: 100%;
  margin-top: 1rem;
}

.page-header p {
  color: var(--text-muted);
  font-size: 1.25rem;
  max-width: 600px;
  margin: 0 auto;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}
.card {
  background: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 2rem;
  transition:
    transform 0.3s ease,
    box-shadow 0.5s ease,
    background 0.5s ease,
    border 0.5s ease;
  position: relative;
  overflow: hidden;
  will-change: transform;
}
.card:hover {
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale3d(1.02, 1.02, 1.02);
  box-shadow:  0 0 40px var(--section-glow, rgba(255, 255, 255, 0.2));
  background: rgba(255, 255, 255, 0.08);
}
.card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at var(--px, 50%) var(--py, 50%),
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0) 60%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 10;
}
.card:hover::after {
  opacity: 1;
}
.card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}
.card p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.read-more {
  display: inline-block;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 1px;
}
.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  border: 1px solid var(--glass-border);
}
.video-container iframe,
.video-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #1a1a1a;
  color: #555;
  font-size: 1.2rem;
  font-family: "Syne", sans-serif;
}
.code-block {
  background: #1e1e1e;
  border-radius: 12px;
  padding: 1.5rem;
  font-family: "Courier New", Courier, monospace;
  color: #d4d4d4;
  overflow-x: auto;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid #333;
  margin-top: 2rem;
  position: relative;
}
.code-header {
  display: flex;
  gap: 8px;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #333;
}
.mac-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.mac-dot.red {
  background-color: #ff5f56;
}
.mac-dot.yellow {
  background-color: #ffbd2e;
}
.mac-dot.green {
  background-color: #27c93f;
}
.code-content {
  white-space: pre;
}
.keyword {
  color: #569cd6;
}
.function {
  color: #dcdcaa;
}
.string {
  color: #ce9178;
}
.comment {
  color: #6a9955;
  font-style: italic;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}
.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1;
  background: #1a1a1a;
  border: 1px solid var(--glass-border);
  will-change: transform;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.gallery-item:hover {
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale3d(1.02, 1.02, 1.02);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 2;
}
.gallery-item::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at var(--px, 50%) var(--py, 50%),
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0) 60%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 10;
}
.gallery-item:hover::after {
  opacity: 1;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.gallery-item:hover img {
  transform: scale(1.1);
}
.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
  transform: translateY(100%);
  transition: transform 0.3s ease;
}
.gallery-item:hover .gallery-overlay {
  transform: translateY(0);
}
footer {
  text-align: center;
  padding: 3rem 1rem;
  border-top: 1px solid var(--glass-border);
  margin-top: 4rem;
}
.footer-logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
  border: 2px solid var(--glass-border);
  transition: transform 0.3s ease;
}
.footer-logo:hover {
  transform: scale(1.1);
}
footer p {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.btn-github {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #24292e;
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    transform 0.2s ease;
  margin-top: 1rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.btn-github:hover {
  background-color: #2f363d;
  color: #fff;
  transform: scale(1.02);
}
.btn-github svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}
.btn-github-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #1a1a1a;
  color: var(--text-muted);
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px dashed var(--glass-border);
  margin-top: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 768px) {
  .nav-links {
    gap: 1rem;
  }
  .nav-links a {
    font-size: 0.9rem;
  }
  .page-header h1 {
    font-size: 2.5rem;
  }
  main {
    padding: 1rem;
  }
}
@media (max-width: 480px) {
  .nav-links {
    gap: 0.75rem;
  }
  .nav-links a {
    font-size: 0.8rem;
  }
}
html.light-theme,
body.light-theme {
  --bg-color: #f8fafc !important;
  background-image: radial-gradient(circle at center, #f8fafc 0%, #e0e7ff 100%) !important;
  --text-color: #0F172A;
  --text-muted: #0F172A;
  --accent-color: #4f46e5;
  --card-bg: rgba(255, 255, 255, 0.7);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.4);
}
body.light-theme ::selection {
  background-color: #ef4444;
  color: #ffffff;
}
body.light-theme h1,
body.light-theme h2,
body.light-theme h3,
body.light-theme h4,
body.light-theme h5,
body.light-theme h6 {
  color: #000000;
}
body.light-theme .page-header h1 {
  background: linear-gradient(135deg, #1e3a8a, #7e22ce);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
body.light-theme .page-header h2.sub-heading {
  background: linear-gradient(135deg, #1e3a8a, #7e22ce);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}


.page-lego .card { border: 1px solid rgba(255, 40, 0, 0.3); }
.page-python .card { border: 1px solid rgba(0, 229, 255, 0.3); }
.page-robotics .card { border: 1px solid rgba(245, 158, 11, 0.3); }

body.light-theme .card {
  background: rgba(255, 255, 255, 0.8) !important;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid #E2E8F0 !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}
body.light-theme .card:hover {
  box-shadow: 0 10px 30px var(--section-glow, rgba(0, 0, 0, 0.1));
  background: rgba(255, 255, 255, 0.85);
}

body.light-theme.page-lego .card {
  background: rgba(255, 230, 230, 0.5) !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
}
body.light-theme.page-lego .card:hover {
  box-shadow: 0 10px 40px rgba(239, 68, 68, 0.15) !important;
  background: rgba(255, 230, 230, 0.7) !important;
}

body.light-theme.page-python .card {
  background: rgba(230, 242, 255, 0.5) !important;
  border: 1px solid rgba(59, 130, 246, 0.3) !important;
}
body.light-theme.page-python .card:hover {
  box-shadow: 0 10px 40px rgba(59, 130, 246, 0.15) !important;
  background: rgba(230, 242, 255, 0.7) !important;
}

body.light-theme.page-robotics .card {
  background: rgba(255, 243, 230, 0.5) !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
}
body.light-theme.page-robotics .card:hover {
  box-shadow: 0 10px 40px rgba(245, 158, 11, 0.15) !important;
  background: rgba(255, 243, 230, 0.7) !important;
}

body.light-theme .btn-primary,
body.light-theme .btn-github {
  background: linear-gradient(135deg, #3b82f6, #ec4899);
  color: #fff;
  border: none;
}
body.light-theme .btn-primary:hover,
body.light-theme .btn-github:hover {
  background: linear-gradient(135deg, #2563eb, #db2777);
  color: #fff;
}
body.light-theme .read-more {
  background: linear-gradient(135deg, #3b82f6, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  transition:
    transform 0.3s ease,
    color 0.3s ease;
}
.theme-toggle:hover {
  transform: scale(1.1);
  color: var(--accent-color);
}
.magnetic-btn {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: var(--accent-color);
  z-index: 10001;
  width: 0%;
  transition: width 0.1s ease-out;
}
/* Featured Grid & Modal Styles */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.featured-hero {
  grid-column: span 2;
  grid-row: span 2;
}

@media (max-width: 900px) {
  .featured-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .featured-hero {
    grid-column: span 2;
    grid-row: span 1;
  }
}
@media (max-width: 600px) {
  .featured-grid {
    grid-template-columns: 1fr;
  }
  .featured-hero {
    grid-column: span 1;
    grid-row: span 1;
  }
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.modal-overlay.active {
  display: flex;
  opacity: 1;
}
.modal-content {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 2rem;
  max-width: 800px;
  width: 90%;
  transform: scale(0.95);
  transition: transform 0.3s ease;
  position: relative;
}
.modal-overlay.active .modal-content {
  transform: scale(1);
}
.carousel-container {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}
.carousel-slide {
  grid-area: 1 / 1;
  width: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background: transparent;
}
.carousel-slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--glass-bg);
  color: #fff;
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}
.carousel-prev {
  left: 10px;
}
.carousel-next {
  right: 10px;
}
.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Custom Cursor */
html.custom-cursor-enabled * {
  cursor: none !important;
}

html.custom-cursor-enabled input,
html.custom-cursor-enabled textarea,
html.custom-cursor-enabled [contenteditable] {
  cursor: auto !important;
}

.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--text-color);
  pointer-events: none;
  z-index: 10000;
  mix-blend-mode: difference;
  transform: translate3d(-50%, -50%, 0);
  transition:
    width 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
    height 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
    background-color 0.3s ease;
  will-change: transform, width, height;
}

.custom-cursor.cursor-hover {
  width: 50px;
  height: 50px;
  background-color: var(--accent-color);
  opacity: 0.8;
}

@media (pointer: coarse) {
  * {
    cursor: auto !important;
  }
  .custom-cursor {
    display: none !important;
  }
}

/* Background Ambient Movement */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -10;
  pointer-events: none;
}
.ambient-blobs {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.ambient-blob {
  position: absolute;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  opacity: 0.25;
  border-radius: 50%;
  animation: drift 20s infinite alternate ease-in-out;
  will-change: transform, border-radius;
  transition: background-color 0.5s ease;
}

.blob-1 {
  width: 400px;
  height: 400px;
  background-color: transparent;
  background: radial-gradient(circle at center, #FF2800 0%, transparent 70%); /* Indigo */
  top: 10%;
  left: 20%;
}

.blob-2 {
  width: 500px;
  height: 500px;
  background-color: transparent;
  background: radial-gradient(circle at center, #00E5FF 0%, transparent 70%); /* Purple */
  bottom: 20%;
  right: 10%;
  animation-delay: -5s;
  animation-duration: 25s;
}

.blob-3 {
  width: 300px;
  height: 300px;
  background-color: transparent;
  background: radial-gradient(circle at center, #9D00FF 0%, transparent 70%); /* Ferrari Red */
  top: 40%;
  left: 60%;
  animation-delay: -10s;
  animation-duration: 22s;
}

@keyframes drift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    border-radius: 50%;
  }
  50% {
    transform: translate3d(100px, 50px, 0) scale(1.1);
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
  }
  100% {
    transform: translate3d(-50px, 100px, 0) scale(0.9);
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  }
}



body.light-theme .blob-1 {
  background-color: transparent;
  background: radial-gradient(circle at center, #38bdf8 0%, transparent 70%);
}

body.light-theme .blob-2 {
  background-color: transparent;
  background: radial-gradient(circle at center, #fb7185 0%, transparent 70%);
}

body.light-theme .blob-3 {
  background-color: transparent;
  background: radial-gradient(circle at center, #34d399 0%, transparent 70%);
}

@media (prefers-reduced-motion: reduce) {
  .ambient-blob {
    animation: none;
    will-change: auto;
  }
}

/* Typewriter & Glitch Effect */
.typewriter-text {
  min-height: 1.5em; /* Prevent layout shift */
  display: inline-block;
  position: relative;
}

.typewriter-text::after {
  content: "|";
  position: absolute;
  right: -10px;
  animation: blink 0.7s infinite;
  color: var(--accent-color);
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.glitch {
  animation: glitch-skew 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes glitch-skew {
  0% {
    transform: skew(0deg);
  }
  20% {
    transform: skew(-20deg);
  }
  40% {
    transform: skew(20deg);
  }
  60% {
    transform: skew(-10deg);
  }
  80% {
    transform: skew(10deg);
  }
  100% {
    transform: skew(0deg);
  }
}


/* Section-Specific Themes */
.page-lego {
  --section-glow: rgba(255, 40, 0, 0.2);
}
.page-lego #bg-canvas {
  background-color: rgba(239, 68, 68, 0.05);
}

.page-python {
  --section-glow: rgba(0, 229, 255, 0.2);
}
.page-python #bg-canvas {
  background-color: rgba(59, 130, 246, 0.05);
}

.page-robotics {
  --section-glow: rgba(245, 158, 11, 0.2);
}
.page-robotics #bg-canvas {
  background-color: rgba(245, 158, 11, 0.05);
}


/* Lightbox Styles added directly into HTML element structure for simplicity */

/* Skeleton Loading Logic */
.skeleton {
  background: #1a1a1a linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0,
    rgba(255, 255, 255, 0.05) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: inherit;
}

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

.skeleton .skeleton-img {
  opacity: 0;
  transition: opacity 0.3s ease;
}

body.light-theme .navbar {
  background: rgba(255, 255, 255, 0.8) !important;
}

body.light-theme .theme-toggle {
  color: #0F172A;
}

body.light-theme .custom-cursor {
  background-color: #0F172A;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
  background: #00E5FF;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #00B8CC;
}


/* =========================================
   SKETCH-CRAFT THEME STYLES
   ========================================= */
html.theme-sketch-craft,
body.theme-sketch-craft {
  --bg-color: #fefce8 !important;
  background-image:
    linear-gradient(rgba(6,182,212,0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6,182,212,0.2) 1px, transparent 1px) !important;
  background-size: 20px 20px !important;
  --text-color: #333333;
  --text-muted: #555555;
  --accent-color: #ff4d4d; /* Default to redstone red */
  --card-bg: transparent;
  --glass-bg: transparent;
  --glass-border: transparent;
  font-family: 'Caveat', cursive !important;
  font-size: 1.2rem;
}

body.theme-sketch-craft.page-python {
  --accent-color: #3b82f6; /* Diamond Blue */
}

body.theme-sketch-craft.page-robotics {
  --accent-color: #22c55e; /* Creeper Green */
}

body.theme-sketch-craft h1,
body.theme-sketch-craft h2,
body.theme-sketch-craft h3,
body.theme-sketch-craft h4,
body.theme-sketch-craft h5,
body.theme-sketch-craft h6 {
  font-family: 'VT323', monospace !important;
  color: #000000 !important;
  text-shadow: 2px 2px 0px rgba(0,0,0,0.1);
  letter-spacing: 1px;
}
body.theme-sketch-craft p,
body.theme-sketch-craft span {
  color: #000000 !important;
}


@keyframes wobble {
  0%, 100% { filter: url(#wobble-1); }
  33% { filter: url(#wobble-2); }
  66% { filter: url(#wobble-3); }
}

body.theme-sketch-craft .card,
body.theme-sketch-craft .btn-primary,
body.theme-sketch-craft .btn-github,
body.theme-sketch-craft .gallery-item {
  border: 4px solid #000000 !important;
  background-color: #fff !important;
  box-shadow: 6px 6px 0px #000000 !important;
  border-radius: 2px !important;
  will-change: transform;
  position: relative !important;
  z-index: 1 !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.theme-sketch-craft .card::after {
  display: none !important;
}

body.theme-sketch-craft .card:hover {
  transform: translateY(-10px) scale(1.05) !important;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
  box-shadow: 8px 8px 0px rgba(0,0,0,0.8) !important;
}

/* Hide blobs in sketch mode */
body.theme-sketch-craft #bg-canvas,
body.theme-sketch-craft .ambient-blobs,
body.theme-sketch-craft .ambient-blob {
  display: none !important;
}

/* Highlighter underlines */
body.theme-sketch-craft a,
body.theme-sketch-craft h1,
body.theme-sketch-craft h2,
body.theme-sketch-craft h3 {
  position: relative;
  display: inline-block;
  z-index: 1;
}

body.theme-sketch-craft a:hover::after,
body.theme-sketch-craft h1:hover::after,
body.theme-sketch-craft h2:hover::after,
body.theme-sketch-craft h3:hover::after {
  content: "";
  position: absolute;
  bottom: 10%;
  left: -2%;
  width: 104%;
  height: 40%;
  background-color: rgba(234, 179, 8, 0.8); /* Yellow highlighter */
  z-index: -1;
  transform: rotate(-2deg);
  border-radius: 4px;
}

body.theme-sketch-craft .page-header h1,
body.theme-sketch-craft .page-header h2.sub-heading {
  background: none !important;
  -webkit-text-fill-color: initial !important;
  color: #111111 !important;
}

body.theme-sketch-craft .navbar {
  background: #f4f1ea !important;
  border-bottom: 4px solid #333 !important;
  box-shadow: 0 4px 0px rgba(0,0,0,0.8) !important;
}

/* Page-Specific Artistic Tweaks */

/* Lego Page Note-cards */
body.theme-sketch-craft.page-lego .card p {
  background-color: #fef08a !important; /* Pale yellow */
  padding: 1.5rem !important;
  color: #333 !important;
  position: relative;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.2) !important;
}

body.theme-sketch-craft.page-lego .card p::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  width: 40px;
  height: 15px;
  background-color: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0,0,0,0.1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  z-index: 2;
}

/* Python Hub Doodles */
body.theme-sketch-craft.page-python .card h3::after {
  content: " 🐍";
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

body.theme-sketch-craft.page-python .page-header h1::after {
  content: " 💻";
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}


body.theme-sketch-craft .btn-primary,
body.theme-sketch-craft .btn-github {
  background-color: var(--accent-color) !important;
  color: #000000 !important;
}

body.theme-sketch-craft a,
body.theme-sketch-craft button,
body.theme-sketch-craft .btn-primary,
body.theme-sketch-craft .btn-github,
body.theme-sketch-craft .magnetic-btn {
  color: #000000 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Sketchpad "Living" Aesthetics */
#sketch-doodles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  display: none;
}

body.theme-sketch-craft #sketch-doodles {
  display: block;
}

.doodle {
  position: absolute;
  font-size: 2rem;
  animation: float-doodle 3s ease-in-out infinite alternate;
}

.doodle-1 { top: 10%; left: 5%; animation-delay: 0s; }
.doodle-2 { top: 20%; right: 10%; animation-delay: 0.5s; font-size: 2.5rem; }
.doodle-3 { bottom: 15%; left: 15%; animation-delay: 1s; font-size: 1.8rem; }
.doodle-4 { bottom: 10%; right: 5%; animation-delay: 1.5s; font-size: 2.2rem; }

@keyframes float-doodle {
  from { transform: translateY(0px) rotate(0deg); }
  to { transform: translateY(-20px) rotate(10deg); }
}

/* Interactive Game Logic */

body.theme-sketch-craft .card:hover,
body.theme-sketch-craft .gallery-item:hover,
body.theme-sketch-craft .btn-primary:hover,
body.theme-sketch-craft .btn-github:hover,
body.theme-sketch-craft a.magnetic-btn:hover {
  animation: wobble 0.6s steps(1) infinite !important;
  will-change: filter, transform;
}
body.theme-sketch-craft .btn-primary:hover,
body.theme-sketch-craft .btn-github:hover,
body.theme-sketch-craft button:hover,
body.theme-sketch-craft a.magnetic-btn:hover {
  transform: translate(6px, 6px) !important;
  box-shadow: 0px 0px 0px #000000 !important;
  background-color: var(--accent-color) !important;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

@media (max-width: 768px) {
  body.theme-sketch-craft .card,
  body.theme-sketch-craft .btn-primary,
  body.theme-sketch-craft .btn-github,
  body.theme-sketch-craft .gallery-item,
  body.theme-sketch-craft .navbar,
  body.theme-sketch-craft *:hover {
    animation: none !important;
  }
}


/* ---------------------------------
   Interactive Live Playground
--------------------------------- */
.playground-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 3rem;
  border-radius: 12px;
}

@media (max-width: 768px) {
  .playground-container {
    grid-template-columns: 1fr;
  }
}

.playground-editor-pane,
.playground-console-pane {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.editor-header,
.console-header {
  padding: 0.75rem 1.25rem;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Syne', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-color);
}

#code-editor {
  flex-grow: 1;
  width: 100%;
  min-height: 250px;
  background: transparent;
  border: none;
  color: var(--text-color);
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  padding: 1rem;
  resize: vertical;
  outline: none;
}

#console-output {
  flex-grow: 1;
  margin: 0;
  padding: 1rem;
  background: #1e1e1e;
  color: #d4d4d4;
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  overflow-y: auto;
  min-height: 250px;
  white-space: pre-wrap;
}

/* Light Theme Overrides */
body.light-theme .playground-editor-pane,
body.light-theme .playground-console-pane {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}

body.light-theme .editor-header,
body.light-theme .console-header {
  background: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

body.light-theme #console-output {
  background: #282a36; /* Still dark for terminal feel */
  color: #f8f8f2;
}

/* Sketch-Craft Theme Overrides */
body.theme-sketch-craft .playground-editor-pane {
  background: #fefce8;
  background-image: repeating-linear-gradient(transparent, transparent 23px, rgba(0,0,0,0.1) 24px);
  background-size: 100% 24px;
  background-position: 0 1rem;
  border: 4px solid #000000 !important;
  border-radius: 2px;
  box-shadow: 4px 4px 0px #000000;
}

body.theme-sketch-craft .playground-console-pane {
  border: 4px solid #000000 !important;
  border-radius: 2px;
  box-shadow: 4px 4px 0px #000000;
}

body.theme-sketch-craft .editor-header,
body.theme-sketch-craft .console-header {
  border-bottom: 4px solid #000000 !important;
  background: transparent;
  color: #000000 !important;
  font-family: 'VT323', monospace;
  font-size: 1.2rem;
}

body.theme-sketch-craft #code-editor {
  color: #000000 !important;
  font-family: 'Caveat', cursive, monospace;
  font-size: 1.1rem;
  line-height: 24px; /* matches repeating gradient */
}

body.theme-sketch-craft #console-output {
  background: #1a1a1a;
  color: #22c55e; /* Terminal Green */
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
}

body.theme-sketch-craft #run-btn {
  font-family: 'VT323', monospace;
  border: 2px solid #000000 !important;
  border-radius: 0;
  box-shadow: 2px 2px 0px #000000;
  background-color: var(--accent-color) !important;
  color: #000000 !important;
}

body.theme-sketch-craft #run-btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 0px 0px 0px #000000;
}

body.theme-sketch-craft .btn-primary,
body.theme-sketch-craft .btn-github,
body.theme-sketch-craft .magnetic-btn,
body.theme-sketch-craft button {
  color: #000000 !important;
  border-color: #000000 !important;
}
