/* KORDAR Portfolio — Museum B&W */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap&font-display=swap');

:root {
  --bg: #ffffff;
  --text: #000000;
  --text-secondary: #555555;
  --text-muted: #999999;
  --border: #e5e5e5;
  --surface: #f5f5f5;
  --serif: 'Cormorant Garamond', 'Georgia', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --radius: 0px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --max-w: 1200px;
  --header-h: 72px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ===== HEADER ===== */

.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease);
}

.header.scrolled {
  border-bottom-color: var(--border);
  background: rgba(255, 255, 255, 0.95);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 6px;
  text-transform: uppercase;
}

.logo-text {
  color: var(--text);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.back-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  position: relative;
  transition: color 0.3s var(--ease);
}

.back-link::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 0; right: 0;
  height: 1px;
  background: var(--text);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.back-link:hover {
  color: var(--text);
}

.back-link:hover::after {
  transform: scaleX(1);
}

.lang-toggle {
  display: flex;
  position: relative;
  gap: 0;
}

.lang-btn {
  padding: 7px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s var(--ease);
  position: relative;
  z-index: 1;
}

.lang-btn:first-of-type {
  border-right: none;
}

.lang-btn.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.lang-slider {
  display: none;
}

/* ===== HERO ===== */

.hero {
  padding: calc(var(--header-h) + 120px) 32px 80px;
  text-align: center;
  position: relative;
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 48px;
  animation: fadeUp 0.8s var(--ease) both;
}

.hero-badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text);
  flex-shrink: 0;
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(52px, 9vw, 120px);
  font-weight: 300;
  letter-spacing: -2px;
  line-height: 1.0;
  margin-bottom: 32px;
  animation: fadeUp 0.8s var(--ease) 0.1s both;
}

.hero-title .gradient {
  font-style: italic;
  font-weight: 400;
}

.hero-subtitle {
  font-size: clamp(16px, 1.8vw, 19px);
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto 48px;
  font-weight: 400;
  line-height: 1.75;
  animation: fadeUp 0.8s var(--ease) 0.2s both;
}

.hero-cta-group {
  display: flex;
  gap: 16px;
  justify-content: center;
  animation: fadeUp 0.8s var(--ease) 0.3s both;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s var(--ease);
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
}

.btn-primary:hover {
  background: transparent;
  color: var(--text);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

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

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== STATS ===== */

.stats-bar {
  display: flex;
  justify-content: center;
  gap: 80px;
  padding: 64px 32px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 0 auto;
  max-width: var(--max-w);
}

.stat {
  text-align: center;
}

.stat-value {
  font-family: var(--serif);
  font-size: 48px;
  font-weight: 300;
  line-height: 1.1;
  color: var(--text);
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-top: 8px;
}

/* ===== PROJECTS GRID ===== */

.section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 96px 32px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 64px;
}

.section-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.section-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--text-muted);
  white-space: nowrap;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
}

/* ===== PROJECT CARD ===== */

.card {
  position: relative;
  background: var(--bg);
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
  cursor: pointer;
  will-change: transform;
  backface-visibility: hidden;
}

@media (hover: hover) {
  .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    border-color: var(--text);
  }
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
}

.card-icon {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1;
}

