/* Theme */
:root {
  --brand: #6b65f6;
  --brand-dark: #4c46d8;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --bg: #0f1117;
  --surface: #151823;
  --border: #232633;
  /* Page transition variables */
  --section-anim-duration: 480ms;
  --section-anim-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --section-anim-distance: 32px;
  /* Avatar movement slightly slower than section transition */
  --avatar-move-duration: 650ms;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 600px at 20% 0%, #121522 0%, var(--bg) 60%), var(--bg);
  line-height: 1.6;
}

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

/* Header (dark) */
.site-header {
  position: sticky;
  top: 0;
  background: #0f1117; /* solid dark fallback */
  border-bottom: 1px solid var(--border);
  z-index: 50;
}
@supports (backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px)) {
  .site-header {
    background: rgba(15,17,23,0.6);
    -webkit-backdrop-filter: saturate(160%) blur(8px);
    backdrop-filter: saturate(160%) blur(8px);
  }
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
}
.brand { display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.brand-name { font-weight: 700; color: var(--text); }
.site-nav { display: flex; align-items: center; gap: 0.5rem; }
.site-nav a {
  color: var(--text);
  text-decoration: none;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
}
.site-nav a:hover { background: var(--surface); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
}
.nav-toggle .bar {
  width: 22px; height: 2px; background: var(--text); border-radius: 1px;
}

/* Hero */
.hero {
  padding: 5rem 0 3.5rem;
  background: linear-gradient(180deg, #fafaff 0%, #ffffff 100%);
}
.hero-inner { text-align: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 0.75rem; }
.hero p { color: var(--muted); margin: 0 0 1.5rem; }
.hero-actions { display: inline-flex; gap: 0.75rem; }

.btn {
  display: inline-block;
  padding: 0.65rem 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
}
.btn.ghost { background: transparent; }
.btn.primary { border-color: transparent; background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn[aria-disabled="true"] { opacity: 0.6; pointer-events: none; }

/* Sections */
.section { padding: 3rem 0; }
.section h2 { font-size: 1.75rem; margin: 0 0 1rem; }
.section p { color: var(--muted); }

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 1rem;
}
.card h3 { margin: 0 0 0.5rem; font-size: 1.125rem; }
.card p { margin: 0; color: var(--muted); }

/* Contact */
.contact-actions { display: flex; gap: 0.75rem; margin-top: 1rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 1rem 0; background: #fff; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; }
.footer-inner small { color: var(--muted); }
.social a { color: var(--muted); text-decoration: none; margin-left: 0.75rem; }
.social a:hover { color: var(--text); }

/* Product */
.product-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, var(--surface) 100%);
  padding: 1.25rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.04);
}
.product-content p { margin: 0 0 1rem; }
.features { margin: 0 0 1rem; padding-left: 1.2rem; color: var(--muted); }
.features li { margin: 0.35rem 0; }
.product-actions { display: flex; gap: 0.75rem; }
.btn.steam { display: inline-flex; align-items: center; gap: 0.5rem; background: #121316; color: #fff; border-color: transparent; }
.btn.steam:hover { background: #1f2227; }
.btn .icon { width: 18px; height: 18px; }

/* Single-section layout */
.single { padding: 5rem 0 3.5rem; }
.single-inner { text-align: center; }
.product-img {
  width: min(900px, 92%);
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
}
.single h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); margin: 1rem 0 0.5rem; }
.single .subtitle { color: var(--muted); margin: 0 0 1.25rem; }
.actions { display: inline-flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; }

/* Wishlist image button */
.wishlist-btn {
  display: inline-block;
  border: none;
  background: transparent;
  line-height: 0;
}
.wishlist-btn img {
  display: block;
  width: min(340px, 85vw);
  height: auto;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}
.wishlist-btn:hover img { transform: translateY(-1px); transition: transform 120ms ease; }
.wishlist-btn:focus-visible img { outline: 2px solid var(--brand); outline-offset: 4px; }

