/* ============================================
   bandur.top — Stylesheet
   Minimal dark, terminal meets editorial
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111;
  --bg-card: #151515;
  --text-primary: #e0e0e0;
  --text-muted: #888;
  --accent: #00ffd0;
  --accent-glow: rgba(0, 255, 208, 0.15);
  --accent-dim: rgba(0, 255, 208, 0.4);
  --font-mono: 'JetBrains Mono', monospace;
  --font-sans: 'IBM Plex Sans', sans-serif;
  --panel-count: 7;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
}

/* --- Scanline/Grid Background Texture --- */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(255, 255, 255, 0.008) 2px,
      rgba(255, 255, 255, 0.008) 4px
    );
}

/* --- Typography --- */
h1, h2, h3 {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.3rem; }

p {
  color: var(--text-muted);
  max-width: 60ch;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.8;
}

/* --- Focus Styles --- */
button:focus-visible,
[role="button"]:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- Utility --- */
.accent { color: var(--accent); }
.mono { font-family: var(--font-mono); }

/* ============================================
   MODE 1: Horizontal Scroll (Desktop)
   ============================================ */

.horizontal-scroll-wrapper {
  position: relative;
  height: calc(100vh * var(--panel-count));
}

.horizontal-scroll-container {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.horizontal-scroll-track {
  display: flex;
  height: 100%;
  transition: transform 0.1s ease-out;
  will-change: transform;
}

.panel {
  flex: 0 0 100vw;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem 4rem;
  text-align: center;
  position: relative;
}

/* --- Panel Content --- */
.panel-content {
  max-width: 800px;
  z-index: 1;
}

.panel-content h2 {
  margin-bottom: 1.5rem;
  font-size: 2rem;
}

.panel-content p {
  margin: 0 auto 1rem;
  font-size: 1.1rem;
  line-height: 1.7;
}

.panel-content .highlight {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 1rem;
}

/* --- Panel 1: Hero --- */
.panel-hero .hero-name {
  font-size: 3.5rem;
  font-family: var(--font-mono);
  color: var(--accent);
  margin-bottom: 0.5rem;
  letter-spacing: -1px;
}

.panel-hero .hero-location {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-family: var(--font-mono);
}

.panel-hero .hero-tagline {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  max-width: 50ch;
  margin-left: auto;
  margin-right: auto;
}

.panel-hero .hero-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 1.5rem;
}

/* --- Scroll Indicator --- */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  animation: pulse 2s ease-in-out infinite;
}

.scroll-indicator .arrow {
  font-size: 1.2rem;
  color: var(--accent);
}

.scroll-indicator .arrow-right {
  display: none;
}

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

/* --- Panel 2: The App --- */
.panel-app {
  background: var(--bg-secondary);
}

.panel-app .bg-decoration {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  opacity: 0.04;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1.8;
  color: var(--accent);
  padding: 2rem;
  white-space: pre;
  pointer-events: none;
}

/* --- Panel 3: The First Experiment --- */
.bug-counter {
  font-family: var(--font-mono);
  font-size: 4rem;
  color: var(--accent);
  margin: 1.5rem 0;
  text-shadow: 0 0 20px var(--accent-glow);
}

.bug-counter .counter-label {
  font-size: 1rem;
  color: var(--text-muted);
  display: block;
}

/* --- Panel 4: The Loop --- */
.panel-loop {
  background: var(--bg-secondary);
}

.blink-cursor {
  display: inline-block;
  width: 10px;
  height: 1.5rem;
  background: var(--accent);
  margin-left: 4px;
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}

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

.tedium-text {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-top: 1.5rem;
  opacity: 0.5;
}

/* --- Panel 5: The Breakthrough --- */
.parallel-cursors {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 1.5rem;
}

.parallel-cursors .cursor-line {
  width: 3px;
  height: 30px;
  background: var(--accent);
  animation: blink 1s step-end infinite;
}

.parallel-cursors .cursor-line:nth-child(2) { animation-delay: 0.2s; }
.parallel-cursors .cursor-line:nth-child(3) { animation-delay: 0.4s; }
.parallel-cursors .cursor-line:nth-child(4) { animation-delay: 0.1s; }
.parallel-cursors .cursor-line:nth-child(5) { animation-delay: 0.6s; }
.parallel-cursors .cursor-line:nth-child(6) { animation-delay: 0.3s; }
.parallel-cursors .cursor-line:nth-child(7) { animation-delay: 0.5s; }

/* --- Panel 6: The Result --- */
.panel-result {
  background: var(--bg-secondary);
}

.result-stats {
  display: flex;
  gap: 3rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 2rem 0;
}

.stat-block {
  text-align: center;
}

.stat-number {
  font-family: var(--font-mono);
  font-size: 4.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  text-shadow: 0 0 30px var(--accent-glow);
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  display: block;
}

.result-summary {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 2rem;
}

/* --- Panel 7: The Stack --- */
.stack-diagram {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 2;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 2rem;
  margin: 1.5rem 0;
  max-width: 600px;
}

.stack-diagram .stack-item { padding-left: 0; }
.stack-diagram .stack-item.indent-1 { padding-left: 1.5rem; }
.stack-diagram .stack-item.indent-2 { padding-left: 3rem; }
.stack-diagram .stack-accent { color: var(--accent); }
.stack-diagram .stack-arrow { color: var(--accent-dim); }

.stack-tagline {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text-primary);
  margin-top: 1.5rem;
}

.scroll-down-hint {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2rem;
  opacity: 0.5;
}

/* --- Panel Progress Dots --- */
.panel-progress {
  position: fixed;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
}

