@import url('https://fonts.googleapis.com/css2?family=Permanent+Marker&family=Press+Start+2P&family=VT323&display=swap');

:root {
  --neon-orange: #ff7700;
  --neon-cyan: #00ffff;
  --neon-green: #39ff14;
  --neon-pink: #ff00ff;
  --bg-dark: #050508;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-touch-callout: none;
}

body {
  background-color: #1a1a1a;
  overflow: hidden;
  font-family: 'VT323', monospace;
  color: var(--neon-orange);
  width: 100vw;
  height: 100vh;
}

/* Fullscreen WebGL Canvas */
#webgl-canvas {
  position: fixed;
  inset: 0;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 1;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
}

/* Back / Return Button */
.btn-back {
  position: absolute;
  top: 14px;
  left: 18px;
  z-index: 40;
  padding: 8px 14px;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.68rem;
  color: var(--neon-cyan);
  border: 2px solid var(--neon-cyan);
  background: rgba(5, 5, 8, 0.85);
  cursor: pointer;
  display: none;
  letter-spacing: 1px;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  touch-action: manipulation;
}

.btn-back:hover,
.btn-back:active {
  background: var(--neon-cyan);
  color: #03080c;
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.6);
}

/* =========================================================================
   MOBILE DEDICATED LEFT PROJECT MENU
   ========================================================================= */
#mobile-project-menu {
  position: fixed;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: none;
  flex-direction: column;
  gap: 8px;
  max-width: 220px;
  pointer-events: auto;
}

.mobile-menu-item {
  background: rgba(5, 5, 8, 0.9);
  border: 2px solid var(--neon-cyan);
  color: var(--neon-cyan);
  padding: 6px 10px;
  font-family: 'VT323', monospace;
  font-size: 1.35rem;
  line-height: 1.1;
  text-align: left;
  cursor: pointer;
  letter-spacing: 1px;
  text-transform: uppercase;
  touch-action: manipulation;
  box-shadow: 0 0 8px rgba(0, 255, 255, 0.2);
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.mobile-menu-item:active {
  background: var(--neon-cyan);
  color: #050508;
  transform: scale(0.96);
}

/* =========================================================================
   UNIVERSAL FULLSCREEN OVERLAYS
   ========================================================================= */
.fullscreen-detail-view {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh; /* Adapts to dynamic mobile browser address bars */
  background-color: var(--bg-dark);
  z-index: 25;
  display: none;
  opacity: 1;
  pointer-events: none;
  padding: 52px 16px 14px 16px;
  overflow: hidden;
  box-sizing: border-box;
  font-family: 'Press Start 2P', monospace;
  color: var(--neon-cyan);

  clip-path: circle(0% at 50% 50%);
  -webkit-clip-path: circle(0% at 50% 50%);
}

.fullscreen-detail-view.active {
  display: flex;
  justify-content: center;
  align-items: stretch;
  pointer-events: auto;
}

/* Two-Column Grid */
.project-modal-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 1.6fr;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  opacity: 0;
  align-items: center;
}

/* Left Stack with Dedicated Scroll Buffer */
.project-left-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  max-height: 100%;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  padding-right: 6px;
  padding-bottom: 80px; /* Buffer so bottom elements never cut off */
  touch-action: pan-y;
  overscroll-behavior: contain;
}

.project-left-col::-webkit-scrollbar {
  width: 4px;
}
.project-left-col::-webkit-scrollbar-thumb {
  background: var(--neon-cyan);
}

.project-card {
  border: 2px solid var(--neon-cyan);
  background: rgba(0, 255, 255, 0.04);
  padding: 12px 14px;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.12);
  flex-shrink: 0;
}

.project-card-title {
  font-family: 'VT323', monospace;
  font-size: clamp(1.8rem, 3.2vw, 2.8rem);
  color: var(--neon-orange);
  text-shadow: 0 0 10px rgba(255, 119, 0, 0.6);
  margin: 0;
  line-height: 1.05;
  letter-spacing: 2px;
}

.project-card-desc {
  font-family: 'VT323', monospace;
  font-size: 1.45rem;
  line-height: 1.3;
  color: #f0ece1;
}