/* Notify form */
.notify { margin-top: 2.25rem; }
.notify h2 { margin: 0 0 0.75rem; font-size: 1.4rem; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.label { color: var(--muted); font-size: 0.9rem; }
.input {
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}
.input::placeholder { color: #7b8190; }
.hp { position: absolute; left: -9999px; opacity: 0; }
.form-actions { margin-top: 0.75rem; }
.form-status { margin-top: 0.5rem; color: var(--muted); }

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

/* Responsive */
@media (max-width: 900px) {
  .cards { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute;
    right: 4%;
    top: 52px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.5rem;
    display: none;
    flex-direction: column;
    min-width: 200px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.06);
  }
  .site-nav.open { display: flex; }
}

/* --- Portfolio UI Refresh --- */
.portfolio-hero {
  padding: 6rem 0 3rem;
  background: radial-gradient(1200px 400px at 20% -20%, rgba(255, 0, 180, 0.12), transparent 60%),
              radial-gradient(800px 300px at 90% 0%, rgba(0, 200, 255, 0.12), transparent 60%);
  position: relative;
  overflow: hidden;
}
/* Full-page VANTA.NET backdrop */
.site-net-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0; /* behind main content but visible */
  pointer-events: none; /* prevent blocking taps on mobile */
}
main {
  position: relative;
  z-index: 1;
  overflow-x: hidden;
  display: grid;
  /* ensure in-page scroll lands above fixed nav/footer */
  scroll-padding-bottom: calc(var(--safe-bottom, 5.5rem) + env(safe-area-inset-bottom));
}
/* Overlay sections in the same grid cell so transitions don't push layout */
main > section {
  grid-area: 1 / 1;
  /* keep last content visible above nav/footer */
  padding-bottom: calc(var(--safe-bottom, 5.5rem) + env(safe-area-inset-bottom));
}
.portfolio-title {
  position: relative;
  margin: 0 0 0.5rem 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: grid;
  place-items: center;
  text-align: center;
}
.portfolio-title .title-backdrop {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  transform-origin: center;
  width: min(1100px, 92vw);
  height: clamp(180px, 24vw, 260px);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.18);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  z-index: 0;
}
.portfolio-title .title-fill { display: none; }
.title-outline #titleText { filter: drop-shadow(0 0 10px rgba(0,0,0,0.8)); }
.title-outline { display: block; width: min(1100px, 92vw); height: auto; overflow: visible; text-rendering: geometricPrecision; shape-rendering: geometricPrecision; position: relative; z-index: 1; }
.portfolio-tagline {
  margin: 0;
  opacity: 0.8;
}
/* Animated subtitle with fade-in bars */
.portfolio-subtitle { position: relative; z-index: 1; margin-top: 0.35rem; }
.fadebars { display: inline-block; padding: 0.125rem 0.25rem; overflow: hidden; }
.fadebars__text { opacity: 0; filter: saturate(120%); animation: fadebars-text-in 900ms ease forwards; animation-delay: 400ms; }
.fadebars__bar { position: absolute; left: 0; top: calc(var(--i) * (100% / 3)); height: calc(100% / 3 - 2px); width: 100%; border-radius: 6px; background: linear-gradient(135deg, rgba(255,79,216,0.8), rgba(122,92,255,0.8), rgba(48,213,255,0.8)); box-shadow: 0 0 14px rgba(0,0,0,0.35); will-change: transform, opacity; animation: fadebars-sweep 1600ms ease-in-out infinite alternate; animation-delay: calc(var(--i) * 160ms); pointer-events: none; }
@keyframes fadebars-text-in {
  0% { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes fadebars-sweep {
  0% { transform: translateX(-120%); opacity: 0.85; }
  50% { transform: translateX(0%); opacity: 0.85; }
  100% { transform: translateX(120%); opacity: 0.35; }
}

.portfolio-hero .container { position: relative; z-index: 1; }
.portfolio-hero canvas { position: absolute !important; inset: 0; z-index: 0; }

/* Layer NET behind projects content */
.projects { position: relative; overflow: hidden; }
.projects .container { position: relative; z-index: 1; }

/* Layer NET behind games content */
.games { position: relative; overflow: hidden; }
.games .container { position: relative; z-index: 1; }

/* Layer NET behind animations content */
.animations { position: relative; overflow: hidden; }
.animations .container { position: relative; z-index: 1; }

.projects .section-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin: 0 0 0.25rem 0;
}
.projects .section-subtitle {
  margin: 0 0 2rem 0;
  opacity: 0.7;
}

/* --- Typewriter Demos --- */
/* --- Matrix Banner (Projects) --- */
.projects .matrix-container {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  height: auto;
  padding: 6px 12px;
  margin: 0 auto 1rem;
  background: #000;
  overflow: hidden;
  border-radius: 8px;
}
.games .matrix-container {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  height: auto;
  padding: 6px 12px;
  margin: 0 auto 1rem;
  background: #000;
  overflow: hidden;
  border-radius: 8px;
}
.animations .matrix-container {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  height: auto;
  padding: 6px 12px;
  margin: 0 auto 1rem;
  background: #000;
  overflow: hidden;
  border-radius: 8px;
}
.projects .matrix-text {
  font-size: clamp(20px, 3.8vw, 36px);
  font-family: monospace;
  position: relative;
  z-index: 2;
  color: transparent;
  background: linear-gradient(135deg, #ff4fd8, #7a5cff 50%, #30d5ff);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: 0 0 10px rgba(122,92,255,0.6), 0 0 20px rgba(48,213,255,0.5);
}
.games .matrix-text {
  font-size: clamp(20px, 3.8vw, 36px);
  font-family: monospace;
  position: relative;
  z-index: 2;
  color: transparent;
  background: linear-gradient(135deg, #ff4fd8, #7a5cff 50%, #30d5ff);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: 0 0 10px rgba(122,92,255,0.6), 0 0 20px rgba(48,213,255,0.5);
}
.animations .matrix-text {
  font-size: clamp(20px, 3.8vw, 36px);
  font-family: monospace;
  position: relative;
  z-index: 2;
  color: transparent;
  background: linear-gradient(135deg, #ff4fd8, #7a5cff 50%, #30d5ff);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: 0 0 10px rgba(122,92,255,0.6), 0 0 20px rgba(48,213,255,0.5);
}
.projects .matrix-text::before {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  animation: glitch 2s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
  transform: translate(-2px, -2px);
  color: transparent;
  background: linear-gradient(135deg, #30d5ff, #7a5cff 50%, #ff4fd8);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: 0 0 6px rgba(255,79,216,0.4), 0 0 12px rgba(48,213,255,0.4);
}
.games .matrix-text::before {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  animation: glitch 2s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
  transform: translate(-2px, -2px);
  color: transparent;
  background: linear-gradient(135deg, #30d5ff, #7a5cff 50%, #ff4fd8);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: 0 0 6px rgba(255,79,216,0.4), 0 0 12px rgba(48,213,255,0.4);
}
.animations .matrix-text::before {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  animation: glitch 2s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
  transform: translate(-2px, -2px);
  color: transparent;
  background: linear-gradient(135deg, #30d5ff, #7a5cff 50%, #ff4fd8);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: 0 0 6px rgba(255,79,216,0.4), 0 0 12px rgba(48,213,255,0.4);
}
.projects .rain {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255,79,216,0.22), rgba(122,92,255,0.22) 50%, rgba(48,213,255,0.22)),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.08) 0, rgba(255,255,255,0.12) 2px, transparent 4px);
  animation: rain 10s linear infinite;
  z-index: 1;
}
.games .rain {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255,79,216,0.22), rgba(122,92,255,0.22) 50%, rgba(48,213,255,0.22)),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.08) 0, rgba(255,255,255,0.12) 2px, transparent 4px);
  animation: rain 10s linear infinite;
  z-index: 1;
}
.animations .rain {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255,79,216,0.22), rgba(122,92,255,0.22) 50%, rgba(48,213,255,0.22)),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.08) 0, rgba(255,255,255,0.12) 2px, transparent 4px);
  animation: rain 10s linear infinite;
  z-index: 1;
}
@keyframes rain {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}
@keyframes glitch {
  0%, 100% {
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
    transform: translate(0);
  }
  33% {
    clip-path: polygon(0 0, 100% 0, 100% 15%, 0 15%);
    transform: translate(-5px, -5px);
  }
  66% {
    clip-path: polygon(0 85%, 100% 85%, 100% 100%, 0 100%);
    transform: translate(5px, 5px);
  }
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.project-card {
  background: rgba(20, 20, 24, 0.6);
  -webkit-backdrop-filter: saturate(160%) blur(6px);
  backdrop-filter: saturate(160%) blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.project-card:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(0,0,0,0.45); }

.project-thumb {
  position: relative;
  height: 180px;
  background: #0f0f12;
}
.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.05);
}
.thumb-svg { width: 100%; height: 100%; display: block; }

