/* ========================================
   BHUYAS — PROJECTS (MOBILE-FIRST)
   Responsive card gallery with focus modal
   ======================================== */

:root {
  --bg: #0E141B;
  --text: #f7f5e7;
  --text-muted: rgba(247, 245, 231, 0.7);
  --accent: #5C7C99;
  --panel: rgba(14, 20, 27, 0.85);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { overflow-x: hidden; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* HEADER */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: var(--space-md) var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1200;
  background: linear-gradient(180deg, rgba(14,20,27,0.95), rgba(14,20,27,0.6));
  backdrop-filter: blur(8px);
}
.logo {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--text-sm);
  letter-spacing: 0.08em;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
.hamburger {
  width: 32px; height: 32px; background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
  position: relative;
}
.hamburger span { 
  display: block; 
  height: 2px; 
  background: var(--text);
  width: 100%;
  transition: all 0.3s ease;
}

/* STAGE (Mobile-first layout) */
.project-stage {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  background: radial-gradient(circle at 20% 30%, rgba(92,124,153,0.12), transparent 45%),
              radial-gradient(circle at 70% 70%, rgba(92,124,153,0.08), transparent 40%),
              #0E141B;
  display: flex;
  flex-direction: column;
  padding: var(--space-4xl) var(--space-md) var(--space-xl) var(--space-md);
  padding-top: calc(var(--space-4xl) * 2.5);
}

.project-backdrop {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(14,20,27,0.8) 0%, rgba(14,20,27,0.3) 100%);
  pointer-events: none;
  z-index: 1;
}

/* Content wrapper for mobile layout */
.project-stage > div:nth-child(3) {
  position: relative;
  z-index: 10;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

/* Sidebar (Hidden on mobile) */
.project-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 60px;
  background: rgba(0,0,0,0.6);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3xl);
  z-index: 5;
  backdrop-filter: blur(10px);
}
.sidebar-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  opacity: 0.6;
}
.category-bar {
  position: relative;
  top: 0;
  right: auto;
  left: auto;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
  width: 100%;
}
.category-guides { 
  display: flex; 
  flex-direction: column; 
  gap: var(--space-sm);
  width: 100%;
  align-items: center;
}
.guide-line {
  position: relative;
  height: 1px;
  width: 100%;
  max-width: 280px;
  background: rgba(247,245,231,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}
.guide-line .arrow {
  width: 12px;
  height: 1px;
  background: rgba(247,245,231,0.6);
  position: absolute;
}
.guide-line .arrow.left { left: 0; }
.guide-line .arrow.left::after {
  content: '';
  position: absolute;
  left: 0;
  top: -3px;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-right: 5px solid rgba(247,245,231,0.6);
}
.guide-line .arrow.right { right: 0; }
.guide-line .arrow.right::after {
  content: '';
  position: absolute;
  right: 0;
  top: -3px;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid rgba(247,245,231,0.6);
}
.guide-label {
  position: relative;
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--text-xs);
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 0 var(--space-md);
  background: rgba(14,20,27,0.6);
}
.category-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--text-xs);
  letter-spacing: 1.5px;
  color: var(--text-muted);
  text-transform: uppercase;
}
.category-buttons {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-behavior: smooth;
}
.category-buttons::-webkit-scrollbar { display: none; }
.category-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid rgba(247,245,231,0.15);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.25s ease, transform 0.25s ease, background 0.25s ease;
  border-radius: 6px;
  white-space: nowrap;
  min-height: var(--touch-target);
}
.category-btn:active { transform: scale(0.98); }
.category-btn:hover { 
  border-color: rgba(247,245,231,0.3); 
  background: rgba(255,255,255,0.06);
}
.category-btn.active { 
  border-color: var(--text); 
  background: rgba(247,245,231,0.1);
}
.category-logo {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--text-xs);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 1px;
  position: relative;
  flex-shrink: 0;
}
.category-logo::after {
  content: '';
  position: absolute;
  right: -14px;
  top: 50%;
  width: 10px;
  height: 1px;
  background: rgba(247,245,231,0.5);
}
.category-text { 
  display: flex; 
  flex-direction: column; 
  align-items: flex-start;
  gap: 2px;
}
.category-name { 
  font-size: var(--text-sm); 
  font-weight: 600;
  line-height: 1.2;
}
.category-sub { 
  font-size: 10px; 
  color: var(--text-muted);
  line-height: 1.2;
}
.social-links {
  display: flex;
  flex-direction: row;
  gap: var(--space-lg);
  justify-content: center;
  width: 100%;
}
.social-link {
  color: rgba(247, 245, 231, 0.5);
  text-decoration: none;
  transition: color 0.25s ease, transform 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--touch-target);
  width: var(--touch-target);
}
.social-link:active { transform: scale(0.9); }
.social-link:hover { color: var(--text); }