.panel-progress .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  transition: background 0.3s, transform 0.3s;
}

.panel-progress .dot.active {
  background: var(--accent);
  transform: scale(1.3);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* ============================================
   MODE 2: Vertical Scroll Sections
   ============================================ */

.vertical-sections {
  position: relative;
}

.section-header {
  text-align: center;
  padding: 6rem 2rem 3rem;
}

.section-header h2 {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.section-header p {
  margin: 0 auto;
  color: var(--text-muted);
}

/* ============================================
   PROJECTS Section
   ============================================ */

.projects-section {
  padding: 0 2rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
}

.project-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  padding: 3rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.project-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.project-card:last-child {
  border-bottom: none;
}

.project-left {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-name {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  color: var(--text-primary);
}

.project-tagline {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
}

.project-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.project-description p {
  max-width: none;
  margin-bottom: 0.75rem;
}

.project-description p:last-child {
  margin-bottom: 0;
}

.project-right {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.project-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.project-stat {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  border: 1px solid rgba(0, 255, 208, 0.1);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
}

.project-image-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  overflow: hidden;
}

.project-image-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #ffaa00;
  border: 1px solid rgba(255, 170, 0, 0.3);
  background: rgba(255, 170, 0, 0.08);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* ============================================
   MEDIA GALLERIES Section
   ============================================ */

.media-section {
  padding: 0 2rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
}

.media-tabs {
  display: flex;
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.media-tab {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 0.8rem 1.5rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.media-tab:hover { color: var(--text-primary); }

.media-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.media-panel { display: none; }
.media-panel.active { display: block; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.gallery-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 1.5rem;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease, border-color 0.2s;
}

.gallery-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.gallery-card:hover {
  border-color: var(--accent-dim);
}

.gallery-card.visible:hover {
  transform: translateY(-2px);
}

.gallery-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.gallery-card p {
  font-size: 0.85rem;
  margin-bottom: 1rem;
  max-width: none;
}

.gallery-card .file-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
}

.gallery-expanded {
  margin-top: 1.5rem;
}

.thumbnail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.thumbnail-item {
  aspect-ratio: 16/9;
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumbnail-item:hover { border-color: var(--accent-dim); }

.thumbnail-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumbnail-item .placeholder-text {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 0.5rem;
  text-align: center;
}

.thumbnail-item.video-thumb {
  position: relative;
}

.thumbnail-item.video-thumb::after {
  content: '▶';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  color: var(--accent);
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

/* ============================================
   LIGHTBOX
   ============================================ */

.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 80vh;
  position: relative;
}

.lightbox-content img,
.lightbox-content video {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-size: 2rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10001;
  font-family: var(--font-mono);
  transition: color 0.2s;
  line-height: 1;
}

.lightbox-close:hover { color: var(--text-primary); }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.5rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 1rem;
  z-index: 10001;
  font-family: var(--font-mono);
  transition: color 0.2s;
  line-height: 1;
}

.lightbox-nav:hover { color: var(--accent); }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

.lightbox-caption {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  margin-top: 1rem;
  text-align: center;
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 4rem 2rem;
  text-align: center;
}

.footer-line {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.footer-line .accent-stat {
  color: var(--accent);
  font-weight: 600;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-top: 1rem;
}

.footer-links a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--accent); }

.footer-copyright {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.2);
  margin-top: 1.5rem;
}

/* ============================================
   ANIMATIONS
   ============================================ */

.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   RESPONSIVE — Tablet (768px–1023px)
   ============================================ */

@media (max-width: 1023px) {
  .horizontal-scroll-wrapper {
    height: auto;
  }

  .horizontal-scroll-container {
    position: relative;
    height: auto;
    overflow: visible;
  }

  .horizontal-scroll-track {
    flex-direction: column;
    transform: none !important;
  }

  .panel {
    width: 100%;
    height: auto;
    min-height: 100vh;
    padding: 4rem 2rem;
  }

  .panel-hero .hero-name { font-size: 2.5rem; }
  .panel-progress { display: none; }

  .scroll-indicator .arrow-down { display: inline; }
  .scroll-indicator .arrow-right { display: none; }

  .result-stats { gap: 2rem; }
  .stat-number { font-size: 3rem; }

  .project-card {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================
   RESPONSIVE — Mobile (< 768px)
   ============================================ */

@media (max-width: 767px) {
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.4rem; }

  .panel {
    padding: 3rem 1.5rem;
    min-height: 100vh;
  }

  .panel-hero .hero-name { font-size: 2rem; }
  .panel-hero .hero-tagline { font-size: 1rem; }
  .panel-content h2 { font-size: 1.4rem; }
  .panel-content p { font-size: 0.95rem; }

  .stat-number { font-size: 2.5rem; }
  .result-stats { flex-direction: column; gap: 1.5rem; }

  .stack-diagram {
    font-size: 0.75rem;
    padding: 1.5rem;
  }

  .project-card {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .project-right { order: -1; }

  .section-header { padding: 4rem 1.5rem 2rem; }

  .gallery-grid { grid-template-columns: 1fr; }
  .thumbnail-grid { grid-template-columns: repeat(2, 1fr); }
  .media-tabs { justify-content: center; }

  .lightbox-nav { font-size: 1.5rem; padding: 0.5rem; }
  .lightbox-prev { left: 0.5rem; }
  .lightbox-next { right: 0.5rem; }

  .footer-links {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .horizontal-scroll-track { transition: none; }

  .fade-in,
  .project-card,
  .gallery-card {
    opacity: 1;
    transform: none;
  }

  .scroll-indicator {
    animation: none;
    opacity: 0.6;
  }
}