/* Flowtrix thumbnail: keep subject centered and avoid tight crop on wide screens */
.project-thumb--flowtrix img {
  object-fit: contain;
  object-position: center;
  background-color: #0f0f12; /* fill remaining area nicely */
}

@media (max-width: 640px) {
  .project-thumb--flowtrix img {
    object-fit: cover; /* use cover on mobile to fill area */
    object-position: center top; /* bias to top for banner subject */
  }
}
.project-thumb--gradient {
  background: linear-gradient(135deg, #ff4fd8 0%, #7a5cff 50%, #30d5ff 100%);
}
.thumb-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: clamp(28px, 5vw, 48px);
  letter-spacing: 0.5px;
  color: transparent;
  background: linear-gradient(135deg, #ff4fd8 0%, #7a5cff 50%, #30d5ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: 0 2px 10px rgba(0,0,0,0.45);
}
.games .thumb-label {
  /* Improve readability of game names over busy thumbnails */
  color: #ffffff;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  text-shadow: 0 2px 12px rgba(0,0,0,0.65), 0 0 1px rgba(0,0,0,0.85);
}
/* Ensure Games slider labels use solid white even without .games wrapper */
#games-slider .thumb-label {
  color: #ffffff;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  text-shadow: 0 2px 12px rgba(0,0,0,0.65), 0 0 1px rgba(0,0,0,0.85);
}
.thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55), rgba(0,0,0,0.2));
}