.card-badge {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.card-badge.live {
  color: var(--text);
}

.card-title {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.card-title::after {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: var(--border);
  margin-top: 16px;
  margin-bottom: 16px;
  transition: width 0.25s var(--ease);
}

@media (hover: hover) {
  .card:hover .card-title::after {
    width: 60px;
  }
}

.card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 32px;
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

.tag::after {
  content: '\00b7';
  margin-left: 6px;
  color: var(--border);
}

.card-tags .tag:last-child::after {
  display: none;
}

.card-arrow {
  font-size: 20px;
  color: var(--text-muted);
  transition: transform 0.25s var(--ease), color 0.25s var(--ease);
  flex-shrink: 0;
}

@media (hover: hover) {
  .card:hover .card-arrow {
    color: var(--text);
    transform: translateX(6px);
  }
}

/* ===== TECH STACK ===== */

.tech-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  justify-content: center;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 32px 0;
}

.tech-item {
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  transition: color 0.3s var(--ease);
  cursor: default;
}

.tech-item:hover {
  color: var(--text);
}

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

.footer {
  border-top: 1px solid var(--border);
  padding: 48px 32px;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-brand {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 4px;
}

.footer-brand .logo-text {
  font-size: 12px;
  color: var(--text);
}

.footer-copy {
  font-size: 12px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 12px;
  color: var(--text-muted);
  position: relative;
  transition: color 0.3s var(--ease);
}

.footer-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0; right: 0;
  height: 1px;
  background: var(--text);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

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

.footer-links a:hover::after {
  transform: scaleX(1);
}

/* ===== PROJECT DETAIL PAGE ===== */

.project-hero {
  padding: calc(var(--header-h) + 80px) 32px 48px;
  max-width: 860px;
  margin: 0 auto;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
  animation: fadeUp 0.6s var(--ease) both;
}

.meta-badge {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
}

.meta-badge.live-badge {
  color: var(--text);
}

.meta-badge.desktop-badge {
  color: var(--text-muted);
}

.meta-date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.project-hero h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -1px;
  margin-bottom: 16px;
  animation: fadeUp 0.6s var(--ease) 0.05s both;
}

.project-hero .subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 40px;
  animation: fadeUp 0.6s var(--ease) 0.1s both;
}

.project-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  animation: fadeUp 0.6s var(--ease) 0.15s both;
}

/* Detail Content */

.project-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 32px 80px;
}

.detail-block {
  margin-bottom: 64px;
}

.detail-block h2 {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--text-muted);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.detail-block h2::after {
  display: none;
}

.detail-block p {
  font-size: 16px;
  color: var(--text);
  line-height: 1.85;
}

.detail-block p + p {
  margin-top: 16px;
}

.features-list {
  list-style: none;
  display: grid;
  gap: 0;
}

.features-list li {
  padding: 18px 0;
  font-size: 15px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.features-list li:first-child {
  border-top: 1px solid var(--border);
}

.feature-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text);
  flex-shrink: 0;
  margin-top: 7px;
}

.tech-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tech-detail .tag {
  font-size: 12px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.3s var(--ease);
}

.tech-detail .tag::after {
  display: none;
}

.tech-detail .tag:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* Architecture Block */

.arch-block {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 32px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-x: auto;
}

/* Project Navigation */

.project-nav {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 32px 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.nav-link {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 32px;
  background: var(--bg);
  transition: all 0.3s var(--ease);
}

.nav-link:hover {
  background: var(--text);
  color: var(--bg);
}

.nav-link.next { text-align: right; }

.nav-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--text-muted);
  transition: color 0.3s var(--ease);
}

.nav-link:hover .nav-label {
  color: rgba(255, 255, 255, 0.5);
}

.nav-title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  color: var(--text);
  transition: color 0.3s var(--ease);
}

.nav-link:hover .nav-title {
  color: var(--bg);
}

/* ===== BILINGUAL ===== */

[data-lang="en"] { display: none; }
body.en [data-lang="ru"] { display: none; }
body.en [data-lang="en"] { display: unset; }

body.en p[data-lang="en"],
body.en h1[data-lang="en"],
body.en h2[data-lang="en"],
body.en h3[data-lang="en"],
body.en span[data-lang="en"],
body.en div[data-lang="en"],
body.en li[data-lang="en"],
body.en a[data-lang="en"] {
  display: unset;
}

/* ===== SCROLL REVEAL (progressive enhancement) ===== */

/* Default: content visible — JS not required */
.reveal {
  opacity: 1;
  transform: translateY(0);
}

