/* ========================================
   YASHDEEP JHA — PORTFOLIO
   Terminal Aesthetic Design System
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* --- CSS Variables --- */
:root {
  --bg: #0a0a0a;
  --bg-elevated: #111111;
  --bg-card: #0e0e0e;
  --border: #1a1a1a;
  --border-hover: #333333;
  --text: #e0e0e0;
  --text-muted: #555555;
  --text-dim: #333333;
  --accent: #FF4500;
  --accent-hover: #FF5722;
  --accent-dim: rgba(255, 69, 0, 0.15);
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  --font-heading: 'Space Grotesk', 'Inter', 'Arial', sans-serif;
  --max-width: 1280px;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--bg);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-hover);
}

/* --- Loading Screen --- */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  transition: opacity 0.6s ease;
}

#loader.hidden {
  opacity: 0;
  pointer-events: none;
}

#loader .loader-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

#loader .loader-bar-track {
  width: 280px;
  height: 2px;
  background: var(--border);
  position: relative;
  overflow: hidden;
}

#loader .loader-bar-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.15s linear;
}

#loader .loader-percent {
  color: var(--accent);
  font-size: 0.7rem;
  margin-top: 12px;
  font-weight: 600;
}

/* --- Hero Section (Scroll-driven) --- */
#hero-container {
  position: relative;
  width: 100%;
}

#hero-sticky {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

#hero-canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Hero text overlays */
.hero-text-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.hero-text {
  position: absolute;
  text-align: center;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  width: 90%;
  max-width: 900px;
}

.hero-text.visible {
  opacity: 1;
}

.hero-text h1 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(3rem, 10vw, 8rem);
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 0.95;
  text-shadow: 0 0 60px rgba(255, 69, 0, 0.3);
}

.hero-text h2 {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: clamp(0.8rem, 2vw, 1.1rem);
  color: #ffffff;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: 16px;
}

.hero-text .hero-tagline {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(1.5rem, 5vw, 3.5rem);
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.1;
}

.hero-text .hero-sub {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: clamp(0.7rem, 1.5vw, 0.9rem);
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 16px;
  display: block;
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}

.scroll-indicator.visible {
  opacity: 1;
}

.scroll-indicator span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
}

.scroll-indicator .arrow {
  display: block;
  width: 1px;
  height: 40px;
  background: var(--text-dim);
  margin: 8px auto 0;
  animation: scrollPulse 2s ease infinite;
}

@keyframes scrollPulse {

  0%,
  100% {
    transform: scaleY(1);
    opacity: 0.3;
  }

  50% {
    transform: scaleY(1.5);
    opacity: 0.8;
  }
}

/* --- Container --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
}

/* --- Section Styling --- */
.section {
  padding: 100px 0;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.section.in-view {
  opacity: 1;
  transform: translateY(0);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 48px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.section-header::before {
  content: '';
  width: 3px;
  height: 18px;
  background: var(--accent);
  flex-shrink: 0;
}

.section-number {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  font-weight: 600;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: #ffffff;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

.section-version {
  margin-left: auto;
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

/* --- Product Ledger Table --- */
.ledger-table {
  width: 100%;
  border: 1px solid var(--border);
}

.ledger-row {
  display: grid;
  grid-template-columns: 50px 1fr 200px 220px 60px;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

.ledger-row:last-child {
  border-bottom: none;
}

.ledger-row:hover {
  background: var(--bg-elevated);
}

.ledger-row.header {
  background: var(--bg-elevated);
}

.ledger-row.header .ledger-cell {
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 12px 16px;
}

.ledger-cell {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--border);
  font-size: 0.8rem;
}

.ledger-cell:last-child {
  border-right: none;
  align-items: center;
}

.ledger-cell .project-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.ledger-cell .project-version {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.ledger-cell .project-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.status-dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
}

.status-dot.active {
  background: var(--accent);
}

.status-dot.building {
  background: #ff9800;
}

.status-dot.archived {
  background: var(--text-dim);
}

/* ledger row links */
.ledger-row a.ledger-link {
  display: contents;
  color: inherit;
  text-decoration: none;
}

/* --- AI Pipeline Grid --- */
.pipeline-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border);
}

.pipeline-card {
  padding: 32px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

.pipeline-card:hover {
  background: var(--bg-elevated);
}

.pipeline-card:nth-child(2n) {
  border-right: none;
}

.pipeline-card:nth-last-child(-n+2) {
  border-bottom: none;
}

.pipeline-card .pipe-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

.pipeline-card .pipe-tag {
  font-size: 0.65rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
  font-weight: 500;
}

.pipeline-card ul {
  list-style: none;
  padding: 0;
}

.pipeline-card ul li {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 3px 0;
  padding-left: 14px;
  position: relative;
  line-height: 1.5;
}

.pipeline-card ul li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.pipeline-card .pipe-tech {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pipeline-card .pipe-tech span {
  font-size: 0.6rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 3px 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* --- Project Showcase --- */
.showcase-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--border);
}

.showcase-card {
  border-right: 1px solid var(--border);
  transition: background 0.2s;
  overflow: hidden;
}

.showcase-card:nth-child(2n) {
  border-right: none;
}

.showcase-card:hover {
  background: var(--bg-elevated);
}

.showcase-visual {
  width: 100%;
  height: 220px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

/* CSS-generated abstract visuals */
.showcase-visual.vr-visual {
  background:
    linear-gradient(135deg, transparent 40%, rgba(255, 69, 0, 0.08) 60%),
    radial-gradient(circle at 30% 50%, rgba(255, 69, 0, 0.06) 0%, transparent 50%),
    var(--bg);
}

.showcase-visual.vr-visual::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 100px;
  height: 100px;
  border: 1px solid rgba(255, 69, 0, 0.4);
  animation: rotateSlow 20s linear infinite;
}

.showcase-visual.vr-visual::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(22deg);
  width: 130px;
  height: 130px;
  border: 1px solid rgba(255, 69, 0, 0.2);
  border-radius: 50%;
  animation: rotateSlow 30s linear infinite reverse;
}

.showcase-visual.agents-visual {
  background:
    linear-gradient(225deg, transparent 40%, rgba(255, 69, 0, 0.08) 60%),
    radial-gradient(circle at 70% 50%, rgba(255, 69, 0, 0.06) 0%, transparent 50%),
    var(--bg);
}

.showcase-visual.agents-visual::before {
  content: '';
  position: absolute;
  top: 30%;
  left: 60%;
  width: 80px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: scanLine 3s ease-in-out infinite;
}

.showcase-visual.agents-visual::after {
  content: '';
  position: absolute;
  top: 55%;
  left: 30%;
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 69, 0, 0.4), transparent);
  animation: scanLine 4s ease-in-out infinite 1s;
}