.project-body { padding: 1rem 1rem 1.25rem; }
.project-title { margin: 0 0 0.35rem 0; font-size: 1.125rem; }
.project-desc { margin: 0 0 0.75rem 0; opacity: 0.85; }
.project-meta { display: flex; gap: 0.75rem; color: var(--muted); font-size: 0.85rem; margin-bottom: 0.75rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.75rem; }
.tag { display: inline-flex; align-items: center; padding: 0.25rem 0.5rem; border: 1px solid rgba(255,255,255,0.12); border-radius: 999px; font-size: 0.8rem; color: var(--text); background: rgba(255,255,255,0.04); }
.project-actions { display: flex; gap: 0.75rem; }

/* AR/VR counters: make numbers prominent */
.projects.arvr .thumb-svg .counter-text {
  font-size: clamp(52px, 8vw, 88px);
  font-weight: 900;
  line-height: 1;
}
/* Give AR/VR thumbnails extra height so large numbers don’t crowd */
.projects.arvr .project-thumb {
  height: clamp(190px, 30vw, 260px);
}
.projects.arvr .thumb-svg { width: 100%; height: 100%; }

.btn.primary {
  background: linear-gradient(135deg, #ff4fd8 0%, #7a5cff 50%, #30d5ff 100%);
  color: #fff;
  border: none;
}
.btn.primary:hover { opacity: 0.95; }

@media (hover: hover) {
  .project-card:hover .project-thumb img { transform: scale(1.02); transition: transform 200ms ease; }
}

/* Responsive tweaks */
@media (max-width: 640px) {
  .title-outline { width: min(900px, 94vw); }
  .portfolio-subtitle { font-size: 0.95rem; }
  .projects .matrix-text, .games .matrix-text, .animations .matrix-text { font-size: clamp(18px, 5.5vw, 28px); }
  .project-grid { grid-template-columns: 1fr; }
  .project-thumb { height: 150px; }
}
/* Slider styles for Games section */
.slider {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.slider-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  /* Center the first/last slide when snapped */
  scroll-padding-left: calc((100% - 50%) / 2);
  scroll-padding-right: calc((100% - 50%) / 2);
}

/* Modernize: hide scrollbar, smoother scroll, prevent rubber-banding */
.slider-track {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge legacy */
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

.slider-track::-webkit-scrollbar { /* WebKit */
  display: none;
}

.slider-track > .project-card {
  flex: 0 0 50%; /* half-width cards on desktop */
  scroll-snap-align: center;
  aspect-ratio: 1 / 1; /* square slides */
  overflow: hidden;
}

/* Tablet: slightly larger cards, still peek next */
@media (min-width: 641px) and (max-width: 1024px) {
  .slider-track > .project-card {
    flex-basis: 60%;
  }
  .slider-track {
    scroll-padding-left: calc((100% - 60%) / 2);
    scroll-padding-right: calc((100% - 60%) / 2);
  }
}

/* Mobile: larger cards for comfortable touch */
@media (max-width: 640px) {
  .slider-track > .project-card {
    flex-basis: 85%;
  }
  .slider-track {
    scroll-padding-left: calc((100% - 85%) / 2);
    scroll-padding-right: calc((100% - 85%) / 2);
  }
}

/* Ensure mobile cards are horizontally centered when snapped */
@media (max-width: 640px) {
  .slider-track > .project-card {
    margin-inline: auto;
  }
}

.slider {
  padding: 0 0.75rem; /* space at edges to glimpse next */
}

.slider-track {
  gap: 1rem; /* spacing between slides to reveal peek */
  padding-bottom: 2rem; /* room for dots overlay */
}

.slider .project-card {
  margin: 0;
}

.slider .project-body {
  display: none; /* keep slides visually square and uncluttered */
}

.slider .project-thumb {
  height: 100%; /* fill the square */
}

.slider-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.75rem;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  pointer-events: none; /* only dots receive clicks */
}

.slider-dot {
  pointer-events: auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  cursor: pointer;
  border: 0;
  background: linear-gradient(90deg, #ff4fd8, #7a5cff, #30d5ff);
  background-size: 200% 200%;
  animation: dotGradient 6s linear infinite;
  box-shadow: 0 0 8px rgba(122, 92, 255, 0.45);
  opacity: 0.55;
}

.slider-dot.active {
  opacity: 1;
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(122, 92, 255, 0.6), 0 0 16px rgba(48, 213, 255, 0.5);
}

.slider-dot:hover {
  opacity: 0.85;
}

@keyframes dotGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.slider-controls {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transform: translateY(-50%);
  pointer-events: none; /* allow clicks only on buttons */
}

.slider-btn {
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  backdrop-filter: blur(4px);
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.slider-btn:hover {
  background: rgba(0, 0, 0, 0.6);
}

/* Edge click zones for manual control */
.slider-edge {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 22%;
  pointer-events: auto;
  cursor: pointer;
}

.slider-edge.prev-zone { left: 0; }
.slider-edge.next-zone { right: 0; }

.slider-edge:focus-visible {
  outline: 2px solid rgba(255,255,255,0.6);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .slider-edge { width: 28%; }
}

/* Mobile centering of game cards */
@media (max-width: 640px) {
  .slider {
    min-height: 70vh;
    display: grid;
    place-items: center;
  }
  .slider-track {
    align-items: center;
  }
}

@media (max-width: 640px) {
  .slider-btn {
    font-size: 1rem;
    padding: 0.4rem 0.6rem;
  }
}
/* Responsive video embed for Showreel */
.video-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Showreel integration: center and fit within project card styles */
.projects.showreel .project-grid {
  place-items: center;
  grid-template-columns: 1fr; /* single centered card */
}
.projects.showreel .project-card {
  width: min(900px, 92vw);
  margin: 0 auto;
  aspect-ratio: 16 / 9; /* ensure entire card keeps 16:9 */
}
.projects.showreel .project-thumb {
  height: 100%; /* fill the card's 16:9 height */
  position: relative; /* ensure overlay and iframe absolute children anchor here */
  background: transparent;
}
.projects.showreel .project-body { display: none; }

/* Make the embed fill the card instead of using padding-bottom */
.projects.showreel .video-embed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding-bottom: 0; /* override 16:9 padding trick */
  border-radius: 16px; /* match card radius */
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}
.projects.showreel .video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Unmute overlay styled to match site aesthetics */
.projects.showreel .video-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: transparent; /* fully transparent overlay per request */
  pointer-events: none; /* do not block clicks; visual only */
  touch-action: manipulation; /* improve tap responsiveness on mobile */
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  z-index: 2;
}
.projects.showreel .video-overlay .video-unmute {
  pointer-events: auto;
  border: none;
  background: transparent !important; /* keep button transparent over video */
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  color: #ffffff;
  text-shadow: 0 0 6px rgba(0,0,0,0.6);
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
}

/* Mobile optimizations for showreel overlay/button */
@media (max-width: 600px) {
  .projects.showreel .project-card {
    width: 96vw;
    border-radius: 12px;
  }
  .projects.showreel .video-embed {
    border-radius: 12px;
  }
  .projects.showreel .video-overlay .video-unmute {
    font-size: 1rem;
    padding: 0.6rem 0.9rem;
    line-height: 1.2;
  }

/* Below-video controls container */
.projects.showreel .video-controls {
  display: flex;
  justify-content: center;
  margin-top: 0.6rem;
}
}
/* end showreel mobile */
/* Shortfilm embed overlay in animations section */
.animations .shortfilm-embed .video-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(to top, rgba(0,0,0,0.45), rgba(0,0,0,0.2));
  z-index: 2;
}
.animations .shortfilm-embed .video-unmute { pointer-events: auto; border: none; }
.animations .shortfilm-embed .project-thumb { height: auto; background: transparent; }
.animations .shortfilm-embed .project-thumb { position: relative; }
.animations .shortfilm-grid {
  place-items: center;
  grid-template-columns: 1fr; /* single centered card */
}
.animations .shortfilm-grid .project-card {
  width: min(900px, 92vw);
  margin: 0 auto;
}
.animations .shortfilm-embed .project-body {
  padding: 0.85rem 1rem 0.35rem;
  text-align: center;
}

