/* ====================================
   Portfolio/Projects Section
   ==================================== */

.portfolio-section {
  padding: 100px 0 100px;
  position: relative;
  z-index: 1;
}

.portfolio-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 48px;
}

/* Portfolio Filter Tabs (projects page only) */
.portfolio-filters {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.filter-btn {
  padding: 10px 24px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s;
}

.filter-btn:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.filter-btn.active {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

/* ====================================
   Carousel Layout (Homepage)
   ==================================== */

.projects-carousel-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
}

.projects-carousel {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 8px 0;
}

.projects-carousel::-webkit-scrollbar {
  display: none;
}

.projects-carousel .project-card {
  flex: 0 0 360px;
  scroll-snap-align: start;
}

/* Hide description and highlights in carousel for compact look */
.projects-carousel .project-description {
  display: none;
}

.projects-carousel .project-highlights {
  display: none;
}

.projects-carousel .project-visual {
  height: 170px;
}

.projects-carousel .project-info {
  padding: 20px 24px 24px;
}

.projects-carousel .project-title {
  font-size: 19px;
  margin-bottom: 12px;
}

.projects-carousel .project-tech-stack {
  margin-bottom: 0;
}

/* Carousel Arrow Buttons */
.carousel-arrow {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-page);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s;
  z-index: 2;
}

.carousel-arrow:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
  background: var(--bg-card);
}

.carousel-arrow:disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

/* View All Projects CTA */
.portfolio-cta {
  text-align: center;
  margin-bottom: 64px;
}

/* ====================================
   Full Grid Layout (Projects Page)
   ==================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(520px, 1fr));
  gap: 32px;
  margin-bottom: 64px;
}

/* Project Card */
.project-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-page);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
}

.project-card:hover {
  border-color: rgba(26, 26, 26, 0.15);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.project-visual {
  position: relative;
  overflow: hidden;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), filter 0.5s ease;
}

.project-card:hover .project-visual {
  transform: scale(1.01);
}

.project-info {
  position: relative;
  padding: 28px 32px 32px;
  background: var(--bg-page);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.04);
}