/* Projects Stack (Mobile: Vertical / Desktop: Horizontal) */
.projects-stack {
  position: relative;
  z-index: 10;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  overflow: visible;
  padding: 0;
  scroll-behavior: smooth;
}

/* Project Cards (Mobile-first: Full width) */
.project-card {
  position: relative;
  width: 100%;
  height: 50vh;
  min-height: 320px;
  max-height: 500px;
  border: 1px solid rgba(247,245,231,0.1);
  background: rgba(255,255,255,0.02);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  border-radius: 8px;
  backdrop-filter: blur(4px);
}
.project-card:active { transform: scale(0.98); }
.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(247,245,231,0.2);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.project-card.is-hidden { display: none; }
.project-card img {
  width: 100%; height: 100%; object-fit: cover;
  filter: brightness(0.7) saturate(1.1);
}
.card-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.7), rgba(0,0,0,0.1));
  pointer-events: none;
}
.card-title {
  position: absolute;
  left: var(--space-md);
  bottom: var(--space-md);
  right: var(--space-md);
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--text-base);
  letter-spacing: 0.5px;
  color: var(--text);
  z-index: 3;
  font-weight: 500;
}

/* Scroll Text (Hidden on mobile) */
.scroll-text {
  position: fixed;
  right: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--text-xs);
  letter-spacing: 2px;
  color: rgba(247,245,231,0.3);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  z-index: 8;
  display: none;
}

/* Timeline & Controls (Hidden on mobile) */
.video-timeline {
  position: fixed;
  left: var(--space-lg);
  right: var(--space-lg);
  bottom: var(--space-3xl);
  height: 2px;
  background: rgba(247, 245, 231, 0.15);
  z-index: 12;
  display: none;
}
.timeline-progress {
  height: 100%;
  background: var(--text);
  width: 25%;
  transition: width 0.3s ease;
}
.video-controls {
  position: fixed;
  left: var(--space-lg);
  right: var(--space-lg);
  bottom: var(--space-xl);
  display: none;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  z-index: 12;
}
.time-stamp, .time-total {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.play-pause {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(247,245,231,0.2);
  padding: var(--space-sm) var(--space-md);
  color: var(--text);
  cursor: pointer;
  transition: opacity 0.25s ease, background 0.25s ease;
  border-radius: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--text-sm);
  min-height: var(--touch-target);
}
.play-pause:active { opacity: 0.6; }
.play-pause:hover { 
  background: rgba(255,255,255,0.1);
}

/* Focus Layer (Modal) */
.focus-layer {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(12px);
  z-index: 3000;
  padding: var(--space-lg);
  -webkit-backdrop-filter: blur(12px);
}
.focus-layer.active { display: flex; animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
  from { opacity: 0; background: rgba(0,0,0,0.4); }
  to { opacity: 1; background: rgba(0,0,0,0.6); }
}

.focus-content {
  position: relative;
  width: 100%;
  height: 70vh;
  max-height: 700px;
  border: 1px solid rgba(247,245,231,0.15);
  background: rgba(14,20,27,0.8);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}

.focus-media {
  position: relative;
  width: 100%;
  flex: 1;
  overflow: hidden;
}

.focus-media img {
  width: 100%; height: 100%; object-fit: cover;
  filter: brightness(0.9);
}

.focus-text {
  position: relative;
  padding: var(--space-lg) var(--space-md);
  background: linear-gradient(0deg, rgba(0,0,0,0.8), rgba(0,0,0,0.3));
  max-height: 40%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.focus-layer.active .focus-text {
  animation: slideUp 0.35s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.focus-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--text-xl);
  letter-spacing: 0.5px;
  margin-bottom: var(--space-md);
  color: var(--text);
  font-weight: 600;
}

.focus-desc {
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-muted);
}

/* Blur effect on overlay */
body.blur-active .project-stage,
body.blur-active .header {
  filter: blur(8px) brightness(0.85);
  pointer-events: none;
}

/* Footer */
.footer { display: none; }

/* ========================================
   TABLET BREAKPOINT (768px+)
   ======================================== */