/* ---- Game details modal (Jeeno) ---- */
.game-modal.hidden { display: none; }
.game-modal {
  position: fixed;
  inset: 0;
  z-index: 3000; /* above avatar/bubble overlay on mobile */
}
.game-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(3px);
}
.game-modal-dialog {
  position: relative;
  width: min(720px, 92vw);
  margin: 8vh auto;
  background: rgba(20,20,28,0.9);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 10px 40px rgba(0,0,0,0.45);
  border-radius: 16px;
  padding: 1rem 1.2rem 1.2rem;
  color: #e9e9ef;
  outline: none;
  max-height: calc(90vh - 12px);
  overflow-y: auto; /* ensure long descriptions remain visible */
}
.game-modal-title { margin: 0 2.2rem 0.6rem 0; font-size: 1.25rem; }
.game-modal-desc { margin: 0; line-height: 1.5; opacity: 0.9; white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.game-modal-close {
  position: absolute;
  top: 0.4rem;
  right: 0.6rem;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}

@media (max-width: 640px) {
  .game-modal-dialog {
    width: calc(100vw - 20px);
    margin: 6vh auto;
    padding: 0.9rem 1rem;
    max-height: calc(88vh - 10px);
  }
  .game-modal-title { font-size: 1.1rem; margin-right: 2rem; }
}
/* Section-by-section navigation */
.section-hidden { display: none !important; }
.section-next-btn {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1000;
}
.section-prev-btn {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 1000;
}

/* Centered bottom nav bar for Previous, Home, Next */
.section-nav-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + 2.5rem); /* leave room for footer below */
  z-index: 1000;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  backface-visibility: hidden;
  transition: opacity 300ms ease;
}
.section-nav-bar .section-prev-btn,
.section-nav-bar .section-next-btn {
  position: static; /* use container positioning */
}
.section-nav-bar .btn {
  min-width: 120px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
/* When auto-faded, keep Home and Next fully visible; soften Previous only */
.section-nav-bar.nav-faded .section-prev-btn { opacity: 0.18; }
.section-nav-bar.nav-faded .section-home-btn,
.section-nav-bar.nav-faded .section-next-btn { opacity: 1; }

/* Hover highlight for buttons */
.btn:hover,
.btn:focus-visible { filter: brightness(1.06); box-shadow: 0 0 10px rgba(122, 92, 255, 0.35); transition: box-shadow 180ms ease, filter 180ms ease; }
.section-nav-bar .btn:hover,
.section-nav-bar .btn:focus-visible { transform: translateY(-1px); }

/* First-page section menu */
.section-index {
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 2; /* ensure above hero backdrop/canvas */
}
.section-index .btn {
  width: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.16);
  background: transparent;
  font-family: monospace;
  font-weight: 800;
  font-size: clamp(14px, 2.3vw, 18px);
  color: transparent;
  background-image: linear-gradient(135deg, #ff4fd8, #7a5cff 50%, #30d5ff);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: 0 0 10px rgba(122,92,255,0.55), 0 0 18px rgba(48,213,255,0.45);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, color 160ms ease, background 160ms ease, border-color 160ms ease;
}
.section-index .btn:hover,
.section-index .btn:focus-visible {
  color: #fff;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  background-image: linear-gradient(135deg, #ff4fd8, #7a5cff 50%, #30d5ff);
  box-shadow: 0 0 14px rgba(122,92,255,0.55), 0 0 22px rgba(48,213,255,0.45);
  border-color: rgba(255,255,255,0.28);
  transform: translateY(-1px);
}
.section-index .btn:active { transform: translateY(0); box-shadow: 0 0 10px rgba(122,92,255,0.45), 0 0 16px rgba(48,213,255,0.35); }

/* Fixed footer below the nav bar */
.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000; /* above everything */
  width: 100%;
  padding: 0.5rem 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: saturate(140%) blur(6px);
  backdrop-filter: saturate(140%) blur(6px);
  border-top: 1px solid rgba(255,255,255,0.14);
  pointer-events: none; /* ensure it doesn't block clicks */
}