.project-card-tags-header,
.project-card-links-header {
  font-size: 0.65rem;
  color: var(--neon-green);
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.project-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-tag {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.55rem;
  background: rgba(57, 255, 20, 0.12);
  color: var(--neon-green);
  border: 1px solid var(--neon-green);
  padding: 4px 6px;
}

.project-links-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.project-ext-link {
  font-family: 'VT323', monospace;
  font-size: 1.45rem;
  color: var(--neon-cyan);
  text-decoration: none;
  touch-action: manipulation;
  transition: transform 0.2s ease, color 0.2s ease;
}

.project-ext-link:hover,
.project-ext-link:active {
  color: var(--neon-pink);
  transform: translateX(6px);
}

.project-coming-soon {
  font-family: 'VT323', monospace;
  font-size: 1.45rem;
  color: #888888;
  letter-spacing: 2px;
}

.scroll-buffer-spacer {
  height: 40px;
  flex-shrink: 0;
  width: 100%;
}

/* Right Column (Video) - Fully scaled and constrained */
.project-right-col {
  border: 2px solid var(--neon-orange);
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  max-height: calc(100dvh - 72px);
  width: 100%;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 16px rgba(255, 119, 0, 0.25);
  box-sizing: border-box;
}

.project-video-element {
  width: 100%;
  height: 100%;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain !important;
  background: #000;
  display: block;
}

/* Socials & About Overlays */
.detail-content {
  opacity: 0;
  max-width: 900px;
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 50px;
}

.detail-header {
  font-family: 'VT323', monospace;
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  color: var(--neon-orange);
  margin-bottom: 14px;
  text-shadow: 0 0 14px rgba(255, 119, 0, 0.6);
  letter-spacing: 2px;
}

.detail-body {
  font-family: 'VT323', monospace;
  font-size: 1.75rem;
  line-height: 1.45;
  color: #f0ece1;
}

.social-link-item {
  display: block;
  margin: 14px 0;
  color: var(--neon-green);
  text-decoration: none;
  font-size: 1.9rem;
  touch-action: manipulation;
  transition: transform 0.2s ease, color 0.2s ease;
}

.social-link-item:hover,
.social-link-item:active {
  color: var(--neon-pink);
  transform: translateX(12px);
}

/* Pinned Showcase HUD */
#showcase-hud {
  position: fixed;
  top: 24px;
  right: 28px;
  z-index: 25;
  max-width: 440px;
  text-align: right;
  pointer-events: none;
  display: none;
  opacity: 0;
  font-family: 'VT323', monospace;
}

#showcase-hud.active {
  display: block;
}

.showcase-hud-title {
  font-family: 'VT323', monospace;
  font-size: 2.4rem;
  line-height: 1.1;
  color: var(--neon-orange);
  margin-bottom: 8px;
  text-shadow: 0 0 10px rgba(255, 119, 0, 0.4);
  letter-spacing: 2px;
}

.showcase-hud-desc {
  font-family: 'VT323', monospace;
  font-size: 1.55rem;
  line-height: 1.25;
  color: #f0ece1;
  margin-bottom: 10px;
}

.showcase-hud-tags {
  font-family: 'VT323', monospace;
  font-size: 1.35rem;
  color: var(--neon-green);
  letter-spacing: 1px;
}

/* =========================================================================
   ORIENTATION BLOCKER (PORTRAIT ONLY)
   ========================================================================= */
.orientation-blocker {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(5, 5, 8, 0.96);
  z-index: 99999;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 24px;
  box-sizing: border-box;
}

@media screen and (orientation: portrait) and (pointer: coarse), 
       screen and (orientation: portrait) and (max-width: 600px) {
  .orientation-blocker {
    display: flex;
  }
}

.orientation-content {
  border: 2px solid var(--neon-orange);
  background: rgba(255, 119, 0, 0.05);
  box-shadow: 0 0 20px rgba(255, 119, 0, 0.35);
  padding: 32px 24px;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.rotate-icon {
  font-size: 3.5rem;
  color: var(--neon-cyan);
  animation: rotateSpin 2.5s infinite ease-in-out;
  text-shadow: 0 0 12px rgba(0, 255, 255, 0.7);
}

.rotate-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.85rem;
  color: var(--neon-orange);
  letter-spacing: 2px;
}

.rotate-text {
  font-family: 'VT323', monospace;
  font-size: 1.8rem;
  line-height: 1.35;
  color: #f0ece1;
  letter-spacing: 1px;
}

@keyframes rotateSpin {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(90deg); }
  100% { transform: rotate(0deg); }
}