@media (min-width: 768px) {
  .project-stage {
    flex-direction: row;
    align-items: stretch;
    padding: var(--space-4xl) var(--space-lg) var(--space-xl) 70px;
  }

  .project-sidebar {
    display: flex;
    position: relative;
    width: 70px;
    background: rgba(0,0,0,0.4);
    margin-right: var(--space-lg);
    flex-shrink: 0;
  }

  .category-bar {
    position: absolute;
    top: auto;
    right: var(--space-lg);
    left: 100px;
    flex-direction: row;
    gap: var(--space-md);
    width: auto;
    margin-bottom: 0;
  }

  .category-guides {
    flex-direction: row;
    align-items: center;
    width: auto;
  }

  .guide-line {
    width: 180px;
    max-width: none;
  }

  .category-buttons {
    justify-content: flex-end;
    gap: var(--space-sm);
    flex-wrap: nowrap;
    width: auto;
    overflow: visible;
  }

  .projects-stack {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 var(--space-lg);
    gap: var(--space-lg);
    align-items: center;
    margin: 0;
    flex: 1;
  }

  .projects-stack::-webkit-scrollbar {
    height: 6px;
  }

  .projects-stack::-webkit-scrollbar-track {
    background: rgba(247,245,231,0.05);
    border-radius: 3px;
  }

  .projects-stack::-webkit-scrollbar-thumb {
    background: rgba(247,245,231,0.3);
    border-radius: 3px;
  }

  .project-card {
    flex: 0 0 380px;
    height: 60vh;
    max-height: 500px;
  }

  .scroll-text {
    display: block;
  }

  .video-timeline,
  .video-controls {
    display: flex;
    bottom: var(--space-xl);
  }

  .social-links {
    flex-direction: column;
    gap: var(--space-2xl);
  }

  .focus-content {
    height: 75vh;
    max-width: 1200px;
  }

  .focus-text {
    padding: var(--space-2xl);
  }

  .focus-title {
    font-size: var(--text-2xl);
  }
}

/* ========================================
   DESKTOP BREAKPOINT (1024px+)
   ======================================== */
@media (min-width: 1024px) {
  .project-stage {
    padding: var(--space-4xl) var(--space-2xl) var(--space-xl) 90px;
  }

  .project-sidebar {
    width: 90px;
  }

  .category-bar {
    left: 130px;
    right: var(--space-2xl);
  }

  .projects-stack {
    gap: var(--space-2xl);
    padding: 0 var(--space-xl);
  }

  .project-card {
    flex: 0 0 420px;
    height: 70vh;
  }

  .project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 28px 60px rgba(0,0,0,0.4);
  }

  .video-timeline,
  .video-controls {
    left: 130px;
    right: var(--space-2xl);
  }

  .focus-layer {
    padding: var(--space-2xl);
  }

  .focus-content {
    height: 80vh;
    max-width: 1400px;
  }

  .focus-text {
    padding: var(--space-3xl);
    max-height: 45%;
  }

  .focus-title {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-lg);
  }

  .focus-desc {
    font-size: var(--text-lg);
  }
}

/* ========================================
   LARGE DESKTOP (1400px+)
   ======================================== */
@media (min-width: 1400px) {
  .project-stage {
    padding: var(--space-4xl) var(--space-3xl) var(--space-xl) 120px;
  }

  .project-sidebar {
    width: 110px;
  }

  .category-bar {
    left: 150px;
    right: var(--space-3xl);
  }

  .projects-stack {
    gap: var(--space-3xl);
    padding: 0 var(--space-2xl);
  }

  .project-card {
    flex: 0 0 480px;
    height: 75vh;
  }

  .video-timeline,
  .video-controls {
    left: 150px;
    right: var(--space-3xl);
  }
}

/* ========================================
   SMALL DEVICES (<480px)
   ======================================== */
@media (max-width: 479px) {
  .header {
    padding: var(--space-md) var(--space-md);
  }

  .project-stage {
    padding: var(--space-3xl) var(--space-md) var(--space-lg) var(--space-md);
    padding-top: calc(var(--space-3xl) * 2);
  }

  .category-buttons {
    width: 100%;
  }

  .project-card {
    height: 45vh;
    min-height: 280px;
  }

  .focus-layer {
    padding: var(--space-md);
  }

  .focus-content {
    height: 65vh;
    border-radius: 8px;
  }

  .focus-text {
    padding: var(--space-md);
  }

  .focus-title {
    font-size: var(--text-lg);
  }

  .focus-desc {
    font-size: var(--text-sm);
  }
}