/* Section transition animations */
.section-animated {
  will-change: opacity, transform;
  transition: opacity var(--section-anim-duration) var(--section-anim-ease),
              transform var(--section-anim-duration) var(--section-anim-ease);
}

/* Forward navigation (next) */
.section-enter-forward { opacity: 0; transform: translate3d(var(--section-anim-distance), 0, 0); }
.section-exit-forward { opacity: 1; transform: translateX(0); }
.section-exit-forward.section-exit-active { opacity: 0; transform: translate3d(calc(var(--section-anim-distance) * -1), 0, 0); }
.section-enter-forward.section-enter-active { opacity: 1; transform: translateX(0); }

/* Backward navigation (prev) */
.section-enter-back { opacity: 0; transform: translate3d(calc(var(--section-anim-distance) * -1), 0, 0); }
.section-exit-back { opacity: 1; transform: translateX(0); }
.section-exit-back.section-exit-active { opacity: 0; transform: translate3d(var(--section-anim-distance), 0, 0); }
.section-enter-back.section-enter-active { opacity: 1; transform: translateX(0); }

@media (prefers-reduced-motion: reduce) {
  .section-animated { transition: none; }
}

/* Hidden sections remain non-interactive */
.section-hidden { display: none !important; }

/* ---- Avatar guide overlay ---- */
.avatar-guide {
  position: fixed;
  left: 50%;
  /* slide horizontally near the footer using CSS variable */
  --avatar-offset: 0vw;
  --avatar-rest-offset: 0px; /* default resting offset (computed in JS) */
  /* allow intro animation to drift vertically */
  transform: translateX(calc(-50% + var(--avatar-offset))) translateY(var(--avatar-intro-y, 0px));
  /* vertically anchor via CSS variable set from JS */
  --avatar-bottom: 3.2rem;
  bottom: var(--avatar-bottom);
  z-index: 2200; /* above footer */
  display: flex;
  flex-direction: column-reverse; /* bubble above avatar */
  align-items: center;
  gap: 8px;
  pointer-events: none; /* don’t block clicks */
  transition: transform var(--avatar-move-duration, var(--section-anim-duration)) var(--section-anim-ease);
}
.avatar-guide.avatar-no-transition { transition: none !important; }
.avatar-guide .avatar-img {
  width: clamp(96px, 12vw, 140px);
  height: auto;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,0.35));
}
.speech-bubble {
  --bubble-shift: 0px; /* JS sets this to keep bubble inside viewport */
  max-width: min(90vw, 520px);
  box-sizing: border-box;
  position: relative; /* keep tail aligned to bubble */
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  white-space: pre-line; /* preserve \n as line breaks */
  background: rgba(0,0,0,0.55);
  -webkit-backdrop-filter: saturate(140%) blur(6px);
  backdrop-filter: saturate(140%) blur(6px);
  color: var(--text);
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  opacity: 0;
  transform: translateY(8px) translateX(var(--bubble-shift));
  transition: opacity 260ms ease, transform 260ms ease;
}
.speech-bubble.bubble-show { opacity: 1; transform: translateY(0); }
.speech-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: rgba(0,0,0,0.55);
  border-left: 1px solid rgba(255,255,255,0.14);
  border-bottom: 1px solid rgba(255,255,255,0.14);
  transform: translateX(-50%) rotate(45deg);
}