/* grid lines inside agents visual */
.showcase-visual .grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 69, 0, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 69, 0, 0.03) 1px, transparent 1px);
  background-size: 30px 30px;
}

/* dots for agents */
.showcase-visual .node-dot {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--accent);
  opacity: 0.6;
}

@keyframes rotateSlow {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes scanLine {

  0%,
  100% {
    opacity: 0;
    transform: translateX(-20px);
  }

  50% {
    opacity: 1;
    transform: translateX(20px);
  }
}

.showcase-info {
  padding: 28px 32px;
}

.showcase-info .show-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}

.showcase-info .show-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.showcase-info .show-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: letter-spacing 0.3s;
}

.showcase-info .show-link:hover {
  letter-spacing: 0.15em;
}

/* --- Tech Stack Matrix --- */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
}

.stack-column {
  padding: 28px 24px;
  border-right: 1px solid var(--border);
}

.stack-column:last-child {
  border-right: none;
}

.stack-column .stack-label {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.7rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.stack-column ul {
  list-style: none;
  padding: 0;
}

.stack-column ul li {
  font-size: 0.8rem;
  color: var(--text);
  padding: 5px 0;
  padding-left: 16px;
  position: relative;
}

.stack-column ul li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--text-dim);
  font-weight: 700;
}

/* --- Footer --- */
footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-left {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.footer-left a {
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-left a:hover {
  color: var(--accent);
}

.footer-right {
  display: flex;
  gap: 24px;
}

.footer-right a {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 500;
  transition: color 0.2s;
}

.footer-right a:hover {
  color: var(--accent);
}

/* --- Utility: Scanline overlay --- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: repeating-linear-gradient(0deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.03) 2px,
      rgba(0, 0, 0, 0.03) 4px);
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .container {
    padding: 0 20px;
  }

  .section {
    padding: 60px 0;
  }

  .ledger-row {
    grid-template-columns: 40px 1fr 1fr 50px;
  }

  .ledger-row .ledger-cell:nth-child(3) {
    display: none;
  }

  .pipeline-grid {
    grid-template-columns: 1fr;
  }

  .pipeline-card {
    border-right: none !important;
  }

  .pipeline-card:nth-last-child(-n+2) {
    border-bottom: 1px solid var(--border);
  }

  .pipeline-card:last-child {
    border-bottom: none;
  }

  .showcase-grid {
    grid-template-columns: 1fr;
  }

  .showcase-card {
    border-right: none !important;
    border-bottom: 1px solid var(--border);
  }

  .showcase-card:last-child {
    border-bottom: none;
  }

  .stack-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stack-column {
    border-bottom: 1px solid var(--border);
  }

  .stack-column:nth-child(2n) {
    border-right: none;
  }

  .footer-inner {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
}

@media (max-width: 600px) {
  .ledger-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .ledger-row .ledger-cell {
    border-right: none;
    padding: 8px 16px;
  }

  .ledger-row .ledger-cell:first-child {
    display: none;
  }

  .ledger-row .ledger-cell:last-child {
    align-items: flex-start;
    padding-bottom: 16px;
  }

  .ledger-row.header {
    display: none;
  }

  .stack-grid {
    grid-template-columns: 1fr;
  }

  .stack-column {
    border-right: none !important;
  }
}