/* Only animate when JS has confirmed observer is ready */
html.js-loaded .reveal:not(.visible) {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

html.js-loaded .reveal.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.reveal-delay-1 { transition-delay: 0.03s; }
.reveal-delay-2 { transition-delay: 0.06s; }
.reveal-delay-3 { transition-delay: 0.09s; }
.reveal-delay-4 { transition-delay: 0.12s; }
.reveal-delay-5 { transition-delay: 0.15s; }
.reveal-delay-6 { transition-delay: 0.18s; }
.reveal-delay-7 { transition-delay: 0.21s; }

@media (prefers-reduced-motion: reduce) {
  .reveal,
  html.js-loaded .reveal:not(.visible),
  html.js-loaded .reveal.visible {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ===== CHESS DEMO ===== */

.chess-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.chess-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  width: 100%;
  max-width: 480px;
  border: 2px solid var(--text);
  user-select: none;
}

.sq {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

.sq-l { background: #ffffff; }
.sq-d { background: #e0e0e0; }

.sq-sel.sq-l { background: #c8c8c8; }
.sq-sel.sq-d { background: #b0b0b0; }

.sq-last.sq-l { background: #d8d8d0; }
.sq-last.sq-d { background: #c0c0b8; }

/* Valid move dot */
.sq-hint::after {
  content: '';
  position: absolute;
  width: 26%;
  height: 26%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.18);
  pointer-events: none;
}

/* Capture ring */
.sq-cap::after {
  content: '';
  position: absolute;
  width: 85%;
  height: 85%;
  border-radius: 50%;
  border: 3px solid rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

.piece {
  font-size: clamp(28px, 6.5vw, 52px);
  line-height: 1;
  pointer-events: none;
  z-index: 1;
}

.piece[data-color="w"] { filter: drop-shadow(0 1px 1px rgba(0,0,0,0.15)); }
.piece[data-color="b"] { filter: drop-shadow(0 1px 1px rgba(0,0,0,0.1)); }

/* Labels */
.sq-lbl {
  position: absolute;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 2;
}

.sq-file { bottom: 2px; right: 4px; }
.sq-rank { top: 2px; left: 4px; }

/* Controls */
.chess-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.chess-status {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
  min-width: 160px;
  text-align: center;
}

.chess-status.status-thinking {
  opacity: 0.6;
  animation: pulse 1.2s ease-in-out infinite;
}

.chess-status.status-check { font-weight: 600; }
.chess-status.status-end { font-style: italic; }

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

.chess-btn {
  padding: 10px 20px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s var(--ease);
}

.chess-btn:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

@media (max-width: 480px) {
  .chess-board { max-width: 100%; }
  .sq-lbl { font-size: 7px; }
  .chess-controls { gap: 12px; }
  .chess-status { font-size: 16px; min-width: auto; }
  .chess-btn { padding: 8px 14px; font-size: 10px; }
}

/* ===== AUTOPOST TERMINAL DEMO ===== */

.ap-terminal {
  background: var(--text);
  max-width: 520px;
  margin: 0 auto;
}

.ap-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.ap-bar i {
  display: block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
}

.ap-bar-title {
  font-family: var(--mono);
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  margin-left: auto;
}

.ap-body {
  padding: 24px 20px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 2.4;
  min-height: 200px;
}

.ap-line {
  color: rgba(255,255,255,0.7);
  display: flex;
  justify-content: space-between;
  opacity: 0;
  transform: translateY(4px);
}

.ap-line .ap-ok { color: rgba(255,255,255,0.4); }

.ap-line.ap-done {
  color: #ffffff;
  font-weight: 500;
  justify-content: flex-start;
}

/* 10s cycle — lines appear sequentially, then all fade out */
.ap-body .ap-line:nth-child(1) { animation: al1 10s ease infinite; }
.ap-body .ap-line:nth-child(2) { animation: al2 10s ease infinite; }
.ap-body .ap-line:nth-child(3) { animation: al3 10s ease infinite; }
.ap-body .ap-line:nth-child(4) { animation: al4 10s ease infinite; }
.ap-body .ap-line:nth-child(5) { animation: al5 10s ease infinite; }

@keyframes al1 { 0%,3%{opacity:0;transform:translateY(4px)} 7%{opacity:1;transform:translateY(0)} 82%{opacity:1} 90%{opacity:0} 100%{opacity:0} }
@keyframes al2 { 0%,15%{opacity:0;transform:translateY(4px)} 19%{opacity:1;transform:translateY(0)} 82%{opacity:1} 90%{opacity:0} 100%{opacity:0} }
@keyframes al3 { 0%,28%{opacity:0;transform:translateY(4px)} 32%{opacity:1;transform:translateY(0)} 82%{opacity:1} 90%{opacity:0} 100%{opacity:0} }
@keyframes al4 { 0%,42%{opacity:0;transform:translateY(4px)} 46%{opacity:1;transform:translateY(0)} 82%{opacity:1} 90%{opacity:0} 100%{opacity:0} }
@keyframes al5 { 0%,58%{opacity:0;transform:translateY(4px)} 62%{opacity:1;transform:translateY(0)} 82%{opacity:1} 90%{opacity:0} 100%{opacity:0} }

@media (max-width: 480px) {
  .ap-body { font-size: 11px; padding: 16px 14px; }
  .ap-terminal { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .ap-body .ap-line { animation: none; opacity: 1; transform: none; }
}

/* ===== VIDEO DUBBER PIPELINE DEMO ===== */

.vd-pipe {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}

.vd-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 14px;
  border: 1px solid var(--border);
  min-width: 76px;
  background: transparent;
  color: var(--text-muted);
}

.vd-icon {
  font-family: var(--mono);
  font-size: 18px;
  line-height: 1;
}

.vd-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.vd-arrow {
  font-family: var(--mono);
  font-size: 16px;
  color: var(--border);
  padding: 0 2px;
  opacity: 0;
}

/* 10s cycle — steps invert sequentially, arrows appear between them */
.vd-pipe > .vd-step:nth-child(1)  { animation: vd1 10s ease-in-out infinite; }
.vd-pipe > .vd-arrow:nth-child(2) { animation: va1 10s ease infinite; }
.vd-pipe > .vd-step:nth-child(3)  { animation: vd2 10s ease-in-out infinite; }
.vd-pipe > .vd-arrow:nth-child(4) { animation: va2 10s ease infinite; }
.vd-pipe > .vd-step:nth-child(5)  { animation: vd3 10s ease-in-out infinite; }
.vd-pipe > .vd-arrow:nth-child(6) { animation: va3 10s ease infinite; }
.vd-pipe > .vd-step:nth-child(7)  { animation: vd4 10s ease-in-out infinite; }
.vd-pipe > .vd-arrow:nth-child(8) { animation: va4 10s ease infinite; }
.vd-pipe > .vd-step:nth-child(9)  { animation: vd5 10s ease-in-out infinite; }
.vd-pipe > .vd-arrow:nth-child(10){ animation: va5 10s ease infinite; }
.vd-pipe > .vd-step:nth-child(11) { animation: vd6 10s ease-in-out infinite; }

@keyframes vd1 { 0%,2%{background:transparent;color:var(--text-muted)} 6%{background:var(--text);color:var(--bg)} 72%{background:var(--text);color:var(--bg)} 82%{background:transparent;color:var(--text-muted)} 100%{background:transparent;color:var(--text-muted)} }
@keyframes vd2 { 0%,11%{background:transparent;color:var(--text-muted)} 15%{background:var(--text);color:var(--bg)} 72%{background:var(--text);color:var(--bg)} 82%{background:transparent;color:var(--text-muted)} 100%{background:transparent;color:var(--text-muted)} }
@keyframes vd3 { 0%,21%{background:transparent;color:var(--text-muted)} 25%{background:var(--text);color:var(--bg)} 72%{background:var(--text);color:var(--bg)} 82%{background:transparent;color:var(--text-muted)} 100%{background:transparent;color:var(--text-muted)} }
@keyframes vd4 { 0%,31%{background:transparent;color:var(--text-muted)} 35%{background:var(--text);color:var(--bg)} 72%{background:var(--text);color:var(--bg)} 82%{background:transparent;color:var(--text-muted)} 100%{background:transparent;color:var(--text-muted)} }
@keyframes vd5 { 0%,41%{background:transparent;color:var(--text-muted)} 45%{background:var(--text);color:var(--bg)} 72%{background:var(--text);color:var(--bg)} 82%{background:transparent;color:var(--text-muted)} 100%{background:transparent;color:var(--text-muted)} }
@keyframes vd6 { 0%,51%{background:transparent;color:var(--text-muted)} 55%{background:var(--text);color:var(--bg)} 72%{background:var(--text);color:var(--bg)} 82%{background:transparent;color:var(--text-muted)} 100%{background:transparent;color:var(--text-muted)} }

@keyframes va1 { 0%,5%{opacity:0} 9%{opacity:1} 76%{opacity:1} 84%{opacity:0} 100%{opacity:0} }
@keyframes va2 { 0%,14%{opacity:0} 18%{opacity:1} 76%{opacity:1} 84%{opacity:0} 100%{opacity:0} }
@keyframes va3 { 0%,24%{opacity:0} 28%{opacity:1} 76%{opacity:1} 84%{opacity:0} 100%{opacity:0} }
@keyframes va4 { 0%,34%{opacity:0} 38%{opacity:1} 76%{opacity:1} 84%{opacity:0} 100%{opacity:0} }
@keyframes va5 { 0%,44%{opacity:0} 48%{opacity:1} 76%{opacity:1} 84%{opacity:0} 100%{opacity:0} }

@media (max-width: 600px) {
  .vd-pipe { gap: 4px; }
  .vd-step { min-width: 56px; padding: 14px 8px; }
  .vd-icon { font-size: 14px; }
  .vd-label { font-size: 8px; }
  .vd-arrow { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .vd-step, .vd-arrow { animation: none !important; }
  .vd-step { background: var(--text); color: var(--bg); }
  .vd-arrow { opacity: 1; }
}

/* ===== IFRAME DEMO FRAME ===== */

.demo-frame-wrap {
  border: 2px solid var(--text);
  overflow: hidden;
  position: relative;
}

.demo-frame {
  display: block;
  width: 100%;
  height: 600px;
  border: none;
}

@media (max-width: 768px) {
  .demo-frame { height: 500px; }
}

/* ===== HIDDEN BG ELEMENTS (no-op if still in HTML) ===== */

.bg-grid,
.bg-glow,
.bg-glow-1,
.bg-glow-2,
.bg-glow-3 {
  display: none;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 900px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .stats-bar {
    gap: 48px;
  }
}

@media (max-width: 768px) {
  :root { --header-h: 60px; }

  .hero {
    padding-top: calc(var(--header-h) + 64px);
    min-height: 80vh;
  }

  .hero-title { letter-spacing: -1px; }
  .hero-cta-group { flex-direction: column; align-items: center; }

  .stats-bar {
    flex-wrap: wrap;
    gap: 32px;
    padding: 40px 16px;
  }
  .stat-value { font-size: 36px; }

  .section,
  .project-content,
  .project-nav { padding-left: 16px; padding-right: 16px; }

  .project-hero { padding-left: 16px; padding-right: 16px; }

  .card { padding: 32px 24px; }

  .footer-inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

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

  .project-actions { flex-direction: column; }
  .project-actions .btn { justify-content: center; }
}

@media (max-width: 480px) {
  .logo { font-size: 13px; letter-spacing: 4px; }
  .lang-btn { padding: 5px 10px; font-size: 10px; }
  .header-inner { padding: 0 16px; }
  .card-title { font-size: 22px; }
  .hero-badge { font-size: 10px; letter-spacing: 2px; }
}