@media (max-width: 600px) {
  .speech-bubble {
    max-width: calc(100vw - 24px); /* leave 12px margin on both sides */
    max-height: calc(60vh); /* cap bubble height to stay within screen */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 0.95rem;
  }
}

@keyframes avatar-forward {
  from { transform: translateX(calc(-50% - 30vw)); }
  to { transform: translateX(-50%); }
}
@keyframes avatar-back {
  from { transform: translateX(calc(-50% + 30vw)); }
  to { transform: translateX(-50%); }
}
.avatar-guide.move-forward { animation: avatar-forward var(--section-anim-duration) var(--section-anim-ease); }
.avatar-guide.move-back { animation: avatar-back var(--section-anim-duration) var(--section-anim-ease); }
/* ===== Cyberpunk Loading Overlay ===== */
body.is-loading {
  overflow: hidden;
}
/* Hide main UI while loading to avoid flicker */
body.is-loading main,
body.is-loading .avatar-guide,
body.is-loading .section-nav-bar,
body.is-loading .site-footer {
  visibility: hidden;
}
/* Fullscreen overlay using body pseudo-elements to avoid extra markup */
body.is-loading::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: all;
  /* Cyberpunk-ish background: dark with neon gradient and scanlines */
  background:
    radial-gradient(1200px 600px at 20% 10%, rgba(0, 247, 255, 0.12), transparent 60%),
    radial-gradient(900px 450px at 80% 90%, rgba(255, 0, 225, 0.11), transparent 60%),
    linear-gradient(180deg, rgba(12, 16, 24, 0.98), rgba(6, 8, 12, 0.98)),
    repeating-linear-gradient(180deg, rgba(255,255,255,0.04) 0px, rgba(255,255,255,0.0) 2px, rgba(0,0,0,0.0) 4px);
}
/* Loading overlay content container */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 1;
  transition: opacity 420ms ease;
}
.loading-overlay.fade-out { opacity: 0; }
.loading-title {
  color: #00f7ff;
  font-size: clamp(18px, 3.5vw, 28px);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-shadow:
    0 0 6px rgba(0, 247, 255, 0.8),
    0 0 18px rgba(0, 247, 255, 0.5),
    0 0 32px rgba(255, 0, 225, 0.3);
  animation: neonFlicker 2.2s infinite;
}
@keyframes neonFlicker {
  0%, 100% { opacity: 1; filter: drop-shadow(0 0 8px rgba(0, 247, 255, 0.7)); }
  38% { opacity: 0.92; }
  42% { opacity: 0.75; }
  45% { opacity: 0.98; }
  70% { opacity: 0.88; }
}
.loading-rotator {
  margin-top: 0.75rem;
  color: #ff00e1;
  font-size: clamp(14px, 2.4vw, 22px);
  letter-spacing: 0.06em;
  opacity: 0;
  transition: opacity 350ms ease;
}
.loading-rotator.show { opacity: 1; }
.loading-bar {
  margin-top: 1.25rem;
  width: min(480px, 76vw);
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
  box-shadow: 0 0 10px rgba(0, 247, 255, 0.2) inset;
}
.loading-progress {
  width: var(--loading-progress, 0%);
  height: 100%;
  background: linear-gradient(90deg, #00f7ff, #ff00e1);
  filter: drop-shadow(0 0 6px rgba(0, 247, 255, 0.6));
  transition: width 260ms ease;
}