.project-category {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.project-title {
  font-family: 'Instrument Serif', serif;
  font-size: 24px;
  color: var(--text-primary);
  margin-bottom: 10px;
  letter-spacing: -0.5px;
  line-height: 1.25;
}

.project-description {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.tech-tag {
  padding: 4px 11px;
  background: transparent;
  border: 1px solid var(--tag-border);
  border-radius: 100px;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all 0.25s ease;
}

.project-card:hover .tech-tag {
  border-color: rgba(139, 115, 85, 0.12);
}

.project-highlights {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.highlight-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.highlight-value {
  font-family: 'Instrument Serif', serif;
  font-size: 22px;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.highlight-label {
  font-size: 11px;
  color: var(--text-muted);
}

/* Carousel Edge Fades */
.projects-carousel-wrap::before,
.projects-carousel-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 60px;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.projects-carousel-wrap::before {
  left: 58px;
  background: linear-gradient(to right, var(--bg-page), transparent);
}

.projects-carousel-wrap::after {
  right: 58px;
  background: linear-gradient(to left, var(--bg-page), transparent);
}

.projects-carousel-wrap.fade-left::before {
  opacity: 1;
}

.projects-carousel-wrap.fade-right::after {
  opacity: 1;
}

/* ====================================
   Project Card Animations
   ==================================== */

/* --- 1. Funding Chart (AI Fundraising Copilot) --- */
.project-anim-funding {
  background: linear-gradient(135deg, #f0ede4 0%, #e8e4d8 100%);
}

.project-anim-funding .anim-funding-chart {
  position: absolute;
  bottom: 8%;
  left: 8%;
  right: 8%;
  height: 74%;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.project-anim-funding .anim-bar {
  flex: 1;
  background: linear-gradient(to top, rgba(139, 115, 85, 0.28), rgba(139, 115, 85, 0.08));
  border-radius: 3px 3px 0 0;
  height: var(--h, 40%);
  transform-origin: bottom;
  animation: fundingPulse 3.5s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

.project-anim-funding .anim-bar:last-child {
  background: linear-gradient(to top, rgba(139, 115, 85, 0.45), rgba(139, 115, 85, 0.15));
  box-shadow: 0 -4px 16px rgba(139, 115, 85, 0.12);
}

.project-anim-funding .anim-trend {
  position: absolute;
  bottom: 8%;
  left: 8%;
  right: 8%;
  height: 74%;
}

.project-anim-funding .anim-trend polyline {
  animation: trendDash 4s linear infinite;
  stroke-dasharray: 6 4;
}

.project-anim-funding .anim-funding-label {
  position: absolute;
  top: 12%;
  right: 14%;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  color: rgba(139, 115, 85, 0.5);
  animation: labelPulse 3.5s ease-in-out infinite;
}

@keyframes fundingPulse {
  0%, 100% { transform: scaleY(0.7); opacity: 0.55; }
  50% { transform: scaleY(1); opacity: 1; }
}

@keyframes trendDash {
  0% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -40; }
}

@keyframes labelPulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.7; }
}

/* --- 2. Heartbeat (Healthcare) --- */
.project-anim-heartbeat {
  background: linear-gradient(135deg, #f0ede4 0%, #ece7db 100%);
}

.project-anim-heartbeat .anim-ecg {
  position: absolute;
  width: 200%;
  height: 100%;
  top: 0;
  left: 0;
  animation: ecgScroll 3s linear infinite;
}

.project-anim-heartbeat .anim-ecg svg {
  width: 50%;
  height: 100%;
}

.project-anim-heartbeat .anim-pulse {
  position: absolute;
  width: 16px;
  height: 16px;
  background: #C0785A;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: heartPulse 1.2s ease-in-out infinite;
}

.project-anim-heartbeat .anim-pulse::before {
  content: '';
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid rgba(192, 120, 90, 0.3);
  top: -16px;
  left: -16px;
  animation: heartRing 1.2s ease-out infinite;
}

@keyframes ecgScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes heartPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  15% { transform: translate(-50%, -50%) scale(1.3); }
  30% { transform: translate(-50%, -50%) scale(1); }
  45% { transform: translate(-50%, -50%) scale(1.15); }
}

@keyframes heartRing {
  0% { transform: scale(1); opacity: 0.4; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* --- 3. Chat Interface (Enterprise Chatbot) --- */
.project-anim-chat {
  background: linear-gradient(135deg, #eae7de 0%, #e5e1d6 100%);
  overflow: hidden;
  padding: 0;
}

.project-anim-chat .anim-chat-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  width: 100%;
  animation: chatScrollUp 18s linear infinite;
}

.project-anim-chat .anim-msg {
  max-width: 72%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 10.5px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.45;
  flex-shrink: 0;
}

.project-anim-chat .anim-msg.user {
  align-self: flex-end;
  background: #1A1A1A;
  color: rgba(255, 255, 255, 0.88);
  border-bottom-right-radius: 4px;
}

.project-anim-chat .anim-msg.bot {
  align-self: flex-start;
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-bottom-left-radius: 4px;
}

@keyframes chatScrollUp {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

/* --- 4. Document Stack (Legal) --- */
.project-anim-docs {
  background: linear-gradient(135deg, #eee9dd 0%, #e8e3d6 100%);
}

.project-anim-docs .anim-doc {
  position: absolute;
  width: 120px;
  height: 160px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(var(--r, 0deg));
  animation: docShuffle var(--dur, 4s) ease-in-out infinite;
  animation-delay: var(--d, 0s);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.project-anim-docs .anim-doc::before {
  content: '';
  position: absolute;
  top: 16px;
  left: 14px;
  right: 14px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  box-shadow: 0 10px 0 var(--border), 0 20px 0 var(--border), 0 30px 0 var(--border);
}

.project-anim-docs .anim-scanline {
  position: absolute;
  width: 140px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(139, 115, 85, 0.5), transparent);
  left: 50%;
  transform: translateX(-50%);
  animation: scanDown 3s ease-in-out infinite;
}

@keyframes docShuffle {
  0%, 100% { transform: translate(-50%, -50%) rotate(var(--r, 0deg)); }
  50% { transform: translate(calc(-50% + var(--mx, 5px)), calc(-50% + var(--my, -8px))) rotate(calc(var(--r, 0deg) + 2deg)); }
}

@keyframes scanDown {
  0% { top: 15%; opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { top: 85%; opacity: 0; }
}

/* --- 5. RAG Layers (RAG Optimization Platform) --- */
.project-anim-rag {
  background: linear-gradient(135deg, #ede9df 0%, #e7e3d8 100%);
}

.project-anim-rag .anim-rag-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70%;
  height: 70%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.project-anim-rag .anim-rag-layer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(139, 115, 85, 0.06);
  border: 1px solid rgba(139, 115, 85, 0.1);
  border-radius: 6px;
  animation: ragLayerPulse 4s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

.project-anim-rag .anim-rag-layer .rag-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: rgba(139, 115, 85, 0.18);
  flex-shrink: 0;
}

.project-anim-rag .anim-rag-layer .rag-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project-anim-rag .anim-rag-layer .rag-line {
  height: 3px;
  border-radius: 2px;
  background: rgba(139, 115, 85, 0.12);
}

.project-anim-rag .anim-rag-arrow {
  display: flex;
  justify-content: center;
  height: 14px;
  position: relative;
}

.project-anim-rag .anim-rag-arrow::after {
  content: '';
  width: 2px;
  height: 100%;
  background: rgba(139, 115, 85, 0.2);
  animation: ragArrowFlow 2s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

.project-anim-rag .anim-rag-layer.active {
  background: rgba(139, 115, 85, 0.14);
  border-color: rgba(139, 115, 85, 0.25);
}

.project-anim-rag .anim-rag-layer.active .rag-icon {
  background: #8B7355;
  box-shadow: 0 0 8px rgba(139, 115, 85, 0.3);
}

@keyframes ragLayerPulse {
  0%, 100% { opacity: 0.6; transform: translateX(0); }
  50% { opacity: 1; transform: translateX(3px); }
}

@keyframes ragArrowFlow {
  0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
  50% { opacity: 0.8; transform: scaleY(1); }
}

/* --- 6. Data Grid (DEWR / Government) --- */
.project-anim-grid {
  background: linear-gradient(135deg, #edeae1 0%, #e6e2d7 100%);
}

.project-anim-grid .anim-grid-wrap {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 6px;
  width: 70%;
  height: 65%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.project-anim-grid .anim-cell {
  background: rgba(139, 115, 85, 0.08);
  border-radius: 4px;
  border: 1px solid rgba(139, 115, 85, 0.08);
  animation: cellHighlight 4s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

@keyframes cellHighlight {
  0%, 100% { background: rgba(139, 115, 85, 0.06); border-color: rgba(139, 115, 85, 0.06); }
  20% { background: rgba(139, 115, 85, 0.22); border-color: rgba(139, 115, 85, 0.3); }
  40% { background: rgba(139, 115, 85, 0.06); border-color: rgba(139, 115, 85, 0.06); }
}

/* --- 7. Shield (Clearpol / Compliance) --- */
.project-anim-shield {
  background: linear-gradient(135deg, #edeae0 0%, #e5e1d5 100%);
}

.project-anim-shield .anim-shield-icon {
  width: 56px;
  height: 66px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.project-anim-shield .anim-shield-icon svg {
  width: 100%;
  height: 100%;
}

.project-anim-shield .anim-orbit {
  position: absolute;
  width: var(--size, 120px);
  height: var(--size, 120px);
  border: 1.5px solid rgba(139, 115, 85, 0.15);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: orbitSpin var(--dur, 8s) linear infinite;
  animation-direction: var(--dir, normal);
}

.project-anim-shield .anim-orbit::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  background: #8B7355;
  border-radius: 50%;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
}

@keyframes orbitSpin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* --- 8. Timeline (LaReg / Regulatory) --- */
.project-anim-timeline {
  background: linear-gradient(135deg, #efece3 0%, #e7e4da 100%);
}

.project-anim-timeline .anim-tl-line {
  position: absolute;
  left: 25%;
  top: 10%;
  bottom: 10%;
  width: 2px;
  background: rgba(139, 115, 85, 0.15);
}

.project-anim-timeline .anim-tl-bar {
  position: absolute;
  left: 25%;
  height: 10px;
  background: rgba(139, 115, 85, 0.12);
  border-radius: 0 4px 4px 0;
  top: var(--y);
  width: 0;
  animation: barSlide var(--dur, 3s) ease-out infinite;
  animation-delay: var(--d, 0s);
}

.project-anim-timeline .anim-tl-bar::before {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  background: #8B7355;
  border-radius: 50%;
  left: -4px;
  top: 1px;
}

@keyframes barSlide {
  0% { width: 0; opacity: 0; }
  20% { opacity: 1; }
  50%, 100% { width: var(--tw, 40%); opacity: 0.6; }
}

/* ====================================
   Project Showcase (Homepage)
   ==================================== */

.proj-showcase {
  position: relative;
  margin-bottom: 40px;
}

.proj-stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: center;
  min-height: 460px;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

/* Left panel */
.proj-slide-left {
  display: flex;
  flex-direction: column;
}

.proj-slide-overline {
  margin-bottom: 14px;
}

.proj-slide-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.proj-slide-title {
  font-family: 'Instrument Serif', serif;
  font-size: 42px;
  line-height: 1.08;
  letter-spacing: -1px;
  color: var(--text-primary);
  margin-bottom: 18px;
}

.proj-slide-desc {
  font-size: 15px;
  line-height: 1.72;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.proj-slide-metrics {
  display: flex;
  gap: 40px;
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-light);
}

.proj-metric {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.proj-metric-val {
  font-family: 'Instrument Serif', serif;
  font-size: 40px;
  line-height: 1;
  color: var(--text-primary);
  letter-spacing: -1.5px;
}

.proj-metric-lbl {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.2px;
}

.proj-slide-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Right panel: large terminal window */
.proj-slide-right {
  position: relative;
}

.proj-slide-right::before {
  content: '';
  position: absolute;
  inset: -32px -32px -32px -32px;
  background: radial-gradient(ellipse at 55% 50%, rgba(139, 115, 85, 0.07) 0%, transparent 70%);
  border-radius: 32px;
  pointer-events: none;
  z-index: 0;
}

.proj-slide-right .proj-terminal {
  position: relative;
  z-index: 1;
  height: 390px;
  font-size: 12.5px;
  line-height: 1.82;
  padding: 20px 24px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.05), 0 16px 56px rgba(0, 0, 0, 0.05);
}

.proj-slide-right .proj-term-bar {
  margin-bottom: 14px;
}

/* Navigation bar */
.proj-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border-light);
}

.proj-nav-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.proj-nav-btn:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
  background: var(--bg-card);
}

.proj-nav-btn:disabled {
  opacity: 0.22;
  cursor: default;
  pointer-events: none;
}

.proj-nav-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.proj-nav-dots {
  display: flex;
  gap: 7px;
  align-items: center;
}

.proj-nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.proj-nav-dot.active {
  background: var(--text-primary);
  width: 22px;
  border-radius: 3px;
}

.proj-nav-dot:hover:not(.active) {
  background: var(--text-muted);
}

.proj-nav-counter {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

.proj-nav-slash {
  margin: 0 3px;
  opacity: 0.35;
}

/* ====================================
   Project Terminal Animation
   ==================================== */

.proj-terminal {
  width: 100%;
  height: 100%;
  background: var(--bg-page);
  display: flex;
  flex-direction: column;
  padding: 14px 16px 12px;
  overflow: hidden;
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  line-height: 1.78;
}

.proj-term-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.proj-term-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
}

.proj-term-label {
  margin-left: auto;
  font-size: 9px;
  color: var(--border);
  letter-spacing: 0.4px;
  font-family: 'DM Sans', sans-serif;
}

.proj-term-out {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  transition: opacity 0.4s ease;
}

.proj-term-out::-webkit-scrollbar {
  display: none;
}

.proj-line {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  min-height: 1.78em;
  font-weight: 500;
}

.proj-line-prompt  { color: #5c4f3f; font-weight: 600; }
.proj-line-out     { color: var(--text-primary); }
.proj-line-accent  { color: #8B7355; font-weight: 600; }
.proj-line-success { color: #3a7a52; }
.proj-line-warn    { color: #9b7a1a; }
.proj-line-muted   { color: var(--text-muted); }
.proj-line-divider { color: var(--border); font-size: 10px; letter-spacing: 0.3px; margin: 2px 0; }
.proj-line-search  { color: var(--text-secondary); font-style: italic; }
.proj-line-source  { color: var(--text-muted); }
.proj-line-check   { color: #3a7a52; }

.proj-cursor {
  display: inline-block;
  width: 5px;
  height: 0.72em;
  background: var(--text-secondary);
  vertical-align: middle;
  border-radius: 1px;
  animation: termBlink 0.9s step-end infinite;
}

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

/* ====================================
   Accessibility
   ==================================== */
@media (prefers-reduced-motion: reduce) {
  .project-anim-funding .anim-bar,
  .project-anim-funding .anim-trend polyline,
  .project-anim-funding .anim-funding-label,
  .project-anim-heartbeat .anim-ecg,
  .project-anim-heartbeat .anim-pulse,
  .project-anim-heartbeat .anim-pulse::before,
  .project-anim-chat .anim-chat-feed,
  .project-anim-docs .anim-doc,
  .project-anim-docs .anim-scanline,
  .project-anim-rag .anim-rag-layer,
  .project-anim-rag .anim-rag-arrow::after,
  .project-anim-grid .anim-cell,
  .project-anim-shield .anim-orbit,
  .project-anim-timeline .anim-tl-bar {
    animation: none;
  }
}

/* ====================================
   Responsive
   ==================================== */

@media (max-width: 900px) {
  .proj-stage {
    grid-template-columns: 1fr;
    gap: 36px;
    min-height: auto;
  }

  .proj-slide-left { order: 2; }
  .proj-slide-right { order: 1; }

  .proj-slide-right .proj-terminal {
    height: 270px;
    font-size: 11px;
    padding: 16px 18px 12px;
  }

  .proj-slide-title {
    font-size: 32px;
  }

  .proj-metric-val {
    font-size: 32px;
  }

  .proj-slide-desc {
    font-size: 14px;
  }

  .proj-nav {
    gap: 24px;
    margin-top: 36px;
    padding-top: 24px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .proj-slide-title {
    font-size: 26px;
    letter-spacing: -0.5px;
  }

  .proj-slide-right .proj-terminal {
    height: 220px;
    font-size: 10.5px;
    padding: 12px 14px 10px;
  }

  .proj-slide-metrics {
    gap: 24px;
  }

  .proj-metric-val {
    font-size: 28px;
  }

  .proj-nav-dot.active {
    width: 16px;
  }
}

@media (max-width: 600px) {
  .project-visual {
    height: 200px;
  }

  .project-info {
    padding: 24px 20px 28px;
  }

  .project-title {
    font-size: 20px;
  }

  .project-highlights {
    grid-template-columns: 1fr;
  }

  .portfolio-filters {
    gap: 8px;
  }

  .filter-btn {
    padding: 8px 16px;
    font-size: 12px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .projects-carousel .project-card {
    flex: 0 0 280px;
  }

  .projects-carousel .project-visual {
    height: 140px;
  }

  .projects-carousel .project-info {
    padding: 16px 18px 20px;
  }

  .projects-carousel .project-title {
    font-size: 17px;
  }

  .carousel-arrow {
    display: none;
  }

  .projects-carousel-wrap {
    margin-left: -20px;
    margin-right: -20px;
    padding: 0 20px;
  }

  .projects-carousel-wrap::before {
    left: 0;
    width: 40px;
  }

  .projects-carousel-wrap::after {
    right: 0;
    width: 40px;
  }

  /* Always enable animations on mobile (no hover needed) */
  .project-card .project-visual {
    transform: scale(1.02);
    filter: brightness(0.98) contrast(1.02);
  }

  .project-card .tech-tag {
    background: rgba(139, 115, 85, 0.05);
    border-color: rgba(139, 115, 85, 0.15);
  }

  /* Scale animations for mobile */
  .project-anim-funding .anim-funding-chart {
    bottom: 6%;
    left: 6%;
    right: 6%;
    height: 68%;
    gap: 6px;
  }

  .project-anim-funding .anim-funding-label {
    top: 8%;
    right: 10%;
    font-size: 9px;
  }

  .project-anim-heartbeat .anim-pulse {
    width: 12px;
    height: 12px;
  }

  .project-anim-heartbeat .anim-pulse::before {
    width: 36px;
    height: 36px;
    top: -12px;
    left: -12px;
  }

  .project-anim-chat .anim-chat-feed {
    padding: 14px;
    gap: 8px;
  }

  .project-anim-chat .anim-msg {
    padding: 7px 11px;
    font-size: 9px;
    max-width: 76%;
  }

  .project-anim-docs .anim-doc {
    width: 90px;
    height: 120px;
  }

  .project-anim-docs .anim-doc::before {
    top: 12px;
    left: 10px;
    right: 10px;
    height: 3px;
    box-shadow: 0 8px 0 var(--border), 0 16px 0 var(--border), 0 24px 0 var(--border);
  }

  .project-anim-docs .anim-scanline {
    width: 100px;
  }

  .project-anim-rag .anim-rag-wrap {
    width: 80%;
    height: 75%;
    gap: 6px;
  }

  .project-anim-rag .anim-rag-layer {
    padding: 6px 10px;
    gap: 8px;
  }

  .project-anim-rag .anim-rag-layer .rag-icon {
    width: 14px;
    height: 14px;
  }

  .project-anim-rag .anim-rag-layer .rag-line {
    height: 2px;
  }

  .project-anim-rag .anim-rag-arrow {
    height: 10px;
  }

  .project-anim-grid .anim-grid-wrap {
    width: 80%;
    height: 70%;
    gap: 4px;
  }

  .project-anim-shield .anim-shield-icon {
    width: 44px;
    height: 52px;
  }

  .project-anim-shield .anim-orbit {
    --size: 90px;
  }

  .project-anim-shield .anim-orbit::after {
    width: 8px;
    height: 8px;
    top: -4px;
  }

  .project-anim-timeline .anim-tl-line {
    left: 20%;
  }

  .project-anim-timeline .anim-tl-bar {
    left: 20%;
    height: 8px;
  }

  .project-anim-timeline .anim-tl-bar::before {
    width: 6px;
    height: 6px;
    left: -3px;
  }
}

/* Responsive — Short viewports */
@media (max-height: 720px) {
  .portfolio-section {
    padding: 64px 0 64px;
  }

  .portfolio-header {
    margin: 0 auto 40px;
  }

  .portfolio-filters {
    margin-bottom: 32px;
  }

  .project-visual {
    height: 200px;
  }

  .project-info {
    padding: 20px 28px 24px;
  }

  .projects-grid {
    gap: 24px;
    margin-bottom: 40px;
  }

  .projects-carousel-wrap {
    margin-bottom: 32px;
  }

  .proj-nav {
    margin-top: 24px;
    padding-top: 20px;
    gap: 20px;
  }

  .proj-stage {
    min-height: auto;
  }
}
